Search completed in 1.03 seconds.
1919 results for "position":
Your results are loading. Please wait...
CSSPositionValue.CSSPositionValue() - Web APIs
the csspositionvalue constructor creates a new csspositionvalue object which represents values for properties that take a position, for example object-position. syntax cvar csspositionvalue = new csspositionvalue(x, y) parameters x a position along the web page's horizontal axis. y a position along the web page's vertical axix. examples the following example positions a container <div> 5 pixels from the top and 10 pixels from the left of the page. ...
...position, for example object-position. syntax cvar csspositionvalue = new csspositionvalue(x, y) parameters x a position along the web page's horizontal axis. y a position along the web page's vertical axix. examples the following example positions a container <div> 5 pixels from the top and 10 pixels from the left of the page. ...
...ple object-position. syntax cvar csspositionvalue = new csspositionvalue(x, y) parameters x a position along the web page's horizontal axis. y a position along the web page's vertical axix. examples the following example positions a container <div> 5 pixels from the top and 10 pixels from the left of the page. ...
...And 4 more matches
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. this information is then, in turn, used by the user agent to provide a user interface which displays media playback information to the viewer. for example, a browser might use this information along with the position property and the navigator.mediasession.playbackstate, as well as the session's metadata to provide an integrated common user interface showing the currently playing media as well as standard pause, play, forward, reverse, and other controls. ...
...this value should always be zero or more. ...
...this value should always be zero or more. ...
...And 4 more matches
CompositionEvent.initCompositionEvent() - Web APIs
canbubblearg a boolean specifying whether or not the event can bubble. cancelablearg a boolean shether or not the event can be canceled. viewarg the window object from which the event was generated. dataarg a domstring representing the value of the data attribute. localearg a domstring representing the value of the locale attribute. return value void. ...
... canbubblearg a boolean specifying whether or not the event can bubble. cancelablearg a boolean shether or not the event can be canceled. viewarg the window object from which the event was generated. dataarg a domstring representing the value of the data attribute. localearg a domstring representing the value of the locale attribute. return value void. ...
... canbubblearg a boolean specifying whether or not the event can bubble. cancelablearg a boolean shether or not the event can be canceled. viewarg the window object from which the event was generated. dataarg a domstring representing the value of the data attribute. localearg a domstring representing the value of the locale attribute. return value void. ...
... can be canceled. viewarg the window object from which the event was generated. dataarg a domstring representing the value of the data attribute. localearg a domstring representing the value of the locale attribute. return value void. specifications specification status comment document object model (dom) level 3 events specificationthe definition of 'initcompositionevent()' in that specification. obsolete initial definition. ...
CompositionEvent.CompositionEvent() - Web APIs
the compositionevent() constructor creates a new compositionevent object instance. syntax const myevent = new compositionevent(typearg [, compositioneventinit]) values typearg is a domstring representing the name of the event. compositioneventinit optional a compositioneventinit dictionary object, which can contain the following members: data initializes the data attribute of the compositionevent object to the characters generated by the ime composition. note: the compositioneventinit dictionary inherits from the uieventinit dictionary, so can also accept members defined on there. ...
...lizes the data attribute of the compositionevent object to the characters generated by the ime composition. note: the compositioneventinit dictionary inherits from the uieventinit dictionary, so can also accept members defined on there. specifications specification status comment document object model (dom) level 3 events specificationthe definition of 'compositionevent()' in that specification. obsolete initial definition. ...
Positioning - Learn web development
previous overview: css layout next positioning allows you to take elements out of the normal document layout flow, and make them behave differently; for example sitting on top of one another, or always remaining in the same place inside the browser viewport. this article explains the different position values, and how to use them. prerequisites: html basics (study introduction to html), and an idea of how css works (study introduction to css.) objective: to learn how css positioning works. we'd like you to follow along with the exercises on your local computer, if possible — grab a copy of 0_basic-flow.html from our github repo (source code here) and use that as a starting point. ...
... prerequisites: html basics (study introduction to html), and an idea of how css works (study introduction to css.) objective: to learn how css positioning works. we'd like you to follow along with the exercises on your local computer, if possible — grab a copy of 0_basic-flow.html from our github repo (source code here) and use that as a starting point. introducing positioning the whole idea of positioning is to allow us to override the basic document flow behavior described above, to produce interesting effects. what if you want to slightly alter the position of some boxes inside a layout from their default layout flow position, to give a slightly quirky, distressed feel? positioning is your tool. or if you want to create a ui element that floats over the top of o...
...esting effects. what if you want to slightly alter the position of some boxes inside a layout from their default layout flow position, to give a slightly quirky, distressed feel? positioning is your tool. or if you want to create a ui element that floats over the top of other parts of the page, and/or always sits in the same place inside the browser window no matter how much the page is scrolled? ...
...And 68 more matches
position - CSS: Cascading Style Sheets
Web › CSS › position
the position css property sets how an element is positioned in a document. the top, right, bottom, and left properties determine the final location of positioned elements. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax the position property is specified as a single keyword chosen from the list of values below. values static the element is positioned according to the normal flow of the document. the top, right, bottom, left, and z-index properties have no effect. this is the default value. ...
...ase clone https://github.com/mdn/interactive-examples and send us a pull request. syntax the position property is specified as a single keyword chosen from the list of values below. values static the element is positioned according to the normal flow of the document. the top, right, bottom, left, and z-index properties have no effect. this is the default value. 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. this value creates a new stacking context when the value of z-index is not auto. its effect on table-*...
...iven for the element in the page layout is the same as if position were static. this value creates a new stacking context when the value of z-index is not auto. its effect on table-*-group, table-row, table-column, table-cell, and table-caption elements is undefined. absolute the element is removed from the normal document flow, and no space is created for the element in the page layout. it is positioned relative to its closest positioned ancestor, if any; otherwise, it is placed relative to the initial containing block. its final position is determined by the values of top, right, bottom, and left. this value creates a new stacking context when the value of z-index is not auto. the margins of absolutely positioned boxes do not collapse with other margins. fixed the element is removed from t...
...And 37 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. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...perty sets the initial position for each background image. the position is relative to the position layer set by background-origin. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...ition for each background image. the position is relative to the position layer set by background-origin. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...And 25 more matches
nsICompositionStringSynthesizer
dom/interfaces/base/nsicompositionstringsynthesizer.idlscriptable this interface is a composition string synthesizer interface that synthesizes composition string with arbitrary clauses and a caret 1.0 66 introduced gecko 26 obsolete gecko 38 inherits from: nsisupports last changed in gecko 38.0 (firefox 38.0 / thunderbird 38.0 / seamonkey 2.35) this interface is obsoleted in gecko 38. you need to use nsitextinputprocessor instead of this. every instance is associated with a dom window at created by nsidomwindowutils.createcompositionstringsynthesizer(). ...
...herits from: nsisupports last changed in gecko 38.0 (firefox 38.0 / thunderbird 38.0 / seamonkey 2.35) this interface is obsoleted in gecko 38. you need to use nsitextinputprocessor instead of this. every instance is associated with a dom window at created by nsidomwindowutils.createcompositionstringsynthesizer(). ...
...(firefox 38.0 / thunderbird 38.0 / seamonkey 2.35) this interface is obsoleted in gecko 38. you need to use nsitextinputprocessor instead of this. every instance is associated with a dom window at created by nsidomwindowutils.createcompositionstringsynthesizer(). to create an instance for this: var domwindowutils = window.windowutils; var compositionstringsynthesizer = 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(). compos...
...And 17 more matches
offset-position - CSS: Cascading Style Sheets
the offset-position css property defines the initial position of the offset-path. ...
... the offset-position css property defines the initial position of the offset-path. ...
... the offset-position css property defines the initial position of the offset-path. ...
...And 17 more matches
Positioning - Archive of obsolete content
horizontally, the left edge of the menu popup is aligned with the left edge of the menu or button. a submenu, however, is placed by default to the right of the parent menu item, such that the top edge of the menu is aligned with the top edge of the parent menu item. however, the submenu will appear to the left instead for right to left locales. ...
...ppear to the left instead for right to left locales. for both top level menus and submenus, they may appear above or to the left instead of their usual placement if there is not enough room to display the menu at full size below or to the right. if there is not enough room on either side, the menu will be shrunk down to fit. for popups attached using the popup or context attributes, the default position to appear is with the upper left corner (or upper right corner in right to left locales) at the position where the mouse was clicked. 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. if a context menu was opened via the keyboard only, the menu will appear at the top left corner of the document, or...
... 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. if a context menu was opened via the keyboard only, the menu will appear at the top left corner of the document, or underneath the currently selected item if a list is focused. ...
...And 16 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. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. the value of this property is overridden by any declaration of the background or background-position shorthand properties applied to the element after it. ...
...nteractive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. the value of this property is overridden by any declaration of the background or background-position shorthand properties applied to the element after it. ...
... in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. the value of this property is overridden by any declaration of the background or background-position shorthand properties applied to the element after it. ...
...And 14 more matches
Practical positioning examples - Learn web development
this article shows how to build some real world examples to illustrate what kinds of things you can do with positioning. prerequisites: html basics (study introduction to html), and an idea of how css works (study introduction to css.) objective: to get an idea of the practicalities of positioning a tabbed info-box the first example we'll look at is a classic tabbed info box — a very common feature used when you want to pack a lot of information into a small area. this includes information-heavy apps like strategy/war games, mobile versions of websites where the screen is narrow and space is limited, and compact information boxes where you might want to make lots of information available without having it fill the whole ui. our simple example will look like th...
...ide, which will become the actual tabs to click on for displaying our content panels. the div contains three <article> elements, which will make up the content panels that correspond to each tab. each panel contains some sample content. the idea here is that we will style the tabs to look like a standard horizontal navigation menu, and style the panels to sit on top of one another using absolute positioning. we'll also give you a bit of javascript to include on your page to display the corresponding panel when a tab is pressed, and style the tab itself. you won't need to understand the javascript itself at this stage, but you should think about learning some basic javascript as soon as possible — the more complex your ui features become, the more likely it is that you'll need some javascript to...
...box li a:focus, .info-box li a:hover { background-color: #a60000; color: white; } .info-box li a.active { background-color: #a60000; color: white; } styling the panels the next job is to style our panels. let's get going! first, of all, add the following rule to style the .panels <div> container. ...
...And 13 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. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. the value of this property is overridden by any declaration of the background or background-position shorthand properties applied to the element after it. ...
...nteractive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. the value of this property is overridden by any declaration of the background or background-position shorthand properties applied to the element after it. ...
...in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. the value of this property is overridden by any declaration of the background or background-position shorthand properties applied to the element after it. ...
...And 13 more matches
-webkit-mask-position-x - CSS: Cascading Style Sheets
the -webkit-mask-position-x css property sets the initial horizontal position of a mask image. ...
... the -webkit-mask-position-x css property sets the initial horizontal position of a mask image. ...
... the -webkit-mask-position-x css property sets the initial horizontal position of a mask image. ...
...And 9 more matches
-webkit-mask-position-y - CSS: Cascading Style Sheets
the -webkit-mask-position-y css property sets the initial vertical position of a mask image. ...
... the -webkit-mask-position-y css property sets the initial vertical position of a mask image. ...
... the -webkit-mask-position-y css property sets the initial vertical position of a mask image. ...
...And 9 more matches
ruby-position - CSS: Cascading Style Sheets
under is a keyword indicating that the ruby has to be placed under the main text for horizontal scripts and left to it for vertical scripts. ...
... under is a keyword indicating that the ruby has to be placed under the main text for horizontal scripts and left to it for vertical scripts. ...
... under is a keyword indicating that the ruby has to be placed under the main text for horizontal scripts and left to it for vertical scripts. ...
...And 9 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. values <position> one to four values representing a 2d position regarding the edges of the element's box. relative or absolute offsets can be given. ...
...ultiple 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. values <position> one to four values representing a 2d position regarding the edges of the element's box. relative or absolute offsets can be given. note that the position can be set outside of the element's box. ...
...he element's box. relative or absolute offsets can be given. note that the position can be set outside of the element's box. ...
...And 8 more matches
<position> - CSS: Cascading Style Sheets
the keyword values are center, top, right, bottom, and left. each keyword represents either an edge of the element's box or the center line between two edges. depending on the context, center represents either the center between the left and right edges, or the center between the top and bottom edges. ...
... the keyword values are center, top, right, bottom, and left. each keyword represents either an edge of the element's box or the center line between two edges. depending on the context, center represents either the center between the left and right edges, or the center between the top and bottom edges. ...
...entage> value or an absolute <length> value. positive values are offset towards the right or the bottom, whichever is appropriate. negative values are offset in the opposite directions. if only a single offset value is specified, it defines the x-coordinate, with the value for the other axis defaulting to center. ...
...And 8 more matches
text-emphasis-position - CSS: Cascading Style Sheets
under draw marks under the text in horizontal writing mode. ...
... under draw marks under the text in horizontal writing mode. ...
... under draw marks under the text in horizontal writing mode. ...
...And 8 more matches
Content-Disposition - HTTP
in a regular http response, the content-disposition response header is a header indicating if the content is expected to be displayed inline in the browser, that is, as a web page or as part of a web page, or as an attachment, that is downloaded and saved locally. in a multipart/form-data body, the http content-disposition general header is a header that can be used on the subpart of a multipart body to give information about the field it applies to. the subpart is delimited by the boundary defined in the content-type header. used on the body itself, content-disposition has no effect. 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. only the value form-data, as well as...
...orbidden header name no syntax as a response header for the main body the first parameter in the http context is either inline (default value, indicating it can be displayed inside the web page, or as the web page) or attachment (indicating it should be downloaded; most browsers presenting a 'save as' dialog, prefilled with the value of the filename parameters if present). ...
... syntax as a response header for the main body the first parameter in the http context is either inline (default value, indicating it can be displayed inside the web page, or as the web page) or attachment (indicating it should be downloaded; most browsers presenting a 'save as' dialog, prefilled with the value of the filename parameters if present). ...
...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. example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation. ...
...you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo. ...
...you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo. ...
...And 7 more matches
object-position - CSS: Cascading Style Sheets
the object-position css property specifies the alignment of the selected replaced element's contents within the element's box. areas of the box which aren't covered by the replaced element's object will show the element's background. you can adjust how the replaced element's object's intrinsic size (that is, its natural size) is adjusted to fit within the element's box using the object-fit property. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...djust how the replaced element's object's intrinsic size (that is, its natural size) is adjusted to fit within the element's box using the object-fit property. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. 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. formal de...
... 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. ...
...And 7 more matches
AudioListener.setPosition() - Web APIs
the setposition() method of the audiolistener interface defines the position of the listener. the three parameters x, y and z are unitless and describe the listener's position in 3d space according to the right-hand cartesian coordinate system. pannernode objects use this position relative to individual audio sources for spatialisation. the default value of the position vector is (0, 0, 0). syntax var audioctx = new audiocontext(); var mylistener = audioctx.listener; mylistener.setposition(1,1,1); returns void. example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation. ...
...spatialisation. the default value of the position vector is (0, 0, 0). syntax var audioctx = new audiocontext(); var mylistener = audioctx.listener; mylistener.setposition(1,1,1); returns void. example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio listener and panner (source) occupy initially, and then update the position of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo. in the example you can see th...
... of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo. 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. to see a complete implementation, check out our panner-node example (view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a track on a boom box and then walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audi...
...And 6 more matches
SVGTextPositioningElement - Web APIs
the svgtextpositioningelement interface is implemented by elements that support attributes that position individual text glyphs. it is inherited by svgtextelement, svgtspanelement, svgtrefelement and svgaltglyphelement. ...
... the svgtextpositioningelement interface is implemented by elements that support attributes that position individual text glyphs. it is inherited by svgtextelement, svgtspanelement, svgtrefelement and svgaltglyphelement. ...
...itioningelement interface is implemented by elements that support attributes that position individual text glyphs. it is inherited by svgtextelement, svgtspanelement, svgtrefelement and svgaltglyphelement. ...
...And 6 more matches
AudioListener.positionX - Web APIs
the positionx read-only property of the audiolistener interface is an audioparam representing the x position of the listener in 3d cartesian space. note: the parameter is a-rate when used with a pannernode whose pannernode is set to equalpower, or k-rate otherwise. syntax var audioctx = new audiocontext(); var mylistener = audioctx.listener; mylistener.positionx.value = 1; value an audioparam. its default value is 0, and it can range between positive and negative infinity. example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation. ...
...octx = new audiocontext(); var mylistener = audioctx.listener; mylistener.positionx.value = 1; value an audioparam. its default value is 0, and it can range between positive and negative infinity. example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio listener and panner (source) occupy initially, and then update the position of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo. in the example you can see th...
... of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo. 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. to see a complete implementation, check out our panner-node example (view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a track on a boom box and then walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audi...
...And 5 more matches
AudioListener.positionY - Web APIs
the positiony read-only property of the audiolistener interface is an audioparam representing the y position of the listener in 3d cartesian space. note: the parameter is a-rate when used with a pannernode whose pannernode is set to equalpower, or k-rate otherwise. syntax var audioctx = new audiocontext(); var mylistener = audioctx.listener; mylistener.positiony.value = 1; value an audioparam. its default value is 0, and it can range between positive and negative infinity. example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation. ...
...octx = new audiocontext(); var mylistener = audioctx.listener; mylistener.positiony.value = 1; value an audioparam. its default value is 0, and it can range between positive and negative infinity. example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio listener and panner (source) occupy initially, and then update the position of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo. in the example you can see th...
... of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo. 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. to see a complete implementation, check out our panner-node example (view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a track on a boom box and then walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audi...
...And 5 more matches
AudioListener.positionZ - Web APIs
the positionz read-only property of the audiolistener interface is an audioparam representing the z position of the listener in 3d cartesian space. note: the parameter is a-rate when used with a pannernode whose pannernode is set to equalpower, or k-rate otherwise. syntax var audioctx = new audiocontext(); var mylistener = audioctx.listener; mylistener.positionz.value = 1; value an audioparam. its default value is 0, and it can range between positive and negative infinity. example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation. ...
...octx = new audiocontext(); var mylistener = audioctx.listener; mylistener.positionz.value = 1; value an audioparam. its default value is 0, and it can range between positive and negative infinity. example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio listener and panner (source) occupy initially, and then update the position of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo. in the example you can see th...
... of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo. 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. to see a complete implementation, check out our panner-node example (view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a track on a boom box and then walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audi...
...And 5 more matches
Geolocation.getCurrentPosition() - Web APIs
timeout: integer (milliseconds) - amount of time before the error callback is invoked, if 0 it will never invoke. ...
... timeout: integer (milliseconds) - amount of time before the error callback is invoked, if 0 it will never invoke. ...
... timeout: integer (milliseconds) - amount of time before the error callback is invoked, if 0 it will never invoke. ...
...And 5 more matches
Geolocation.watchPosition() - Web APIs
return value an integer id that identifies the registered handler. ...
... return value an integer id that identifies the registered handler. ...
... return value an integer id that identifies the registered handler. ...
...And 5 more matches
XRPose.emulatedPosition - Web APIs
usage notes there are two basic categories of xr tracking systems. a basic xr headset provides three degrees of freedom (3dof), tracking the pitch, yaw, and roll of the user's head. ...
... usage notes there are two basic categories of xr tracking systems. a basic xr headset provides three degrees of freedom (3dof), tracking the pitch, yaw, and roll of the user's head. ...
... usage notes there are two basic categories of xr tracking systems. a basic xr headset provides three degrees of freedom (3dof), tracking the pitch, yaw, and roll of the user's head. ...
...And 5 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. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...osition css property specifies the position of the underline which is set using the text-decoration property's underline value. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...the position of the underline which is set using the text-decoration property's underline value. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...And 5 more matches
Element Positioning - Archive of obsolete content
the size of an element is determined by two factors, the size that the element wants to be and the size you specify. the size that an element wants to be is determined by what is in the element. ...
...the size of an element is determined by two factors, the size that the element wants to be and the size you specify. the size that an element wants to be is determined by what is in the element. ...
...the size of an element is determined by two factors, the size that the element wants to be and the size you specify. the size that an element wants to be is determined by what is in the element. ...
...And 4 more matches
CSSPositionValue.x - Web APIs
the x property of the csspositionvalue interface returns returns the item's position along the web page's horizontal axis. syntax var x = csspositionvalue.x value a cssnumericvalue. example the following example positions a container <div> 5 pixels from the top and 10 pixels from the left of the page. ...
... the x property of the csspositionvalue interface returns returns the item's position along the web page's horizontal axis. syntax var x = csspositionvalue.x value a cssnumericvalue. example the following example positions a container <div> 5 pixels from the top and 10 pixels from the left of the page. ...
... the x property of the csspositionvalue interface returns returns the item's position along the web page's horizontal axis. syntax var x = csspositionvalue.x value a cssnumericvalue. example the following example positions a container <div> 5 pixels from the top and 10 pixels from the left of the page. ...
...And 4 more matches
CSSPositionValue.y - Web APIs
the y property of the csspositionvalue interface returns the item's position along the vertical axis. syntax var y = csspositionvalue.y value a cssnumericvalue. example the following example positions a container <div> 5 pixels from the top and 10 pixels from the left of the page. ...
... the y property of the csspositionvalue interface returns the item's position along the vertical axis. syntax var y = csspositionvalue.y value a cssnumericvalue. example the following example positions a container <div> 5 pixels from the top and 10 pixels from the left of the page. ...
... the y property of the csspositionvalue interface returns the item's position along the vertical axis. syntax var y = csspositionvalue.y value a cssnumericvalue. example the following example positions a container <div> 5 pixels from the top and 10 pixels from the left of the page. ...
...And 4 more matches
CompositionEvent - Web APIs
the dom compositionevent represents events that occur due to the user indirectly entering text. ...
... the dom compositionevent represents events that occur due to the user indirectly entering text. ...
... the dom compositionevent represents events that occur due to the user indirectly entering text. ...
...And 4 more matches
MediaSession.setPositionState() - Web APIs
if the object is empty, the existing playback state information is cleared. return value undefined. ...
...if the object is empty, the existing playback state information is cleared. return value undefined. ...
... user's device in any kind of interface that provides details about ongoing media. this can be particularly useful if your code implements a player for type of media not directly supported by the browser. call this method on the navigator object's mediasession object. ...
...And 4 more matches
list-style-position - CSS: Cascading Style Sheets
the list-style-position css property sets the position of the ::marker relative to a list item. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. it is often more convenient to use the shorthand list-style. note: this property is applied to list items, i.e., elements with display: list-item;. by default this includes <li> elements. 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. ...
...: this property is applied to list items, i.e., elements with display: list-item;. by default this includes <li> elements. 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. ...
... note that there is variance among browsers regarding behavior when a block element is placed first within a list element declared as list-style-position: inside. chrome and safari both place this element on the same line as the marker box, whereas firefox, internet explorer, and opera place it on the next line. for more information on this, see bug 36854. 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. values inside the ::marker is the first element among the list item's contents. outside the ::marker is outside the principal block box. formal definit...
...And 3 more matches
popup.position - Archive of obsolete content
if specified as 2 words, the value indicates which corner or edge of the anchor (the first word) is aligned which which corner of the popup (the second word). ...
... if specified as 2 words, the value indicates which corner or edge of the anchor (the first word) is aligned which which corner of the popup (the second word). ...
...ed as 2 words, the value indicates which corner or edge of the anchor (the first word) is aligned which which corner of the popup (the second word). the anchor value (ie, the first word) can be one of topleft, topright, bottomleft, bottomright, leftcenter, rightcenter, topcenter or bottomcenter. ...
...And 2 more matches
Mail composition back end
you also have the ability to save rfc822 files to disk, should you need this data for some reason. included in this functionality is the...
...ns copy to sent folder drafts templates "send later" sending unsent messages sending unsent messages listener quoting sample programs overview i've done considerable work in the past few weeks reorganizing the mail composition back end, so i thought it would be helpful to put together a small doc on the new interfaces and how one can use them. the mail composition back end is responsible for the assembly and creation of rfc822 messages to be delivered either via smtp or nntp services. you also have the ability to save rfc822 files to disk, should you need this data for some reason. included in this functionality is the code to copy the messages to the appropriate locations after delivery (i.e. a "sent" folder) as well as the ability to store messages for f...
...ll be extracted from this object and any embedded objects or links will be sent as part of the message in mhtml nsimsgidentity *auseridentity, - the user identity for the person doing the send operation. this will be needed to determine the appropriate folder for copy operations. nsimsgcompfields *fields, - the message composition fields. this will contain all of the relevant header information for message creation prbool digest_p, - this is a flag that says that most of the documents we are attaching are themselves messages, and so we should generate a multipart/digest container instead of multipart/mixed. (it's a minor difference.) prbool ...
...And 2 more matches
DocumentOrShadowRoot.caretPositionFromPoint() - Web APIs
example this example inserts line breaks wherever you click. the code for it is below the demo. 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. at vero eos et accusam et justo duo dolores et ea rebum. ...
... example this example inserts line breaks wherever you click. the code for it is below the demo. 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. at vero eos et accusam et justo duo dolores et ea rebum. ...
...sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. at vero eos et accusam et justo duo dolores et ea rebum. ...
...And 2 more matches
Element: compositionend event - Web APIs
the compositionend event is fired when a text composition system such as an input method editor completes or cancels the current composition session. for example, this event could be fired after a user finishes entering a chinese character using a pinyin ime. ...
... the compositionend event is fired when a text composition system such as an input method editor completes or cancels the current composition session. for example, this event could be fired after a user finishes entering a chinese character using a pinyin ime. ...
...ncels the current composition session. for example, this event could be fired after a user finishes entering a chinese character using a pinyin ime. ...
...s const inputelement = document.queryselector('input[type="text"]'); const log = document.queryselector('.event-log-contents'); const clearlog = document.queryselector('.clear-log'); clearlog.addeventlistener('click', () => { log.textcontent = ''; }); function handleevent(event) { log.textcontent = log.textcontent + `${event.type}: ${event.data}\n`; } inputelement.addeventlistener('compositionstart', handleevent); inputelement.addeventlistener('compositionupdate', handleevent); inputelement.addeventlistener('compositionend', handleevent); result specifications specification status ui events working draft ...
Element: compositionstart event - Web APIs
the compositionstart event is fired when a text composition system such as an input method editor starts a new composition session. for example, this event could be fired after a user starts entering a chinese character using a pinyin ime. ...
... the compositionstart event is fired when a text composition system such as an input method editor starts a new composition session. for example, this event could be fired after a user starts entering a chinese character using a pinyin ime. ...
...editor starts a new composition session. for example, this event could be fired after a user starts entering a chinese character using a pinyin ime. ...
...s const inputelement = document.queryselector('input[type="text"]'); const log = document.queryselector('.event-log-contents'); const clearlog = document.queryselector('.clear-log'); clearlog.addeventlistener('click', () => { log.textcontent = ''; }); function handleevent(event) { log.textcontent = log.textcontent + `${event.type}: ${event.data}\n`; } inputelement.addeventlistener('compositionstart', handleevent); inputelement.addeventlistener('compositionupdate', handleevent); inputelement.addeventlistener('compositionend', handleevent); result specifications specification status ui events working draft ...
Element: compositionupdate event - Web APIs
the compositionupdate event is fired when a new character is received in the context of a text composition session controlled by a text composition system such as an input method editor. for example, this event could be fired while a user enters a chinese character using a pinyin ime. ...
... the compositionupdate event is fired when a new character is received in the context of a text composition session controlled by a text composition system such as an input method editor. for example, this event could be fired while a user enters a chinese character using a pinyin ime. ...
...omposition system such as an input method editor. for example, this event could be fired while a user enters a chinese character using a pinyin ime. ...
...s const inputelement = document.queryselector('input[type="text"]'); const log = document.queryselector('.event-log-contents'); const clearlog = document.queryselector('.clear-log'); clearlog.addeventlistener('click', () => { log.textcontent = ''; }); function handleevent(event) { log.textcontent = log.textcontent + `${event.type}: ${event.data}\n`; } inputelement.addeventlistener('compositionstart', handleevent); inputelement.addeventlistener('compositionupdate', handleevent); inputelement.addeventlistener('compositionend', handleevent); result specifications specification status ui events working draft ...
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. this information can then, in turn, be used by the user agent to provide a user interface which displays media playback information to the viewer. for example, a browser might use this information along with the position property and the navigator.mediasession.playbackstate, as well as the session's metadata to provide an integrated common user interface showing the currently playing media as well as standard pause, play, forward, reverse, and other controls. ...
...this value should always be positive. ...
...this value should always be positive. to indicate media of unknown or indeterminate length, such as an ongoing live stream, specify a value of positive infinity (infinity). ...
...ion; value a floating-point value indicating the overall duration, in seconds, of the media being performed. this value should always be positive. to indicate media of unknown or indeterminate length, such as an ongoing live stream, specify a value of positive infinity (infinity). 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. d...
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. this information can then, in turn, be used by the user agent to provide a user interface which displays media playback information to the viewer. for example, a browser might use this information along with the position property and the navigator.mediasession.playbackstate, as well as the session's metadata to provide an integrated common user interface showing the currently playing media as well as standard pause, play, forward, reverse, and other controls. ...
...r interface which displays media playback information to the viewer. for example, a browser might use this information along with the position property and the navigator.mediasession.playbackstate, as well as the session's metadata to provide an integrated common user interface showing the currently playing media as well as standard pause, play, forward, reverse, and other controls. syntax let positionstate = { playbackrate: rate }; let playbackrate = positionstate.playbackrate; value a floating-point value specifying a multiplier corresponding to the current relative rate at which the media being performed is playing. a value of 1.0 indicates the media is playing forward at normal speed, while higher values indicate that the media is being played faster than normal. lower values indicate t...
... more slowly. negative values can be specified to indicate the media is playing in reverse, with decreasing values then indicating faster and faster reverse playback. note: a value of 0.0 is not permitted. example in this example, an app is updating the browser to let it know that the user has clicked a button causing the playback to shift to a double-speed mode. 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. specifications specification status comment media session standa...
... 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. specifications specification status comment media session standardthe definition of 'mediapositionstate.playbackrate' in that specification. draft initial definition. ...
Node.compareDocumentPosition() - Web APIs
the node.comparedocumentposition() method reports the position of the given node relative to another node in any document — not just the given node’s document. the return value is a bitmask of the following values: name value document_position_disconnected 1 document_position_preceding 2 document_position_following 4 document_position_contains 8 document_position_contained_by 16 document_position_implementation_specific 32 syntax comparemask = node.comparedocumentposition(othernode) parameters othernode the other node with which to compare the first node’s document position. return value an integer value whose bits represent the othernode's relationship to the calling node. more than ...
...paredocumentposition(othernode) parameters othernode the other node with which to compare the first node’s document position. return value an integer value whose bits represent the othernode's relationship to the calling node. 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). ...
... 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). example const head = document.head; const body = document.body; if (head.comparedocumentposition(body) & node.document_position_following) { console.log('well-formed document'); } else { console.error('<head> is not before <body>'); } note: because the result returned by comparedocumentposition() is a bitmask, the bitwise and operator must be used for meaningful results. specifications specification status comment domthe definition of 'node.comparedocumentpo...
...e the result returned by comparedocumentposition() is a bitmask, the bitwise and operator must be used for meaningful results. specifications specification status comment domthe definition of 'node.comparedocumentposition()' in that specification. living standard document object model (dom) level 3 core specificationthe definition of 'node.comparedocumentposition()' in that specification. obsolete initial definition ...
PositionOptions - Web APIs
the positionoptions dictionary describes an object containing option properties to pass as a parameter of geolocation.getcurrentposition() and geolocation.watchposition(). properties positionoptions.enablehighaccuracy secure context is a boolean that indicates the application would like to receive the best possible results. if true and if the device is able to provide a more accurate position, it will do so. note that this can result in slower response times or increased power consumption (with a gps chip on a mobile device for example). on the other hand, if false, the device can take the liberty to save resources by responding more quickly and/or using less power. default: false. ...
...eceive the best possible results. if true and if the device is able to provide a more accurate position, it will do so. note that this can result in slower response times or increased power consumption (with a gps chip on a mobile device for example). on the other hand, if false, the device can take the liberty to save resources by responding more quickly and/or using less power. default: false. positionoptions.timeout secure context is a positive long value representing the maximum length of time (in milliseconds) the device is allowed to take in order to return a position. the default value is infinity, meaning that getcurrentposition() won't return until the position is available. ...
...take the liberty to save resources by responding more quickly and/or using less power. default: false. positionoptions.timeout secure context is a positive long value representing the maximum length of time (in milliseconds) the device is allowed to take in order to return a position. the default value is infinity, meaning that getcurrentposition() won't return until the position is available. positionoptions.maximumage secure context is a positive long value indicating the maximum age in milliseconds of a possible cached position that is acceptable to return. 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. default: 0. specifications ...
...milliseconds of a possible cached position that is acceptable to return. 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. default: 0. specifications specification status comment geolocation apithe definition of 'positionoptions' in that specification. recommendation initial definition ...
XRRigidTransform.position - Web APIs
the units are meters. note: the w component of the point is always 1.0. ...
...the units are meters. note: the w component of the point is always 1.0. ...
...the units are meters. note: the w component of the point is always 1.0. ...
... working draft initial definition. ...
font-variant-position - CSS: Cascading Style Sheets
the font-variant-position css property controls the use of alternate, smaller glyphs that are positioned as superscript or subscript. the glyphs are positioned relative to the baseline of the font, which remains unchanged. these glyphs are typically used in <sub> and <sup> elements. /* keyword values */ font-variant-position: normal; font-variant-position: sub; font-variant-position: super; /* global values */ font-variant-position: inherit; font-variant-position: initial; font-variant-position: unset; when the usage of these alternate glyphs is activated, if one character in the run doesn't have such a typographically-enhanced glyph, the whole set of characters of the run is rendered using a fallback method, synthesizing these glyphs. these alternate glyphs share the same em-box and the sa...
...racter in the run doesn't have such a typographically-enhanced glyph, the whole set of characters of the run is rendered using a fallback method, synthesizing these glyphs. these alternate glyphs share the same em-box and the same baseline as the rest of the font. they are merely graphically enhanced, and have no effect on the line-height and other box characteristics. syntax the font-variant-position property is specified as one of the keyword values listed below. values normal deactivates alternate superscript and subscript glyphs. sub activates subscript alternate glyphs. if, in a given run, one such glyph is not available for a character, all the characters in the run are rendered using synthesized glyphs. super activates superscript alternate glyphs. if, in a given run, one such ...
...finition initial valuenormalapplies toall elements. 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 definition of 'font-variant-position' in that specification. candidate recommendation initial definition. browser compatibility the compatibility table on this page is generated...
... browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
position - Archive of obsolete content
this attribute is ignored if either an insertbefore or insertafter attribute matches an element. ...
...this attribute is ignored if either an insertbefore or insertafter attribute matches an element. ...
...this attribute is ignored if either an insertbefore or insertafter attribute matches an element. ...
Stack Positioning - Archive of obsolete content
« previousnext » this section will describe how to position items in a stack. placement of stack children normally, the child elements of a stack stretch to fit the size of the stack. however, you may also place the children at specific coordinates. for example, if a stack has two buttons as children, one may be placed 20 pixels from the left edge and 50 pixels from the top edge. the second button can be placed at 100 pixels from the left edge and 5 pixels from the top edge. the position of a child element may be specified by placing two attributes on the element. for the horizontal position, use the left attribute and for the vertical position, use the top attribute. if you don't put these attributes on a child of a stack, the child will stretch to fit the size of the stack. ...
...bute and for the vertical position, use the top attribute. if you don't put these attributes on a child of a stack, the child will stretch to fit the size of the stack. example 1 : source view <stack> <button label="goblins" left="5" top="5"/> <button label="trolls" left="60" top="20"/> <button label="vampires" left="10" top="60"/> </stack> the stack here contains three elements, each positioned at the coordinates given by the left and top attributes. here, all three children are buttons, but the elements do not have to be same type. they may be any element, including boxes and other stacks. the size of a stack is determined by the positions of the child elements. it is always sized so that all of the child elements are visible (excluding any children with -moz-stack-sizing: ignore). ...
...h -moz-stack-sizing: ignore). so if you set a left attribute to 400, the stack will have a width around 400 pixels plus the width of the element. you can override this size with the various style properties such as width and max-width. you can use a script to adjust the value of the left and top attributes and thus make the elements move around. stacks have the advantage that when one absolutely positioned element changes its position, the position of the other elements is not affected. if you tried to move elements in a regular box, other elements might shuffle their positions around. it is also possible to place the child elements so that they overlap. when drawing the child elements, the elements are shown in the order that they appear in the stack. that is, the first child of the stack appea...
Test your skills: position - Learn web development
the aim of this task is to get you working with the css position property and values covered in our lesson on position. you will be working through two small tasks which use different elements of the material you have just covered. note: you can try out solutions in the interactive editors below, however it may be helpful to download the code and use an online tool such as codepen, jsfiddle, or glitch to work on the tasks. if you get stuck, then ask us for help — see the assessment or further help section at the bottom of this page. positioning one in this task you need to position the item with a class of target to the top and right of the container, which has the 5px grey border. try updating the live code below to recreate the finished example: as an extra challenge, can you ...
...ition the item with a class of target to the top and right of the container, which has the 5px grey border. try updating the live code below to recreate the finished example: as an extra challenge, can you change the target to display underneath the text? for assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor. position two in the below example if you scroll the box the sidebar scrolls with the content. change it so that the sidebar stays in place and only the content scrolls. try updating the live code below to recreate the finished example: for assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor. assessment or further help ...
...r are stuck and want to ask for help: put your work into an online shareable editor such as codepen, jsfiddle, or glitch. you can write the code yourself, or use the starting point files linked to in the above sections. write a post asking for assessment and/or help at the mdn discourse forum learning category. your post should include: a descriptive title such as "assessment wanted for position skill test 1". details of what you have already tried, and what you would like us to do, e.g. if you are stuck and need help, or want an assessment. a link to the example you want assessed or need help with, in an online shareable editor (as mentioned in step 1 above). this is a good practice to get into — it's very hard to help someone with a coding problem if you can't see their code. ...
nsIDOMGeoPosition
read only. timestamp domtimestamp the time at which the reading was taken. read only. ...
...read only. timestamp domtimestamp the time at which the reading was taken. read only. ...
...table this interface describes a geographical location at a specific time. 1.0 66 introduced gecko 1.9.1 inherits from: nsisupports last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) attributes attribute type description address nsidomgeopositionaddress the address of the user's current location, if available. read only. coords nsidomgeopositioncoords the user's current position information. read only. timestamp domtimestamp the time at which the reading was taken. read only. see also using geolocation ...
nsIDOMGeoPositionCoords
read only. ...
...read only. ...
...butes attribute type description latitude double the user's current latitude, in degrees. read only. longitude double the user's current longitude, in degrees. read only. altitude double the user's current altitude, in meters. zero if the device doesn't support altitude detection. read only. accuracy double the accuracy of position information, in meters. read only. altitudeaccuracy double the accuracy of altitude information, in meters. zero if the device doesn't support altitude detection. read only. heading double the current heading at which the user is moving, in degrees. read only. speed double the speed at which the user is moving, in meters per second (confirm this). read...
GeolocationPositionError - Web APIs
the geolocationpositionerror interface represents the reason of an error occurring when using the geolocating device. properties the geolocationpositionerror interface doesn't inherit any property. geolocationpositionerror.code read only secure context returns an unsigned short representing the error code. the following values are possible: value associated constant description 1 permission_denied the acquisition of the geolocation information failed because the page didn't have the permission to do it. 2 position_unavailable the acquisition of the geolocation failed because at least one internal source of position returned an internal error. 3 timeout the time allowed to acquire the geolocation, def...
...ion 1 permission_denied the acquisition of the geolocation information failed because the page didn't have the permission to do it. 2 position_unavailable the acquisition of the geolocation failed because at least one internal source of position returned an internal error. 3 timeout the time allowed to acquire the geolocation, defined by positionoptions.timeout information was reached before the information was obtained. geolocationpositionerror.message read only secure context returns a human-readable domstring describing the details of the error. ...
... geolocation, defined by positionoptions.timeout information was reached before the information was obtained. geolocationpositionerror.message read only secure context returns a human-readable domstring describing the details of the error. specifications note that this is primarily intended for debugging use and not to be shown directly in a user interface. methods the geolocationpositionerror interface neither implements nor inherits any method. specifications specification status comment geolocation apithe definition of 'geolocationpositionerror' in that specification. recommendation initial specification. ...
PannerNode.positionX - Web APIs
depending on the directionality of the sound (as specified using the attributes coneinnerangle, coneouterangle, and codeoutergain), the orientation of the sound may alter the perceived volume of the sound as it's being played. if the sound is pointing toward the listener, it will be louder than if the sound is pointed away from the listener. ...
... the orientation of the sound may alter the perceived volume of the sound as it's being played. if the sound is pointing toward the listener, it will be louder than if the sound is pointed away from the listener. the audioparam contained by this property is read only; however, you can still change the value of the parameter by assigning a new value to its audioparam.value property. syntax var positionx = pannernode.positionx; pannernode.positionx.value = newpositionx; value an audioparam whose value is the x coordinate of the audio source's position, in 3d cartesian coordinates. the default value is 0. example the following example starts an oscillator, and pans it to the left after 1 second, to the right after 2 seconds, and back to the center after 3 seconds. const context = new audio...
...lue is the x coordinate of the audio source's position, in 3d cartesian coordinates. the default value is 0. example the following example starts an oscillator, and pans it to the left after 1 second, to the right after 2 seconds, and back to the center after 3 seconds. 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. working draft ...
PannerNode.positionY - Web APIs
depending on the directionality of the sound (as specified using the attributes coneinnerangle, coneouterangle, and codeoutergain), the orientation of the sound may alter the perceived volume of the sound as it's being played. if the sound is pointing toward the listener, it will be louder than if the sound is pointed away from the listener. ...
... the orientation of the sound may alter the perceived volume of the sound as it's being played. if the sound is pointing toward the listener, it will be louder than if the sound is pointed away from the listener. the audioparam contained by this property is read only; however, you can still change the value of the parameter by assigning a new value to its audioparam.value property. syntax var positiony = pannernode.positiony; pannernode.positiony.value = newpositiony; value an audioparam whose value is the y coordinate of the audio source's position, in 3d cartesian coordinates. example the following example starts an oscillator and pans it above the listener after 1 second, below the listener after 2 seconds, and back to the center after 3 seconds. note that in this case, the change wil...
...lator and pans it above the listener after 1 second, below the listener after 2 seconds, and back to the center after 3 seconds. note that in this case, the change will mainly affect the timbre of the oscillator, as it's a simple mono wave. 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. working draft ...
PannerNode.positionZ - Web APIs
depending on the directionality of the sound (as specified using the attributes coneinnerangle, coneouterangle, and codeoutergain), the orientation of the sound may alter the perceived volume of the sound as it's being played. if the sound is pointing toward the listener, it will be louder than if the sound is pointed away from the listener. ...
... the orientation of the sound may alter the perceived volume of the sound as it's being played. if the sound is pointing toward the listener, it will be louder than if the sound is pointed away from the listener. the audioparam contained by this property is read only; however, you can still change the value of the parameter by assigning a new value to its audioparam.value property. syntax var positionz = pannernode.positionz; pannernode.positionz.value = newpositionz; value an audioparam whose value is the z coordinate of the audio source's position, in 3d cartesian coordinates. example the following example starts an oscillator and moves it in front of the listener after 1 second, behind the listener after 2 seconds, and back to the listener's position after 3 seconds. note that in this...
... moves it in front of the listener after 1 second, behind the listener after 2 seconds, and back to the listener's position after 3 seconds. note that in this case, the change will mainly affect the timbre and perceived volume of the sound. 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. working draft ...
Box alignment for block, absolutely positioned and table layout - CSS: Cascading Style Sheets
as this page aims to detail things which are specific to block layout and box alignment, it should be read in conjunction with the main box alignment page, which details the common features of box alignment across layout methods. note: at the time of writing (may 2018), there is no real support for the box alignment properties in block layout. ...
...container. if a content distribution method such as space-between, space-around or space-evenly is requested then the fallback alignment will be used, as the content is treated as a single alignment subject. justify-self the justify-self property is used to align an item inside its containing block on the inline axis. this property does not apply to floated elements or table cells. absolutely positioned elements the alignment container is the positioned block, accounting for the offset values of top, left, bottom, and right. the normal keyword resolves to stretch, unless the positioned item is a replaced element, in which case it resolves to start. align-self the align-self property does not apply to block-level boxes (including floats), because there is more than one item in the block axis...
...d block, accounting for the offset values of top, left, bottom, and right. the normal keyword resolves to stretch, unless the positioned item is a replaced element, in which case it resolves to start. align-self the align-self property does not apply to block-level boxes (including floats), because there is more than one item in the block axis. it also does not apply to table cells. absolutely positioned elements the alignment container is the positioned block, accounting for the offset values of top, left, bottom, and right. the normal keyword resolves to stretch, unless the positioned item is a replaced element, in which case it resolves to start. aligning in these layout methods today as we do not currently have browser support for box alignment in block layout, your options for alignment...
Logical properties for floating and positioning - CSS: Cascading Style Sheets
this guide takes a look at how to use these. mapped properties and values the table below details the properties and values discussed in this guide along with their physical mappings. they assume a horizontal writing-mode, with a left-to-right direction. ...
...ings for left and right. in the example below i have two boxes — the first has the box floated with float: left, the second with float: inline-start. if you change the writing-mode to vertical-rl or the direction to rtl you will see that the left-floated box always sticks to the left, whereas the inline-start-floated item follows the direction and writing-mode. example: inset properties for positioned layout positioning generally allows us to position an element in a manner relative to its containing block — we essentially inset the item relative to where it would fall based on normal flow. to do this we have historically used the physical properties top, right, bottom and left. these properties take a length or a percentage as a value, and relate to the user's screen dimensions. new pr...
... its containing block — we essentially inset the item relative to where it would fall based on normal flow. to do this we have historically used the physical properties top, right, bottom and left. these properties take a length or a percentage as a value, and relate to the user's screen dimensions. new properties have been created in the logical properties specification for when you want the positioning to relate to the flow of text in your writing mode. these are as follows: inset-block-start, inset-block-end, inset-inline-start and inset-inline-end. in the below example i have used the inset-block-start and inset-inline-end properties to position the blue box using absolute positioning inside the area with the grey dotted border, which has position: relative. change the writing-mode proper...
Positions - SVG: Scalable Vector Graphics
« previousnext » in this article, we examine how scalable vector graphics (svg) represents the positions and sizes of objects within a drawing context, including coordinate system and what a "pixel" measurement means in a scalable context. the grid for all elements, svg uses a coordinate system or grid system similar to the one used by canvas (and by a whole lot of other computer drawing routines). that is, the top left corner of the document is considered to be the point (0,0), or point of origin. positions are then measured in pixels from the top left corner, with the positive x direction being to the right, and the positive y direction being to the bottom. note that this is slightly different than the way you're taught to graph as a kid (y axis is flipped). however, this is ...
... example: the element <rect x="0" y="0" width="100" height="100" /> defines a rectangle from the upper left corner, that spans from there 100px to the right and to the bottom. ...
... example: the element <rect x="0" y="0" width="100" height="100" /> defines a rectangle from the upper left corner, that spans from there 100px to the right and to the bottom. what are "pixels"? in the most basic case one pixel in an svg document maps to one pixel on the output device (a.k.a. the screen). ...
moveToAlertPosition - Archive of obsolete content
...
... ...
position - Archive of obsolete content
...
... ...
nsIDOMGeoPositionAddress
note: this needs to be moved into the dom reference. attributes attribute type description city domstring the city. read only. country domstring the country. read only. ...
... a location, including street, city, and country information, for example. this information may or may not be available, depending on the geolocation service being used. 1.0 66 introduced gecko 1.9.2 obsolete gecko 14.0 inherits from: nsisupports last changed in gecko 11 (firefox 11 / thunderbird 11 / seamonkey 2.8) this object is obtained from an nsidomgeopositionaddress object via its address attribute. note: this needs to be moved into the dom reference. attributes attribute type description city domstring the city. read only. country domstring the country. read only. countrycode obsolete since gecko 11 domstring removed in firefox 11, since it isn't defined in the specification; use country instead. county domstring the county. read only. p...
nsIDOMGeoPositionError
last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) inherits from: nsisupports attributes attribute type description code short numerical error code; see error constants for a complete list. read only. message domstring human readable error message. read only. gecko 1.9.2 note the message attribute was removed in gecko 1.9.2 (firefox 3.6). error constants constant value description permission_denied 1 the user denied permission to retrieve location data. ...
... numerical error code; see error constants for a complete list. read only. message domstring human readable error message. read only. gecko 1.9.2 note the message attribute was removed in gecko 1.9.2 (firefox 3.6). error constants constant value description permission_denied 1 the user denied permission to retrieve location data. position_unavailable 2 unable to access location data. timeout 3 a timeout occurred while trying to retrieve location data ...
CSSPositionValue - Web APIs
the csspositionvalue interface of the the css typed object model api represents values for properties that take a position, for example object-position. constructor csspositionvalue.csspositionvalue() creates a new csspositionvalue object. properties csspositionvalue.x returns the item's position along the web page's horizontal axis. csspositionvalue.y returns the item's position along the vertical axis. methods none. examples the following example positions a container <div> 5 pixels from the top and 10 pixels from the left of the page. ...
...sspositionvalue object. properties csspositionvalue.x returns the item's position along the web page's horizontal axis. csspositionvalue.y returns the item's position along the vertical axis. methods none. examples the following example positions a container <div> 5 pixels from the top and 10 pixels from the left of the page. 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. #image { width: 300px; height: 300px; border: 1px solid black; background-color: #de...
GeolocationPosition - Web APIs
the geolocationposition interface represents the position of the concerned device at a given time. the position, represented by a geolocationcoordinates object, comprehends the 2d position of the device, on a spheroid representing the earth, but also its altitude and its speed. properties the geolocationposition interface doesn't inherit any properties. geolocationposition.coords read only secure context returns a geolocationcoordinates object defining the current location. geolocationposition.timestamp read only secure context returns a domtimestamp representing the time at which the location was retrieved. methods the geolocationposition interface neither implements, nor inherits any methods. specifications specification status comment geoloc...
...coordinates object defining the current location. geolocationposition.timestamp read only secure context returns a domtimestamp representing the time at which the location was retrieved. methods the geolocationposition interface neither implements, nor inherits any methods. specifications specification status comment geolocation apithe definition of 'geolocationposition' in that specification. recommendation initial specification. ...
GeolocationPositionError.code - Web APIs
the geolocationpositionerror.code read-only property is an unsigned short representing the error code. syntax let typeerr = geolocationpositionerrorinstance.code value an unsigned short representing the error code. the following values are possible: value associated constant description 1 permission_denied the acquisition of the geolocation information failed because the page didn't have the permission to do it. 2 position_unavailable the acquisition of the geolocation failed because one or several internal sources of position returned an internal error. 3 timeout the time allowed to acquire the geolocation, defined by positionoptions.timeout information that was reached before the information was obtained. spe...
...uisition of the geolocation failed because one or several internal sources of position returned an internal error. 3 timeout the time allowed to acquire the geolocation, defined by positionoptions.timeout information that was reached before the information was obtained. specifications specification status comment geolocation apithe definition of 'positionerror.code' in that specification. recommendation initial definition ...
MediaPositionState - Web APIs
properties duration a floating-point value giving the total duration of the current media in seconds. this should always be a positive number, with positive infinity (infinity) indicating media without a defined end, such as a live stream. playbackrate a floating-point value indicating the rate at which the media is being played, as a ratio relative to its normal playback speed. ...
...m. playbackrate a floating-point value indicating the rate at which the media is being played, as a ratio relative to its normal playback speed. thus, a value of 1 is playing at normal speed, 2 is playing at double speed, and so forth. negative values indicate that the media is playing in reverse; -1 indicates playback at the normal speed but backward, -2 is double speed in reverse, and so on. position a floating-point value indicating the last reported playback position of the media in seconds. this must always be a positive value. specifications specification status comment media session standardthe definition of 'mediapositionstate' in that specification. draft initial definition. ...
CSS Positioned Layout - CSS: Cascading Style Sheets
css positioned layout is a module of css that defines how to position elements on the page. reference css properties bottom clear float left position right top z-index guides understanding css z-index presents the notion of stacking context and explains how z-ordering works, with several examples. ...
... css positioned layout is a module of css that defines how to position elements on the page. reference css properties bottom clear float left position right top z-index guides understanding css z-index presents the notion of stacking context and explains how z-ordering works, with several examples. ...
overline-position - SVG: Scalable Vector Graphics
the overline-position attribute represents the ideal vertical position of the overline. the overline position is expressed in the font's coordinate system. ...
... the overline-position attribute represents the ideal vertical position of the overline. the overline position is expressed in the font's coordinate system. ...
strikethrough-position - SVG: Scalable Vector Graphics
« svg attribute reference home the strikethrough-position attribute represents the ideal vertical position of the strikethrough. the strikethrough position is expressed in the font's coordinate system. ...
...erence home the strikethrough-position attribute represents the ideal vertical position of the strikethrough. the strikethrough position is expressed in the font's coordinate system. ...
underline-position - SVG: Scalable Vector Graphics
« svg attribute reference home the underline-position attribute represents the ideal vertical position of the underline. the underline position is expressed in the font's coordinate system. ...
...vg attribute reference home the underline-position attribute represents the ideal vertical position of the underline. the underline position is expressed in the font's coordinate system. ...
position - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the position function returns a number equal to the context position from the expression evaluation context. syntax position() returns an integer equal to the context position from the expression evaluation context. notes note that a node's position in a context is not zero-based. the first node has a position of 1. the context is determined by the rest of the path. <xsl:template match="//a[position() = 5]"> <!-- this template matches the fifth a element anywhere in the document. ...
...ion from the expression evaluation context. notes note that a node's position in a context is not zero-based. the first node has a position of 1. the context is determined by the rest of the path. <xsl:template match="//a[position() = 5]"> <!-- this template matches the fifth a element anywhere in the document. --> </xsl:template> <xsl:template match="//div[@class='foo']/bar[position() = 1]"> <!-- this template matches the first bar element that is a child of a div element with a class attribute equal to "foo" --> </xsl:template> defined xpath 1.0 4.1 gecko support supported. ...
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. this allows a scrolling experience that gives the effect of paging through content rather than needing to drag content into view. defining snap positions on the scroll container was introduced in the css scroll snap specification. ...
NSPR's Position On Abrupt Thread Termination
i resist including this function in nspr because it results in bad programming practice and unsupportable programs. threads are not processes. abrupt termination has been available in the unix/c environment for some time (exit()), and i assume that the basic semantics defined there are applicable here. in that environment, exit() may be called and any time, and results in the calling thread's immediate termination. in the situation where it was defined (unix), which has only a single thread of execution, that is equivalent to terminating the process. ...
GroupPosition
« nsiaccessible page summary this method returns grouping information. used for tree items, list items, tab panel labels, radio buttons, etc. also used for collectons of non-text objects. 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. remark alternatively this information is exposed by nsiaccessible.attribute attribute, also see group attributes page. refer to accessible web specifications to get an idea what elements expose group information. ...
GetImagePosition
...
nsIDOMGeoPositionCallback
the nsidomgeopositioncallback interface is called when updated position information is available. you need to implement this interface to accept callbacks after using nsidomgeolocation.watchposition(). dom/interfaces/geolocation/nsidomgeopositioncallback.idlscriptable please add a summary to this article. last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) method overview void handleevent(in nsidomgeoposition position); methods handleevent() called when new position information is available. void handleevent( in nsidomgeoposition position ); parameters position an nsidomgeoposition object indicating the updated location information. ...
nsIDOMGeoPositionErrorCallback
the nsidomgeopositionerrorcallback interface is used to represent an object that receives callback notifications when geolocation errors occur. dom/interfaces/geolocation/nsidomgeopositionerrorcallback.idlscriptable please add a summary to this article. last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) method overview void handleevent(in nsidomgeopositionerror position); methods handleevent() called to handle a geolocation error. void handleevent( in nsidomgeoposition position ); parameters position the error that occurred, as an nsidomgeopositionerror object. ...
nsIDOMGeoPositionOptions
last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) inherits from: nsisupports attributes attribute type description enablehighaccuracy boolean if true, high accuracy mode is used. timeout unsigned long maximum time in milliseconds before giving up on an attempt to retrieve location information. ...
Reposition elements in the page - Firefox Developer Tools
new in firefox 48 starting in firefox 48 you can move absolutely positioned elements by dragging them around the page. 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. for relatively positioned elements the dashed lines indicate the original position of the node. the offsets are indicated by a line and a tooltip for each side. ...
CaretPosition - Web APIs
the caretposition interface represents the caret position, an indicator for the text insertion point. you can get a caretposition using the document.caretpositionfrompoint method. properties this interface doesn't inherit any properties. 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. methods caretposition.getclientrect specification specification status comment css object model (cssom) view modulethe definition of 'caretposition' in that specification. working draft ...
CompositionEvent.data - Web APIs
the data read-only property of the compositionevent interface returns the characters generated by the input method that raised the event; its exact nature varies depending on the type of event that generated the compositionevent object. syntax mydata = compositionevent.data value a domstring representing the event data: for compositionstart events, this is the currently selected text that will be replaced by the string being composed. this value doesn't change even if content changes the selection range; rather, it indicates the string that was selected when composition started. for compositionupdate, this is the string as it stands currently as editing is ongoing. for compositionend events, this is the string as committed to the editor. specifications specification statu...
CompositionEvent.locale - Web APIs
the locale read-only property of the compositionevent interface returns the locale of current input method (for example, the keyboard layout locale if the composition is associated with ime). syntax mylocale = compositionevent.locale value a domstring representing the locale of current input method. specifications specification status comment document object model (dom) level 3 events specification obsolete no longer in the spec, but still supported. ...
GeolocationPosition.coords - Web APIs
the geolocationposition.coords read-only property returns a geolocationcoordinates object representing a geographic position. it contains the location, that is longitude and latitude on the earth, the altitude, and the speed of the object concerned, regrouped inside the returned value. it also contains accuracy information about these values. syntax let coord = geolocationpositioninstance.coords value a geolocationcoordinates object instance. specifications specification status comment geolocation apithe definition of 'geolocationposition.coords' in that specification. recommendation initial specification. ...
GeolocationPosition.timestamp - Web APIs
the geolocationposition.timestamp read-only property returns a domtimestamp object, represents the date and the time of the creation of the geolocationposition object it belongs to. the precision is to the millisecond. syntax var timestamp = geolocationpositioninstance.timestamp value a domtimestamp object instance. specifications specification status comment geolocation apithe definition of 'geolocationposition.timestamp' in that specification. recommendation initial definition ...
GeolocationPositionError.message - Web APIs
the geolocationpositionerror.message read-only property returns a human-readable domstring describing the details of the error. syntax let msg = geolocationpositionerrorinstance.message value a human-readable domstring describing the details of the error. specifications specification status comment geolocation apithe definition of 'geolocationpositionerror.message' in that specification. recommendation initial definition ...
PositionOptions.enableHighAccuracy - Web APIs
the positionoptions.enablehighaccuracy property is a boolean that indicates the application would like to receive the best possible results. if true and if the device is able to provide a more accurate position, it will do so. note that this can result in slower response times or increased power consumption (with a gps chip on a mobile device for example). on the other hand, if false (the default value), the device can take the liberty to save resources by responding more quickly and/or using less power. syntax positionoptions.enablehighaccuracy = booleanvalue specifications specification status comment geolocation apithe definition of 'positionoptions.enablehighaccuracy' in that specification. recommendation initial definition ...
PositionOptions.maximumAge - Web APIs
the positionoptions.maximumage property is a positive long value indicating the maximum age in milliseconds of a possible cached position that is acceptable to return. 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. syntax positionoptions.maximumage = timelength specifications specification status comment geolocation apithe definition of 'positionoptions.maximumage' in that specification. recommendation initial definition ...
PositionOptions.timeout - Web APIs
the positionoptions.timeout property is a positive long value representing the maximum length of time (in milliseconds) the device is allowed to take in order to return a position. the default value is infinity, meaning that getcurrentposition() won't return until the position is available. syntax positionoptions.timeout = timelength specifications specification status comment geolocation apithe definition of 'positionoptions.timeout' in that specification. recommendation initial definition ...
SecurityPolicyViolationEvent.disposition - Web APIs
the disposition read-only property of the securitypolicyviolationevent interface indicates how the violated policy is configured to be treated by the user agent. syntax let disposition = violationeventinstance.disposition; value a value defined in the securitypolicyviolationeventdisposition enum representing the uri of the blocked resource. possible values are "enforce" or "report" example document.addeventlistener("securitypolicyviolation", (e) => { console.log(e.disposition); }); specifications specification status comment content security policy level 3the definition of 'disposition' in that specification. working draft initial definition ...
Index - Web APIs
Web › API › Index
erface is the base class upon which all dom range types are defined. a range is an object that indicates the start and end points of a section of content within the document. 17 abstractrange.collapsed api, abstractrange, dom, dom api, empty, property, range, reference, collapsed the collapsed read-only property of the abstractrange interface returns true if the range's start position and end position are the same. 18 abstractrange.endcontainer api, abstractrange, dom, dom api, end, node, position, property, range, read-only, reference, container, endcontainer the endcontainer property of the abstractrange interface returns the node in which the end of the range is located. 19 abstractrange.endoffset api, abstractrange, dom, dom api, end, pr...
...container, endcontainer the endcontainer property of the abstractrange interface returns the node in which the end of the range is located. 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. 20 abstractrange.startcontainer api, abstractrange, dom, dom api, property, range, read-only, reference, start, startcontainer the read-only startcontainer property of the abstractrange interface returns the start node for the range. 21 abstractrange.startoffset api, abstractrange, dom, dom api, property, range, read-only, reference, offset, startoffset ...
...t, startcontainer the read-only startcontainer property of the abstractrange interface returns the start node for the range. 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. 22 abstractworker api, abstract, abstractworker, interface, reference, sharedworker, web workers, web workers api, worker the abstractworker interface of the web workers api is an abstract interface that defines properties and methods that are common to all types of worker, including not only the basic worker, but also serviceworker and sharedworker. 23 abstractwo...
...And 121 more matches
IME handling guide
this document explains how gecko handles ime. introduction ime is an abbreviation of input method editor. this is a technical term from windows but these days, this is used on other platforms as well. ime is a helper application of a user's text input. it handles native key events before or after focused application (depending on the platform) and creates a composition string (a.k.a. preedit string), suggests a list of what the user attempts to input, commits composition string as a selected item off the list and commits composition string without any conversion. ime is used by chinese, japanese, korean and taiwan users for inputting chinese characters because the number of them is beyond thousands and cannot be input from the keyboard directly. however, especially on mobile devices now...
... cannot enable ime), we call this state "disabled". if ime is enabled but users use direct input mode (e.g., for inputting latin characters), we call it "ime is closed". otherwise, we call it "ime is open". (fyi: "open" is also called "active" or "turned on". "closed" is also called "inactive" or "turned off") so, this document is useful when you're try to fix a bug for text input in gecko. composition string and clauses typical japanese ime can input two or more words into a composition string. when a user converts from hiragana characters to chinese characters the composition string, japanese ime separates the composition string into multiple clauses. for example, if a user types "watasinonamaehanakanodesu", it's converted to hiragana characters, "わたしのなまえはなかのです", au...
...t two or more words into a composition string. when a user converts from hiragana characters to chinese characters the composition string, japanese ime separates the composition string into multiple clauses. for example, if a user types "watasinonamaehanakanodesu", it's converted to hiragana characters, "わたしのなまえはなかのです", automatically (in the following screenshots, the composition string has a wavy underline and the only one clause is called "raw input clause"). when a user presses convert key, japanese ime separates the composition string as "わたしの" (my), "なまえは" (name is) and "なかのです" (nakano). then, converts each clause with chinese characters: "私の", "名前は" and "中野です" (in the following screenshot each clause is underlined and...
...And 82 more matches
nsITextInputProcessor
dom/interfaces/base/nsitextinputprocessor.idlscriptable this interface is a text input events synthesizer and manages its composition and modifier state 1.0 66 introduced gecko 38 inherits from: nsisupports last changed in gecko 38.0 (firefox 38.0 / thunderbird 38.0 / seamonkey 2.35) the motivation of this interface is to provide better api than nsidomwindowutils to dispatch key events and create, modify, and commit composition in higher level. nsidomwindowutils has provided the methods which dispatched keyboard events and composition events almost directly. therefore they sometimes caused impossible scenarios in automated tests (what's tested with such events?) and js-ime and/or js-keyboard on firefox os or add-ons may dispatch events with wrong rules. for solvi...
...ch dispatched keyboard events and composition events almost directly. therefore they sometimes caused impossible scenarios in automated tests (what's tested with such events?) and js-ime and/or js-keyboard on firefox os or add-ons may dispatch events with wrong rules. for solving that issue, methods of this interface have been designed for performing a key operation or representing a change of composition state. for example, the implementation of this interface manages modifier state and composition state, initializes dom events from minimum information, and doesn't dispatch some events if they are not necessary. this means that even when gecko changes the dom event behavior, it may not be necessary that the users of this interface need to be updated, i.e., the implementation of this class can be...
...he users of this interface need to be updated, i.e., the implementation of this class can be a cushion from the impact of gecko's change. you can create an instance of this interface with the following code: var tip = components.classes["@mozilla.org/text-input-processor;1"]. createinstance(components.interfaces.nsitextinputprocessor); next, you need to get the rights to create composition or dispatch keyboard events with begininputtransaction() or begininputtransactionfortests(): if (!tip.begininputtransaction(window, callback)) { return; } if begininputtransaction() or begininputtransactionfortests() returns false, it means that another instance of nsitextinputprocessor has composition on the window or is dispatching an event. in this case, other instances cannot create comp...
...And 52 more matches
Linear-gradient Generator - CSS: Cascading Style Sheets
linear-gradient generator html content <div id="container"> <div id="gradient-container" data-alpha="true"> </div> <div id="controls"> <div class="section"> <div class="title"> active point </div> <div class="property"> <div class="ui-input-slider" data-topic="point-position" data-info="position" data-unit="px" data-min="-1000" data-value="0" data-max="1000" data-sensivity="5"></div> <div id="delete-point" class="button"> delete point </div> </div> <div class="ui-color-picker" data-topic="picker"></div> </div> <div class="section"> <div class="title"> active axis </div> <d...
... </div> </div> </div> css content /* * color picker tool */ .ui-color-picker { width: 420px; margin: 0; border: 1px solid #ddd; background-color: #fff; display: table; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; user-select: none; } .ui-color-picker .picking-area { width: 198px; height: 198px; margin: 5px; border: 1px solid #ddd; position: relative; float: left; display: table; } .ui-color-picker .picking-area:hover { cursor: default; } /* hsv format - hue-saturation-value(brightness) */ .ui-color-picker .picking-area { background: url("images/picker_mask.png"); background: -moz-linear-gradient(bottom, #000 0%, rgba(0, 0, 0, 0) 100%), -moz-linear-gradient(left, #fff 0%, rgba(255, 255, 255, 0) 100%); background: -webki...
...%, hsla(0, 0%, 50%, 0) 100%); background: -o-linear-gradient(top, hsl(0, 0%, 100%) 0%, hsla(0, 0%, 100%, 0) 50%, hsla(0, 0%, 0%, 0) 50%, hsl(0, 0%, 0%) 100%), -o-linear-gradient(left, hsl(0, 0%, 50%) 0%, hsla(0, 0%, 50%, 0) 100%); background-color: #f00; } .ui-color-picker .picker { width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; border: 1px solid #fff; position: absolute; top: 45%; left: 45%; } .ui-color-picker .picker:before { width: 8px; height: 8px; content: ""; position: absolute; border: 1px solid #999; border-radius: 50%; } .ui-color-picker .hue, .ui-color-picker .alpha { width: 198px; height: 28px; margin: 5px; border: 1px solid #fff; float: left; } .ui-color-picker .hue { background: url("images/hue_mask.png"); background: -moz...
...And 38 more matches
Introduction to CSS layout - Learn web development
e. prerequisites: the basics of html (study introduction to html), and an idea of how css works (study introduction to css.) objective: to give you an overview of css page layout techniques. each technique can be learned in greater detail in subsequent tutorials. ...
...sics of html (study introduction to html), and an idea of how css works (study introduction to css.) objective: to give you an overview of css page layout techniques. each technique can be learned in greater detail in subsequent tutorials. ...
...by understanding what each method is designed for you will be in a good place to understand which is the best layout tool for each task. ...
...And 29 more matches
Color picker tool - CSS: Cascading Style Sheets
sivity="10"></div> </div> </div> css /* * color picker tool */ .ui-color-picker { width: 420px; margin: 0; border: 1px solid #ddd; background-color: #fff; display: table; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; user-select: none; } .ui-color-picker .picking-area { width: 198px; height: 198px; margin: 5px; border: 1px solid #ddd; position: relative; float: left; display: table; } .ui-color-picker .picking-area:hover { cursor: default; } /* hsv format - hue-saturation-value(brightness) */ .ui-color-picker .picking-area { background: url('https://mdn.mozillademos.org/files/5707/picker_mask_200.png') center center; background: -moz-linear-gradient(bottom, #000 0%, rgba(0, 0, 0, 0) 100%), -moz-linear-gradient(left, #fff 0%...
...(left, hsl(0, 0%, 50%) 0%, hsla(0, 0%, 50%, 0) 100%); background: -o-linear-gradient(top, hsl(0, 0%, 100%) 0%, hsla(0, 0%, 100%, 0) 50%, hsla(0, 0%, 0%, 0) 50%, hsl(0, 0%, 0%) 100%), -o-linear-gradient(left, hsl(0, 0%, 50%) 0%, hsla(0, 0%, 50%, 0) 100%); background-color: #f00; } .ui-color-picker .picker { width: 10px; height: 10px; border-radius: 50%; border: 1px solid #fff; position: absolute; top: 45%; left: 45%; } .ui-color-picker .picker:before { width: 8px; height: 8px; content: ""; position: absolute; border: 1px solid #999; border-radius: 50%; } .ui-color-picker .hue, .ui-color-picker .alpha { width: 198px; height: 28px; margin: 5px; border: 1px solid #fff; float: left; } .ui-color-picker .hue { background: url("https://mdn.mozillademos.org/files/5701/...
...83.33%, #f00 100%); } .ui-color-picker .alpha { border: 1px solid #ccc; background: url("https://mdn.mozillademos.org/files/5705/alpha.png"); } .ui-color-picker .alpha-mask { width: 100%; height: 100%; background: url("https://mdn.mozillademos.org/files/6089/alpha_mask.png"); } .ui-color-picker .slider-picker { width: 2px; height: 100%; border: 1px solid #777; background-color: #fff; position: relative; top: -1px; } /* input hsv and rgb */ .ui-color-picker .info { width: 200px; margin: 5px; float: left; } .ui-color-picker .info * { float: left; } .ui-color-picker .input { width: 64px; margin: 5px 2px; float: left; } .ui-color-picker .input .name { height: 20px; width: 30px; text-align: center; font-size: 14px; line-height: 18px; float: left; } .ui-color-picker .inp...
...And 28 more matches
WebGL model view projection - Web APIs
a and move it around in 3d world space. the projection matrix is used to convert world space coordinates into clip space coordinates. a commonly used projection matrix, the perspective projection matrix, is used to mimic the effects of a typical camera serving as the stand-in for the viewer in the 3d virtual world. the view matrix is responsible for moving the objects in the scene to simulate the position of the camera being changed, altering what the viewer is currently able to see. the sections below offer an in-depth look into the ideas behind and implementation of the model, view, and projection matrices. these matrices are core to moving data around on the screen, and are concepts that transcend individual frameworks and engines. clip space in a webgl program, data is typically uploaded to...
... webglbox.prototype.draw = function(settings) {...
... webglbox.prototype.draw = function(settings) { // create some attribute data; these are the triangles th...
...And 25 more matches
Using the Geolocation API - Web APIs
the geolocation api is used to retrieve the user's location, so that it can for example be used to display their position using a mapping api. this article explains the basics of how to use it. the geolocation object the geolocation api is available through the navigator.geolocation object. if the object exists, geolocation services are available. you can test for the presence of geolocation thusly: if('geolocation' in navigator) { /* geolocation is available */ } else { /* geolocation is not available */ } getting the current position to obtain the user's current location, you can call the getcurrentposition() method. ...
...the object exists, geolocation services are available. you can test for the presence of geolocation thusly: if('geolocation' in navigator) { /* geolocation is available */ } else { /* geolocation is not available */ } getting the current position to obtain the user's current location, you can call the getcurrentposition() method. this initiates an asynchronous request to detect the user's position, and queries the positioning hardware to get up-to-date information. when the position is determined, the defined callback function is executed. ...
...it is useful if you need a quick answer regardless of the accuracy. ...
...And 24 more matches
Geometry and reference spaces in WebXR - Web APIs
augmented reality or virtual reality contexts is performed using webgl, so the two apis share much of the same design language. 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. ...
...epts that must be understood. in this article, we introduce the ways in which webxr expands upon the geometry of webgl, and how the positions and orientations of objects—both physical and virtual—are described in relation to one another using spaces and, in particular, reference spaces. the article spatial tracking in webxr builds upon the information provided here to cover how the physical position and orientation of the user's head, as well as potentially other parts of their body such as the hands, are mapped into the digital world, as well as how the relative positions of both physical and virtual objects are tracked as they move around, so that the scene can be properly rendered and composited. fundamentals of 3d geometry while we'll examine here the required math operations used to c...
...ation of the user's head, as well as potentially other parts of their body such as the hands, are mapped into the digital world, as well as how the relative positions of both physical and virtual objects are tracked as they move around, so that the scene can be properly rendered and composited. fundamentals of 3d geometry while we'll examine here the required math operations used to compute the positions, orientations, and movement of objects in virtual space—plus the need to integrate the human viewer of the scene into the mix—a thorough introduction to geometry and the use of matrices and vectors to manage 3d representations of a scene is well beyond the scope of what can be accomplished in this article. you can learn more about the individual operations in matrix math for the web. units ...
...And 24 more matches
Using CSS transitions - CSS: Cascading Style Sheets
plies to all properties during the transition, or multiple values to allow each property to transition over a different period of time. ...
... transition-property: width height background-color font-size left top transform -webkit-transform color; transition-duration: 0.5s; transition-timing-function: ease-in-out; } .box1{ transform: rotate(270deg); -webkit-transform: rotate(270deg); width: 50px; height: 50px; background-color: blue; color: yellow; font-size: 18px; left: 150px; top: 25px; position: absolute; -webkit-transition-property: width height background-color font-size left top transform -webkit-transform color; -webkit-transition-duration: 0.5s; -webkit-transition-timing-function: ease-in-out; transition-property: width height background-color font-size left top transform -webkit-transformv color; transition-duration: 0.5s; transition-timing-function: ease-i...
...yselector("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 -webkit-transform color; -webkit-transition-duration: 1s; -webkit-transition-timing-function: ease-in-out; transition-property: width height background-color font-size left top transform color; transition-duration: 1s; transition-timing-function: ease-in-out; } .box1{ transform: ro...
...And 23 more matches
Web audio spatialization basics - Web APIs
computer into. creating an audio listener so let's begin! the baseaudiocontext (the interface the audiocontext is extended from) has a listener property that returns an audiolistener object. this represents the listener of the scene, usually your user. you can define where they are in space and in which direction they are facing. they remain static. ...
...g an audio listener so let's begin! ...
...t is extended from) has a listener property that returns an audiolistener object. this represents the listener of the scene, usually your user. you can define where they are in space and in which direction they are facing. they remain static. the pannernode can then calculate its sound position relative to the position of the listener. ...
...And 22 more matches
Spaces and reference spaces: Spatial tracking in WebXR - Web APIs
sert a human into a virtual environment. to accomplish this, software needs the ability to not only track the locations, orientation, and movements of objects in the virtual world, but the user's location, orientation, and movement as well. but webxr goes beyond that by adding the ability to track the location, orientation, and motion of the input devices which generate data used to determine the position and movement of individual parts of the viewer's body (with appropriate equipment). the location and movement of the user's headset represent their head's position and orientation in the virtual environment. hand controllers represent their hands in the same manner. other hardware elements can be used similarly to represent other parts of the body, providing additional data to use when simulatin...
...head's position and orientation in the virtual environment. hand controllers represent their hands in the same manner. other hardware elements can be used similarly to represent other parts of the body, providing additional data to use when simulating the user's actions in their environment. in this guide, we'll explore how webxr uses spaces and, more specifically, reference spaces, to track the positions, orientations, and movements of objects and of the user's body in the virtual world. note: this article presumes that you are familiar with the concepts introduced in geometry and reference spaces in webxr: that is, the basics of 3d coordinate systems, as well as webxr spaces, reference spaces, and how reference spaces are used to create local coordinate systems for individual objects or movab...
...f the user's body in the virtual world. note: this article presumes that you are familiar with the concepts introduced in geometry and reference spaces in webxr: that is, the basics of 3d coordinate systems, as well as webxr spaces, reference spaces, and how reference spaces are used to create local coordinate systems for individual objects or movable components within a scene. ...
...And 21 more matches
Border-image generator - CSS: Cascading Style Sheets
****************************************************/ /*************************************************************************************/ /* * ui dropdown */ /* dropdown */ .ui-dropdown { height: 2em; width: 120px; font-family: "segoe ui", arial, helvetica, sans-serif; font-size: 12px; background-image: url("https://mdn.mozillademos.org/files/6037/drop_arrow_icon.png"); background-position: right center; background-repeat: no-repeat; background-color: #359740; position: relative; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; user-select: none; } .ui-dropdown:hover { cursor: pointer; background-color: #208b20; } /* dropdown select button */ .ui-dropdown-...
...ter; background-color: #208b20; } /* dropdown select button */ .ui-dropdown-select { height: inherit; padding: 0 0.75em; color: #fff; line-height: 2em; } /* dropdown list */ .ui-dropdown-list { width: 100%; height: 150px; max-height: 150px; margin: 0; padding: 0 0.3em; border: 3px solid #3490d2; border-color: #208b20; background: #666; background-color: #eef1f5; color: #000; position: absolute; top: 2em; left: 0; z-index: 100; overflow: hidden; transition: all 0.3s; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; } .ui-dropdown-list:hover { overflow: auto; } .ui-dropdown-list[data-hidden='true'] { height: 0 !important; opacity: 0; visibility: hidden; } .ui-dropdown[data-position='left'] .ui-dropdown-list { left: -100%; t...
...: 0; z-index: 100; overflow: hidden; transition: all 0.3s; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; } .ui-dropdown-list:hover { overflow: auto; } .ui-dropdown-list[data-hidden='true'] { height: 0 !important; opacity: 0; visibility: hidden; } .ui-dropdown[data-position='left'] .ui-dropdown-list { left: -100%; top: 0; } .ui-dropdown[data-position='right'] .ui-dropdown-list { left: 100%; top: 0; } .ui-dropdown-list > div { width: 100%; height: 1.6em; margin: 0.3em 0; padding: 0.3em; line-height: 1em; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; } .ui-dropdown-list > div:hover { background: #3490d2; color:#fff; border-radius: 2px; cursor: pointer; } /********************************...
...And 20 more matches
Inputs and input sources - Web APIs
. this may involve the user simply tapping on a spot on the screen, tracking their eyes, or the use of a joystick or motion-sensing controller to move a cursor. actions include both selection actions, such as clicking on a button, and squeeze actions, such as pulling a trigger or tightening your grip while wearing haptic gloves. 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. input device types webxr supports a variety of different types of devices to handle targeting and action inputs. these devices include but aren't limited to: screen taps (particularly but not necessarily only on phones or tablets) can be used to simultaneously perform both targeti...
...riate mesh to use to represent the controller in the view and to help present it in the correct hand if drawing hands on the display. it can also be useful if your app uses the notion of "main hand" and "off hand" for determining the functionality of a controller; in a game, for example, the main hand controller may be the player's weapon while the off hand controller might be used to control the positioning of a shield. targeting ray mode the targeting ray mode is a string found in the targetraymode property. it describes the technique used to determine the targeting ray and how it should be shown to the user if presented visually. when the targeting ray mode is gaze, the ray's origin is at the viewer and simply aims in the direction the user is facing. this gaze input method is fairly simple,...
... final target ray mode is most commonly found on mobile devices like smartphones and tablets. the screen mode indicates that the target ray is determined based on the user interacting with the webxr context by engaging with the screen in some way—most likely by the viewer tapping the screen or dragging the target ray around with their fingers. target ray space the xrspace used to describe the position and orientation of the target ray is found in the targetrayspace property. this space's native origin is located at the point from which the target ray is emitted (such as the front tip of the controller, or the end of a gun barrel if the controller is being rendered as a gun, for example), and the space's orientation vector extends outward along the path of the target ray. you can easily obtain...
...And 19 more matches
SVG documentation index - SVG: Scalable Vector Graphics
Web › SVG › Index
some time to understand namespaces now and it will save you all sorts of headaches in the future. 7 example svg, xml in this example, we use xhtml, svg, javascript, and the dom to animate a swarm of "motes". these motes are governed by two simple principles. first, each mote tries to move towards the mouse cursor, and second each mote tries to move away from the average mote position. combined, we get this very natural-looking behavior. 8 other resources reference, svg here is a list of additional resources on svg: 9 project svg no summary! 10 replaced element svg this page was auto-generated because a user created a sub-page to this page. 11 svg 1.1 support in firefox firefox, svg you can fin...
...1 baseprofile deprecated, svg, svg attribute the baseprofile attribute describes the minimum svg language profile that the author believes is necessary to correctly render the content. the attribute does not specify any processing restrictions; it can be considered metadata. 32 baseline-shift needsexample, svg, svg attribute the baseline-shift attribute allows repositioning of the dominant-baseline relative to the dominant-baseline of the parent text content element. the shifted object might be a sub- or superscript. 33 bbox deprecated, svg, svg attribute the bbox attribute defines the maximal bounding box of a font. 34 begin needscompattable, svg, svg attribute the begin attribute defines when an animation should begin o...
...s the kd value in the phong lighting model. in svg, this can be any non-negative number. 58 direction svg, svg attribute the direction attribute specifies the inline-base direction of a <text> or <tspan> element. it defines the start and end points of a line of text as used by the text-anchor and inline-size properties. it also may affect the direction in which characters are positioned if the unicode-bidi property's value is either embed or bidi-override. 59 display svg, svg attribute the display attribute lets you control the rendering of graphical or container elements. 60 divisor filters, svg, svg attribute the divisor attribute specifies the value by which the resulting number of applying the kernelmatrix of a <feconvolvematrix> e...
...And 19 more matches
menupopup - Archive of obsolete content
yed. it may be attached to any element using the context attribute. when a context menu is opened, the menupopup will be displayed. a context menu may be opened by right-clicking the element, or by pressing the menu key on the keyboard. more information is available in the xul tutorial and popup guide. 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. <menulist> <menupopup> <menuitem label="mozilla" value="http://mozilla.org"/> <menuitem label="slashdot"...
...bel is right-clicked, the menu will be displayed. <menupopup id="clipmenu"> <menuitem label="cut"/> <menuitem label="copy"/> <menuitem label="paste"/> </menupopup> <label value="right click for popup" context="clipmenu"/> attributes ignorekeys type: boolean if true, keyboard navigation between items in the popup is disabled. left type: integer overrides the horizontal position of the popup specified by the showpopup method. onpopuphidden type: script code this event is sent to a popup after it has been hidden. this event may also be received while the popup is still open, but when sub-menus contained within this popup are hidden. example: <menupopup id="top" onpopuphidden="console.log('the onpopuphidden method of id=top was called.');"> <menuitem l...
... this event is sent to a popup just before it is opened. this handler is usually used to dynamically set the contents when the user requests to display it. returning false from this event handler prevents the popup from appearing. onpopupshown type: script code this event is sent to a popup after it has been opened, much like the onload event is sent to a window when it is opened. ...
...And 18 more matches
panel - Archive of obsolete content
Archive › Mozilla › XUL › panel
supported. some features may work, but only on some platforms. for those versions of firefox, it is best to avoid child frames in a panel, if possible. this limitation was resolved as of firefox 4.0. attributes backdrag, close, consumeoutsideclicks, fade, flip, ignorekeys, label, left, level, noautofocus, noautohide, norestorefocus, onpopuphidden, onpopuphiding, onpopupshowing, onpopupshown, position, titlebar, top, type properties accessibletype, label, popupboxobject, popup, state methods hidepopup, moveto, openpopup, openpopupatscreen, sizeto examples the following example shows how a panel may be attached to a label. <panel id="thepanel"> <hbox align="start"> <image src="warning.png"/> <vbox> <description value="you have 6 new messages."/> <hbox> ...
...er, being able to flip horizontally makes sense. this attribute, set to both, permits that behavior. you will not normally have to use this attribute, since it's automatically applied to arrow panels. an arrow panel can also specify a value of slide, which causes the arrow to "slide" instead of flipping when the panel doesn't have room. a sliding panel will have the start (or end) position extended such that the panel can be the requested size, meaning the arrow will no longer be at the start (or end) of the panel - i.e., the arrow will appear to have been slid along the panel to ensure the arrow is still pointing at the anchor. in this image, the panel has flip="slide" and has a width which is greater than the distance from the anchor to the right of the screen (or ...
...would have had its width truncated and the panel would not extend to the left of the anchor. ignorekeys type: boolean if false, the default value, the escape key may be used to close the panel. if true, the escape key cannot be used to close the panel. label type: string for panels with titlebars, the label on the titlebar. left type: integer overrides the horizontal position of the popup specified by the showpopup method. level type: one of the values below specifies whether the panel appears on top of all windows, or just on top of the window the panel is in. if this attribute is not set, the popup window level depends on the platform. on linux, the default value is top, otherwise, the default value is parent. if a panel has one or more text fields, this at...
...And 17 more matches
tooltip - Archive of obsolete content
ples | attributes | properties | methods | related ] this element is used for the tooltip popups. for text-only tooltips, this element doesn't need to be used; instead you may just add a tooltiptext attribute to an element. more information is available in the xul tutorial. ...
...t is used for the tooltip popups. for text-only tooltips, this element doesn't need to be used; instead you may just add a tooltiptext attribute to an element. more information is available in the xul tutorial. ...
... a window when it is opened. page type: boolean setting the page attribute to true will result in the tooltip being filled automatically as appropriate for a browser content area tooltip, i.e. the tooltip text is set according to the dom element in the browser that the user hovered over. ...
...And 17 more matches
Viewpoints and viewers: Simulating cameras in WebXR - Web APIs
for either of you to see the difference. a third party can tell the difference, but the two of you cannot. if you are a camera, you can achieve the same visual result both by moving the camera or by moving everything around the camera. and that's our solution. since we can't move the camera, we move the world around it. our renderer needs to know where we imagine the camera to be, then alter the position of every visible object to simulate that position and orientation. thus, instead of referring to an actual camera object, the term camera is used in webgl and webxr programming to refer to an object describing the position and viewing direction of a hypothetical viewer of the scene, whether there's an actual object present in 3d space or not. points of view since the camera is a virtual object ...
...gaming-related situations are listed separately since they are often a special case specific to gaming, but any of these perspectives might apply to any 3d graphics scene. ...
...will follow those methods. deviating from them can pull the viewer out of the moment. in business applications, the 3d camera is used to simply set the apparent size and perspective when rendering things such as graphs and charts. in mapping applications, the camera may either be placed directly over the scene, or might use various angles to show perspective. for 3d gps solutions, the camera is positioned to show the area around the user, with the majority of the display showing the area ahead of the user's path of motion. when using webgl to accelerate 2d graphics drawing, the camera is typically placed directly above the center of the scene with the distance and field of view set to allow the entire scene to be presented. when accelerating bitmapped graphics, the renderer would draw the 2d i...
...And 17 more matches
Box-shadow generator - CSS: Cascading Style Sheets
<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"...
...sx" 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"...
... </div> </div> <div id="output" class="category"> <div id="menu" class="menu"></div> <div class="title"> css code </div> <div class="group" style="border-top-left-radius: 0;"> <div class="output" data-topic="element" data-name="element" data-prop="width height background-color position=[relative] box-shadow"> </div> <div class="output" data-topic="before" data-name="element:before" data-prop="content=[&quot;&quot;] position=[absolute] width height top left z-index background-color box-shadow transform -webkit-transform -ms-transform"> </div> <div class="output" data-topic="af...
...And 16 more matches
Index
Mozilla › Tech › XPCOM › Index
accelerator for the given action index supported by accessible. 270 getrelation this method returns accessible relation for this accessible object by index. 271 getrelations this method returns multiple accessible relations for this accessible object. 272 getstate this method retrieves states of the accessible. 273 groupposition this method returns grouping information. used for tree items, list items, tab panel labels, radio buttons, etc. also used for collectons of non-text objects. 274 help help text associated with node. 275 indexinparent the 0-based index of this accessible in its parent's list of children, or -1 if this accessible does not have a parent. ...
... retrieves the nsiaccessiblehyperlink object at the given link index. 297 getlink no summary! 298 getlinkindex no summary! 299 linkcount no summary! 300 nsiaccessibleimage interfaces, interfaces:scriptable, xpcom, xpcom interface reference returns the coordinates of the image accessible. 301 getimageposition this content is now available at nsiaccessibleimage.getimageposition(). 302 getimagesize this content is now available at nsiaccessibleimage.getimagesize(). 303 nsiaccessibleprovider accessibility, interfaces, interfaces:scriptable, xpcom, xpcom api reference, xpcom interface reference no summary! 304 nsiaccessiblerelation inter...
...on about the update that is currently being downloaded. this information is most commonly used to update a user interface that informs the user as to the status of an update. 336 nsiarray interfaces, interfaces:scriptable, xpcom, xpcom api reference, xpcom interface reference an indexed collection of elements. provides basic functionality for retrieving elements at a specific position, searching for elements. indexes are zero-based, such that the last element in the array is stored at the index length-1. 337 nsiasyncinputstream interfaces, interfaces:scriptable, needscontent, streams, xpcom api reference, xpcom interface reference if an input stream is non-blocking, it may return ns_base_stream_would_block when read. the caller must then wait for the strea...
...And 15 more matches
nsIDOMWindowUtils
iew void activatenativemenuitemat(in astring indexstring); void clearmozafterpaintevents(); pruint32 comparecanvases(in nsidomhtmlcanvaselement acanvas1, in nsidomhtmlcanvaselement acanvas2, out unsigned long amaxdifference); double computeanimationdistance(in nsidomelement element, in astring property, in astring value1, in astring value2); nsicompositionstringsynthesizer createcompositionstringsynthesizer(); obsolete since gecko 38.0 void disablenontestmouseevents(in boolean adisable); boolean dispatchdomeventviapresshell(in nsidomnode atarget, in nsidomevent aevent, in boolean atrusted); nsidomelement elementfrompoint(in float ax, in float ay, in boolean aignorerootscrollframe, in boolean aflushlayout); vo...
...olete since gecko 13.0 void purgepccounts(); unsigned long redraw([optional] in unsigned long acount); void renderdocument(in nsconstrect arect, in pruint32 aflags, in nscolor abackgroundcolor, in gfxcontext athebescontext); native code only! ...
...ng redraw([optional] in unsigned long acount); void renderdocument(in nsconstrect arect, in pruint32 aflags, in nscolor abackgroundcolor, in gfxcontext athebescontext); native code only! ...
...And 15 more matches
AudioListener - Web APIs
the audiolistener interface represents the position and orientation of the unique person listening to the audio scene, and is used in audio spatialization. all pannernodes spatialize in relation to the audiolistener stored in the baseaudiocontext.listener attribute. it is important to note that there is only one listener per context and that it isn't an audionode. 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. this is why these values are not marked read only, which is how they appear in the specification's idl. ...
...and that it isn't an audionode. 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. this is why these values are not marked read only, which is how they appear in the specification's idl. audiolistener.positionx represents the horizontal position of the listener in a right-hand cartesian coordinate sytem. the default is 0. audiolistener.positiony represents the vertical position of the listener in a right-hand cartesian coordinate sytem. the default is 0. audiolistener.positionz represents the longitudinal (back and forth) position of the listener in a right-hand cartesian coordinate sytem. the def...
...ht-hand cartesian coordinate sytem. the default is 0. audiolistener.positiony represents the vertical position of the listener in a right-hand cartesian coordinate sytem. the default is 0. audiolistener.positionz represents the longitudinal (back and forth) position of the listener in a right-hand cartesian coordinate sytem. the default is 0. audiolistener.forwardx represents the horizontal position of the listener's forward direction in the same cartesian coordinate sytem as the position (positionx, positiony, and positionz) values. the forward and up values are linearly independent of each other. the default is 0. ...
...And 15 more matches
left - CSS: Cascading Style Sheets
Web › CSS › left
the left css property participates in specifying the horizontal position of a positioned element. it has no effect on non-positioned elements. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...ase clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... <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. for relatively positioned elements, the distance that the element is moved to the right of its normal position. ...
...And 15 more matches
Relationship of grid layout to other layout methods - CSS: Cascading Style Sheets
ing: 1em; color: #d9480f; } <div class="wrapper"> <div>one</div> <div>two</div> <div>three</div> </div> .wrapper { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); } we now have the ability to create a grid with a flexible number of flexible tracks, but see items laid out on the grid aligned by rows and columns at the same time. ...
..."> <div>one</div> <div>two</div> <div>three</div> </div> .wrapper { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); } we now have the ability to create a grid with a flexible number of flexible tracks, but see items laid out on the grid aligned by rows and columns at the same time. ...
...</div> .wrapper { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); } we now have the ability to create a grid with a flexible number of flexible tracks, but see items laid out on the grid aligned by rows and columns at the same time. grid and absolutely positioned elements grid interacts with absolutely positioned elements, which can be useful if you want to position an item inside a grid or grid area. ...
...And 14 more matches
Using CSS gradients - CSS: Cascading Style Sheets
height: 120px; } .angled-gradient { background: linear-gradient(70deg, blue, pink); } when using an angle, 0deg creates a vertical gradient running bottom to top, 90deg creates a horizontal gradient running left to right, and so on in a clockwise direction. negative angles run in the counterclockwise direction. declaring colors & creating effects all css gradient types are a range of position-dependent colors. the colors produced by css gradients can vary continuously with position, producing smooth color transitions. it is also possible to create bands of solid colors, and hard transitions between two colors. the following are valid for all gradient functions: using more than two colors you don't have to limit yourself to two colors—you may use as many as you like! by default, c...
... are valid for all gradient functions: using more than two colors you don't have to limit yourself to two colors—you may use as many as you like! by default, colors are evenly spaced along the gradient. <div class="auto-spaced-linear-gradient"></div> div { width: 120px; height: 120px; } .auto-spaced-linear-gradient { background: linear-gradient(red, yellow, blue, orange); } positioning color stops you don't have to leave your color stops at their default positions. to fine-tune their locations, you can give each one zero, one, or two percentage or, for radial and linear gradients, absolute length values. if you specify the location as a percentage, 0% represents the starting point, while 100% represents the ending point; however, you can use values outside that range if nec...
...ositions. to fine-tune their locations, you can give each one zero, one, or two percentage or, for radial and linear gradients, absolute length values. if you specify the location as a percentage, 0% represents the starting point, while 100% represents the ending point; however, you can use values outside that range if necessary to get the effect you want. if you leave a location unspecified, the position of that particular color stop will be automatically calculated for you, with the first color stop being at 0% and the last color stop being at 100%, and any other color stops being half way between their adjacent color stops. <div class="multicolor-linear"></div> div { width: 120px; height: 120px; } .multicolor-linear { background: linear-gradient(to left, lime 28px, red 77%, cyan); ...
...And 14 more matches
Index - Archive of obsolete content
everal seconds around the visual representation of that node in the browser window. 392 finding the file to modify add-ons, extensions now that we have a hackable mozilla, it's time to find the file we want to hack. mozilla's ui is divided into three layers: the structure, the style, and the behavior. the structure layer identifies the widgets (menus, buttons, etc.) and their position in the ui relative to each other, the style layer defines how the widgets look (size, color, style, etc.) and their overall position (alignment), and the behavior layer specifies how the widgets behave and how users can use them to accomplish their goals. mention the localization layer 393 making a mozilla installation modifiable add-ons, extensions mozilla's user interface i...
...ertooltiptext xul attributes, xul reference no summary! 1011 pinned xul, xul attribute, xul reference no summary! 1012 placeholder xul attributes, xul reference no summary! 1013 popup xul attributes, xul reference no summary! 1014 popup.left xul attributes, xul reference no summary! 1015 popup.position xul attributes, xul reference no summary! 1016 popup.top xul attributes, xul reference no summary! 1017 popupalign no summary! 1018 popupanchor no summary! 1019 position xul attributes, xul reference no summary! 1020 predicate xul attributes, xul reference no summary! 1021 ...
...nulist.appenditem xul methods, xul reference no summary! 1265 menulist.select xul methods, xul reference no summary! 1266 movebyoffset xul methods, xul reference no summary! 1267 movetabto xul methods, xul reference no summary! 1268 moveto xul methods, xul reference no summary! 1269 movetoalertposition xul methods, xul reference no summary! 1270 onfindagaincommand no summary! 1271 onsearchcomplete needshelp, xul methods, xul reference no summary! 1272 ontextentered needshelp, xul methods, xul reference no summary! 1273 ontextreverted needshelp, xul methods, xul reference no summary! 1274 op...
...And 13 more matches
Adding 2D content to a WebGL context - Web APIs
eed to define the shaders that will create the color for our simple scene as well as draw our object. these will establish how the square plane appears on the screen. the shaders a shader is a program, written using the opengl es shading language (glsl), that takes information about the vertices that make up a shape and generates the data needed to render the pixels onto the screen: namely, the positions of the pixels and their colors. there are two shader functions run when drawing webgl content: the vertex shader and the fragment shader. you write these in glsl and pass the text of the code into webgl to be compiled for execution on the gpu. together, a set of vertex and fragment shaders is called a shader program. let's take a quick look at the two types of shader, with the example in mind ...
... each time a shape is rendered, the vertex shader is run for each vertex in the shape. its job is to transform the input vertex from its original coordinate system into the clip space coordinate system used by webgl, in which each axis has a range from -1.0 to 1.0, regardless of aspect ratio, actual size, or any other factors. the vertex shader must perform the needed transforms on the vertex's position, make any other adjustments or calculations it needs to make on a per-vertex basis, then return the transformed vertex by saving it in a special variable provided by glsl, called gl_position. the vertex shader can, as needed, also do things like determine the coordinates within the face's texture of the texel to apply to the vertex, apply the normals to determine the lighting factor to apply to ...
...gl_position. the vertex shader can, as needed, also do things like determine the coordinates within the face's texture of the texel to apply to the vertex, apply the normals to determine the lighting factor to apply to the vertex, and so on. this information can then be stored in varyings or attributes as appropriate to be shared with the fragment shader. our vertex shader below receives vertex position values from an attribute we define called avertexposition. that position is then multiplied by two 4x4 matrices we provide called uprojectionmatrix and umodelviewmatrix; gl_position is set to the result. for more info on projection and other matrixes you might find this article useful. ...
...And 13 more matches
right - CSS: Cascading Style Sheets
Web › CSS › right
the right css property participates in specifying the horizontal position of a positioned element. it has no effect on non-positioned elements. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...ne https://github.com/mdn/interactive-examples and send us a pull request. ...
...> 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. for relatively positioned elements, the distance that the element is moved to the left of its normal position. ...
...And 13 more matches
PannerNode - Web APIs
the pannernode interface represents the position and behavior of an audio source signal in space. it is an audionode audio-processing module describing its position with right-hand cartesian coordinates, its movement using a velocity vector and its directionality using a directionality cone. a pannernode always has exactly one input and one output: the input can be mono or stereo but the output is always stereo (2 channels); you can't have panning effects without at least two audio channels! number of inputs 1 number of outputs 1 channel count mode "clamped-max" channel count 2 channel interpretation "speakers" constructor pannernode.pannernode creates a new pannernode object instance. properties inherits properties f...
...ffects without at least two audio channels! number of inputs 1 number of outputs 1 channel count mode "clamped-max" channel count 2 channel interpretation "speakers" constructor pannernode.pannernode creates a new pannernode object instance. properties inherits properties from its parent, audionode. the orientation and position value are set and retrieved using different syntaxes, since they're stored as audioparam values. retrieval is done by accessing, for example, pannernode.positionx. while setting the same property is done with pannernode.positionx.value. this is why these values are not marked read only, which is how they appear in the webidl. pannernode.coneinnerangle is a double value describing the angle, ...
...ithm to use to reduce the volume of the audio source as it moves away from the listener. possible values are "linear", "inverse" and "exponential". the default value is "inverse". pannernode.maxdistance a double value representing the maximum distance between the audio source and the listener, after which the volume is not reduced any further. pannernode.orientationx represents the horizontal position of the audio source's vector in a right-hand cartesian coordinate system. while this audioparam cannot be directly changed, its value can be altered using its value property. the default is value is 1. pannernode.orientationy represents the vertical position of the audio source's vector in a right-hand cartesian coordinate system. the default is 0. while this audioparam cannot be directly chang...
...And 12 more matches
Web Video Text Tracks Format (WebVTT) - Web APIs
d and the other part to remain normal, we can define it as follows using css. ...
...follows using css. ...
...00 that’s an, an, that’s an l! 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? 00:00:03.000 --> 00:00:06.500 position:90% align:right size:35% i think he went down this lane. 00:00:04.000 --> 00:00:06.500 position:45%,line-right align:center size:35% what are you waiting for? webvtt cues a cue is a single subtitle block that has a single start time, end time, and textual payload. example 6 consists of the header, a blan...
...And 12 more matches
nsIEditorIMESupport
editor/idl/nsieditorimesupport.idlscriptable please add a summary to this article. ...
... editor/idl/nsieditorimesupport.idlscriptable please add a summary to this article. ...
... editor/idl/nsieditorimesupport.idlscriptable please add a summary to this article. ...
...And 11 more matches
Movement, orientation, and motion: A WebXR example - Web APIs
= null; let xrinputsources = null; let xrreferencespace = null; let xrbutton = null; let gl = null; let animationframerequestid = 0; let shaderprogram = null; let programinfo = null; let buffers = null; let texture = null; let mouseyaw = 0; let mousepitch = 0; this is followed by a set of constants, mostly to contain various vectors and matrices used while rendering the scene. ...
...arious vectors and matrices used while rendering the scene. const viewerstartposition = vec3.fromvalues(0, 0, -10); const viewerstartorientation = vec3.fromvalues(0, 0, 1.0); const cubeorientation = vec3.create(); const cubematrix = mat4.create(); const mousematrix = mat4.create(); const inverseorientation = quat.create(); const radians_per_degree = math.pi / 180.0; the first two—viewerstartposition and viewerstartorientation—indicate where the viewer will be placed relative to the center of the space, and the direction in which they'll initially be looking. cubeorientation will store the current orientation of the cube, while cubematrix and mousematrix are storage for matrices used during the rendering of the scene. inverseorientation is a quaternion which will be used to represent the ro...
... part of the program generated the error, since similar errors can have in multiple situations. the vertex and fragment shaders the vertex and fragment shaders are both exactly the same as those used in the example for our article lighting in webgl. refer to that if you're interested in the glsl source code for the basic shaders used here. suffice it to say that the vertex shader computes the position of each vertex given the initial positions of each vertex and the transforms that need to be applied to convert them to simulate the viewer's current position and orientation. the fragment shader returns the color of each vertex, interpolating as needed from the values found in the texture and applying the lighting effects. starting up and shutting down webxr upon initially loading the script, ...
...And 11 more matches
Layout and the containing block - CSS: Cascading Style Sheets
most often, the containing block is the content area of an element's nearest block-level ancestor, but this is not always the case. in this article, we examine the factors that determine an element's containing block. when a user agent (such as your browser) lays out a document, it generates a box for every element. each box is divided into four areas: content area padding area border area margin area many developers believe that the containing block of an element is always the content area of its parent, but that isn't necessarily true. let's investigate the factors that determine what an element's containing block is. ...
...a many developers believe that the containing block of an element is always the content area of its parent, but that isn't necessarily true. let's investigate the factors that determine what an element's containing block is. effects of the containing block before learning what determines the containing block of an element, it's useful to know why it matters in the first place. the size and position of an element are often impacted by its containing block. 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. identifying the containing block the process for identifying the containing block depends entirely on...
...acted by its containing block. 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. ...
...And 11 more matches
JavaScript Daemons Management - Archive of obsolete content
*...
...1) { return; } this.rate = nrate; this.synchronize(); }; daemon.prototype.forceposition = function (vto) { if (isfinite(vto)) { this.index = math.round(math.abs(vto)); } }; daemon.prototype.getduration = function () { return this.rate * this.length; }; daemon.prototype.getdirection = function () { return this.isatend() !== this.backw; }; daemon.prototype.getposition = function () { return this.index; }; /* instantaneous movement (synchronous). */ daemon.prototype.makesteps = function (nhowmany, breverse, bforce) { if (nhowmany === 0) { return true; } if (isnan(nhowmany)) { return false; } var nidx = 0, nlen = math.round(math.abs(nhowmany)), bcontinue = true, bbackw = nhowmany > 0 === boolean(breverse); this.backw = bbackw; f...
...ts: index (the iterative index of each invocation), length (the number of total invocations assigned to the daemon - finite or infinity), and backwards (a boolean expressing whether the process is going backwards or not). note: the stop() method is not part of the base system. daemon instances methods mydaemon.isatend() returns a boolean expressing whether the daemon is at the start/end position or not. mydaemon.synchronize() synchronizes the timer of a started daemon with the time of invocation of mydaemon.synchronize(). if the rate property has been changed, the daemon will be updated with the new rate value. mydaemon.pause() pauses the daemon. mydaemon.start([backwards]) starts the daemon forwards (index of each invocation increasing) or backwards (index decreasing). mydaemon.s...
...And 10 more matches
Backgrounds and borders - Learn web development
used length units to size it inside the box. you can see this has distorted the image. try the following. change the length units used to modify the size of the background. remove the length units and see what happens when you use background-size: cover or background-size: contain. if your image is smaller than the box, you can change the value of background-repeat to repeat the image. positioning the background image the background-position property allows you to choose the position in which the background image appears on the box it is applied to. this uses a coordinate system in which the top-left-hand corner of the box is (0,0), and the box is positioned along the horizontal (x) and vertical (y) axes. note: the default background-position value is (0,0). the most common backgro...
...the background image the background-position property allows you to choose the position in which the background image appears on the box it is applied to. this uses a coordinate system in which the top-left-hand corner of the box is (0,0), and the box is positioned along the horizontal (x) and vertical (y) axes. note: the default background-position value is (0,0). the most common background-position values take two individual values — a horizontal value followed by a vertical value. ...
... system in which the top-left-hand corner of the box is (0,0), and the box is positioned along the horizontal (x) and vertical (y) axes. note: the default background-position value is (0,0). the most common background-position values take two individual values — a horizontal value followed by a vertical value. ...
...And 10 more matches
source-editor.jsm
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 rem...
...ue an array of all of the breakpoints in the editor instance. each breakpoint is an object with the following properties: property type description line number the 0-based line number on which the breakpoint is set. condition string the condition string that was specified when the breakpoint was set. getcaretoffset() returns the current caret position (insertion point) as an offset into the text. number getcaretoffset(); parameters none. return value the 0-based offset into the text at which newly-typed characters will be inserted. getcaretposition() returns an object describing the position of the caret (insertion point) in terms of its line number and column. object getcaretposition(); parameters none. return value the returned...
... col number the 0-based column number on which the caret is located. ...
...And 10 more matches
WebGLRenderingContext.vertexAttribPointer() - Web APIs
glbuffer is bound to the array_buffer target. when using a webgl 2 context, a gl.invalid_operation error is thrown if this vertex attribute is defined as a integer in the vertex shader (e.g. uvec4 or ivec4, instead of vec4). description let's assume we want to render some 3d geometry, and for that we will need to supply our vertices to the vertex shader. each vertex has a few attributes, like position, normal vector, or texture coordinate, that are defined in an arraybuffer and will be supplied to the vertex buffer object (vbo). first, we need to bind the webglbuffer we want to use to gl.array_buffer, then, with this method, gl.vertexattribpointer(), we specify in what order the attributes are stored, and what data type they are in. in addition, we need to include the stride, which is the tota...
...the graphics card when compiling the vertex shader. depending on the graphics card, the index will vary, so you must call gl.getattriblocation() to find out the index, and then provide this index to gl.vertexattribpointer(). if you are using webgl 2, you can specify the index yourself in the vertex shader code and override the default used by the graphics card, e.g. layout(location = 3) in vec4 position; would set the "position" attribute to index 3. integer attributes while the arraybuffer can be filled with both integers and floats, the attributes will always be converted to a float when they are sent to the vertex shader. if you need to use integers in your vertex shader code, you can either cast the float back to an integer in the vertex shader (e.g. (int) floatnumber), or use gl.vertexat...
...th vec4 but in our gl.vertexattribpointer() call we set the size to 2, then webgl will set the first two components based on the array buffer, while the third and fourth components are taken from the default value. the default value is vec4(0.0, 0.0, 0.0, 1.0) by default but we can specify a different default value with gl.vertexattrib[1234]f[v](). for example, your vertex shader may be using a position and a color attribute. most meshes have the color specified at a per-vertex level, but some meshes are of a uniform shade. for those meshes, it is not necessary to place the same color for each vertex into the array buffer, so you use gl.vertexattrib4fv() to set a constant color. querying current settings you can call gl.getvertexattrib() and gl.getvertexattriboffset() to get the current parame...
...And 10 more matches
A basic 2D WebGL animation example - Web APIs
vertex shader first, let's take a look at the vertex shader. its job, as always, is to convert the coordinates we're using for our scene into clipspace coordinates (that is, the system by which (0, 0) is at the center of the context and each axis extends from -1.0 to 1.0 regardless of the actual size of the context). ...
...inates we're using for our scene into clipspace coordinates (that is, the system by which (0, 0) is at the center of the context and each axis extends from -1.0 to 1.0 regardless of the actual size of the context). ...
...ne into clipspace coordinates (that is, the system by which (0, 0) is at the center of the context and each axis extends from -1.0 to 1.0 regardless of the actual size of the context). ...
...And 10 more matches
WebXR Device API - Web APIs
each of these two images is rendered into a single framebuffer, with the left eye's rendered image on the left and the right eye's viewpoint rendered into the right half of the buffer. once both eyes' perspectives on the scene have been rendered, the resulting framebuffer is delivered to...
...ne to the device at an appropriate frame rate (optionally) mirror the output to a 2d display create vectors representing the movements of input controls at the most basic level, a scene is presented in 3d by computing the perspective to apply to the scene in order to render it from the viewpoint of each of the user's eyes by computing the position of each eye and rendering the scene from that position, looking in the direction the user is currently facing. each of these two images is rendered into a single framebuffer, with the left eye's rendered image on the left and the right eye's viewpoint rendered into the right half of the buffer. 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 t...
...bxr device api concepts and usage example webxr hardware setup while the older webvr api was designed solely to support virtual reality (vr), webxr provides support for both vr and augmented reality (ar) on the web. support for ar functionality is added by the webxr augmented reality module. a typical xr device can have either 3 or 6 degrees of freedom and might or might not have an external positional sensor. the equipment may also include an accelerometer, barometer, or other sensors which are used to sense when the user moves through space, rotates their head, or the like. accessing the webxr api to gain access to the webxr api within the context of a given window, use the navigator.xr property, which returns an xrsystem object through which the entire webxr device api is then exposed. ...
...And 10 more matches
background - CSS: Cascading Style Sheets
nteractive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...ground-color> */ background: border-box red; /* a single image, centered and scaled */ background: no-repeat center/80% url("../img/image.png"); the background property is specified as one or more background layers, separated by commas. the syntax of each layer is as follows: each layer may include zero or one occurrences of any of the following values: <attachment> <bg-image> <position> <bg-size> <repeat-style> the <bg-size> value may only be included immediately after <position>, separated with the '/' character, like this: "center/80%". the <box> value may be included zero, one, or two times. 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-cl...
...ound-origin and background-clip. if it is included twice, the first occurrence sets background-origin, and the second sets background-clip. the <background-color> value may only be included in the last layer specified. values <attachment> see background-attachment <box> see background-clip and background-origin <background-color> see background-color <bg-image> see background-image <position> see background-position <repeat-style> see background-repeat <bg-size> see background-size. accessibility concerns browsers do not provide any special information on background images to assistive technology. this is important primarily for screen readers, as a screen reader will not announce its presence and therefore convey nothing to its users. if the image contains information critic...
...And 10 more matches
panel - Archive of obsolete content
ted by the self module, like this: var mypanel = require("sdk/panel").panel({ contenturl: require("sdk/self").data.url("myfile.html") }); mypanel.show(); from firefox 34, you can use "./myfile.html" as an alias for self.data.url("myfile.html"). ...
...k/self").data.url("myfile.html") }); mypanel.show(); from firefox 34, you can use "./myfile.html" as an alias for self.data.url("myfile.html"). so you can rewrite the above code like this: var mypanel = require("sdk/panel").panel({ contenturl: "./myfile.html" }); mypanel.show(); panel positioning by default the panel appears in the center of the currently active browser window. you can position the panel by passing a position to the panel's constructor or to its show() method. ...
...nel = require("sdk/panel").panel({ contenturl: "./myfile.html" }); mypanel.show(); panel positioning by default the panel appears in the center of the currently active browser window. you can position the panel by passing a position to the panel's constructor or to its show() method. ...
...And 9 more matches
Index - Archive of obsolete content
Archive › Mozilla › XUL › Index
pickertooltiptext xul attributes, xul reference no summary! 280 pinned xul, xul attribute, xul reference no summary! 281 placeholder xul attributes, xul reference no summary! 282 popup xul attributes, xul reference no summary! 283 popup.left xul attributes, xul reference no summary! 284 popup.position xul attributes, xul reference no summary! 285 popup.top xul attributes, xul reference no summary! 286 popupalign no summary! 287 popupanchor no summary! 288 position xul attributes, xul reference no summary! 289 predicate xul attributes, xul reference no summary! 290 pre...
... menulist.appenditem xul methods, xul reference no summary! 534 menulist.select xul methods, xul reference no summary! 535 movebyoffset xul methods, xul reference no summary! 536 movetabto xul methods, xul reference no summary! 537 moveto xul methods, xul reference no summary! 538 movetoalertposition xul methods, xul reference no summary! 539 onfindagaincommand no summary! 540 onsearchcomplete needshelp, xul methods, xul reference no summary! 541 ontextentered needshelp, xul methods, xul reference no summary! 542 ontextreverted needshelp, xul methods, xul reference no summary! 543 open ...
... related to popups and menus. 609 popupkeys xul, xul popup guide when using a menupopup element, a keyboard listener is attached to the window that will handle keypresses for the menu. this allows items within the menu to be navigated with the cursor keys. the following table lists the keys that are checked, and what the menu keyboard listener does in response: 610 positioning xul, xul popup guide there are several ways in which the location of a popup on screen may be controlled. 611 special per-platform menu considerations beginner, guide, xul, xul popup guide for many menu commands, convention dictates where these items will be placed. for instance, the edit menu always starts with the undo command if such a feature is available in ...
...And 9 more matches
Building up a basic demo with A-Frame - Game development
ote: an entity is any element — it can be an object like a box, cylinder or cone, but it can also be a camera, light or sound source. let's create the scene by adding an <a-scene> element inside the <body> element: <a-scene> </a-scene> adding a cube adding the cube to the scene is done by adding a simple <a-box> element inside the <a-scene> element. ...
...a camera, light or sound source. let's create the scene by adding an <a-scene> element inside the <body> element: <a-scene> </a-scene> adding a cube adding the cube to the scene is done by adding a simple <a-box> element inside the <a-scene> element. add it now: <a-box color="#0095dd" position="0 1 0" rotation="20 40 0"> </a-box> it contains a few parameters already defined: color, position and rotation — these are fairly obvious, and define the base color of the cube, the position inside the 3d scene, and the rotation of the cube. note: the distance values (e.g. for the cube y position) are unitless, and can basically be anything you deem suitable for your scene — milimeters, meters, feet, or miles — it's up to you. adding a background: sky box a sky box is a background ...
...se for looking around and the keyboard for movement (try the w, a, s, and d keys.) there's even an "enter vr mode" button in the bottom right corner of the screen, to allow you to shift to full screen, stereoscopic image viewing if you have the necesary vr hardware set up and ready. specifying a camera a camera entity can be created by adding an <a-camera> element to the scene. ...
...And 9 more matches
GLSL Shaders - Game development
fragment shaders compute the renderings of a shape's colors and other attributes. glsl is not as intuitive as javascript. glsl is strongly typed and there is a lot of math involving vectors and matrices. ...
...a gpu (graphics processing unit), which is optimized for such operations. using a gpu to deal with shaders offloads some of the number crunching from the cpu. this allows the cpu to focus its processing power on other tasks, like executing code. vertex shaders vertex shaders manipulate coordinates in a 3d space and are called once per vertex. the purpose of the vertex shader is to set up the gl_position variable — this is a special, global, and built-in glsl variable. gl_position is used to store the position of the current vertex. the void main() function is a standard way of defining the gl_position variable. everything inside void main() will be executed by the vertex shader. a vertex shader yields a variable containing how to project a vertex's position in 3d space onto a 2d screen. fr...
... the calculations result in a variable containing the information about the rgba color. demo let's build a simple demo to explain those shaders in action. be sure to read three.js tutorial first to grasp the concept of the scene, its objects, and materials. ...
...And 9 more matches
Index - Learn web development
ng effects article, beginner, blend modes, boxes, css, codingscripting, filters, styling, box shadows, effects, shapes we hope this article was fun — playing with shiny toys generally is, and it is always interesting to see what kinds of advanced styling tools are becoming available in modern browsers. 106 backgrounds and borders background, beginner, css, image, learn, position, borders, color we have covered quite a lot here, and you can see that there is quite a lot to adding a background or a border to a box. do explore the different property pages if you want to find out more about any of the features we have discussed. each page on mdn has more examples of usage for you to play with and enhance your knowledge. 107 css selectors attribute, begin...
...the aim of this task is to help you check your understanding of the css box model. 113 type, class, and id selectors beginner, css, class, learn, selectors, id in this lesson we will take a look at the simplest selectors that are available, which you will probably use the most in your work. 114 css values and units beginner, css, function, image, learn, number, position, color, length, percentage, units, values this has been a quick run through of the most common types of values and units you might encounter. you can have a look at all of the different types on the css values and units reference page; you will encounter many of these in use as you work through these lessons. 115 cascade and inheritance beginner, css, cascade, inheritance, le...
... to css, learn, modules, specifications, syntax css (cascading style sheets) allows you to create great-looking web pages, but how does it work under the hood? this article explains what css is, with a simple syntax example, and also covers some key terms about the language. 140 css layout beginner, css, floating, grids, guide, landing, layout, learn, module, multiple column, positioning, alignment, flexbox, float, table at this point we've already looked at css fundamentals, how to style text, and how to style and manipulate the boxes that your content sits inside. now it's time to look at how to place your boxes in the right place in relation to the viewport, and one another. we have covered the necessary prerequisites so we can now dive deep into css layout, looking a...
...And 9 more matches
Drawing graphics - Learn web development
), in which to draw the new example. we'll be using some common methods and properties across all of the below sections: beginpath() — start drawing a path at the point where the pen currently is on the canvas. on a new canvas, the pen starts out at (0, 0). moveto() — move the pen to a different point on the canvas, without recording or tracing the line; the pen simply "jumps" to the new position. fill() — draw a filled shape by filling in the path you've traced so far. stroke() — draw an outline shape by drawing a stroke along the path you've drawn so far. you can also use features like linewidth and fillstyle/strokestyle with paths as well as rectangles. a typical, simple path-drawing operation would look something like so: ctx.fillstyle = 'rgb(255, 0, 0)'; ctx.beginpath(); ct...
... to draw a circle in canvas. this is accomplished using the arc() method, which draws all or part of a circle at a specified point. let's add an arc to our canvas — add the following to the bottom of your code: ctx.fillstyle = 'rgb(0, 0, 255)'; ctx.beginpath(); ctx.arc(150, 106, 50, degtorad(0), degtorad(360), false); ctx.fill(); arc() takes six parameters. the first two specify the position of the arc's center (x and y, respectively). the third is the circle's radius, the fourth and fifth are the start and end angles at which to draw the circle (so specifying 0 and 360 degrees gives us a full circle), and the sixth parameter defines whether the circle should be drawn counterclockwise (anticlockwise) or clockwise (false is clockwise). note: 0 degrees is horizontally to the righ...
...oop); } loop(); we run the loop() function once at the bottom of the code to start the cycle, drawing the first animation frame; the loop() function then takes charge of calling requestanimationframe(loop) to run the next frame of the animation, again and again. note that on each frame we are completely clearing the canvas and redrawing everything. for every ball present we draw it, update its position, and check to see if it is colliding with any other balls. once you've drawn a graphic to a canvas, there's no way to manipulate that graphic individually like you can with dom elements. you can't move each ball around on the canvas, because once it's drawn, it's part of the canvas, and is not an individual accessible element or object. instead, you have to erase and redraw, either by erasing the...
...And 9 more matches
TPS Bookmark Lists
this bookmark; used only in verify and modify actions. changes: an object containing new properties to be set for this bookmark when this asset list is used in a modify action. ...
...required. siteuri: the livemark's uri. optional. feeduri: the livemark's feed uri. required. after: the title of ...
...required. ...
...And 9 more matches
Raining rectangles - Web APIs
game that demonstrates clearing with solid colors, scissoring, animation, and user interaction. animation and user interaction with scissoring this is a simple game. the objective: try to catch as many of the raining rectangles as you can by clicking on them. in this example, we use an object-oriented approach for the displayed rectangles, which helps to keep the state of the rectangle (its position, color, and so on) organized in one place, and the overall code more compact and reusable. this example combines clearing the drawing buffer with solid colors and scissoring operations. it is a preview of a full graphical application that manipulates various phases of the webgl graphics pipeline and state machine. in addition, the example demonstrates how to integrate the webgl function calls w...
...so we reschedule // the timeout to call drawanimation again in ...
...so we reschedule // the timeout to call drawanimation again in 17ms. // otherwise we w...
...And 9 more matches
Rendering and the WebXR frame animation callback - Web APIs
ticle setting up and shutting down a webxr session. preparing the renderer once the xr session has been set up, with the webgl framebuffer connected and webgl primed with the data it needs in order to render the scene, you can set up the renderer to start running. this begins with getting the reference space in which you want to draw, with its origin and orientation set at the viewer's starting position and viewing direction. once that's in hand, you request that the browser call your rendering function the next time it needs a framebuffer to render your scene. this is done by calling the xrsession method requestanimationframe(). kicking off the renderer thus looks like this: let worldrefspace; async function runxr(xrsession) { worldrefspace = await xrsession.requestreferencespace("immersiv...
...ebuffer to render your scene. this is done by calling the xrsession method requestanimationframe(). ...
...ion.requestreferencespace("immersive-vr"); if (worldrefspace) { viewerrefspace = worldrefspace.getoffsetreferencespace( new xrrigidtransform(viewerstartposition, viewerstartorientation)); animationframerequestid = xrsession.requestanimationframe(mydrawframe); } } after getting a reference space for the immersive world, this creates an offset reference space representing the position and orientation of the viewer by creating an xrrigidtransform representing that position and orientation, then calling the xrreferencespace method getoffsetreferencespace(). then the first animation frame is scheduled by calling the xrsession method requestanimationframe(), providing a callback function, mydrawframe(), whose job is to render the frame. note that this code doesn't have a loop! i...
...And 9 more matches
OpenClose - Archive of obsolete content
pup, you may wish to open the popup programatically. to do this, use the popup's openpopup method. this method may be used for any type of popup, either a menupopup, a panel, or a tooltip, including ones that can be opened via other means, for instance, a popup attached via the context attribute. ...
...nupopup, a panel, or a tooltip, including ones that can be opened via other means, for instance, a popup attached via the context attribute. the openpopup method takes six arguments which are used to specify how and where the popup should be positioned. these will be described below. the openpopup method is defined as follows: void openpopup(in domelement anchorelement, in string position, in long x, in long y, in boolean iscontextmenu, in boolean attributesoverride); first an example: somepopup.openpopup(anchor, "after_start", 0, 0, false, false); this example will open a popup located just underneath another element referenced by 'anchor'. this emulates how a menu is opened, where 'anchor' is the menu element. it i...
...irst an example: somepopup.openpopup(anchor, "after_start", 0, 0, false, false); this example will open a popup located just underneath another element referenced by 'anchor'. this emulates how a menu is opened, where 'anchor' is the menu element. it is possible to use the openpopup method with a menu, however, it is easier to just set the menu's open attribute to true, as that will handle the positioning of the menupopup for you. note that while the open attribute applies to the parent menu or button, the openpopup method applies to the menupopup element. the anchor of a popup is the element node that the popup is displayed next to. for instance, to have a popup appear next to a button, pass a reference to this button as the first argument to the openpopup method. in this next example, the po...
...And 8 more matches
Styling web forms - Learn web development
e apparent via the screenshot is that the radio and checkbox controls still look the same, but they are centered in the 150px of horizontal space provided by the width property. other browsers may not center the widgets, but they do adhere to the space allotted. legend placement the <legend> element is okay to style, but it can be a bit tricky to control placement of it. ...
...ame, but they are centered in the 150px of horizontal space provided by the width property. other browsers may not center the widgets, but they do adhere to the space allotted. legend placement the <legend> element is okay to style, but it can be a bit tricky to control placement of it. by default it is always positioned over the top border of its <fieldset> parent, near the top left corner. ...
...he widgets, but they do adhere to the space allotted. legend placement the <legend> element is okay to style, but it can be a bit tricky to control placement of it. 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 8 more matches
OS.File for the main thread
ot be used with create. create if true, file will be opened for writing. the file must not exist. if the file already exists, throw an error. cannot be used with truncate or existing. existing if true, the file must already exist. if the file does not exist, throw an error. cannot be used with create. append if true, the file will be opened for appending, meaning the equivalent of .setposition(0, pos_end) is executed before each write. the default is true, i.e. opening a file for appending. specify append: false to open the file in regular mode. optionsoptional platform-specific options for opening the file. for advanced users only. most users will never have need of these options. to specify options, pass an object that may contain some of the following flags: unixflags (i...
...he same process). you can build this policy from constants os.constants.win.file_share_*. winsecurity (ignored under non-windows platforms) if specified, a security policy, as per windows function createfile. if unspecified, no security attributes. winaccess (ignored under non-windows platforms) if specified, access mode, as per windows function createfile. this also requires option windisposition and this replaces argument mode. if unspecified, value is built from mode. windisposition (ignored under non-windows platforms) if specified, disposition mode, as per windows function createfile. this also requires option winaccess and this replaces argument mode. if unspecified, value is built from mode. promise resolves to an instance of os.file representing the expected file. note...
...lete is a very bad idea. promise can be rejected with os.file.error in case of any error, in particular if the destination file cannot be overwritten, or if tmppath is not on the same device as path. instances of os.file to obtain an instance of os.file, use function os.file.open. ...
...And 8 more matches
Scroll-linked effects
the definition of a scroll-linked effect is an effect implemented on a webpage where something changes based on the scroll position, for example updating a positioning property with the aim of producing a parallax scrolling effect. this article discusses scroll-linked effects, their effect on performance, related tools, and possible mitigation techniques. scrolling effects explained often scrolling effects are implemented by listening for the scroll event and then updating elements on the page in some way (usually the css position or transform property.) you can find a sampling of such effects at css scroll api: use cases. these effects work well in browsers where the scrolling is done synchronously on the browser's main thread. however, most browsers now support some sort of asynchrono...
...sform property.) you can find a sampling of such effects at css scroll api: use cases. these effects work well in browsers where the scrolling is done synchronously on the browser's main thread. however, most browsers now support some sort of asynchronous scrolling in order to provide a consistent 60 frames per second experience to the user. in the asynchronous scrolling model, the visual scroll position is updated in the compositor thread and is visible to the user before the scroll event is updated in the dom and fired on the main thread. this means that the effects implemented will lag a little bit behind what the user sees the scroll position to be. this can cause the effect to be laggy, janky, or jittery — in short, something we want to avoid. below are a couple of examples of effects tha...
...the main thread. this means that the effects implemented will lag a little bit behind what the user sees the scroll position to be. this can cause the effect to be laggy, janky, or jittery — in short, something we want to avoid. below are a couple of examples of effects that would not work well with asynchronous scrolling, along with equivalent versions that would work well: example 1: sticky positioning here is an implementation of a sticky-positioning effect, where the "toolbar" div will stick to the top of the screen as you scroll down. ...
...And 8 more matches
IAccessibleText
utes match those of offset. (0 based) textattributes a string of attributes describing the text(). the attributes are described in the; text attributes specification on the iaccessible2 web site. return value e_invalidarg if bad [in] passed, [out] values are 0s and null respectively. s_false if there is nothing to return, [out] values are 0s and null respectively. s_ok. caretoffset() returns the position of the caret. returns the 0-based offset of the caret within the text(). if the text() is implemented as a tree of text() objects with embed characters in higher levels representing substrings of child text() objects and the caret is in one of the child text() objects, then the offset in the higher level text() object would be at the embed character representing child text() object that contains ...
...[propget] hresult caretoffset( [out] long offset ); parameters offset the returned offset is relative to the text() represented by this object. return value s_false if the caret is not currently active on this object, that is the caret is located on some other object. the retur...
...t to right language. [propget] hresult caretoffset( [out] long offset ); parameters offset the returned offset is relative to the text() represented by this object. return value s_false if the caret is not currently active on this object, that is the caret is located on some other object. the returned offset value will be -1. s_ok. characterextents() returns the bounding box of the specified position. the virtual character after the last character of the represented text(), that is the one at position length is a special case. it represents the current input position and will therefore typically be queried by at more often than other positions. because it does not represent an existing character its bounding box is defined in relation to preceding characters. it should be roughly equivalent t...
...And 8 more matches
nsIWindowMediator
nd getting the most recent / any window of a given type. ...
...e. ...
...ator;1 as a service: var windowmediator = components.classes["@mozilla.org/appshell/window-mediator;1"] .getservice(components.interfaces.nsiwindowmediator); method overview void addlistener(in nsiwindowmediatorlistener alistener); boolean calculatezposition(in nsixulwindow inwindow, in unsigned long inposition, in nsiwidget inbelow, out unsigned long outposition, out nsiwidget outbelow); native code only! nsisimpleenumerator getenumerator(in wstring awindowtype); nsidomwindow getmostrecentwindow(in wstring awindowtype); nsidomwindow getouterwindowwithid(in unsigned long long aouterwindowid); nsisimpleenumerator getxulwindowenumerator(in wstring awindowtype); pruint32 getzlevel(in nsixulwindow awindow); native...
...And 8 more matches
KeyboardEvent.code - Web APIs
the modifier keys. 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. this property is useful when you want to handle keys based on their physical positions on the input device rather than the characters associated with those keys; this is especially common when writing code to handle input for games that simulate a gamepad-like environment using keys on the keyboard. be aware, however, that you can't use the value reported by keyboardevent.code to determine the character generated by the keystroke, because the keycode's name may not match the actua...
...30"/> </svg> <script>refresh();</script> css .world { margin: 0px; padding: 0px; background-color: black; width: 400px; height: 400px; } #spaceship { fill: orange; stroke: red; stroke-width: 2px; } javascript the first section of the javascript code establishes some variables we'll be using. shipsize contains the size of the ship the player is moving around, for convenience. position is used to track the position of the ship within the play field. moverate and turnrate are the number of pixels forward and backward each keystroke moves the ship and how many degrees of rotation the left and right steering controls apply per keystroke. angle is the current amount of rotation applied to the ship, in degrees; it starts at 0° (pointing straight up). finally, spaceship is set to re...
...and how many degrees of rotation the left and right steering controls apply per keystroke. angle is the current amount of rotation applied to the ship, in degrees; it starts at 0° (pointing straight up). finally, spaceship is set to refer to the element with the id "spaceship", which is the svg polygon representing the ship the player controls. ...
...And 8 more matches
Scissor animation - Web APIs
« previousnext » a simple webgl example in which we have some animation fun using scissoring and clearing operations. animation with scissoring in this example, we are animating squares using scissor() and clear(). we again establish an animation loop using timers. 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. this is a nice demonstration of webgl as a state machine. for each square, we set its color once, and then update only its position every frame. the clear color state of webgl remains at the set value, until we change it again ...
...in her...
...ght : 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); // variables to hold the webgl context, and the color and // position of animated squares. ...
...And 8 more matches
XRView - Web APIs
Web › API › XRView
the webxr device api's xrview interface provides information describing a single view into the xr scene for a specific frame, providing orientation and position information for the viewpoint. you can think of it as a description of a specific eye or camera and how it views the world. a 3d frame will involve two views, one for each eye, separated by an appropriate distance which approximates the distance between the viewer's eyes. this allows the two views, when projected in isolation into the appropriate eyes, to simulate a 3d world. properties eye read only which of the two eyes (left) or (right) for which this xrview represents the perspective. this value is used to ensure that any content which is pre-rendered for presenting to a specific eye is distributed or positioned correctly. the...
...ew of something that doesn't need to appear in 3d). projectionmatrix read only the projection matrix that will transform the scene to appear correctly given the point-of-view indicated by eye. this matrix should be used directly in order to avoid presentation distortions that may lead to potentially serious user discomfort. ...
...int-of-view indicated by eye. this matrix should be used directly in order to avoid presentation distortions that may lead to potentially serious user discomfort. transform read only an xrrigidtransform which describes the current position and orientation of the viewpoint in relation to the xrreferencespace specified when getviewerpose() was called on the xrframe being rendered. 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. that object's views property is a list of all of the xrview objects representing the viewpoints ...
...And 8 more matches
bottom - CSS: Cascading Style Sheets
Web › CSS › bottom
the bottom css property participates in setting the vertical position of a positioned element. it has no effect on non-positioned elements. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. 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. ...
...the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. 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. when position is set to sticky, the bottom property is used to compute the sticky-constraint rectangle. ...
... 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. when position is set to sticky, the bottom property is used to compute the sticky-constraint rectangle. when position is set to static, the bottom property has no effect. when both top and bottom are specified, position is set to absolute or fixed, and height is unspecified (either auto or 100%) both the top and bottom distances are respected. in all other situations, if height is constrained in any way or position is set to relative, the top property takes precedence and the bottom property is ignored. synta...
...And 8 more matches
repeating-radial-gradient() - CSS: Cascading Style Sheets
ner, similar to repeating-linear-gradient() . the function's result is an object of the <gradient> data type, which is a special kind of <image>. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. with each repetition, the positions of the color stops are shifted by a multiple of the dimensions of the basic radial gradient (the distance between the last color stop and the first). thus, the position of each ending color stop coincides with a starting color stop; if the color values are different, this will result in a sharp visual transition, which can be mitigated by repeating the first color as the last color. as with any...
...if unspecified, it defaults to center. <shape> the gradient's shape. the value can be circle (meaning that the gradient's shape is a circle with constant radius) or ellipse (meaning that the shape is an axis-aligned ellipse). if unspecified, it defaults to ellipse. <extent-keyword> a keywor...
...if unspecified, it defaults to center. <shape> the gradient's shape. the value can be circle (meaning that the gradient's shape is a circle with constant radius) or ellipse (meaning that the shape is an axis-aligned ellipse). if unspecified, it defaults to ellipse. <extent-keyword> a keyword describing ho...
...And 8 more matches
WebVR — Virtual Reality for the Web - Game development
es to chose from: desktop ones like oculus rift or htc vive, through consoles with playstation vr (which admittedly doesn't support webvr at this time), to mobile experiences like gear vr or google cardboard. note: for more information, read our webvr concepts article. 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. note: there are of course other apis useful for creating games, for example the gamepad api for control inputs, and the device orientation api for handling display orientation on mobile. browser support and spec status currently browser support for the webvr a...
...regular builds. the webvr spec is in editor's draft status which means it is still subject to change. the development is led by vladimir vukicevic from mozilla and brandon jones from google. for more info be sure to visit the mozvr.com and webvr.info websites. 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. get the devices to get information about devices connected to your computer, you can use the navigator.getvrdevices method: navigator.getvrdevices().then(function(devices) { for (var i = 0; i < devices.length; ++i) { if (devices[i] insta...
... devices to get information about devices connected to your computer, you can use the navigator.getvrdevices method: navigator.getvrdevices().then(function(devices) { for (var i = 0; i < devices.length; ++i) { if (devices[i] instanceof hmdvrdevice) { 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 thi...
...And 7 more matches
2D maze game with device orientation - Game development
we're loading two images first that will be used later in the preload state to show the progress of loading all the other assets. the create function holds some basic configuration: we're setting up the scaling and alignment of the canvas, and moving on to the preload state when everything's ready. preloader.js the preloader state takes care of loading all the assets...
... name of the image asset the button is using. function that will be executed when someone clicks the button. the execution context. frame from the image asset used as the button's "hover" state. frame from the image asset used as the button's "normal" or "out" state. frame from the image asset used as the button's "click" or "...
...th*0.5, 200, 'button-start', this.startgame, this, 2, 0, 1); this.startbutton.anchor.set(0.5,0); this.startbutton.input.usehandcursor = true; }, startgame: function() { this.game.state.start('howto'); } }; to create a new button there's add.button method with the following list of optional arguments: top absolute position on canvas in pixels. left absolute position on canvas in pixels. name of the image asset the button is using. function that will be executed when someone clicks the button. the execution context. frame from the image asset used as the button's "hover" state. frame from the image asset used as the button's "normal" or "out" state. frame from the image asset used as the button's "click" or "down" state. the anchor.set is setting up t...
...And 7 more matches
CustomizableUI.jsm
e this facility, you should create a plain js object which defines some of the event handlers defined below. not all event handler methods need to be defined. customizableui will catch exceptions. events are dispatched synchronously on the ui thread, so if you can delay any/some of your processing, that is advisable. ...
...r methods need to be defined. customizableui will catch exceptions. events are dispatched synchronously on the ui thread, so if you can delay any/some of your processing, that is advisable. the following event handlers are supported: onwidgetadded(awidgetid, aarea, aposition) fired when a widget is added to an area. awidgetid is the widget that was added, aarea the area it was added to, and aposition the position in which it was added. onwidgetmoved(awidgetid, aarea, aoldposition, anewposition) fired when a widget is moved within its area. awidgetid is the widget that was moved, aarea the area it was moved in, aoldposition its old position, and anewposition its new position. onwidgetremoved(awidgetid, aarea) fired when a widget is removed from its area. awidgetid is the widget that was re...
...change(anode, anextnode, acontainer, awasremoval) like onwidgetbeforedomchange, but fired after the change to the dom node of the widget. onwidgetreset(anode, acontainer) fired after a reset to default placements moves a widget's node to a different location. anode is the widget's node, acontainer is the area it was moved into (nb: it might already have been there and been moved to a different position!) onwidgetundomove(anode, acontainer) fired after undoing a reset to default placements moves a widget's node to a different location. anode is the widget's node, acontainer is the area it was moved into (nb: it might already have been there and been moved to a different position!) onareareset(aarea, acontainer) fired after a reset to default placements is complete on an area's dom node. note...
...And 7 more matches
Geolocation API - Web APIs
ation api is accessed via a call to navigator.geolocation; this will cause the user's browser to ask them for permission to access their location data. if they accept, then the browser will use the best available functionality on the device to access this information (for example, gps). ...
...use the user's browser to ask them for permission to access their location data. if they accept, then the browser will use the best available functionality on the device to access this information (for example, gps). the developer can now access this location information in a couple of different ways: geolocation.getcurrentposition(): retrieves the device's current location. geolocation.watchposition(): registers a handler function that will be called automatically each time the position of the device changes, returning the updated location. in both cases, the method call takes up to three arguments: a mandatory success callback: if the location retrieval is successful, the callback executes with a geolocationposition object as its only parameter, providing access to the location data. ...
..., returning the updated location. in both cases, the method call takes up to three arguments: a mandatory success callback: if the location retrieval is successful, the callback executes with a geolocationposition object as its only parameter, providing access to the location data. an optional error callback: if the location retrieval is unsuccessful, the callback executes with a geolocationpositionerror object as its only parameter, providing access information on what went wrong. an optional positionoptions object, which provides options for retrieval of the position data. ...
...And 7 more matches
Screen.lockOrientation() - Web APIs
r a string or an array of strings. passing several strings lets the screen rotate only in the selected orientations. the following strings represent the possible orientation requirements you may specify: portrait-primary it represents the orientation of the screen when it is in its primary portrait mode. ...
...rray of strings. passing several strings lets the screen rotate only in the selected orientations. the following strings represent the possible orientation requirements you may specify: portrait-primary it represents the orientation of the screen when it is in its primary portrait mode. ...
...ets the screen rotate only in the selected orientations. the following strings represent the possible orientation requirements you may specify: portrait-primary it represents the orientation of the screen when it is in its primary portrait mode. ...
...And 7 more matches
In Flow and Out of Flow - CSS: Cascading Style Sheets
inline. the list is displayed using flexbox to arrange the items into a row, however it too is participating in block and inline layout - the container has an outside display type of block. all of the elements can be said to be in flow. appearing on the page in the order that they are in the source. taking an item out of flow all elements are in-flow apart from: floated items items with position: absolute (including position: fixed which acts in the same way) the root element (html) out of flow items create a new block formatting context (bfc) and therefore everything inside them can be seen as a mini layout, separate from the rest of the page. the root element therefore is out of flow, as the container for everything in our document, and establishes the block formatting context for t...
... that paragraph that have been shortened to cause the effect of wrapping content around the float. the box of our paragraph is still displaying according to the rules of normal flow. this is why, to make space around a floated item, you must add a margin to the item, in order to push the line boxes away from it. you cannot apply anything to the following in-flow content to achieve that. ...
...en shortened to cause the effect of wrapping content around the float. the box of our paragraph is still displaying according to the rules of normal flow. this is why, to make space around a floated item, you must add a margin to the item, in order to push the line boxes away from it. you cannot apply anything to the following in-flow content to achieve that. ...
...And 7 more matches
jspage - Archive of obsolete content
ldnodes).each(function(l){element.destroy(l); });return this;},dispose:function(){return(this.parentnode)?this.parentnode.removechild(this):this;},haschild:function(l){l=document.id(l,true);if(!l){return false; }if(browser.engine.webkit&&browser.engine.version<420){return $a(this.getelementsbytagname(l.tagname)).contains(l);}return(this.contains)?(this!=l&&this.contains(l)):!!(this.comparedocumentposition(l)&16); },match:function(l){return(!l||(l==this)||(element.get(this,"tag")==l));}});native.implement([element,window,document],{addlistener:function(o,n){if(o=="unload"){var l=n,m=this; n=function(){m.removelistener("unload",n);l();};}else{h[this.uid]=this;}if(this.addeventlistener){this.addeventlistener(o,n,false);}else{this.attachevent("on"+o,n); }return this;},removelistener:function(m,l){if(t...
...eturn a;},setstyles:function(b){for(var a in b){this.setstyle(a,b[a]); }return this;},getstyles:function(){var a={};array.flatten(arguments).each(function(b){a[b]=this.getstyle(b);},this);return a;}});element.styles=new hash({left:"@px",top:"@px",bottom:"@px",right:"@px",width:"@px",height:"@px",maxwidth:"@px",maxheight:"@px",minwidth:"@px",minheight:"@px",backgroundcolor:"rgb(@, @, @)",backgroundposition:"@px @px",color:"rgb(@, @, @)",fontsize:"@px",letterspacing:"@px",lineheight:"@px",clip:"rect(@px @px @px @px)",margin:"@px @px @px @px",padding:"@px @px @px @px",border:"@px @ rgb(@, @, @) @px @ rgb(@, @, @) @px @ rgb(@, @, @)",borderwidth:"@px @px @px @px",borderstyle:"@ @ @ @",bordercolor:"rgb(@, @, @) rgb(@, @, @) rgb(@, @, @) rgb(@, @, @)",zindex:"@",zoom:"@",fontweight:"@",textindent:"@px",...
...height};},getscroll:function(){if(b(this)){return this.getwindow().getscroll(); }return{x:this.scrollleft,y:this.scrolltop};},getscrolls:function(){var i=this,h={x:0,y:0};while(i&&!b(i)){h.x+=i.scrollleft;h.y+=i.scrolltop;i=i.parentnode; }return h;},getoffsetparent:function(){var h=this;if(b(h)){return null;}if(!browser.engine.trident){return h.offsetparent;}while((h=h.parentnode)&&!b(h)){if(d(h,"position")!="static"){return h; }}return null;},getoffsets:function(){if(this.getboundingclientrect){var j=this.getboundingclientrect(),m=document.id(this.getdocument().documentelement),p=m.getscroll(),k=this.getscrolls(),i=this.getscroll(),h=(d(this,"position")=="fixed"); return{x:j.left.toint()+k.x-i.x+((h)?0:p.x)-m.clientleft,y:j.top.toint()+k.y-i.y+((h)?0:p.y)-m.clienttop};}var l=this,n={x:0,y:0};if(b...
...And 6 more matches
Box Objects - Archive of obsolete content
are generally used. the others have functions which are more easily accessible by methods mapped directly onto the element, since those types are generally only used with one particular element. the base box object, or the interface nsiboxobject, however, has a number of properties which are quite useful for xul development. the base box object has two useful features. first, you can retrieve the position and size of the xul element as displayed, and second, you can determine the order of the elements in the box as displayed, instead of their order as they are stored in the dom. retrieving position and size the box object provides six read only properties, x, y, screenx, screeny, width and height, for determining the currently displayed position and size of an element. all values returned are in ...
...the element, including css padding and borders. css margins are excluded. width, height the width and height properties are also measured in pixels and return the width and height of the element, including css padding and borders. css margins are excluded. *note that x, y refers to the portion of the element that is just inside any borders, which is inconsistent with the other four boxobject position and size references, which include borders as part of the element. the values are always the position and sizes as currently displayed, so the values will be different if the element is moved or resized. for example, a flexible element will change in size and the box object dimensions will update accordingly. the following example shows this. example 1 : source view <button label="click me" ...
...e the box object properties. 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. hidden or collapsed element the hidden attribute will hide an element such that it will not be displayed. since it is not displayed, all four position and size properties of the box object will have the value 0. when an element is hidden, it is removed from the display and the layout objects are removed for it. thus, since it isn't displayed anywhere, it will have no position or size. the collapsed attribute will have the same effect to the user element visually, except that it leaves the element on screen and keeps the layout objects intact, b...
...And 6 more matches
Building up a basic demo with Babylon.js - Game development
ne to your code below the scene creation and the line where we defined the clearcolor. var camera = new babylon.freecamera("camera", new babylon.vector3(0, 0, -10), scene); there are many cameras available in babylon.js; freecamera is the most basic and universal one. to initialize it you need to pass it three parameters: any name you want to use for it, the coordinates where you want it to be positioned in the 3d space, and the scene you want to add it to. note: you probably noticed the babylon.vector3() method in use here — this defines a 3d position on the scene. babylon.js is bundled with a complete math library for handling vectors, colors, matrices etc. let there be light there are various light sources available in babylon.js. the most basic one is the pointlight, which works like...
...re are various light sources available in babylon.js. the most basic one is the pointlight, which works like a flashlight — shining a spotlight in a given direction. add the following line below your camera definition: var light = new babylon.pointlight("light", new babylon.vector3(10, 10, 0), scene); the parameters are very similar to the previously defined camera: the name of the light, a position in 3d space and the scene to which the light is added. geometry now the scene is properly rendering we can start adding 3d shapes to it. to speed up development babylon.js provides a bunch of predefined primitives that you can use to create shapes instantly in a single line of code. there are cubes, spheres, cylinders and more complicated shapes available. let's start by defining the geometry f...
...shape — add the following new code below your previous additions: var box = babylon.mesh.createbox("box", 2, scene); a mesh is a way the engine creates geometric shapes, so material can be easily applied to them later on. in this case we're creating a box using the mesh.createbox method with it's own name, a size of 2, and a declaration of which scene we want it added to. note: the size or position values (e.g. for the box size) are unitless, and can basically be anything you deem suitable for your scene — milimeters, meters, feet, or miles — it's up to you. if you save and refresh now, your object will look like a square, because it's facing the camera. the good thing about objects is that we can move them on the scene however we want, for example rotating and scaling. let's apply a ...
...And 6 more matches
UI pseudo-classes - Learn web development
contents onto new lines if the content becomes too long: fieldset > div { margin-bottom: 20px; display: flex; flex-flow: row wrap; } the effect this has is that the label and input sit on separate lines because they are both width: 100%, but the <span> has a width of 0 so can sit on the same line as the input. now onto the generated content. ...
...margin-bottom: 20px; display: flex; flex-flow: row wrap; } the effect this has is that the label and input sit on separate lines because they are both width: 100%, but the <span> has a width of 0 so can sit on the same line as the input. now onto the generated content. ...
...h: 100%, but the <span> has a width of 0 so can sit on the same line as the input. now onto the generated content. ...
...And 6 more matches
Applying styles and colors - Web APIs
on either side of the path. because canvas coordinates do not directly reference pixels, special care must be taken to obtain crisp horizontal and vertical lines. in the example below, 10 straight lines are drawn with increasing line widths. the line on the far left is 1.0 units wide. however, the leftmost and all other odd-integer-width thickness lines do not appear crisp, because of the path's positioning. function draw() { var ctx = document.getelementbyid('canvas').getcontext('2d'); for (var i = 0; i < 10; i++) { ctx.linewidth = 1 + i; ctx.beginpath(); ctx.moveto(5 + i * 14, 5); ctx.lineto(5 + i * 14, 140); ctx.stroke(); } } <canvas id="canvas" width="150" height="150"></canvas> draw(); screenshotlive sample obtaining crisp lines requires understanding how pa...
...us example code. to fix this, you have to be very precise in your path creation. knowing that a 1.0 width line will extend half a unit to either side of the path, creating the path from (3.5,1) to (3.5,5) results in the situation in the third image—the 1.0 line width ends up completely and precisely filling a single pixel vertical line. ...
...very precise in your path creation. knowing that a 1.0 width line will extend half a unit to either side of the path, creating the path from (3.5,1) to (3.5,5) results in the situation in the third image—the 1.0 line width ends up completely and precisely filling a single pixel vertical line. ...
...And 6 more matches
Pointer Lock API - Web APIs
it gives you access to raw mouse movement, locks the target of mouse events to a single element, eliminates limits on how far mouse movement can go in a single direction, and removes the cursor from view. it is ideal for first person 3d games, for example. ...
...ddeventlistener('mozpointerlockerror', lockerror, false); function lockerror(e) { alert("pointer lock failed"); } note: until firefox 50 the above events were prefixed with moz in firefox. extensions to mouse events the pointer lock api extends the normal mouseevent interface with movement attributes. two new attributes to mouse events—movementx and movementy—provide the change in mouse positions. the values of the parameters are the same as the difference between the values of mouseevent properties, screenx and screeny, which are stored in two subsequent mousemove events, enow and eprevious. in other words, the pointer lock parameter movementx = enow.screenx - eprevious.screenx. locked state when pointer lock is enabled, the standard mouseevent properties clientx, clienty, screenx, an...
...ored in two subsequent mousemove events, enow and eprevious. in other words, the pointer lock parameter movementx = enow.screenx - eprevious.screenx. locked state when pointer lock is enabled, the standard mouseevent properties clientx, clienty, screenx, and screeny are held constant, as if the mouse is not moving. the movementx and movementy properties continue to provide the mouse's change in position. there is no limit to movementx and movementy values if the mouse is continuously moving in a single direction. the concept of the mouse cursor does not exist and the cursor cannot move off the window or be clamped by a screen edge. unlocked state the parameters movementx and movementy are valid regardless of the mouse lock state, and are available even when unlocked for convenience. when the ...
...And 6 more matches
Using z-index - CSS: Cascading Style Sheets
if you are not familiar with the z-axis, imagine the page as a stack of layers, each one having a number. layers are rendered in numerical order, with larger numbers above smaller numbers. ...
...if you are not familiar with the z-axis, imagine the page as a stack of layers, each one having a number. layers are rendered in numerical order, with larger numbers above smaller numbers. ...
...y is specified, elements are rendered on the default rendering layer 0 (zero). if several elements share the same z-index value (i.e., they are placed on the same layer), stacking rules explained in the section stacking without the z-index property apply. in the following example, the layers' stacking order is rearranged using z-index. ...
...And 6 more matches
Stacking context example 1 - CSS: Cascading Style Sheets
the only stacking context is the root context. without z-indexes, elements are stacked in order of occurrence. if div #2 is assigned a positive (non-zero and non-auto) z-index value, it is rendered above all the other divs. ...
... the only stacking context is the root context. without z-indexes, elements are stacked in order of occurrence. if div #2 is assigned a positive (non-zero and non-auto) z-index value, it is rendered above all the other divs. ...
... the only stacking context is the root context. without z-indexes, elements are stacked in order of occurrence. if div #2 is assigned a positive (non-zero and non-auto) z-index value, it is rendered above all the other divs. ...
...And 6 more matches
align-items - CSS: Cascading Style Sheets
he interactive example below demonstrates some of the values for align-items using grid layout. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...ms: center; /* pack items around the center */ align-items: start; /* pack items from the start */ align-items: end; /* pack items from the end */ align-items: flex-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-...
...al 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. in static position of absolutely-positioned layouts, the keyword behaves as stretch. for flex items, the keyword behaves as stretch. for grid items, this keyword leads to a behavior similar to the one of stretch, except for boxes with an aspect ratio or an intrinsic sizes where it behaves like start. the property doesn't apply to block-level boxes, and to table cells. flex-s...
...And 6 more matches
align-self - CSS: Cascading Style Sheets
is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. the property doesn't apply to block-level boxes, or to table cells. if a flexbox item's cross-axis margin is auto, then align-self is ignored. ...
...eline; 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. 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. in static position of absolutely-positioned layouts, the keyword behaves as stretch. for flex items, the keyword behaves as stretch. for grid items, this keyword leads to a behavior similar to the one of stretch, except for boxes with an aspect ratio or...
...tems exactly fills the alignment container along the cross axis. safe if the size of the item overflows the alignment container, the item is instead aligned as if the alignment mode were start. unsafe regardless of the relative sizes of the item and alignment container, the given alignment value is honored. formal definition initial valueautoapplies toflex items, grid items, and absolutely-positioned boxesinheritednocomputed valueauto computes to itself on absolutely-positioned elements, and to the computed value of align-items on the parent (minus any legacy keywords) on all other boxes, or start if the box has no parent. its behavior depends on the layout model, as described for justify-self. otherwise the specified value.animation typediscrete formal syntax auto | normal | stretch | <b...
...And 6 more matches
background-size - CSS: Cascading Style Sheets
y or horizontally so that no empty space remains. auto scales the background image in the corresponding direction such that its intrinsic proportions are maintained. <length> stretches the image in the corresponding dimension to the specified length. negative values are not allowed. <percentage> stretches the image in the corresponding dimension to the specified percentage of the background positioning area. the background positioning area is determined by the value of background-origin (by default, the padding box). however, if the background's background-attachment value is fixed, the positioning area is instead the entire viewport. negative values are not allowed. intrinsic dimensions and proportions the computation of values depends on the image's intrinsic dimensions (width and heigh...
...s or intrinsic proportions. background images created with the element() function use the intrinsic dimensions and proportions of the generating element. note: the behavior of <gradient>s changed in gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5). before this, they were treated as images with no intrinsic dimensions, but with intrinsic proportions identical to that of the background positioning area. note: in gecko, background images created using the element() function are currently treated as images with the dimensions of the element, or of the background positioning area if the element is svg, with the corresponding intrinsic proportion. this is non-standard behavior. based on the intrinsic dimensions and proportions, the rendered size of the background image is computed as f...
...mensions and proportions, the rendered size of the background image is computed as follows: if both components of background-size are specified and are not auto: the background image is rendered at the specified size. ...
...And 6 more matches
justify-self - CSS: Cascading Style Sheets
ource for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. the effect of this property is dependent of the layout mode we are in: in block-level layouts, it aligns an item inside its containing block on the inline axis. ...
...erty is dependent of the layout mode we are in: in block-level layouts, it aligns an item inside its containing block on the inline 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. ...
...note that justify-self is ignored in flexbox layouts. ...
...And 6 more matches
top - CSS: Cascading Style Sheets
Web › CSS › top
the top css property participates in specifying the vertical position of a positioned element. it has no effect on non-positioned elements. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. 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. ...
...ntribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. 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. ...
... 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. when position is set to static, the top property has no effect. when both top and bottom are specified, position is set to absolute or fixed, and height is unspecified (either auto or 100%) both the top and bottom distances are respected. in all other situations, if height is constrained in any way or position is set to relative, the top property takes precedence and the bottom property is ignored. syntax ...
...And 6 more matches
Event reference
sition has begun running (fired before any delay starts). ...
... view events event name fired when ...
... view events event name fired when fullscreench...
...And 6 more matches
CSS3 - Archive of obsolete content
lyphs with specific opentype features via the css font-feature-settings property. the control of the aspect ratio to use when fallback fonts are selected via the css font-size-adjust property. the choice of alternative font faces using the css font-stretch, font-variant-alternates, font-variant-caps, font-variant-east-asian, font-variant-ligatures, font-variant-numeric, and font-variant-position properties. it also extends the related css font-variant shorthand property and introduces the @font-feature-values at-rule. the control of the automatic generation of an oblique or bold face when none are found via the css font-synthesis property. css basic user interface module level 3 recommendation since june 21st, 2018 adds: the abili...
...-index may be postponed to the next iteration of this module . support for icons, defined by the css icon property simultaneously with the new icon value of the css content property. at risk: due to insufficient browser support, standardization of the icon property and the icon value may be postponed to css4. support for the css outline-offset property giving more control on the position of the outline. support for the css resize property allowing web authors to control if and how elements should be resized. support for the css text-overflow property defining how text overflows, if needed. at risk: due to insufficient browser support, the 2-value syntax of this property as well as the support for <string> values may be postponed to the next iteration of this modul...
...r new font-relative length units: rem and ch . definition for viewport-relative length units: vw, vh, vmax, and vmin . precision about the real size of the absolute length units, which are not really absolute, but defined in relation with the reference pixel . definition for <angle>, <time>, <frequency>, <resolution>. normative value to the definition of <color>, <image>, and <position>. definition for the calc(), attr(), and toggle() functional notations. at risk: due to insufficient browser support, standardization of the calc(), attr(), and toggle() functional notations may be postponed to the next iteration of this module. several types definition, like <ident> and <custom-ident>, have been deferred to css values and units module level 4. ...
...And 5 more matches
Building up a basic demo with Three.js - Game development
add() method, to add objects to this scene. camera we have the rendered scene, but we still need to add a camera to view our handiwork — imagine a movie set without any cameras. the following lines put the camera in place in the 3d coordinate system, and point it in the direction of our scene, so we can finally see something: var camera = new three.perspectivecamera(70, width/height); camera.position.z = 50; scene.add(camera); add the above lines to your code, below those previously added. there are other types of camera available (cube, orthographic), but the simplest is perspective. to initialize it, we have to set its field of view and aspect ratio: the former is used to set how much is seen, and the latter is important for the objects on the screen to have the right proportions when re...
...ter the amount of scene the camera will show. imagine a normal camera view, versus a fish eye effect, which allows a lot more to be seen. the default value is 50. the aspect ratio is set to the current width and height of the window so it will be dynamically adjusted. we could set a fixed ratio — for example 16 ⁄ 9, which is the aspect ratio of a widescreen tv. the default value is 1. the z position, with the value of 50 units, is the distance between the camera and the center of the scene on the z axis. here we're moving the camera back, so the objects in the scene can be viewed. 50 feels about right. it's not too near, or too far, and the sizes of the objects allow them to stay on the scene, within the given field of view. the x and y values, if not specified, will default to 0. you shou...
...ra back, so the objects in the scene can be viewed. 50 feels about right. it's not too near, or too far, and the sizes of the objects allow them to stay on the scene, within the given field of view. the x and y values, if not specified, will default to 0. you should experiment with these values and see how they change what you see in the scene. note: the distance values (e.g. for the camera z position) are unitless, and can be anything you deem suitable for your scene: milimeters, meters, feet, or miles. it's up to you. rendering the scene everything is ready, but we still can't see anything. although we've set-up the renderer, we still need to render everything. our render() function will do this job, with a little help from requestanimationframe(), which causes the scene to be re-rendered...
...And 5 more matches
create fancy boxes - Learn web development
e many examples, but we will always work on the most simple piece of html possible, a simple element: <div class="fancy">hi! i want to be fancy.</div> ok, that's a very small bit of html, what can we tweak on that element? all of the following: its box model properties: width, height, padding, border, etc. its background properties: background, background-color, background-image, background-position, background-size, etc. its pseudo-element: ::before and ::after and some aside properties like: box-shadow, transform, outline, etc. so we have a very large playground. let the fun begin. box model tweak the box model alone allows us to do some basic stuff, like adding simple borders, making squares, etc.. it starts to get interesting when you push the properties to the limit by having nega...
...turned into a blank canvas you'll fill. before we jump to some practical examples, let's step back a bit as there are two things you should know about backgrounds. it's possible to set several backgrounds on a single box. they are stacked on top of each other like layers. backgrounds can be either solid colors or images: solid color always fills the whole surface but images can be scaled and positioned. <div class="fancy">hi! i want to be fancy.</div> okay, let's have fun with backgrounds: .fancy { padding : 1em; width: 100%; height: 200px; box-sizing: border-box; /* at the bottom of our background stack, let's have a misty grey solid color */ background-color: #e4e4d9; /* we stack linear gradients on top of each other to create our color strip effect. as ...
... css pseudo-elements. a cloud <div class="fancy">hi! i want to be fancy.</div> let's have an example by turning our box into a cloud: .fancy { text-align: center; /* same trick as previsouly used to make circles */ box-sizing: border-box; width : 150px; height : 150px; padding : 80px 1em 0 1em; /* we make room for the "ears" of our cloud */ margin : 0 100px; position: relative; background-color: #a4c9cf; /* well, actually we are not making a full circle as we want the bottom of our cloud to be flat. feel free to tweak this example to make a cloud that isn't flat at the bottom ;) */ border-radius: 100% 100% 0 0; } /* those are common style that apply to both our ::before and ::after pseudo elements. */ .fancy::before, .fancy::after {...
...And 5 more matches
Styling lists - Learn web development
e looked at general spacing techniques for lists, let's explore some list-specific properties. there are three properties you should know about to start with, which can be set on <ul> or <ol> elements: list-style-type: sets the type of bullets to use for the list, for example, square or circle bullets for an unordered list, or numbers, letters or roman numerals for an ordered list. list-style-position: sets whether the bullets appear inside the list items, or outside them before the start of each item. list-style-image: allows you to use a custom image for the bullet, rather than a simple square or circle. bullet styles as mentioned above, the list-style-type property allows you to set what type of bullet to use for the bullet points. in our example, we've set the ordered list to use upper...
...re or circle. bullet styles as mentioned above, the list-style-type property allows you to set what type of bullet to use for the bullet points. in our example, we've set the ordered list to use uppercase roman numerals, with: ol { list-style-type: upper-roman; } this gives us the following look: you can find a lot more options by checking out the list-style-type reference page. ...
...yles as mentioned above, the list-style-type property allows you to set what type of bullet to use for the bullet points. in our example, we've set the ordered list to use uppercase roman numerals, with: ol { list-style-type: upper-roman; } this gives us the following look: you can find a lot more options by checking out the list-style-type reference page. ...
...And 5 more matches
Advanced form styling - Learn web development
i like strawberry </label> </p> </fieldset> </form> now, let's style these with a custom checkbox design. ...
...h a custom checkbox design. ...
...change the appearance of our custom checkbox as its state changes: input[type="checkbox"] { position: relative; width: 1em; height: 1em; border: 1px solid gray; /* adjusts the position of the checkboxes on the text baseline */ vertical-align: -2px; /* set here so that windows' high-contrast mode can override */ color: green; } input[type="checkbox"]::before { content: "✔"; position: absolute; font-size: 1.2em; right: -1px; top: -0.3em; visibility: hidden; } input[type="checkbox"]:checked::before { /* use `visibility` instead of `display` to avoid recalculating layout */ visibility: visible; } input[type="checkbox"]:disabled { border-color: black; background: #ddd; color: gray; } you'll find more out about such pseudo-classes and more in the next article...
...And 5 more matches
Video and Audio APIs - Learn web development
to get an idea of what the finished product will look like, check out our finished version. exploring the css now open the css file and have a look inside. the css for the example is not too complicated, but we'll highlight the most interesting bits here. first of all, notice the .controls styling: .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 attr...
...this is an icon font — all the characters of the alphabet equate to common icons you might want to use in an application. next we use generated content to display an icon on each button: we use the ::before sele...
...utting down on http requests because you don't need to download those icons as image files, great scalability, and the fact that you can use text properties to style them — like color and text-shadow. ...
...And 5 more matches
Performance best practices for Firefox front-end engineers
te steps of the pipeline, this hacks blog post does a great job of explaining it. to achieve a 60 fps frame rate, all of the above has to happen in 16 milliseconds or less, every frame. note that requestanimationframe() lets you queue up javascript to run right before the style flush occurs. this allows you to put all of your dom writes (most importantly, anything that could change the size or position of things in the dom) just before the style and layout steps of the pipeline, combining all the style and layout calculations into a single batch so it all happens once, in a single frame tick, instead of across multiple frames. see detecting and avoiding synchronous reflow below for more information. this also means that requestanimationframe() is not a good place to put queries for layout or s...
...appens, some of them will be postponed until the next frame (or possibly multiple frames, if necessary), this skipping of frames is called jank. generally speaking, you force a synchronous style flush any time you query for style information after the dom has changed within the same frame tick. depending on whether or not the style information you’re asking for has something to do with size or position, you may also cause a layout recalculation (also referred to as layout flush or reflow), which is also an expensive step (see detecting and avoiding synchronous reflow below). to avoid this: avoid reading style information if you can. if you must read style information, do so at the very beginning of the frame, before any changes have been made to the dom since the last time a style flush occurr...
...striving for interruptible layout is always good practice because uninterruptible layout has the potential to be much worse (see next section). to repeat, only interruptible reflows in web content can be interrupted. uninterruptible reflow uninterruptible reflow is what we want to avoid at all costs. uninterruptible reflow occurs when some dom node’s styles have changed such that the size or position of one or more nodes in the document will need to be updated, and then javascript asks for the size or position of anything. since everything is pending a reflow, the answer isn't available, so everything stalls until the reflow is complete and the script can be given an answer. flushing layout also means that styles must be flushed to calculate the most up-to-date state of things, so it's a doub...
...And 5 more matches
nsIDOMGeoGeolocation
dom/interfaces/geolocation/nsidomgeogeolocation.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 implemented by: @mozilla.org/geolocation;1. ...
... .getservice(components.interfaces.nsidomgeogeolocation); note: if nsidgeogeolocation throws an exception when importing, try using this: var geolocation = components.classes["@mozilla.org/geolocation;1"] .getservice(components.interfaces.nsisupports); method overview void clearwatch(in unsigned short watchid); void getcurrentposition(in nsidomgeopositioncallback successcallback, [optional] in nsidomgeopositionerrorcallback errorcallback, [optional] in nsidomgeopositionoptions options); unsigned short watchposition(in nsidomgeopositioncallback successcallback, [optional] in nsidomgeopositionerrorcallback errorcallback, ...
...ck, [optional] in nsidomgeopositionerrorcallback errorcallback, [optional] in nsidomgeopositionoptions options); unsigned short watchposition(in nsidomgeopositioncallback successcallback, [optional] in nsidomgeopositionerrorcallback errorcallback, [optional] in nsidomgeopositionoptions options); attributes attribute type description lastposition nsidomgeoposition the most recently retrieved location as seen by the provider. may be null. read only. methods clearwatch() when the clearwatch() method is called, the watch() process stops calling for new position identifiers and cease invoking callbacks. void clearwatch( in unsigned ...
...And 5 more matches
Drawing shapes with canvas - Web APIs
as and we will see how that can be done. the grid before we can start drawing, we need to talk about the canvas grid or coordinate space. our html skeleton from the previous page had a canvas element 150 pixels wide and 150 pixels high. to the right, you see this canvas with the default grid overlayed. normally 1 unit in the grid corresponds to 1 pixel on the canvas. the origin of this grid is positioned in the top left corner at coordinate (0,0). all elements are placed relative to this origin. so the position of the top left corner of the blue square becomes x pixels from the left and y pixels from the top, at coordinate (x,y). later in this tutorial we'll see how we can translate the origin to a different position, rotate the grid and even scale it, but for now we'll stick to the default. d...
...first let's look at the rectangle. there are three functions that draw rectangles on the canvas: fillrect(x, y, width, height) draws a filled rectangle. strokerect(x, y, width, height) draws a rectangular outline. clearrect(x, y, width, height) clears the specified rectangular area, making it fully transparent. each of these three functions takes the same parameters. x and y specify the position on the canvas (relative to the origin) of the top-left corner of the rectangle. width and height provide the rectangle's size. below is the draw() function from the previous page, but now it is making use of these three functions. rectangular shape example <html> <body onload="draw();"> <canvas id="canvas" width="150" height="150"></canvas> </body> </html> function draw() { var canv...
...rm a shape. every time this method is called, the list is reset and we can start drawing new shapes. note: when the current path is empty, such as immediately after calling beginpath(), or on a newly created canvas, the first path construction command is always treated as a moveto(), regardless of what it actually is. for that reason, you will almost always want to specifically set your starting position after resetting a path. the second step is calling the methods that actually specify the paths to be drawn. we'll see these shortly. the third, and an optional step, is to call closepath(). this method tries to close the shape by drawing a straight line from the current point to the start. if the shape has already been closed or there's only one point in the list, this function does nothing. n...
...And 5 more matches
DOMPoint - Web APIs
Web › API › DOMPoint
a dompoint object represents a 2d or 3d point in a coordinate system; it includes values for the coordinates in up to three dimensions, as well as an optional perspective value. dompoint is based on dompointreadonly but allows its properties' values to be changed. in general, a positive x component represents a position to the right of the origin, a positive y component is downward from the origin, and a positive z component extends outward from the screen (in other words, toward the user). constructor dompoint() creates and returns a new dompoint object given the values of zero or more of its coordinate components and optionally the w perspective value. you can also use an existing dompoint or dompointreadonly or a dompointinit dictionary to create a new point by calling the dompoint.fromp...
...ich provides the values for its properties. properties dompoint inherits properties from its parent, dompointreadonly. dompoint.x the x coordinate of the dompoint. dompoint.y the y coordinate of the dompoint. dompoint.z the z coordinate of the dompoint. dompoint.w the perspective value of the dompoint. examples in the webxr device api, dompointreadonly values are used to represent positions and orientations. 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. function onxrframe(...
...h 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. ...
...And 5 more matches
PannerNode.panningModel - Web APIs
the possible values are: equalpower: represents the equal-power panning algorithm, generally regarded as simple and efficient. equalpower is the default value. hrtf: renders a stereo output of higher quality than equalpower — it uses a convolution with measured impulse responses from human subjects. syntax var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.panningmodel = 'hrtf'; value a enum — see panningmodeltype. ...
...sured impulse responses from human subjects. syntax var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.panningmodel = 'hrtf'; value a enum — see panningmodeltype. example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio listener and panner (source) occupy initially, and then update the position of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo. in the example you can see th...
... of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo. 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. to see a complete implementation, check out our panner-node example (view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a track on a boom box and then walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audi...
...And 5 more matches
UIEvent.layerX - Web APIs
Web › API › UIEvent › layerX
syntax var xpos = event.layerx xpos is an integer value in pixels for the x-coordinate of the mouse pointer, when the mouse event fired. ...
... syntax var xpos = event.layerx xpos is an integer value in pixels for the x-coordinate of the mouse pointer, when the mouse event fired. ...
...ction showcoords(evt){ var form = document.forms.form_coords; var parent_id = evt.target.parentnode.id; form.parentid.value = parent_id; form.pagexcoords.value = evt.pagex; form.pageycoords.value = evt.pagey; form.layerxcoords.value = evt.layerx; form.layerycoords.value = evt.layery; } </script> <style type="text/css"> #d1 { border: solid blue 1px; padding: 20px; } #d2 { position: absolute; top: 180px; left: 80%; right:auto; width: 40%; border: solid blue 1px; padding: 20px; } #d3 { position: absolute; top: 240px; left: 20%; width: 50%; border: solid blue 1px; padding: 10px; } </style> </head> <body onmousedown="showcoords(event)"> <p>to display the mouse coordinates please click anywhere on the page.</p> <div id="d1"> <span>this is an un-p...
...And 5 more matches
UIEvent.layerY - Web APIs
Web › API › UIEvent › layerY
syntax var ypos = event.layery; ypos is an integer value in pixels for the y-coordinate of the mouse pointer, when the mouse event fired. ...
... syntax var ypos = event.layery; ypos is an integer value in pixels for the y-coordinate of the mouse pointer, when the mouse event fired. ...
...ction showcoords(evt){ var form = document.forms.form_coords; var parent_id = evt.target.parentnode.id; form.parentid.value = parent_id; form.pagexcoords.value = evt.pagex; form.pageycoords.value = evt.pagey; form.layerxcoords.value = evt.layerx; form.layerycoords.value = evt.layery; } </script> <style type="text/css"> #d1 { border: solid blue 1px; padding: 20px; } #d2 { position: absolute; top: 180px; left: 80%; right:auto; width: 40%; border: solid blue 1px; padding: 20px; } #d3 { position: absolute; top: 240px; left: 20%; width: 50%; border: solid blue 1px; padding: 10px; } </style> </head> <body onmousedown="showcoords(event)"> <p>to display the mouse coordinates please click anywhere on the page.</p> <div id="d1"> <span>this is an un-p...
...And 5 more matches
Creating 3D objects using WebGL - Web APIs
« previousnext » let's take our square plane into three dimensions by adding five more faces to create a cube. to do this efficiently, we're going to switch from drawing using the vertices directly by calling the gl.drawarrays() method to using the vertex array as a table, and referencing individual vertices in that table to define the positions of each face's vertices, by calling gl.drawelements(). consider: each face requires four vertices to define it, but each vertex is shared by three faces. 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. if you wonder why we need 24 vertices, and not just 8, it is because each corner belongs to three faces o...
...ferent colors, and a single vertex needs to have a single specific color; therefore we will create three copies of each vertex in three different colors, one for each face. this example uses the glmatrix library to perform its matrix and vertex math. you'll need to include it if you create your own project based on this code. our sample loads a copy from a cdn in our html's <head>. ...
...r; therefore we will create three copies of each vertex in three different colors, one for each face. this example uses the glmatrix library to perform its matrix and vertex math. you'll need to include it if you create your own project based on this code. our sample loads a copy from a cdn in our html's <head>. define the positions of the cube's vertices first, let's build the cube's vertex position buffer by updating the code in initbuffers(). ...
...And 5 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(). then, when drawing the scene, you can use the offset reference sp...
...this is demonstrated in the example implementing rotation based on non-xr inputs, which demonstrates a way to use this method to let the user use their mouse to pitch and yaw their viewing angle. ...
...this is demonstrated in the example implementing rotation based on non-xr inputs, which demonstrates a way to use this method to let the user use their mouse to pitch and yaw their viewing angle. ...
...And 5 more matches
XRReferenceSpace: reset event - Web APIs
this is common when the user calibrates or recalibrates an xr device, or if the device automatically changes its origin after losing tracking of the user, then re-gaining it. in the case of xrboundedreferencespace objects, the reset event can also be fired when the boundsgeometry changes. in either case, the event is sent before any webxr animation frames which make use of the new origin are executed. ...
... pending frame, to ensure that those callbacks have the updated coordinate system available. there are a number of reasons why a reset might occur. most common among them are the following: the user has manually reset the coordinate system, such as by requesting that the headset recalibrate itself to ensure that the facing direction and hand controllers are synchronized with the user's actual position and facing. this is primarily an issue for local or local-floor reference spaces. for a bounded-floor reference space, the coordinate system can be reset if the user exits the boundaries of the reference space and enters a new one (such as by crossing from one level to another in a game, where each level is its own map with its own coordinate system). the tracking system has temporarily lost th...
... the coordinate system can be reset if the user exits the boundaries of the reference space and enters a new one (such as by crossing from one level to another in a game, where each level is its own map with its own coordinate system). the tracking system has temporarily lost the user, then regained them, but not until after they had moved enough to leave the immediate vicinity of the last-known position. primarily an issue for unbounded reference spaces. the user is in an unbounded reference space and has moved far enough from the starting position (the reference space's origin) that floating-point or other forms of error or drift are problematic. the coordinate system is thus reset with its new origin at or near the user's current position. the webxr infrastructure or hardware drivers detecte...
...And 5 more matches
Coordinate systems - CSS: Cascading Style Sheets
when specifying the location of a pixel in a graphics context (just like when specifying coordinate systems in algebra), its position is defined relative to a fixed point in the context. this fixed point is called the origin. the position is specified as the number of pixels offset from the origin along each dimension of the context. this guide describes the standard coordinate systems used by the css object model. these are generally only different in terms of where their origin is located. 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,...
...nsform. however, we'll only talk about the standard coordinate system for now. standard cssom coordinate systems there are four standard coordinate systems used by the css object model, as described below. offset coordinates specified using the "offset" model use the top-left corner of the element being examined, or on which an event has occurred. for example, when a mouse event occurs, the position of the mouse as specified in the event's offsetx and offsety properties are given relative to the top-left corner of the node to which the event has been delivered. the origin is inset by the distances specified by padding-left and padding-top. client the "client" coordinate system uses as its origin the top-left corner of the viewport or browsing context in which the event occurred. this is th...
... distances specified by padding-left and padding-top. client the "client" coordinate system uses as its origin the top-left corner of the viewport or browsing context in which the event occurred. this is the entire viewing area in which the document is presented. scrolling is not a factor. on a desktop computer, for example, the mouseevent.clientx and mouseevent.clienty properties indicate the position of the mouse cursor at the moment the event occurred, relative to the top-left corner of the browser window. the top-left corner of the window is always (0, 0), regardless of the content of the document or any scrolling that may have been done. in other words, scrolling the document will change the client coordinates of a given position within the document. page the "page" coordinate system giv...
...And 5 more matches
Border-radius generator - CSS: Cascading Style Sheets
e-height: 1.5em; color: #fff; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; user-select: none; } .ui-checkbox > input { display: none; } .ui-checkbox > label { font-size: 12px; padding: 0.333em 1.666em 0.5em; height: 1em; line-height: 1em; background-color: #888; background-image: url("https://mdn.mozillademos.org/files/5683/disabled.png"); background-position: center center; background-repeat: no-repeat; color: #fff; border-radius: 3px; font-weight: bold; float: left; } .ui-checkbox .text { padding-left: 34px; background-position: center left 10px; } .ui-checkbox .left { padding-right: 34px; padding-left: 1.666em; background-position: center right 10px; } .ui-checkbox > label:hover { cursor: pointer; } .ui-checkbox > input:checked + la...
...: 100%; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; } /******************************************************************************/ /******************************************************************************/ /* * preview area */ #preview { height: 500px; border: 1px solid #ccc; border-radius: 3px; text-align: center; overflow: hidden; position: relative; } #preview .content { width: 100%; height: 100%; display: block; } #preview input { color: #333; border: 1px solid #ccc; border-radius: 3px; } #subject { width: 400px; height: 150px; margin: 0 auto; border: 3px solid #c60; background: #fff; position: relative; } .radius { width: 50%; height: 50%; border: 1px solid #ccc; display: none; position: absolute; z-index: ...
...#ccc; border-radius: 3px; } #subject { width: 400px; height: 150px; margin: 0 auto; border: 3px solid #c60; background: #fff; position: relative; } .radius { width: 50%; height: 50%; border: 1px solid #ccc; display: none; position: absolute; z-index: 1; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; } .handle { width: 16px; height: 16px; position: absolute; z-index: 2; } .handle-top-left { top: -12px; left: -12px; cursor: se-resize; background: url("https://mdn.mozillademos.org/files/5677/resize-handle.png") top left no-repeat; } .handle-top-right { top: -12px; right: -12px; cursor: sw-resize; background: url("https://mdn.mozillademos.org/files/5677/resize-handle.png") top right no-repeat; } .handle-bottom-right { bottom: -12...
...And 5 more matches
align-content - CSS: Cascading Style Sheets
layout to demonstrate some of the values of this property. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. this property has no effect on single line flex containers (i.e. ones with flex-wrap: nowrap). ...
...flush to each other against the edge of the alignment container depending on the flex container's cross-end side. this only applies to flex layout items. for items that are not children of a flex container, this value is treated like end. center the items are packed flush to each other in the center of the alignment container along 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. the fallback alignment for first baseline is start, the one f...
... mode were start. unsafe used alongside an alignment keyword. regardless of the relative sizes of the item and alignment container and whether overflow which causes data loss might happen, the given alignment value is honored. ...
...And 5 more matches
linear-gradient() - CSS: Cascading Style Sheets
if specified, it consists of the word to and up to two keywords: one indicates the horizontal side (l...
...if specified, it consists of the word to and up to two keywords: one indicates the horizontal side (left or right), and the other the vertical side (top or bottom). the order of the side keywords does not matter. ...
...e values to top, to bottom, to left, and to right are equivalent to the angles 0deg, 180deg, 270deg, and 90deg, respectively. the other values are translated into an angle. <angle> the gradient line's angle of direction. a value of 0deg is equivalent to to top; increasing values rotate clockwise from there. <linear-color-stop> a color-stop's <color> value, followed by one or two optional stop positions, (each being either a <percentage> or a <length> along the gradient's axis). <color-hint> the color-hint is an interpolation hint defining how the gradient progresses between adjacent color stops. the length defines at which point between two color stops the gradient color should reach the midpoint of the color transition. if omitted, the midpoint of the color transition is the midpoint betwee...
...And 5 more matches
mask - CSS: Cascading Style Sheets
Web › CSS › mask
mmended 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. ...
...k: none; /* image values */ mask: url(mask.png); /* pixel image used as mask */ mask: url(masks.svg#star); /* element within svg graphic used as mask */ /* combined values */ mask: url(masks.svg#star) luminance; /* element within svg graphic used as luminance mask */ mask: url(masks.svg#star) 40px 20px; /* element within svg graphic used as mask positioned 40px from the top and 20px from the left */ mask: url(masks.svg#star) 0 0/50px 50px; /* element within svg graphic used as mask with a width and height of 50px */ mask: url(masks.svg#star) repeat-x; /* element within svg graphic used as horizontally repeated mask */ mask: url(masks.svg#star) stroke-box; /* element within svg graphic used as mask extending to the box enclosed by th...
...peat-y, /* element within svg graphic is used as a mask on the left-hand side with a width of 16px */ url(masks.svg#circle) right / 16px repeat-y; /* element within svg graphic is used as a mask on the right-hand side with a width of 16px */ values <mask-reference> sets the mask image source. see mask-image. <masking-mode> sets the masking mode of the mask image. see mask-mode. <position> sets the position of the mask image. see mask-position. <bg-size> sets the size of the mask image. see mask-size. <repeat-style> sets the repetition of the mask image. see mask-repeat. <geometry-box> if only one <geometry-box> value is given, it sets both mask-origin and mask-clip. if two <geometry-box> values are present, then the first sets mask-origin and the second sets mask-clip. <g...
...And 5 more matches
radial-gradient() - CSS: Cascading Style Sheets
ce for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* a gradient at the center of its container, starting red, changing to blue, and finishing green */ radial-gradient(circle at center, red 0, blue, green 100%) values <position> the position of the gradient, interpreted in the same way as background-position or transform-origin. if unspecified, it defaults to center. <shape> the gradient's shape. the value can be circle (meaning that the gradient's shape is a circle with constant radius) or ellipse (meaning that the shape is an axis-aligned ellipse). if unspecified, it defaults to ellipse. <extent-keyword> a keywor...
...f the box from its center. note: early implementations of this function included other keywords (cover and contain) as synonyms of the standard farthest-corner and closest-side, respectively. use the standard keywords only, as some implementations have already dropped those older variants. ...
... <color-hint> th color-hint is an interpolation hint defining how the gradient progresses between adjacent color stops. ...
...And 5 more matches
transition-delay - CSS: Cascading Style Sheets
all elements, ::before and ::after pseudo-elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <time># examples transition-delay: 0.5s <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; -webkit-transition-duration:2s; -webkit-transition-delay:0.5s; -webkit-transition-timing-function: linear; transition-property: width height background-color font-size left top color; transition-duration:2s; transition-delay:0.5s; transition-timing-function: linear; } .bo...
...ebkit-transition-delay:0.5s; -webkit-transition-timing-function: linear; transition-property: width height background-color font-size left top color; transition-duration:2s; transition-delay:0.5s; transition-timing-function: linear; } .box1{ width: 50px; height: 50px; background-color: blue; color: yellow; font-size: 18px; left: 150px; top:25px; position:absolute; -webkit-transition-property: width height background-color font-size left top color; -webkit-transition-duration:2s; -webkit-transition-delay:0.5s; -webkit-transition-timing-function: linear; transition-property: width height background-color font-size left top color; transition-duration:2s; transition-delay:0.5s; transition-timing-function: linear; } ...
...cument.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; -webkit-transition-duration:2s; -webkit-transition-delay:1s; -webkit-transition-timing-function: linear; transition-property: width height background-color font-size left top color; transition-duration:2s; transition-delay:1s; transition-timing-function: linear; } .box1{...
...And 5 more matches
transition-duration - CSS: Cascading Style Sheets
elements, ::before and ::after pseudo-elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <time># examples transition-duration: 0.5s <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 transform -webkit-transform color; -webkit-transition-duration:0.5s; -webkit-transition-timing-function: ease-in-out; transition-property: width height background-color font-size left top transform -webkit-transform color; transition-duration:0.5s; transition-timing-function: ease-in-ou...
... transition-property: width height background-color font-size left top transform -webkit-transform color; transition-duration:0.5s; transition-timing-function: ease-in-out; } .box1{ transform: rotate(270deg); -webkit-transform: rotate(270deg); width: 50px; height: 50px; background-color: blue; color: yellow; font-size: 18px; left: 150px; top:25px; position:absolute; -webkit-transition-property: width height background-color font-size left top transform -webkit-transform color; -webkit-transition-duration:0.5s; -webkit-transition-timing-function: ease-in-out; transition-property: width height background-color font-size left top transform -webkit-transformv color; transition-duration:0.5s; transition-timing-function: ease-in-o...
...ent.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 -webkit-transform color; -webkit-transition-duration:1s; -webkit-transition-timing-function: ease-in-out; transition-property: width height background-color font-size left top transform color; transition-duration:1s; transition-timing-function: ease-in-out; } .box1{ transform: rotat...
...And 5 more matches
<input type="time"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › time
ere's the css used in the above example. here we make use of the :valid and :invalid css properties to style the input based on whether or not the current value is valid. we had to put the icons on a <span> next to the input, not on the input itself, because in chrome the generated content is placed inside the form control, and can't be styled or shown effectively. ...
... or not the current value is valid. we had to put the icons on a <span> next to the input, not on the input itself, because in chrome the generated content is placed inside the form control, and can't be styled or shown effectively. div { margin-bottom: 10px; position: relative; } input[type="number"] { width: 100px; } input + span { padding-right: 30px; } input:invalid+span:after { position: absolute; content: '✖'; padding-left: 5px; } input:valid+span:after { position: absolute; content: '✓'; padding-left: 5px; } the result here is that: only times between 12:00 and 18:00 will be seen as valid; times outside that range will be denoted as invalid. depending on what browser you're using, you might find that times outside the specified range might not even be selec...
...display an error message (and highlight the input as invalid) if your entry doesn't match the pattern nn:nn, where n is a number from 0 to 9. of course, this doesn't stop people from entering invalid times, or incorrectly formatted times that follow the pattern. then there's the problem of the user having no idea exactly what format the time is expected to be in. ...
...And 5 more matches
Audio for Web games - Game development
cross all modern desktop and mobile browsers, with the exception of opera mini. with that in mind, it's an acceptable approach for many situations to use the web audio api (see the can i use web audio api page for more on browser compatibility). the web audio api is an advanced audio javascript api that is ideal for game audio. developers can generate audio and manipulate audio samples as well as positioning sound in 3d game space. a feasible cross-browser strategy would be to provide basic audio using the standard <audio> element and, where supported, enhance the experience using the web audio api. element and, where supported, enhance the experience using the web audio api. note: significantly, ios safari now supports the web audio api, which means it's now possible to write web-based game...
...ar beats = relativetime / tempo; var remainder = beats - math.floor(beats); var delay = tempo - (remainder*tempo); source.start(context.currenttime+delay, relativetime+delay); } note: you can try our wait calculator code here, on jsfiddle (i've synched to the bar in this case). note: if the first parameter is 0 or less than the context currenttime, playback will commence immediately. ...
...etime / tempo; var remainder = beats - math.floor(beats); var delay = tempo - (remainder*tempo); source.start(context.currenttime+delay, relativetime+delay); } note: you can try our wait calculator code here, on jsfiddle (i've synched to the bar in this case). note: if the first parameter is 0 or less than the context currenttime, playback will commence immediately. ...
...And 4 more matches
Player paddle and controls - Game development
his point you should grab the paddle graphic from github, and save it in your /img folder. rendering the paddle, with physics next up, we will init our paddle by adding the following add.sprite() call inside the create() function — add it right at the bottom: paddle = game.add.sprite(game.world.width*0.5, game.world.height-5, 'paddle'); we can use the world.width and world.height values to position the paddle exactly where we want it: game.world.width*0.5 will be right in the middle of the screen. in our case the world is the same as the canvas, but for other types of games, like side-scrollers for example, the world will be bigger, and you can tinker with it to create interesting effects. as you'll notice if you reload your index.html at this point, the paddle is currently not exactly in ...
...dth*0.5 will be right in the middle of the screen. in our case the world is the same as the canvas, but for other types of games, like side-scrollers for example, the world will be bigger, and you can tinker with it to create interesting effects. as you'll notice if you reload your index.html at this point, the paddle is currently not exactly in the middle. why? because the anchor from which the position is calculated always starts from the top left edge of the object. we can change that to have the anchor in the middle of the paddle's width and at the bottom of it's height, so it's easier to position it against the bottom edge. 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. now, to make it collide with th...
...n set the body of the paddle to be immovable, so it won't move when the ball hits it. to do this, add the below line at the bottom of the create() function: paddle.body.immovable = true; now it works as expected. controlling the paddle the next problem is that we can't move the paddle. to do that we can use the system's default input (mouse or touch, depending on platform) and set the paddle position to where the input position is. add the following new line to the update() function, as shown: function update() { game.physics.arcade.collide(ball, paddle); paddle.x = game.input.x; } now on every new frame the paddle's x position will adjust accordingly to the input's x position, however when we start the game, the position of the paddle is not in the middle. it's because the input p...
...And 4 more matches
Example 1 - Learn web development
om form widget. ...
... <li class="option">lemon</li> <li class="option">banana</li> <li class="option">strawberry</li> <li class="option">apple</li> </ul> </div> css /* --------------- */ /* required styles */ /* --------------- */ .select { position: relative; display : inline-block; } .select.active, .select:focus { box-shadow: 0 0 3px 1px #227755; outline: none; } .select .optlist { position: absolute; top : 100%; left : 0; } .select .optlist.hidden { max-height: 0; visibility: hidden; } /* ------------ */ /* fancy styles */ /* ------------ */ .select { font-size : 0.625em; /* 10px */ font-family : verdana, arial, sans-serif; -moz-box-sizing : border-box; box-sizing : border-box; padding : 0.1em 2.5em 0.2em 0.5em; /* 1px 25px 2px 5px */ width : 10e...
...*/ border-radius : 0.4em; /* 4px */ box-shadow : 0 0.1em 0.2em rgba(0,0,0,.45); /* 0 1px 2px */ background : #f0f0f0; background : linear-gradient(0deg, #e3e3e3, #fcfcfc 50%, #f0f0f0); } .select .value { display : inline-block; width : 100%; overflow : hidden; white-space : nowrap; text-overflow : ellipsis; vertical-align: top; } .select:after { content : "▼"; position: absolute; z-index : 1; height : 100%; width : 2em; /* 20px */ top : 0; right : 0; padding-top : .1em; -moz-box-sizing : border-box; box-sizing : border-box; text-align : center; border-left : .2em solid #000; border-radius: 0 .1em .1em 0; background-color : #000; color : #fff; } .select .optlist { z-index : 2; list-style: none; margin : 0; paddi...
...And 4 more matches
Useful string methods - Learn web development
count from 0, not 1! you could use this to, for example, find the first letter of a series of strings and order them alphabetically. to retrieve the last character of any string, we could use the following line, combining this technique with the length property we looked at above: browsertype[browsertype.length-1]; the length of "mozilla" is 7, but because the count starts at 0, the character position is 6; using length-1 gets us the last character. finding a substring inside a string and extracting it sometimes you'll want to find if a smaller string is present inside a larger one (we generally say if a substring is present inside a string). this can be done using the indexof() method, which takes a single parameter — the substring you want to search for. if the substring is found insid...
...substring inside a string and extracting it sometimes you'll want to find if a smaller string is present inside a larger one (we generally say if a substring is present inside a string). this can be done using the indexof() method, which takes a single parameter — the substring you want to search for. if the substring is found inside the main string, it returns a number representing the index position of the substring — which character number of the main string the substring starts at. if the substring is not found inside the main string, it returns a value of -1. try this: browsertype.indexof('zilla'); this gives us a result of 2, because the substring "zilla" starts at position 2 (0, 1, 2 — so 3 characters in) inside "mozilla". such code could be used to filter strings. for examp...
...egation operator, as shown below. you could do something like this: if(browsertype.indexof('mozilla') !== -1) { // do stuff with the string } when you know where a substring starts inside a string, and you know at which character you want it to end, slice() can be used to extract it. try the following: browsertype.slice(0,3); this returns "moz" — the first parameter is the character position to start extracting at, and the second parameter is the character position after the last one to be extracted. so the slice happens from the first position, up to, but not including, the last position. in this example, since the starting index is 0, the second parameter is equal to the length of the string being returned. also, if you know that you want to extract all of the remaining charac...
...And 4 more matches
Standard OS Libraries
also known as winapi32 or just winapi. a list of all the functions available through this api can be found at the msdn winapi index. for finding out the values and types of arguments and returns of the functions you want to use from this api, you must visit the functions page on this linked msdn site; it will give you all that information. example: getcursorpos i wanted to get the mouse cursor position without using a mousemove listener, as this is a high overhead event listener. so i went to the msdn winapi index page and then went to the "cursors" category and came across getcursorpos. i then searched it on msdn and saw that it needed the user32.dll. (msdn - getcursorpos) this example was created on windows xp sp2. it is a full working example; just copy & paste it to try it out. components...
...re: gnome developer :: gdk 2 reference manual. for gdk3 documentation is found here: gnome developer :: gdk 3 reference manual. because gnome is in the name of the websites don't get confused and think this only works on gnome. it is true though that gdk was developed by the gnome team. example: gdk_window_get_pointer this example is fot the gdk 2.0 library. in gdk 3.0 the gdk_window_get_device_position function was deprecated, see below for gdk 3.0 example. components.utils.import('resource://gre/modules/ctypes.jsm'); var gdk = ctypes.open('libgdk-x11-2.0.so.0'); // types var gint = ctypes.int; var gdkdevice = ctypes.structtype('gdkdevice'); var gdkmodifiertype = ctypes.int; var gdkwindow = ctypes.structtype('gdkwindow'); var void = ctypes.void_t; // https://developer.gnome.org/gdk3/stable/...
... gdkwindow.ptr, // window gint.ptr, ...
...And 4 more matches
AbstractRange - Web APIs
the start and end points of a section of content within the document. as an abstract interface, you will not directly instantiate an object of type abstractrange. instead, you will use the range or staticrange interfaces. to understand the difference between those two interfaces, and how to choose which is appropriate for your needs. ...
...e abstractrange. instead, you will use the range or staticrange interfaces. to understand the difference between those two interfaces, and how to choose which is appropriate for your needs. ...
...ke-width="2px" /><text x="66" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">abstractrange</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties collapsed read only a boolean value which is true if the range is collapsed. a collapsed range is one whose start position and end position are the same, resulting in a zero-character-long range. 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. this value must be le...
...And 4 more matches
AudioListener.dopplerFactor - Web APIs
x var audioctx = new audiocontext(); var mylistener = audioctx.listener; mylistener.dopplerfactor = 1; value a double indicating the doppler effect's pitch shift value. the value is 1 by default. example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio listener and panner (source) occupy initially, and then update the position of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo. in the example you can see th...
... of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo. 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. to see a complete implementation, check out our panner-node example (view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a track on a boom box and then walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audi...
...on. ...
...And 4 more matches
AudioListener.forwardX - Web APIs
ioctx = new audiocontext(); var mylistener = audioctx.listener; mylistener.forwardx.value = 0; value an audioparam. its default value is 0, and it can range between positive and negative infinity. example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio listener and panner (source) occupy initially, and then update the position of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo. in the example you can see th...
... of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo. 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. to see a complete implementation, check out our panner-node example (view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a track on a boom box and then walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audi...
...on. ...
...And 4 more matches
AudioListener.forwardY - Web APIs
ioctx = new audiocontext(); var mylistener = audioctx.listener; mylistener.forwardy.value = 0; value an audioparam. its default value is 0, and it can range between positive and negative infinity. example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio listener and panner (source) occupy initially, and then update the position of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo. in the example you can see th...
... of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo. 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. to see a complete implementation, check out our panner-node example (view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a track on a boom box and then walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audi...
...on. ...
...And 4 more matches
AudioListener.forwardZ - Web APIs
octx = new audiocontext(); var mylistener = audioctx.listener; mylistener.forwardz.value = 0; value an audioparam. its default value is -1, and it can range between positive and negative infinity. example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio listener and panner (source) occupy initially, and then update the position of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo. in the example you can see th...
... of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo. 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. to see a complete implementation, check out our panner-node example (view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a track on a boom box and then walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audi...
...on. ...
...And 4 more matches
AudioListener.setOrientation() - Web APIs
ear analysis terms, they must be perpendicular to each other. syntax var audioctx = new audiocontext(); var mylistener = audioctx.listener; mylistener.setorientation(0,0,-1,0,1,0); returns void. example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio listener and panner (source) occupy initially, and then update the position of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo. in the example you can see th...
... of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo. 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. to see a complete implementation, check out our panner-node example (view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a track on a boom box and then walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audi...
...on. ...
...And 4 more matches
AudioListener.speedOfSound - Web APIs
n delay is automatically applied to a sound far from the listener. syntax var audioctx = new audiocontext(); var mylistener = audioctx.listener; mylistener.speedofsound = 343.3; value a double. example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio listener and panner (source) occupy initially, and then update the position of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo. in the example you can see th...
... of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo. 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. to see a complete implementation, check out our panner-node example (view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a track on a boom box and then walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audi...
...on. ...
...And 4 more matches
AudioListener.upX - Web APIs
Web › API › AudioListener › upX
r audioctx = new audiocontext(); var mylistener = audioctx.listener; mylistener.upx.value = 0; value an audioparam. its default value is 0, and it can range between positive and negative infinity. example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio listener and panner (source) occupy initially, and then update the position of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo. in the example you can see th...
... of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo. 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. to see a complete implementation, check out our panner-node example (view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a track on a boom box and then walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audi...
...on. ...
...And 4 more matches
AudioListener.upY - Web APIs
Web › API › AudioListener › upY
r audioctx = new audiocontext(); var mylistener = audioctx.listener; mylistener.upy.value = 0; value an audioparam. its default value is 1, and it can range between positive and negative infinity. example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio listener and panner (source) occupy initially, and then update the position of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo. in the example you can see th...
... of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo. 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. to see a complete implementation, check out our panner-node example (view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a track on a boom box and then walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audi...
...on. ...
...And 4 more matches
AudioListener.upZ - Web APIs
Web › API › AudioListener › upZ
r audioctx = new audiocontext(); var mylistener = audioctx.listener; mylistener.upz.value = 0; value an audioparam. its default value is 0, and it can range between positive and negative infinity. example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio listener and panner (source) occupy initially, and then update the position of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo. in the example you can see th...
... of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo. 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. to see a complete implementation, check out our panner-node example (view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a track on a boom box and then walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audi...
...on. ...
...And 4 more matches
BaseAudioContext.createPanner() - Web APIs
the createpanner() method of the baseaudiocontext interface is used to create a new pannernode, which is used to spatialize an incoming audio stream in 3d space. the panner node is spatialized in relation to the audiocontext's audiolistener (defined by the audiocontext.listener attribute), which represents the position and orientation of the person listening to the audio. syntax baseaudioctx.createpanner(); returns a pannernode. example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio listener and panner (source) occupy initially, and then update the position of one or both of these as the application is used. yo...
... of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo. 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. to see a complete implementation, check out our panner-node example (view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a track on a boom box and then walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audi...
...on. ...
...And 4 more matches
Element - Web APIs
Web › API › Element
element. for example, the htmlelement interface is the base interface for html elements, while the svgelement interface is the basis for all svg elements. most functionality is specified further down the class hierarchy. languages outside the realm of the web platform, like xul through the xulelement interface, also implement element. ...
...ments. most functionality is specified further down the class hierarchy. languages outside the realm of the web platform, like xul through the xulelement interface, also implement element. ...
... value of the named attribute from the current node and returns it as an object. element.getattributenames() returns an array of attribute names from the current element. element.getattributens() retrieves the value of the attribute with the specified name and namespace, from the current node and returns it as an object. element.getboundingclientrect() returns the size of an element and its position relative to the viewport. element.getclientrects() returns a collection of rectangles that indicate the bounding rectangles for each line of text in a client. element.getelementsbyclassname() returns a live htmlcollection that contains all descendants of the current element that possess the list of classes given in the parameter. element.getelementsbytagname() returns a live htmlcollection ...
...And 4 more matches
PannerNode.distanceModel - Web APIs
e is the default value of distancemodel. syntax var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.distancemodel = 'inverse'; value a enum — see distancemodeltype. example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio listener and panner (source) occupy initially, and then update the position of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo. in the example you can see th...
... of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo. 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. to see a complete implementation, check out our panner-node example (view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a track on a boom box and then walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audi...
...on. ...
...And 4 more matches
PannerNode.maxDistance - Web APIs
xdistance = 10000; value a double. the default is 10000, and non-positive values are not allowed. exceptions rangeerror the property has been given a value that is outside the accepted range. example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio listener and panner (source) occupy initially, and then update the position of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo. in the example you can see th...
... of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo. 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. to see a complete implementation, check out our panner-node example (view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a track on a boom box and then walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audi...
...on. ...
...And 4 more matches
PannerNode.setOrientation() - Web APIs
dinate system. the default value of the direction vector is (1, 0, 0). syntax var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.setorientation(1,0,0); returns void. example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio listener and panner (source) occupy initially, and then update the position of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo. in the example you can see th...
... of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo. 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. to see a complete implementation, check out our panner-node example (view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a track on a boom box and then walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audi...
...on. ...
...And 4 more matches
PannerNode.setVelocity() - Web APIs
meters per second. the default value of the velocity vector is (0, 0, 0). syntax var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.setvelocity(0,0,17); returns void. example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio listener and panner (source) occupy initially, and then update the position of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo. in the example you can see th...
... of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo. 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. to see a complete implementation, check out our panner-node example (view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a track on a boom box and then walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audi...
...on. ...
...And 4 more matches
TextEncoder.prototype.encodeInto() - Web APIs
encodeintoresult dictionary, which contains two members: read the number of utf-16 units of code from the source that has been converted over to utf-8. this may be less than string.length if uint8array did not have enough space. written the number of bytes modified in the destination uint8array. the bytes written are guaranteed to form complete utf-8 byte sequences. ...
...d in the destination uint8array. the bytes written are guaranteed to form complete utf-8 byte sequences. encode into a specific position encoder.encodeinto always puts its output at the start of the array. however, it is sometimes useful to make the output start at a particular index. the solution is typedarray.prototype.subarray(). observe. ...
...array. the bytes written are guaranteed to form complete utf-8 byte sequences. encode into a specific position encoder.encodeinto always puts its output at the start of the array. however, it is sometimes useful to make the output start at a particular index. the solution is typedarray.prototype.subarray(). observe. ...
...And 4 more matches
Lighting in WebGL - Web APIs
0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, // right 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, // left -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0 ]; gl.bufferdata(gl.array_buffer, new float32array(vertexnormals), gl.static_draw); ... return { position: positionbuffer, normal: normalbuffer, texturecoord: texturecoordbuffer, indices: indexbuffer, }; this should look pretty familiar by now; we create a new buffer, bind it to be the buffer we're working with, then send along our array of vertex normals into the buffer by calling bufferdata(). then we add the code to drawscene() to bind the normals array to a shader attribute so t...
... update the shaders now that all the data the shaders need is available to them, we need to update the code in the shaders themselves. the vertex shader the first thing to do is update the vertex shader so it generates a shading value for each vertex based on the ambient lighting as well as the directional lighting. ...
...well as the directional lighting. ...
...And 4 more matches
XRRigidTransform() - Web APIs
w must always be 1. ...
...w must always be 1. ...
...w must always be 1. ...
...And 4 more matches
Basic Concepts of grid layout - CSS: Cascading Style Sheets
to the specified pixel which fits to the layout you desire. you can also create a grid using flexible sizes with percentages or with the new fr unit designed for this purpose. item placement you can place items into a precise location on the grid using line numbers, names or by targeting an area of the grid. grid also contains an algorithm to control the placement of items not given an explicit position on the grid. creation of additional tracks to hold content you can define an explicit grid with grid layout. the grid layout specification is flexible enough to add additional rows and columns when needed. features such as adding “as many columns that will fit into a container” are included. alignment control grid contains alignment features so we can control how the items align once plac...
... padding: 1em; color: #d9480f; } <div class="wrapper"> <div>one</div> <div>two <p>i have some more content in.</p> <p>this makes me taller than 100 pixels.</p> </div> <div>three</div> <div>four</div> <div>five</div> </div> grid lines it should be noted that when we define a grid we define the grid tracks, not the lines. ...
...the following example demonstrates doing this in a simple way. when placing an item, we target the line – rather than the track. ...
...And 4 more matches
CSS grids, logical values, and writing modes - CSS: Cascading Style Sheets
in these guides, i have already touched on an important feature of grid layout: the support for different writing modes that is built into the specification. for this guide, we will look at this feature of grid and other modern layout methods, learning a little about writing modes and logical vs. physical properties as we do so. ...
... of grid layout: the support for different writing modes that is built into the specification. for this guide, we will look at this feature of grid and other modern layout methods, learning a little about writing modes and logical vs. physical properties as we do so. logical and physical properties and values css is full of physical positioning keywords – left and right, top and bottom. ...
... different writing modes that is built into the specification. for this guide, we will look at this feature of grid and other modern layout methods, learning a little about writing modes and logical vs. physical properties as we do so. logical and physical properties and values css is full of physical positioning keywords – left and right, top and bottom. if we position an item using absolute positioning, we use these physical keywords as offset values to push the item around. ...
...And 4 more matches
Stacking with floated blocks - CSS: Cascading Style Sheets
for floated blocks, the stacking order is a bit different. floating blocks are placed between non-positioned blocks and positioned blocks: the background and borders of the root element descendant non-positioned blocks, in order of appearance in the html floating blocks descendant positioned elements, in order of appearance in the html actually, as you can see in the example below, the background and border of the non-positioned block (div #4) is completely unaffected by floating blocks, but the content is affected. this happens according to standard float behaviour. ...
...rder of appearance in the html actually, as you can see in the example below, the background and border of the non-positioned block (div #4) is completely unaffected by floating blocks, but the content is affected. this happens according to standard float behaviour. this behavior can be shown with an added rule to the above list: the background and borders of the root element descendant non-positioned blocks, in order of appearance in the html floating blocks descendant non-positioned inline elements descendant positioned elements, in order of appearance in the html note: if an opacity value is applied to the non-positioned block (div #4), then something strange happens: the background and border of that block pops up above the floating blocks and the positioned blocks. this is due t...
...ied to the non-positioned block (div #4), then something strange happens: the background and border of that block pops up above the floating blocks and the positioned blocks. this is due to a peculiar part of the specification: applying a opacity value creates a new stacking context (see what no one told you about z-index). ...
...And 4 more matches
Stacking context example 3 - CSS: Cascading Style Sheets
« css « understanding css z-index stacking context example 3 this last example shows problems that arise when mixing several positioned elements in a multi-level html hierarchy and when z-indexes are assigned using class selectors. let's take as an example a three-level hierarchical menu made from several positioned divs. second-level and third-level divs appear when hovering or clicking on their parents. usually this kind of menu is script-generated either client-side or server-side, so style rules are assigned with a class selector instead of the id selector. if the three menu levels partially overlap, then managing stacking could become a problem. ...
...in order to put it above all first-level menus, a z-index is used. the problem is that for each second-level menu, a stacking context is created and each third-level menu belongs to the context of its parent. ...
...ing on their parents. usually this kind of menu is script-generated either client-side or server-side, so style rules are assigned with a class selector instead of the id selector. if the three menu levels partially overlap, then managing stacking could become a problem. the first-level menu is only relatively positioned, so no stacking context is created. the second-level menu is absolutely positioned inside the parent element. in order to put it above all first-level menus, a z-index is used. the problem is that for each second-level menu, a stacking context is created and each third-level menu belongs to the context of its parent. so a third-level menu will be stacked under the following second-level menus, because all second-level menus share the same z-index value and the default stacki...
...And 4 more matches
justify-items - CSS: Cascading Style Sheets
e for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. the effect of this property is dependent of the layout mode we are in: in block-level layouts, it aligns the items inside their containing block on the inline axis. ...
...dependent of the layout mode we are in: in block-level layouts, it aligns the items inside their containing block on the inline axis. 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. ...
...note that justify-items is ignored in flexbox layouts. ...
...And 4 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 start...
... url() references the id of an svg shape -- circle, ellipse, line, path, polyg...
...a css shape including circle(), ellipse(), inset(), polygon(), or path(). path() a path string defined with svg coordinate syntax. none specifies no motion path at all. description this property defines a path an animated element can follow. an offset path is either a specified path with one or multiple sub-paths or the geometry of a not-styled basic shape. ...
...And 4 more matches
perspective-origin - CSS: Cascading Style Sheets
the perspective-origin css property determines the position at which the viewer is looking. it is used as the vanishing point by the perspective property. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. the perspective-origin and perspective properties are attached to the parent of a child transformed in 3-dimensional space, unlike the perspective() transform function which is placed on the element being transformed. ...
...bute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. the perspective-origin and perspective properties are attached to the parent of a child transformed in 3-dimensional space, unlike the perspective() transform function which is placed on the element being transformed. 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. it can ...
...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. it can have one of the following values: <length-percentage> indicating the position as an absolute length value or relative to the width of the element. the value may be negative. left, a keyword being a shortcut for the 0 length value. center, a keyword being a shortcut for the 50% percentage value. right, a keyword being a shortcut for the 100% percentage value. y-position indicates the position of the ordinate of the vanishing point. it can have one of the followi...
...And 4 more matches
<input type="datetime-local"> - HTML: Hypertext Markup Language
hts the input as invalid) if your entry doesn't match the pattern nnnn-nn-nntnn:nn, where n is a number from 0 to 9. of course, this doesn't stop people from entering invalid dates, or incorrectly formatted dates and times. and what user is going to understand the pattern they need to enter the time and date in? we still have a problem. ...
...n-nntnn:nn, where n is a number from 0 to 9. of course, this doesn't stop people from entering invalid dates, or incorrectly formatted dates and times. and what user is going to understand the pattern they need to enter the time and date in? we still have a problem. ...
...oesn't stop people from entering invalid dates, or incorrectly formatted dates and times. and what user is going to understand the pattern they need to enter the time and date in? we still have a problem. ...
...And 4 more matches
<input type="image"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › image
ta points are submitted to the server automatically by the browser — x and y. you can see this in action in our x y coordinates example. when you click on the image to submit the form, you'll see the data appended to the url as parameters, for example ?x=52&y=55. ...
...nd y. you can see this in action in our x y coordinates example. when you click on the image to submit the form, you'll see the data appended to the url as parameters, for example ?x=52&y=55. if the image input has a name attribute, then keep in mind that the specified name is prefixed on every attribute, so if the name is position, then the returned coordinates would be formatted in the url as ?position.x=52&position.y=55. this, of course, applies to all other attributes as well. these are the x and y coordinates of the image that the mouse clicked on to submit the form, where (0,0) is the top-left of the image. these can be used when the position the image was clicked on is significant, for example you might have a map that when clicked, sends the coordinates that were clicked to the server. t...
... a map that when clicked, sends the coordinates that were clicked to the server. the server-side code then works out what location was clicked on, and returns information about places nearby. in our above example, we could write server-side code that works out what color was clicked on by the coordinates submitted, and keeps a tally of the favorite colors people voted for. adjusting the image's position and scaling algorithm you can use the object-position property to adjust the positioning of the image within the <input> element's frame, and the object-fit property to control how the image's size is adjusted to fit within the frame. 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 im...
...And 4 more matches
<input type="month"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › month
ere's the css used in the above example. here we make use of the :valid and :invalid css properties to style the input based on whether or not the current value is valid. we had to put the icons on a <span> next to the input, not on the input itself, because in chrome the generated content is placed inside the form control, and can't be styled or shown effectively. ...
... or not the current value is valid. we had to put the icons on a <span> next to the input, not on the input itself, because in chrome the generated content is placed inside the form control, and can't be styled or shown effectively. div { margin-bottom: 10px; position: relative; } input[type="number"] { width: 100px; } input + span { padding-right: 30px; } input:invalid+span:after { position: absolute; content: '✖'; padding-left: 5px; } input:valid+span:after { position: absolute; content: '✓'; padding-left: 5px; } important: html form validation is not a substitute for scripts that ensure that the entered data is in the proper format. it's far too easy for someone to make adjustments to the html that allow them to bypass the validation, or to remove it entirely. it...
...t as invalid) if your entry doesn't match the pattern nnnn-nn, where n is a number from 0 to 9. of course, this doesn't stop people from entering invalid dates (such as 0000-42), or incorrectly formatted dates that follow the pattern. there's also the problem that the user won't necessarily know which of the many date formats is expected. we have work left to do. ...
...And 4 more matches
<input type="search"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › search
tered into your database. a note on styling there are useful pseudo-classes available for styling valid/invalid form elements: :valid and :invalid. in this section, we'll use the following css, which will place a check (tick) next to inputs containing valid values, and a cross next to inputs containing invalid values. input:invalid ~ span:after { content: '✖'; padding-left: 5px; position: absolute; } input:valid ~ span:after { content: '✓'; padding-left: 5px; position: absolute; } the technique also requires a <span> element to be placed after the form element, which acts as a holder for the icons. this was necessary because some input types on some browsers don't display icons placed directly after them very well. making input required you can use the required ...
...the following example is from firefox: different messages will be shown when you try to submit the form with different types of invalid data conta...
...the following example is from firefox: different messages will be shown when you try to submit the form with different types of invalid data contained inside the inputs; see the below examples. input value length you can specify a minimum le...
...And 4 more matches
MIME types (IANA media types) - HTTP
ed with http's 206 "partial content" response returned when the fetched data is only part of the content, such as is delivered using the range header). important mime types for web developers application/octet-stream this is the default for binary files. as it means unknown binary file, browsers usually don't execute it, or even ask if it should be executed. they treat it as if the content-disposition header was set to attachment, and propose a "save as" dialog. text/plain this is the default for textual files. even if it really means "unknown textual file," browsers assume they can display it. note that text/plain does not mean "any kind of textual data." if they expect a specific kind of textual data, they will likely not consider it a match. specifically if they download a text/plain fi...
...ideo codec used within it; vorbis is the usual audio codec. multipart/form-data the multipart/form-data type can be used when sending the values of a completed html form from browser to server. as a multipart document format, it consists of different parts, delimited by a boundary (a string starting with a double dash --). ...
...tipart document format, it consists of different parts, delimited by a boundary (a string starting with a double dash --). each part is its own entity with its own http headers, content-disposition, and content-type for file uploading fields. ...
...And 4 more matches
Object.prototype.constructor - JavaScript
otype.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. let's consider one more case. ...
...uture 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. let's consider one more case. ...
...r.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. let's consider one more case. ...
...And 4 more matches
text-anchor - SVG: Scalable Vector Graphics
here the wrapping area is determined from the inline-size property relative to a given point. it is not applicable to other types of auto-wrapped text. for those cases you should use text-align. for multi-line text, the alignment takes place for each line. the text-anchor attribute is applied to each individual text chunk within a given <text> element. each text chunk has an initial current text position, which represents the point in the user coordinate system resulting from (depending on context) application of the x and y attributes on the <text> element, any x or y attribute values on a <tspan>, <tref> or <altglyph> element assigned explicitly to the first rendered character in a text chunk, or determination of the initial current text position for a <textpath> element. note: as a presentati...
.../> <circle cx="60" cy="110" r="3" fill="red" /> <style><![cdata[ text { font: bold 36px verdana, helvetica, arial, sans-serif; } ]]></style> </svg> usage notes default value start value start | middle | end animatable yes start the rendered characters are aligned such that the start of the text string is at the initial current text position. for an element with a direction property value of ltr (typical for most european languages), the left side of the text is rendered at the initial text position. for an element with a direction property value of rtl (typical for arabic and hebrew), the right side of the text is rendered at the initial text position. for an element with a vertical primary text direction (often typical for asian te...
...(for text on a path, conceptually the text string is first laid out in a straight line. the midpoint between the start of the text string and the end of the text string is determined. ...
...And 4 more matches
x - SVG: Scalable Vector Graphics
Web › SVG › Attribute › x
g>, x defines the x coordinate of the uper left corner of its viewport. value <length> | <percentage> default value 0 animatable yes note: starting with svg2, x is a geometry property meaning this attribute can also be used as a css property for <svg>. text for <text>, if it contain a single value, x defines the x coordinate on where the content text position must be placed. the content text position is usualy a point on the baseline of the first line of text. the exact content text position is influenced by some properties like text-anchor, or direction. if there are multiple values, x defines the x coordinate of each individual glyph from the text. if there are less values than glyphes, the remaining glyphes are placed in the continuity of the last...
...if there are more values than glyphes, extra values are ignored. ...
... list of (<length> | <percentage>) default value 0 animatable yes example html,body,svg { height:100% } <svg viewbox="0 0 200 100" xmlns="http://www.w3.org/2000/svg"> <!-- horizontal line to materialized the text base line --> <line x1="0" y1="40%" x2="100%" y2="40%" /> <line x1="0" y1="90%" x2="100%" y2="90%" /> <!-- vertical line to materialized the x positioning --> <line x1="25%" y1="0" x2="25%" y2="100%" /> <line x1="50%" y1="0" x2="50%" y2="100%" /> <line x1="75%" y1="0" x2="75%" y2="100%" /> <!-- x with a single value --> <text y="40%" x="50%">svg</text> <!-- x with multiple values --> <text y="90%" x="25%, 50%, 75%">svg</text> </svg> text { font: 40px sans-serif; } line { fill: none; stroke: red; stroke-width: .5px; st...
...And 4 more matches
y - SVG: Scalable Vector Graphics
Web › SVG › Attribute › y
vg>, y defines the y coordinate of the uper left corner of its viewport. value <length> | <percentage> default value 0 animatable yes note: starting with svg2, y is a geometry property meaning this attribute can also be used as a css property for <svg>. text for <text>, if it contain a single value, y defines the y coordinate on where the content text position must be placed. the content text position is usualy a point on the baseline of the first line of text. the exact content text position is influenced by some properties like text-anchor, or direction. if there are multiple values, y defines the y coordinate of each individual glyph from the text. if there are less values than glyphes, the remaining glyphes are placed in the continuity of the last...
...if there are more values than glyphes, extra values are ignored. ...
...fault value 0 animatable yes example html,body,svg { height:100% } <svg viewbox="0 0 200 100" xmlns="http://www.w3.org/2000/svg"> <!-- horizontal line to materialized the text base line --> <line x1="0" y1="40%" x2="100%" y2="40%" /> <line x1="0" y1="60%" x2="100%" y2="60%" /> <line x1="0" y1="80%" x2="100%" y2="80%" /> <!-- vertical line to materialized the x positioning --> <line x1="5%" y1="0" x2="5%" y2="100%" /> <line x1="55%" y1="0" x2="55%" y2="100%" /> <!-- y with a single value --> <text y="40%" x="5%">svg</text> <!-- y with multiple values --> <text y="40%,60%,80%" x="55%">svg</text> </svg> text { font: 40px sans-serif; } line { fill: none; stroke: red; stroke-width: .5px; stroke-dasharray: 2px; } tref warning: as of sv...
...And 4 more matches
Example - SVG: Scalable Vector Graphics
combined, we get this very natural-looking behavior. this is done completely in w3c standards–xhtml, svg, and javascript–no flash or any vendor-specific extensions. this example should work in firefox 1.5 and above. ...
...{ clear: left; } ]]> </style> </head> <body onload='update()'> <svg:svg id='display' width='400' height='300'> <svg:circle id='cursor' cx='200' cy='150' r='7' fill='#0000ff' fill-opacity='0.5'/> </svg:svg> <p>a swarm of motes, governed by two simple principles. first, each mote tries to move towards the cursor, and second each mote tries to move away from the average mote position. combined, we get this very natural looking behavior. </p> <p> this is done completely in w3c standards–xhtml, svg and javascript–no flash or any vendor specific extensions. currently, this will work in mozilla firefox version 1.5 and above. </p> <div> (c) 2006 <a id='emailme' href='#'>nick johnson</a> <script type='text/javascript'> <![cdata[ // foil spam bots ...
... { 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, sum_y=0; for(i=0; i<motes.length; i++) { sum_x += motes[i].x; sum_y += motes[i].y; } return [sum_x/motes.length, sum_y/motes.length]; } // a nicer, integer random function rand(modulo) { return math.round( math.random() * (modulo-1)); } // class mo...
...And 4 more matches
StringView - Archive of obsolete content
nce to stringview.bufferview or a new arraybufferview of stringview.buffer will be created (depending on startoffset and length arguments passed). a new arraybufferview of stringview.buffer will be created. arraybufferview object reference to input.buffer. object reference to input or a new arraybufferview of the buffer input.buffer (depending on many factors regarding the position of the focused parts). object reference to input or a new arraybufferview of the buffer input.buffer (depending on many factors regarding the position of the focused parts). other ordered object (like array, collections, etc.) a new arraybuffer will be created. object reference to stringview.bufferview or a new arraybufferview of stringview.buffer will be created (dependin...
...presentation of the whole buffer as an array of 8-bit, 16-bit, or 32-bit integers (depending on the chosen encoding). stringview instances' methods makeindex() syntax stringview.makeindex([characterslength[, startfrom]]) description if the characterslength argument is a number it will be taken as codepoints length and makeindex() will return the index in elements of that position starting from 0. if the startfrom argument is passed the analysis will be done starting from it. if the characterslength argument is omitted, makeindex() will return the length in codepoints (ascii or utf-encoded) of the stringview object. arguments characterslength optional a number expressing the distance in codepoints from startfrom of the index of stringview.rawdata to be return...
... the analysis will be done starting from it. if the characterslength argument is omitted, makeindex() will return the length in codepoints (ascii or utf-encoded) of the stringview object. arguments characterslength optional a number expressing the distance in codepoints from startfrom of the index of stringview.rawdata to be returned. startfrom optional a number expressing the position in raw elements of the characters parts to skip. if omitted it will be considered as 0. examples var mystringview = new stringview("\u6432\u6432\u6432\u6432"); alert(mystringview.makeindex()) // 4 alert(mystringview.makeindex(2)) // 6 …using the startfrom argument… var mystringview = stringview.makefrombase64("5lit5pahigvzcghdsw9sievuz2xpc2gg4ks54ks/4kso4kwn4ksm4kwainin2yty...
...And 3 more matches
An Interview With Douglas Bowman of Wired News - Archive of obsolete content
o an interview and in the process shed a lot of light on what goes into a standards-based redesign. wired news redesign in a nutshell driven by xhtml 1.0 transitional and css; allows centralized control over layout and appearance for thousands of pages; simple markup allows for rapid changes to templates; average page weight dropped by almost half; page layout accomplished with simple css positioning; vastly increased accessibility without special coding or user agent detection. why did you pursue a standards-based redesign of wired news? as network design manager at lycos for the last two years, i've been creating and documenting design standards for our network of sites. this includes rules and guidelines applying to everything from headers, footers, page hierarchy, titles, typograph...
...ntent is not locked into a specific table structure, we have much more flexibility in how we present that content. a few changes to the css can completely alter the presentation of thousands of pages. as a very welcome side benefit, we also believe the accessibility of wired news will dramatically improve without the clutter of nested layout tables. are you setting up your columns with floats or positioning? in trying to eliminate that last table i was using to set the column structure of our pages, i took a close look at both floated divs and positioned divs. i went back and forth between each one for two weeks, and finally narrowed in on positioned divs as the choice for wired news. why did you choose positioning over floats? floats had a few disadvantages from my perspective. one was the re...
... center column content to appear first in browsers that got the un-styled version. with floats, either the left column or the right column always had to be drawn first. for sites that rely on a left or right column for primary navigation, this content order requirement of float usage may produce desired and advantageous behavior. ...
...And 3 more matches
Creating a Web based tone generator - Archive of obsolete content
nd plays the resulting tone. the function requestsounddata() produces the samples to be played. this function is called at a certain interval through the setinterval() function. the function mozwriteaudio() is called to write those samples produced in the audio stream. in order to always have samples to play, a buffer of 500 ms is created. 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. <!doctype html> <html> <head> <title>javascript audio write example</title> </head> <body> <input type="text" size="4" id="freq" value="440"><label for="hz">hz</label> <button onclick="start()">play</button> <button onclick="stop()">stop</button> <script type="text/javascript"> fun...
... <input type="text" size="4" id="freq" value="440"><label for="hz">hz</label> <button onclick="start()">play</button> <button onclick="stop()">stop</button> <script type="text/javascript"> function audiodatadestination(samplerate, readfn) { // initialize the audio output. 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. setinterval(function() { var written; // check if some data was not written in previous attempts. if(tail) { written = audio.mozwriteaudio(tail); ...
... var prebuffersize = samplerate / 2; // buffer 500ms var tail = null; // the function called with regular interval to populate // the audio output buffer. setinterval(function() { var written; // check if some data was not written in previous attempts. ...
...And 3 more matches
openPopup - Archive of obsolete content
« xul reference home openpopup( anchor , position , x , y , iscontextmenu, attributesoverride, triggerevent ) return type: no return value opens the popup relative to a specified node at a specific location. anchor the popup may be either anchored to another node or opened freely. 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. the anchor node does not need to be in the same document as the popup. unanchored popups may be created by supplying null as the anchor node. the direction in which the popup is oriented depends on the direction of the anchor. ...
...de or opened freely. 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. the anchor node does not need to be in the same document as the popup. unanchored popups may be created by supplying null as the anchor node. the direction in which the popup is oriented depends on the direction of the anchor. position possible values for position are: before_start, before_end, after_start, after_end, start_before, start_after, end_before, end_after, overlap, and after_pointer. check positioning of the popup guide for a precise description of the effect of the different values. ...
... iscontextmenu the iscontextmenu argument should be true for context menus and false for all other types of popups. ...
...And 3 more matches
Panels - Archive of obsolete content
cript if desired. when you want to associate a panel with a button, place the <panel> element directly inside the button element. 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 panel will, by default, appear with its topleft corner just underneath the bottom edge of the button, much as a menu does. the position can, however, be changed. for more information about positioning the popup, see positioning popups. only buttons (and toolbarbuttons) have this automatic behaviour which opens the popup when pressed. for other types of elements, you need to use a different technique as in the following example. <label value="search" popup="search-panel"/> <panel id="search-panel"> <label control="search" val...
... is pressed on the element with the popup attribute, the corresponding panel will be displayed. for instance, to attach the popup defined above to a label, use the following code: <label value="search" popup="search-panel"/> the result is a search button which opens a panel for entering the search term. when using the popup attribute, the panel will appear with the top left corner at the mouse position. ...
...yed. for instance, to attach the popup defined above to a label, use the following code: <label value="search" popup="search-panel"/> the result is a search button which opens a panel for entering the search term. when using the popup attribute, the panel will appear with the top left corner at the mouse position. in this case, you may wish to have the popup appear below the label instead. the position attribute may be used to control the placement of the popup. here is a complete example: <panel id="search-panel" position="after_start"> <label control="search" value="terms:"/> <textbox id="search"/> </panel> <label value="search" popup="search-panel"/> the position attribute has been added to the panel element with the value 'after_start'. this causes the panel to be displayed not wher...
...And 3 more matches
XUL element attributes - Archive of obsolete content
bute to create elements that stretch in the opposite direction. left the elements are aligned on their left edges. center the elements are centered horizontally. right the elements are aligned on their right edges. the pack attribute is related to the alignment but is used to specify the position in the opposite direction. you can also specify the value of align using the style property -moz-box-align. allowevents type: boolean if true, events are passed to children of the element. otherwise, events are passed to the element only. allownegativeassertions type: boolean valid on any element that has a datasources attribute. when multiple datasources are used, one may...
...efore type: id when an element is in an overlay, the insertbefore attribute specifies the id of the element in the base window that the element should appear before. this value may be a comma-separated list of ids, which are scanned and the first one found in the window is used. left type: string (representing an integer) for elements placed directly within a stack, specifies the pixel position of the left edge of the element relative to the left edge of the stack. maxheight type: string (representing an integer) the maximum height of the element. this corresponds to the max-height css property. maxwidth type: string (representing an integer) the maximum width of the element. this corresponds to the max-width css property. menu type: id alternate name for the ...
...lements may override this if they specify mousethrough="never". never mouse events are passed to the element as normal. observes type: id set to an id of a broadcaster element that is being observed by the element. if an attribute changes in the broadcaster it is also changed in the observer. ordinal type: string (representing an integer) an integer which specifies the position of the element within its parent. by default, elements appear in the order they appear in the xul code. the ordinal attribute can be used to change the order. note the default ordinal for elements is 1. you can retrieve the displayed order by using the properties of the boxobject of the container. orient type: one of the values below used to specify whether the children of the element ar...
...And 3 more matches
Browser Feature Detection - Archive of obsolete content
ize true true true fontstyle true true true fontvariant true true true fontweight true true true height true true true letterspacing true true true lineheight true true true liststyle true true true liststyleimage true true true liststyleposition true true true liststyletype true true true margin true true true margintop true true true marginright true true true marginbottom true true true marginleft true true true padding true true true paddingtop true true true paddingright ...
...e true true verticalalign true true true whitespace true true true width true true true wordspacing true true true dom css 2 support for properties/methods in document.body.style</caption> name firefox 1.5 ie 6 & 7 opera 8.54 - 9.01 azimuth true false false backgroundposition true true true bordercollapse true true true borderspacing true false true bordertopcolor true true true borderrightcolor true true true borderbottomcolor true true true borderleftcolor true true true bordertopstyle true true true borderrightstyle true...
...ter true true true pagebreakbefore true true true pagebreakinside true false true pause true false true pauseafter true false true pausebefore true false true pitch true false false pitchrange true false true playduring false false false position true true true quotes true false true richness true false false right true true true size true false true speak true false true speakheader true false false speaknumeral true false false speakpunctuation true false false speechrate tr...
...And 3 more matches
Bounding volume collision detection with THREE.js - Game development
eometry.computeboundingbox beforehand. var knot = new three.mesh( new three.torusknotgeometry(0.5, 0.1), new meshnormalmaterial({})); knot.geometry.computeboundingbox(); var knotbbox = new box3( knot.geometry.boundingbox.min, knot.geometry.boundingbox.max); note: the boundingbox property takes the geometry itself as reference, and not the mesh. so any transformations such as scale, position, etc. applied to the mesh will be ignored while computing the calculating box. 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 meshnormalma...
...new three.vector3(), new three.vector3()); knotbbox.setfromobject(knot); instantiating spheres instantiating sphere objects is similar. we need to provide the sphere's center and radius, which can be added to the boundingsphere property available in geometry. 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. so if we apply transformations or change the position of the mesh, we need to manually update the bounding sphere. for instance: knot.scale.set(2, 2, 2); knotbsphere.radius = knot.geometry.radius * 2; intersection tests point vs. box3 / sphere both box3 and sphere have...
...ct method in order to have a bounding box matching the mesh. boxhelper is the recommended way to handle 3d collisions with bounding volumes in three.js. you will miss sphere tests, but the tradeoffs are well worth it. the advantages of using this helper are: it has an update() method that will resize its bounding box mesh if the linked mesh rotates or changes its dimensions, and update its position. it takes into account the child meshes when computing the size of the bounding box, so the original mesh and all its children are wrapped. we can easily debug collisions by rendering the meshes that boxhelper creates. by default they are created with a linebasicmaterial material (a three.js material for drawing wireframe-style geometries). the main disadvantage is that it only creates box bo...
...And 3 more matches
Parser API
epresenting the ast variant type. each subtype of node is documented below with the specific string of its type field. you can use this field to determine which interface a node implements. the loc field represents the source location information of the node. ...
...e ast variant type. each subtype of node is documented below with the specific string of its type field. you can use this field to determine which interface a node implements. the loc field represents the source location information of the node. ...
...ecific string of its type field. you can use this field to determine which interface a node implements. the loc field represents the source location information of the node. ...
...And 3 more matches
Places Developer Guide
ookmarkuri = cc["@mozilla.org/network/io-service;1"] .getservice(ci.nsiioservice) .newuri("http://www.mozilla.com", null, null); var bookmarkid = bookmarks.insertbookmark( bookmarks.toolbarfolder, // the id of the folder the bookmark will be placed in. bookmarkuri, // the uri of the bookmark - an nsiuri object. bookmarks.default_index, // the position of the bookmark in its parent folder. "my bookmark title"); // the title of the bookmark. creating a folder var folderid = bookmarks.createfolder( bookmarks.toolbarfolder, // the id of the folder the new folder will be placed in. "my folder title", // the title of the new folder. bookmarks.default_index); // the position of the new folder in its parent folder. creating a sep...
...older, // the id of the folder the new folder will be placed in. "my folder title", // the title of the new folder. bookmarks.default_index); // the position of the new folder in its parent folder. creating a separator var separatorid = bookmarks.insertseparator( bookmarks.toolbarfolder, // the id of the folder the separator will be placed in. bookmarks.default_index); // the position of the separator in its parent folder. creating a livemark var ioservice = cc["@mozilla.org/network/io-service;1"] .getservice(ci.nsiioservice); var siteuri = ioservice.newuri("http://www.mozilla.com", null, null); var feeduri = ioservice.newuri("http://www.mozilla.org/news.rdf", null, null); var livemarks = cc["@mozilla.org/browser/livemark-service;2"] .getserv...
... .getservice(ci.nsilivemarkservice); livemarks.createlivemark(bookmarks.toolbarfolder, // the id of the folder the livemark will be placed in "my livemark title", // the title of the livemark siteuri, // the uri of the site. a nsiuri object. feeduri, // the uri of the actual feed. a nsiuri object. ...
...And 3 more matches
XPCOM Interface Reference by grouping
tions defined in other groups. user this section contains elements specific to a given user's data storage. ...
... groups. user this section contains elements specific to a given user's data storage. ...
...ion contains elements specific to a given user's data storage. ...
...And 3 more matches
GeolocationCoordinates.longitude - Web APIs
the geolocationcoordinates interface's read-only longitude property is a double-precision floating point value which represents the longitude of a geographical position, specified in decimal degrees. together with a domtimestamp indicating a time of measurement, the geolocationcoordinates object is part of the geolocationposition interface, which is the object type returned by geolocation api functions that obtain and return a geographical position. syntax let longitude = geolocationcoordinatesinstance.longitude value the value in longitude is the geographical longitude of the location on earth described by the coordinates object, in decimal degrees. the value is defined by the world geodetic system 1984 specification (wgs 84). note: the zero meridian (also known as the prime mer...
...the world geodetic system 1984 specification (wgs 84). note: the zero meridian (also known as the prime meridian or the reference meridian) is not precisely the same as the greenwhich meridian that most people think of. it is, instead, the iers reference meridian, which is located 5.3 arcseconds (102 meters / 335 feet) east of the greenwich meridian. this is the same standard used by the global positioning system (gps). examples in this simple example, we fetch the user's location and display the resulting coordinates once they're returned. javascript the javascript code below creates an event listener so that when the user clicks on a button, the location information is retrieved and displayed. let button = document.getelementbyid("get-location"); let lattext = document.getelementbyid("la...
... javascript the javascript code below creates an event listener so that when the user clicks on a button, the location information is retrieved and displayed. ...
...And 3 more matches
HTMLTableRowElement - Web APIs
the htmltablerowelement interface provides special properties and methods (beyond the htmlelement interface it also has available to it by inheritance) for manipulating the layout and presentation of rows in an html table. ...
...lement interface provides special properties and methods (beyond the htmlelement interface it also has available to it by inheritance) for manipulating the layout and presentation of rows in an html table. ...
...ported. htmltablerowelement.choff is a domstring containing a integer indicating how many characters must be left at the right (for left-to-right scripts; or at the left for right-to-left scripts) of the character defined by htmltablerowelement.ch. this property was optional and was not very well supported. htmltablerowelement.rowindex read only returns a long value which gives the logical position of the row within the entire table. if the row is not part of a table, returns -1. htmltablerowelement.sectionrowindex read only returns a long value which gives the logical position of the row within the table section it belongs to. if the row is not part of a section, returns -1. htmltablerowelement.valign is a domstring representing an enumerated value indicating how the content of the ...
...And 3 more matches
Key Values - Web APIs
elow list the standard key values in various categories of key, with an explanation of what the key is typically used for. corresponding virtual keycodes for common platforms are included where available. learn how to use these key values in javascript using keyboardevent.key special values | modifier keys | whitespace keys | navigation keys | editing keys | ui keys | device keys | ime and composition keys | function keys | phone keys | multimedia keys | audio control keys | tv control keys | media controller keys | speech recognition keys | document keys | application selector keys | browser control keys | numeric keypad keys special values values of key which have special meanings other than identifying a specific key or character. keyboardevent.key value description virtua...
...ards). appcommand_cut gdk_key_cut (0x1008ff58) qt::key_cut (0x010000d0) "delete" [2] the delete key, del. vk_delete (0x2e) kvk_forwarddelete (0x75) [1] gdk_key_delete (0xffff) gdk_key_kp_delete (0xff9f) qt::key_delete (0x01000007) keycode_forward_del (112) "eraseeof" erase to end of field. deletes all characters from the current cursor position to the end of the current field. vk_ereof (0xf9) gdk_key_3270_exselect (0xfd1b) "exsel" [4] the exsel (extend selection) key. vk_exsel (0xf8) gdk_key_3270_exselect (0xfd1b) "insert" the insert key, ins. toggles between inserting and overwriting text. vk_insert (0x2d) gdk_key_insert (0xff63) gdk_key_kp_insert (0xff9e) qt::key_in...
...ed to wake the computer from the hibernation or standby modes. gdk_key_wakeup (0x1008ff2b) qt::key_wakeup (0x010000b8) keycode_wakeup (224) [1] the standby key is not supported by internet explorer (tested on release 9 and 11) and firefox 36 and earlier, so it is reported as "unidentified". [2] prior to firefox 37, this key generated the value "unidentified". ime and composition keys keys used when using an input method editor (ime) to input text which can't readily be entered by simple keypresses, such as text in languages such as those which have more graphemes than there are character entry keys on the keyboard. common examples include chinese, japanese, korean, and hindi. some keys are common across multiple languages, while others exist only on keyboards targeting...
...And 3 more matches
UIEvent.pageY - Web APIs
Web › API › UIEvent › pageY
tion showcoords(evt){ var form = document.forms.form_coords; var parent_id = evt.target.parentnode.id; form.parentid.value = parent_id; form.pagexcoords.value = evt.pagex; form.pageycoords.value = evt.pagey; form.layerxcoords.value = evt.layerx; form.layerycoords.value = evt.layery; } </script> <style type="text/css"> #d1 { border: solid blue 1px; padding: 20px; } #d2 { position: absolute; top: 180px; left: 80%; right:auto; width: 40%; border: solid blue 1px; padding: 20px; } #d3 { position: absolute; top: 240px; left: 20%; width: 50%; border: solid blue 1px; padding: 10px; } </style> </head> <body onmousedown="showcoords(event)"> <p>to display the mouse coordinates please click anywhere on the page.</p> <div id="d1"> <span>this is an un-p...
...op: 240px; left: 20%; width: 50%; border: solid blue 1px; padding: 10px; } </style> </head> <body onmousedown="showcoords(event)"> <p>to display the mouse coordinates please click anywhere on the page.</p> <div id="d1"> <span>this is an un-positioned div so clicking it will return layerx/layery values almost the same as pagex/pagey values.</span> </div> <div id="d2"> <span>this is a positioned div so clicking it will return layerx/layery values that are relative to the top-left corner of this positioned element. ...
...k anywhere on the page.</p> <div id="d1"> <span>this is an un-positioned div so clicking it will return layerx/layery values almost the same as pagex/pagey values.</span> </div> <div id="d2"> <span>this is a positioned div so clicking it will return layerx/layery values that are relative to the top-left corner of this positioned element. note the pagex\pagey properties still return the absolute position in the document, including page scrolling.</span> <span>make the page scroll more! ...
...And 3 more matches
Starting up and shutting down a WebXR session - Web APIs
r api emulator extension the mozilla webxr team has created a webxr api emulator browser extension, compatible with both firefox and chrome, which emulates the webxr api, simulating a variety of compatible devices such as the htc vive, the oculus go and oculus quest, samsung gear, and google cardboard. 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. it also lets you perform some basic testing before taking your code to a real device. be aw...
... for the canvas into which you intend to render your frames by calling the htmlcanvaselement method getcontext() on the target context. set up your webgl data and models and prepare to render the scene. set the webgl context as the source for the xr system by creating an xrwebgllayer and passing set the value of the session's renderstate property baselayer. perform calculations for the initial position and scale of your objects as needed. begin the frame rendering cycle. in basic form, code to do this final setup might look something like this: async function runsession(session) { let worlddata; session.addeventlistener("end", onsessionend); let canvas = document.queryselector("canvas"); gl = canvas.getcontext("webgl", { xrcompatible: true }); // set up webgl data and such w...
...this includes the xrsession itself, all of the data used to render the scene in webgl, the world reference sp...
...And 3 more matches
Window.open() - Web APIs
Web › API › Window › open
e used as the target for the target attribute of <a> or <form> elements. the name should not contain whitespace. keep in mind that this will not be used as the window's title. windowfeatures optional a domstring containing a comma-separated list of window features given with their corresponding values in the form "name=value". these features include options such as the window's default size and position, whether or not to include toolbar, and so forth. there must be no whitespace in the string. see window features below for documentation of each of the features that can be specified. return value a windowproxy object, which is basically a thin wrapper for the window object representing the newly created window, and has all its features available. if the window couldn't be opened, the returned...
...ed to change the features. if windowname does not specify an existing window and the windowfeatures parameter is not provided (or if the windowfeatures parameter is an empty string), then the new secondary window will render the default toolbars of the main window. 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. note on position and dimension error correction position if only one of them is specified, the behavior is implementation-dependent, and web author should not rely on it. left or screenx specifies the distance the new window is placed from the left side of the work area for applications of th...
...sion error correction position if only one of them is specified, the behavior is implementation-dependent, and web author should not rely on it. left or screenx specifies the distance the new window is placed from the left side of the work area for applications of the user's operating system to the leftmost border (resizing handle) of the browser window. the new window cannot be initially positioned offscreen. top or screeny specifies the distance the new window is placed from the top side of the work area for applications of the user's operating system to the topmost border (resizing handle) of the browser window. the new window cannot be initially positioned offscreen. ...
...And 3 more matches
Web APIs
Web › API
bluetoothremotegattservice body broadcastchannel budgetservice budgetstate buffersource bytelengthqueuingstrategy bytestring c cdatasection css cssconditionrule csscounterstylerule cssgroupingrule cssimagevalue csskeyframerule csskeyframesrule csskeywordvalue cssmathproduct cssmathsum cssmathvalue cssmediarule cssnamespacerule cssnumericvalue cssomstring csspagerule csspositionvalue cssprimitivevalue csspseudoelement cssrule cssrulelist cssstyledeclaration cssstylerule cssstylesheet cssstylevalue csssupportsrule cssunitvalue cssunparsedvalue cssvalue cssvaluelist cssvariablereferencevalue cache cachestorage canvascapturemediastreamtrack canvasgradient canvasimagesource canvaspattern canvasrenderingcontext2d caretposition channelmergernode chann...
...alue csssupportsrule cssunitvalue cssunparsedvalue cssvalue cssvaluelist cssvariablereferencevalue cache cachestorage canvascapturemediastreamtrack canvasgradient canvasimagesource canvaspattern canvasrenderingcontext2d caretposition channelmergernode channelsplitternode characterdata childnode client clients clipboard clipboardevent clipboarditem closeevent comment compositionevent constantsourcenode constrainboolean constraindomstring constraindouble constrainulong contentindex contentindexevent convolvernode countqueuingstrategy crashreportbody credential credentialscontainer crypto cryptokey cryptokeypair customelementregistry customevent d domconfiguration domerror domexception domhighrestimestamp domimplementation domimplementationlist domlocator ...
... 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 htmlbasefontelement htmlbodyelement htmlbuttonelement htmlcanvaselement htmlcollection htmlcontentelement htmldlistelement htmldataelement htmldatalistelement htmldetailselement htmldialogelement htmldivelement htmldocument...
...And 3 more matches
Line-based placement with CSS Grid - CSS: Cascading Style Sheets
in this article we will fully explore how this fundamental feature of the specification works. starting your exploration of grid with numbered lines is the most logical place to begin, as when you use grid layout you always have numbered lines. the lines are numbered for columns and rows, and are indexed from 1. note that grid is indexed according to the writing mode of the document. in a left to right language such as english line 1 is on the left-hand side of the grid. if you are working in a right-to-left language then line 1 will be the far right of the grid. ...
...i would like the first item to start on the far left of the grid and span a single column track. it should also start on the first row line, at the top of the grid and span to the fourth row line. .box1 { grid-column-start: 1; grid-column-end: 2; grid-row-start: 1; grid-row-end: 4;...
... line number we can use line-based placement to control where these items sit on the grid. i would like the first item to start on the far left of the grid and span a single column track. it should also start on the first row line, at the top of the grid and span to the fourth row line. .box1 { grid-column-start: 1; grid-column-end: 2; grid-row-start: 1; grid-row-end: 4; } as you position some items, other items on the grid will continue to be laid out using the auto-placement rules. we will take a proper look at how these work in a later guide but you can see as you work that grid is laying out un-placed items into empty cells of the grid. addressing each item individually we can place all four items spanning row and column tracks. note that we can leave cells empty if we wish. ...
...And 3 more matches
Stacking without the z-index property - CSS: Cascading Style Sheets
when the z-index property is not specified on any element, elements are stacked in the following order (from bottom to top): the background and borders of the root element descendant non-positioned blocks, in order of appearance in the html descendant positioned elements, in order of appearance in the html keep in mind, when the order property alters rendering from the "order of appearance in the html" within flex containers, it similarly affects the order for stacking context. in the example below, elements #1 through #4 are positioned elements. ...
... from the "order of appearance in the html" within flex containers, it similarly affects the order for stacking context. in the example below, elements #1 through #4 are positioned elements. element #5 is static, and so is drawn below the other four elements, even though it comes later in the html markup. ...
... affects the order for stacking context. in the example below, elements #1 through #4 are positioned elements. element #5 is static, and so is drawn below the other four elements, even though it comes later in the html markup. ...
...And 3 more matches
Using CSS transforms - CSS: Cascading Style Sheets
by modifying the coordinate space, css transforms change the shape and position of the affected content without disrupting the normal document flow. this guide provides an introduction to using transforms. css transforms are implemented using a set of css properties that let you apply affine linear transformations to html elements. these transformations include rotation, skewing, scaling, and translation both in the plane and in the 3d space. only elements positioned by the box model can be transformed. as a rule of thumb, an element is positioned by the box model if it has display: block. css transforms properties two major properties are used to define css transforms: transform and transform-origin transform-origin specifies the position of the origin. by default, it is at the center...
...composite transforms are effectively applied in order from right to left. examples here is an unaltered image of the mdn logo: rotating here is the mdn logo rotated 90 degrees from its bottom-left corner. ...
...art by configuring the 3d space by giving it a perspective, then you have to configure how your 2d elements will behave in that space. perspective the first element to set is the perspective. the perspective is what gives us the 3d impression. the farther from the viewer the elements are, the smaller they are. setting perspective this example shows a cube with the perspective set at different positions. how quick the cube shrinks is defined by the perspective property. the smaller its value is, the deeper the perspective is. html the html below creates four copies of the same box, with the perspective set at different values. <table> <tbody> <tr> <th><code>perspective: 250px;</code> </th> <th><code>perspective: 350px;</code> </th> </tr> <tr> <td> ...
...And 3 more matches
CSS reference - CSS: Cascading Style Sheets
Web › CSS › Reference
an-plus-b><angle><angle-percentage>animationanimation-delayanimation-directionanimation-durationanimation-fill-modeanimation-iteration-countanimation-nameanimation-play-stateanimation-timing-function@annotationannotation()attr()b::backdropbackdrop-filterbackface-visibilitybackgroundbackground-attachmentbackground-blend-modebackground-clipbackground-colorbackground-imagebackground-originbackground-positionbackground-repeatbackground-size<basic-shape>::before (:before)bleed (@page)<blend-mode>block-sizeblur()borderborder-blockborder-block-colorborder-block-endborder-block-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-r...
...nt-face)font-feature-settingsfont-feature-settings (@font-face)@font-feature-valuesfont-kerningfont-language-overridefont-optical-sizingfont-sizefont-size-adjustfont-stretchfont-stretch (@font-face)font-stylefont-style (@font-face)font-synthesisfont-variantfont-variant (@font-face)font-variant-alternatesfont-variant-capsfont-variant-east-asianfont-variant-ligaturesfont-variant-numericfont-variant-positionfont-variation-settingsfont-variation-settings (@font-face)font-weightfont-weight (@font-face)format()fr<frequency><frequency-percentage>:fullscreenggapgrad<gradient>grayscale()gridgrid-areagrid-auto-columnsgrid-auto-flowgrid-auto-rowsgrid-columngrid-column-endgrid-column-startgrid-rowgrid-row-endgrid-row-startgrid-templategrid-template-areasgrid-template-columnsgrid-template-rowshhzhanging-punctu...
...inateinheritinitialinline-sizeinsetinset()inset-blockinset-block-endinset-block-startinset-inlineinset-inline-endinset-inline-start<integer>:invalidinvert()isolationjjustify-contentjustify-itemsjustify-selfkkhz@keyframesl:lang:last-child:last-of-typeleader():leftleft@left-bottom<length><length-percentage>letter-spacingline-breakline-heightlinear-gradient():linklist-stylelist-style-imagelist-style-positionlist-style-typelocal()mmarginmargin-blockmargin-block-endmargin-block-startmargin-bottommargin-inlinemargin-inline-endmargin-inline-startmargin-leftmargin-rightmargin-top::markermarks (@page)maskmask-bordermask-border-modemask-border-outsetmask-border-repeatmask-border-slicemask-border-sourcemask-border-widthmask-clipmask-compositemask-imagemask-modemask-originmask-positionmask-repeatmask-sizemask...
...And 3 more matches
Visual formatting model - CSS: Cascading Style Sheets
is includes continuous media such as a computer screen and paged media such as a book or document printed by browser print functions. most of the information applies equally to continuous and paged media. in the visual formatting model, each element in the document tree generates zero or more boxes according to the box model. the layout of these boxes is governed by: box dimensions and type. positioning scheme (normal flow, float, and absolute positioning). relationships between elements in the document tree. external information (e.g., viewport size, intrinsic dimensions of images, etc.). much of the information about the visual formatting model is defined in css2, however, various level 3 specifications have added to this information. when reading specifications you will often find refe...
...is called a "block box" or just a "block". note however that block boxes, block-level boxes and box containers are all subtly different; see the block boxes section below for more details. the principal box when an element generates one or more boxes, one of them is the principal box, which contains its descendant boxes and generated content in the box tree, and is also the box involved in any positioning scheme. some elements may generate additional boxes in addition to the principal box, for example display: list-item generates more than one box (e.g. a principal block box and a child marker box). and some values (such as none or contents) cause the element and/or its descendants to not generate any boxes at all. anonymous boxes an anonymous box is created when there is not an html element...
...e boxes that wrap each line of text. you can see the difference between line boxes and their containing block if you float an item and then follow it by a block that has a background color. in the following example, the line boxes following the floated <div> are shortened to wrap around the float. the background of the box runs behind the float, as the floated item has been taken out of flow. positioning schemes and in-flow and out-of-flow elements in css, a box may be laid out according to three positioning schemes — normal flow, floats, or absolute positioning. normal flow in css, the normal flow includes block-level formatting of block boxes, inline-level formatting of inline boxes, and also includes relative and sticky positioning of block-level and inline-level boxes. read more abou...
...And 3 more matches
clip-path - CSS: Cascading Style Sheets
Web › CSS › clip-path
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 property is specified as one or a combination of the values listed below. values <clip-source> a <url> referencing an svg <clippath> element. <basic-shape> a shape whose size and position is defined by the <geometry-box> value. if no geometry box is specified, the border-box will be used as the reference box. <geometry-box> if specified in combination with a <basic-shape>, this value defines the reference box for the basic shape. if specified by itself, it causes the edges of the specified box, including any corner shaping (such as a border-radius), to be the clipping path. the ...
... uses the padding box as the reference box. content-box uses the content box as the reference box. fill-box uses the object bounding box as the reference box. stroke-box uses the stroke bounding box as the reference box. view-box uses the nearest svg viewport as the reference box. 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. none no clipping path is created. note: a computed value other than none results in the creation of a new stacking context the same way that css opacity does for values other than 1. formal defin...
... for <basic-shape>, otherwise no formal syntax <clip-source> | [ <basic-shape> | <geometry-box> ] | nonewhere <clip-source> = <url><basic-shape> = <inset()> | <circle()> | <ellipse()> | <polygon()> | <path()><geometry-box> = <shape-box> | fill-box | stroke-box | view-boxwhere <inset()> = inset( <length-percentage>{1,4} [ round <'border-radius'> ]? )<circle()> = circle( [ <shape-radius> ]? ...
...And 3 more matches
conic-gradient() - CSS: Cascading Style Sheets
wheel */ background: conic-gradient( hsl(360, 100%, 50%), hsl(315, 100%, 50%), hsl(270, 100%, 50%), hsl(225, 100%, 50%), hsl(180, 100%, 50%), hsl(135, 100%, 50%), hsl(90, 100%, 50%), hsl(45, 100%, 50%), hsl(0, 100%, 50%) ); values <angle> preceded by the from keyterm, and taking an angle as its value, defines the gradient rotation in clockwise direction. <position> using the same length, order and keyterm values as the background-position property, the position defines center of the gradient. if omitted, the default value is center, meaing the gradient will be centered, . <angular-color-stop> a color-stop's <color> value, followed by one or two optional stop positions, (an <angle> along the gradient's circumference axis). <color-hint> th color-hint is...
...onic-gradient() function instead. because <gradient>s belong to the <image> data type, they can only be used where <image>s can be used. for this reason, conic-gradient() won't work on background-color and other properties that use the <color> data type. why is it called a "conic" gradient? if the color stops are much lighter on one side than the other, it can look like a cone from above. composition of a conic gradient the conic-gradient syntax is similar to the radial-gradient syntax, but the color-stops are placed around a gradient arc, the circumference of a circle, rather than on the gradient line emerging from the center of the gradient. with conic gradients, the colors transition as as if spun around the center of a circle, starting at the top and going clockwise. in a radial gradient...
...dient are specified with an angle. units include deg for degrees, grad for gradients, rad for radians, and turn for turns. there are 360 degrees, 400 gradians, 2π radians, and 1 turn in a circle. browsers supporting conic gradients also accept percent values, with 100% equaling 360 degrees, but this is not in the specification. similar to radial gradients, the conic gradient syntax provides for positioning the center of the gradient anywhere within, or even outside, the image. the values for the position are similar to the syntax for 2-value background-position. the gradient arc is the circumference of the gradient. the starting point of the gradient or arc is north, or 12:00pm. the gradient is then rotated by the from angle. the colors of the gradient are determined by the angled color stops, ...
...And 3 more matches
justify-content - CSS: Cascading Style Sheets
u'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. the alignment is done after the lengths and auto margins are applied, meaning that, if in a flexbox layout there is at least one flexible element, with flex-grow different from 0, it will have no effect as there won't be any available space. ...
...the left edge of the alignment container. if the property’s axis is not parallel with the inline axis, this value behaves like start. right the items are packed flush to each other toward the right edge of the alignment container in the appropriate axis. if the property’s axis is not parallel with the inline axis, this value behaves like start. normal the items are packed in their default position as if no justify-content value was set. this value behaves as stretch in grid and flex containers. 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. th...
...ed alongside an alignment keyword. regardless of the relative sizes of the item and alignment container, and regardless of whether overflow which causes data loss might happen, the given alignment value is honored. ...
...And 3 more matches
scroll-snap-destination - CSS: Cascading Style Sheets
the first value gives the x coordinate of the snap destination, the second value its y coordinate. ...
...the first value gives the x coordinate of the snap destination, the second value its y coordinate. ...
...the first value gives the x coordinate of the snap destination, the second value its y coordinate. ...
...And 3 more matches
z-index - CSS: Cascading Style Sheets
Web › CSS › z-index
whether the box establishes a local stacking context. ...
... whether the box establishes a local stacking context. ...
...ositioned element and its descendants or flex items. overlapping elements with a larger z-index cover those with a smaller one. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. for a positioned box (that is, one with any position other than static), the z-index property specifies: the stack level of the box in the current stacking context. whether the box establishes a local stacking context. 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:...
...And 3 more matches
Cross-browser audio basics - Developer guides
uration now }); loadedmetadata metadata can consist of more than just duration — if you want to wait for all the metadata to download before doing something, you can detect the loadedmetadata event. myaudio.addeventlistener("loadedmetadata", function() { //you can display the duration now }); loadeddata the loadeddata event is fired when the first bit of media arrives. the playhead is in position but not quite ready to play. myaudio.addeventlistener("loadeddata", function() { //you could display the playhead now }); progress the progress event indicates that the download of media is still in progress. it is good practice to display some kind of 'loader' at this point. myaudio.addeventlistener("progress", function() { // you could let the user know the media is downloading }); can...
...but it would be nice to be able to navigate the audio using the progress bar. fortunately this isn't too difficult to implement. ...
... there are a ...
...And 3 more matches
<input type="text"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › text
base. a note on styling there are useful pseudo-classes available for styling form elements to help the user see when their values are valid or invalid. these are :valid and :invalid. in this section, we'll use the following css, which will place a check (tick) mark next to inputs containing valid values, and a cross (x) next to inputs containing invalid values. div { margin-bottom: 10px; position: relative; } input + span { padding-right: 30px; } input:invalid+span:after { position: absolute; content: '✖'; padding-left: 5px; } input:valid+span:after { position: absolute; content: '✓'; padding-left: 5px; } the technique also requires a <span> element to be placed after the form element, which acts as a holder for the icons. this was necessary because some input types on...
...well. making input required you can use the required attribute as an easy way of making entering a value required before form submission is allowed: <form> <div> <label for="uname">choose a username: </label> <input type="text" id="uname" name="name" required> <span class="validity"></span> </div> <div> <button>submit</button> </div> </form> div { margin-bottom: 10px; position: relative; } input + span { padding-right: 30px; } input:invalid+span:after { position: absolute; content: '✖'; padding-left: 5px; } input:valid+span:after { position: absolute; content: '✓'; padding-left: 5px; } this renders like so: if you try to submit the form with no search term entered into it, the browser will show an error message. input value length you can specify a minimum l...
...elow requires that the entered value be 4–8 characters in length. <form> <div> <label for="uname">choose a username: </label> <input type="text" id="uname" name="name" required size="10" placeholder="username" minlength="4" maxlength="8"> <span class="validity"></span> </div> <div> <button>submit</button> </div> </form> div { margin-bottom: 10px; position: relative; } input + span { padding-right: 30px; } input:invalid+span:after { position: absolute; content: '✖'; padding-left: 5px; } input:valid+span:after { position: absolute; content: '✓'; padding-left: 5px; } this renders like so: if you try to submit the form with less than 4 characters, you'll be given an appropriate error message (which differs between browsers). if you try to ent...
...And 3 more matches
Using Promises - JavaScript
console.log(`got the final result: ${finalresult}`); } catch(error) { failurecallback(error); } } it builds on promises, e.g. dosomething() is the same function as before. you can read more about the syntax here. promises solve a fundamental flaw with the callback pyramid of doom, by catching all errors, even thrown exceptions and programming errors. this is essential for functional composition of asynchronous operations. promise rejection events whenever a promise is rejected, one of two events is sent to the global scope (generally, this is either the window or, if being used in a web worker, it's the worker or other worker-based interface). the two events are: rejectionhandled sent when a promise is rejected, after that rejection has been handled by the executor's reject functi...
...est possible level, and then never call them directly again: const wait = ms => new promise(resolve => settimeout(resolve, ms)); wait(10*1000).then(() => saysomething("10 seconds")).catch(failurecallback); basically, the promise constructor takes an executor function that lets us resolve or reject a promise manually. since settimeout() doesn't really fail, we left out reject in this case. composition promise.resolve() and promise.reject() are shortcuts to manually create an already resolved or rejected promise respectively. this can be useful at times. promise.all() and promise.race() are two composition tools for running asynchronous operations in parallel. we can start operations in parallel and wait for them all to finish like this: promise.all([func1(), func2(), func3()]) .then(([resu...
...olved or rejected promise respectively. this can be useful at times. promise.all() and promise.race() are two composition tools for running asynchronous operations in parallel. ...
...And 3 more matches
String.prototype.indexOf() - JavaScript
d us a pull request. note: for the array method, see array.prototype.indexof(). syntax str.indexof(searchvalue [, fromindex]) parameters searchvalue the string value to search for. if no string is explicitly provided, searchvalue will be coerced to "undefined", and this value will be searched for in str. so, for example: 'undefined'.indexof() will return 0, as undefined is found at position 0 in the string undefined. 'undefine'.indexof() however will return -1, as undefined is not found in the string undefine. fromindex optional an integer representing the index at which to start the search. defaults to 0. for fromindex values lower than 0, or greater than str.length, the search starts at index 0 and str.length, respectively. for example, 'hello world'.indexof('o', -5) wil...
...'undefine'.indexof() however will return -1, as undefined is not found in the string undefine. fromindex optional an integer representing the index at which to start the search. defaults to 0. for fromindex values lower than 0, or greater than str.length, the search starts at index 0 and str.length, respectively. for example, 'hello world'.indexof('o', -5) will return 4, as it starts at position 0, and o is found at position 4. on the other hand, 'hello world'.indexof('o', 11) (and with any fromindex value greater than 11) will return -1, as the search is started at position 11, a position after the end of the string. return value the index of the first occurrence of searchvalue, or -1 if not found. an empty string searchvalue produces strange results. with no fromindex value, or a...
... ...
...And 3 more matches
stroke-linejoin - SVG: Scalable Vector Graphics
--> <path d="m3,11 a2,2 0,0,0 2,-3 a3,3 0 0 1 2,3.5" stroke="black" fill="none" stroke-linejoin="miter-clip" /> <!-- bottom right path: effect of the "arcs" value with fallback to "miter" if not supported. ...
...roke at the join point with arcs that have the same curvature as the outer edges at the join point. ...
...ink" /> </g> </svg> bevel the bevel value indicates that a bevelled corner is to be used to join path segments. example html,body,svg { height:100% } <svg viewbox="0 0 6 6" xmlns="http://www.w3.org/2000/svg"> <!-- effect of the "bevel" value --> <path d="m1,5 l2,-3 l2,3" stroke="black" fill="none" stroke-linejoin="bevel" /> <!-- the following pink lines highlight the position of the path for each stroke --> <g id="p"> <path d="m1,5 l2,-3 l2,3" stroke="pink" fill="none" stroke-width="0.025" /> <circle cx="1" cy="5" r="0.05" fill="pink" /> <circle cx="3" cy="2" r="0.05" fill="pink" /> <circle cx="5" cy="5" r="0.05" fill="pink" /> </g> </svg> miter the miter value indicates that a sharp corner is to be used to join path segments. the c...
...And 3 more matches
SeaMonkey - making custom toolbar (SM ver. 1.x) - Archive of obsolete content
ozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script type="application/javascript" src="chrome://custombutton/content/button.js"/> <!-- browser --> <toolbar id="nav-bar"> <hbox id="nav-bar-buttons"> <toolbarbutton id="custom-button-1"/> </hbox> </toolbar> <!-- address book --> <toolbar id="abtoolbar"> <hbox id="toolbar_button_box"> <toolbarbutton id="custom-button-1" position="8"/> </hbox> </toolbar> <!-- message compose --> <toolbar id="composetoolbar"> <hbox id="toolbar_button_box"> <toolbarbutton id="custom-button-1" position="8"/> </hbox> </toolbar> <!-- mail, message --> <hbox id="toolbar_button_box"> <toolbarbutton id="custom-button-1" position="15"/> </hbox> <!-- composer --> <toolbar id="edittoolbar"> <toolbarbutton id="custom-button...
.../> </hbox> </toolbar> <!-- message compose --> <toolbar id="composetoolbar"> <hbox id="toolbar_button_box"> <toolbarbutton id="custom-button-1" position="8"/> </hbox> </toolbar> <!-- mail, message --> <hbox id="toolbar_button_box"> <toolbarbutton id="custom-button-1" position="15"/> </hbox> <!-- composer --> <toolbar id="edittoolbar"> <toolbarbutton id="custom-button-1" position="18"/> </toolbar> <!-- chat --> <menubar id="mainmenu"> <menu id="custom-menu" position="4" label="custom" accesskey="c"> <menupopup> <menuitem id="custom-item-1" label="custom item 1" accesskey="1" tooltiptext="my custom menu item" oncommand="custombutton[1]()" /> </menupopup> </menu> </menubar> <!-- calendar --> <toolbar id="ca...
...inmenu"> <menu id="custom-menu" position="4" label="custom" accesskey="c"> <menupopup> <menuitem id="custom-item-1" label="custom item 1" accesskey="1" tooltiptext="my custom menu item" oncommand="custombutton[1]()" /> </menupopup> </menu> </menubar> <!-- calendar --> <toolbar id="calendar-bar"> <toolbarbutton id="custom-button-1" position="10"/> </toolbar> <!-- button details --> <toolbarbutton id="custom-button-1" label="custom" tooltiptext="my custom toolbar button" oncommand="custombutton[1]()" class="toolbarbutton-1 custombutton" /> </overlay> optionally customize the file by changing the label, accesskey and tooltiptext attributes. change the text between double-quote characters on those lines. optionall...
...And 2 more matches
scrollbox - Archive of obsolete content
if you just want scrollbars to appear, add style='overflow: auto;'. this may also be used with any other container element. ...
...at happens depends on the enclosing elements; often the content is just clipped off on the bottom or right (depending on what's too big to fit). <vbox> <label value="01 four score and seven years ago "/> <label value="02 our fathers brought forth on "/> <label value="03 this continent, a new nation, "/> <label value="04 conceived in liberty, and "/> <label value="05 dedicated to the proposition "/> <label value="06 that all men are created equal."/> </vbox> the next bunch of labels is similar, but if the container doesn't give enough room for it, scroll bars will sprout out of nowhere and allow the user to scroll around the big content in the small view space. for the most part, the horizontal and vertical scrollbars will independently handle too-tall and too-wide cases, but each sc...
... the other one if it's close to the edge anyway. use overflow:scroll if you want the scroll bars on all the time. <vbox flex="1" style="overflow:auto"> <label value="01 four score and seven years ago "/> <label value="02 our fathers brought forth on "/> <label value="03 this continent, a new nation, "/> <label value="04 conceived in liberty, and "/> <label value="05 dedicated to the proposition "/> <label value="06 that all men are created equal."/> </vbox> the flex="1" above may or may not be needed, or even desired. in our case an enclosing element also was overflow:auto. if the user made the window smaller, the outer box would get smaller in response and sprout its scroll bars. we wanted our vbox to get smaller and sprout its scroll bars instead. note that this example doesn't u...
...And 2 more matches
XForms Input Element - Archive of obsolete content
c). attributes ui common appearance - the value of this attribute gives a hint to the xforms processor as to which type of widget(s) to use to represent this control accesskey - used to specify the keyboard shortcut for focusing this control single-node binding special inputmode - not supported for this control incremental - supported. the default value is 'false'. mozilla extensions labelposition - only for boolean types: show the label before or after the checkbox (see below) type restrictions the input element can be bound to a node containing simple content of any data type except xsd:base64binary, xsd:hexbinray or any data type derived from these. representations the xforms input element can be represented by the following widgets for the spcified data types (or types derived from ...
...s the focus. checkbox most often used when the form author only needs a simple 'true', 'false', '1', or '0' response from the user (xhtml/xul). ...
...eckbox/> the corresponding label can be displayed before or after the checkbox by using the labelposition attribute. specific handling of attributes incremental - if "true" or this attribute is omitted from this element, then the instance node will be updated when the user checks or un-checks the checkbox. if "false" then the instance node will be updated when the checkbox loses the focus. labelposition - a mozilla xforms extension in the namespace http://www.mozilla.org/projects/xfor...009/extensions. this attribute is optional, possible values are before and after. the default value if omitted is after. it controls the display of the label relative to the checkbox. ...
...And 2 more matches
How to build custom form controls - Learn web development
want. to that end, we will split our css work into two parts: the first part will be the css rules absolutely necessary to make our control behave like a <select> element, and the second part will consist of the fancy styles used to make it look the way we want. required styles the required styles are those necessary to handle the three states of our control. .select { /* this will create a positioning context for the list of options; adding this to .select:focus-within will be a better option when fully supported */ position: relative; /* this will make our control become part of the text flow and sizable at the same time */ display : inline-block; } we need an extra class active to define the look and feel of our control when it is in its active state. because our control is...
... active state is visible, especially to keyboard users, that we use it as a default value. */ box-shadow: 0 0 3px 1px #227755; } now, let's handle the list of options: /* the .select selector here helps to make we only select element inside our control. */ .select .optlist { /* this will make sure our list of options will be displayed below the value and out of the html flow */ position : absolute; top : 100%; left : 0; } we need an extra class to handle when the list of options is hidden. this is necessary in order to manage the differences between the active state and the open state that do not exactly match. .select .optlist.hidden { /* this is a simple way to hide the list in an accessible way; we will talk more about accessibility in the end */ max-h...
...overflow : hidden; white-space : nowrap; text-overflow: ellipsis; vertical-align: top; } we don't need an extra element to design the down arrow; instead, we're using the :after pseudo-element. it could also be implemented using a simple background image on the select class. ...
...And 2 more matches
HTML text fundamentals - Learn web development
n'; } 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 i am married to a fish.</p>'; var solutionentry = htmlsolution; textarea.addeventlistener('input', updatecode); window.addeventlistener('load', updatecode); // stop tab key tabbing out of textarea and // make it write a tab at the caret position instead textarea.onkeydown = function(e){ if (e.keycode === 9) { e.preventdefault(); insertatcaret('\t'); } if (e.keycode === 27) { textarea.blur(); } }; function insertatcaret(text) { var scrollpos = textarea.scrolltop; var caretpos = textarea.selectionstart; var front = (textarea.value).substring(0, caretpos); var back = (textarea.value).substring(textarea.select...
... textarea.value = userentry; solution.value = 'show solution'; } updatecode(); }); var htmlsolution = '<ul>\n<li>milk</li>\n<li>eggs</li>\n<li>bread</li>\n<li>hummus</li>\n</ul>'; var solutionentry = htmlsolution; textarea.addeventlistener('input', updatecode); window.addeventlistener('load', updatecode); // stop tab key tabbing out of textarea and // make it write a tab at the caret position instead textarea.onkeydown = function(e){ if (e.keycode === 9) { e.preventdefault(); insertatcaret('\t'); } if (e.keycode === 27) { textarea.blur(); } }; function insertatcaret(text) { var scrollpos = textarea.scrolltop; var caretpos = textarea.selectionstart; var front = (textarea.value).substring(0, caretpos); var back = (textarea.value).substring(textarea.select...
...n<li>turn right</li>\n<li>go straight across the first two roundabouts</li>\n<li>turn left at the third roundabout</li>\n<li>the school is on your right, 300 meters up the road</li>\n</ol>'; var solutionentry = htmlsolution; textarea.addeventlistener('input', updatecode); window.addeventlistener('load', updatecode); // stop tab key tabbing out of textarea and // make it write a tab at the caret position instead textarea.onkeydown = function(e){ if (e.keycode === 9) { e.preventdefault(); insertatcaret('\t'); } if (e.keycode === 27) { textarea.blur(); } }; function insertatcaret(text) { var scrollpos = textarea.scrolltop; var caretpos = textarea.selectionstart; var front = (textarea.value).substring(0, caretpos); var back = (textarea.value).substring(textarea.select...
...And 2 more matches
Object building practice - Learn web development
(otherwise known as collision detection). getting started to begin with, make local copies of our index.html, style.css, and main.js files. these contain the following, respectively: a very simple html document featuring an <h1> element, a <canvas> element to draw our balls on, and elements to apply our css and javascript to our html. some very simple styles, which mainly serve to style and position the <h1>, and get rid of any scrollbars or margin around the edge of the page (so that it looks nice and neat). some javascript that serves to set up the <canvas> element and provide a general function that we're going to use. the first part of the script looks like so: const canvas = document.queryselector('canvas'); const ctx = canvas.getcontext('2d'); const width = canvas.width = window.
...er (ctx). the context is like the paper, and now we want to command our pen to draw something on it: first, we use beginpath() to state that we want to draw a shape on the paper. next, we use fillstyle to define what color we want the shape to be — we set it to our ball's color property. next, we use the arc() method to trace an arc shape on the paper. its parameters are: the x and y position of the arc's center — we are specifying the ball's x and y properties. the radius of the arc — in this case, the ball's size property. the last two parameters specify the start and end number of degrees around the circle that the arc is drawn between. here we specify 0 degrees, and 2 * pi, which is the equivalent of 360 degrees in radians (annoyingly, you have to specify this in radians...
...aller visible viewport that remains when the console opens. type in the following to create a new ball instance: let testball = new ball(50, 100, 4, 4, 'blue', 10); try calling its members: testball.x testball.size testball.color testball.draw() when you enter the last line, you should see the ball draw itself somewhere on the canvas. updating the ball's data we can draw the ball in position, but to actually move the ball, we need an update function of some kind. add the following code at the bottom of your javascript file, to add an update() method to the ball()'s prototype: ball.prototype.update = function() { if ((this.x + this.size) >= width) { this.velx = -(this.velx); } if ((this.x - this.size) <= 0) { this.velx = -(this.velx); } if ((this.y + this.size) >=...
...And 2 more matches
Implementing feature detection - Learn web development
blems — the geolocation api (which exposes available location data for the device the web browser is running on) has the main entry point for its use, a geolocation property available on the global navigator object. therefore, you can detect whether the browser supports geolocation or not by using something like the following: if ("geolocation" in navigator) { navigator.geolocation.getcurrentposition(function(position) { // show the location on a map, perhaps using the google maps api }); } else { // give the user a choice of static maps instead perhaps } it is probably better to use an established feature detection library however, rather than writing your own all the time. modernizr is the industry standard for feature detection tests, and we'll look at that later on. before we mo...
...w) with a valid google maps api key. to get a key, sign in to a google account, go to the get a key/authentication page, then click the blue get a key button and follow the instructions. ...
...ogle maps api key. to get a key, sign in to a google account, go to the get a key/authentication page, then click the blue get a key button and follow the instructions. ...
...And 2 more matches
Gecko info for Windows accessibility vendors
uses the bullet bstr role to expose bullets and numbers that are automatically inserted into the formatting by gecko. in addition, role_list with state_readonly and role_listitem are used to expose the list structure. this makes it important to check the state_readonly flag when encountering a role_list, because the html list form element also uses role_list, but without state_readonly set. ...
...for example, "3 of 5" indicates the 3rd object out of 5. ...
...st form element also uses role_list, but without state_readonly set. positional descriptions are supported the accdescription field is overriden for the following roles: role_listitem, role_menuitem, role_radiobutton, role_pagetab and role_outlineitem for everything other than outline item, the positional description is in the form "n of m" where n is an integer indicating the position within other similar objects in a group, and m represents the number of objects in that group. for example, "3 of 5" indicates the 3rd object out of 5. ...
...And 2 more matches
nsIMutableArray
parameters element the element to append. weak whether or not to store the element using a weak reference. exceptions thrown ns_error_failure when a weak reference is requested, but the element does not support nsiweakreference. clear() clear the entire array, releasing all stored objects. void clear(); parameters none. ...
...weak whether or not to store the element using a weak reference. exceptions thrown ns_error_failure when a weak reference is requested, but the element does not support nsiweakreference. clear() clear the entire array, releasing all stored objects. void clear(); parameters none. insertelementat() insert an element at the given position, moving the element currently located in that position, and all elements in higher position, up by one. ...
...ire array, releasing all stored objects. void clear(); parameters none. insertelementat() insert an element at the given position, moving the element currently located in that position, and all elements in higher position, up by one. void insertelementat( in nsisupports element, in unsigned long index, in boolean weak ); parameters element the element to insert. index the position in the array: if the position is lower than the current length of the array, the elements at that position and onwards are bumped one position up. if the position is equal to the current length of the array, the new element is appended. an index lower than 0 or higher than the current length of the array is invalid and will be ignored. weak whether or not to store the element using a weak...
...And 2 more matches
nsISHEntry
in nsiinputstream inputstream, in nsilayouthistorystate layouthistorystate, in nsisupports cachekey, in acstring contenttype, in nsisupports owner, in unsigned long long docshellid, in boolean dynamiccreation); native code only! ...
...crollposition(out long x, out long y); void getviewerbounds(in nsintrect bounds); native code only! 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. contenttype acstring indicates the content-type of the document that...
...istory.pushstate(). docshellid unsigned long long the history id of the docshell. document nsidomdocument dom document. obsolete since gecko 1.8 expirationstatus boolean indicates whether the page is already expired in cache. id unsigned long an id to help identify this entry from others during subframe navigation. layouthistorystate nsilayouthistorystate layouthistorystate for scroll position and form values. loadtype unsigned long the loadtype for this entry. this is typically loadhistory except when reload is pressed, it has the appropriate reload flag. owner nsisupports get the owner, if any, that was associated with the channel that the document that was loaded to create this history entry came from. pageidentifier unsigned long an integer that should be the same for two en...
...And 2 more matches
nsIScrollable
boolean specifying the visibility of the horizontal scrollbar. getscrollrange() obsolete since gecko 29.0 (firefox 29.0 / thunderbird 29.0 / seamonkey 2.26) void getscrollrange( in long scrollorientation, out long minpos, out long maxpos ); parameters scrollorientation an integer representing the orientation of the scrollbar. minpos minimal position of the scroll range. maxpos maximal position of the scroll range. setcurscrollpos() obsolete since gecko 29.0 (firefox 29.0 / thunderbird 29.0 / seamonkey 2.26) void setcurscrollpos( in long scrollorientation, in long curpos ); parameters scrollorientation an integer representing the orientation of the scrollbar. curpos an integer represent...
...scroll range. maxpos maximal position of the scroll range. setcurscrollpos() obsolete since gecko 29.0 (firefox 29.0 / thunderbird 29.0 / seamonkey 2.26) void setcurscrollpos( in long scrollorientation, in long curpos ); parameters scrollorientation an integer representing the orientation of the scrollbar. curpos an integer representing the position of the cursor. setcurscrollposex() obsolete since gecko 29.0 (firefox 29.0 / thunderbird 29.0 / seamonkey 2.26) void setcurscrollposex( in long curhorizontalpos, in long curverticalpos ); parameters curhorizontalpos an integer representing the horizontal position of the cursor. ...
... setdefaultscrollbarpreferences() void setdefaultscrollbarpreferences( in long scrollorientation, in long scrollbarpref ); parameters scrollorientation an integer representing the orientation of the scrollbar. scrollbarpref an integer representing the state of the scrollbar. ...
...And 2 more matches
nsITextInputProcessorCallback
tions to ime from gecko. this interface has a "function" attribute. therefore, js-ime can implement this as a function. ...
...an implement this as a function. ...
... createinstance(components.interfaces.nsitextinputprocessor); } if (!this._tip.begininputtransaction(window, this._callback)) { return false; } ... ...
...And 2 more matches
Waterfall - Firefox Developer Tools
mputed styles that apply to page elements. restyle hint a string indicating what kind of restyling is needed. the hint may be any of: self subtree latersiblings csstransitions cssanimations svgattranimations styleattribute styleattribute_animations force forcedescendants layout calculating the position and size of page elements. this operation is sometimes called "reflow". paint drawing pixels to the screen. garbage collection garbage collection event. non-incremental gc events are labeled "(non-incremental)". reason a string indicating the reason gc was performed. non-incremental reason if the gc...
... the page in response to some event: javascript function call: some event - for example, a dom event - causes some javascript in the page to run. the javascript changes some of the page's dom or cssom. recalculate style: if the browser thinks the computed styles for page elements have changed, it must then recalculate them. layout: next, the browser uses the computed styles to figure out the position and geometry for the elements. this operation is labeled "layout" but is also sometimes called "reflow". paint: finally, the browser needs to repaint the elements to the screen. one last step is not shown in this sequence: the page may be split into layers, which are painted independently and then combined in a process called "composition". this sequence needs to fit into a single frame, since...
...ons will appear smooth. for a rate of 60 frames per second, that gives the browser 16.7 milliseconds to execute the complete flow. importantly for responsiveness, the browser doesn't always have to go through every step: css animations update the page without having to run any javascript. not all css property changes cause a reflow. changing properties that can alter an object's geometry and position, such as width, display, font-size, or top, will cause a reflow. however, changing properties that don't alter geometry or position, such as color or opacity, will not. not all css property changes cause a repaint. in particular, if you animate an element using the transform property, the browser will use a separate layer for the transformed element, and doesn't even have to repaint when the ele...
...And 2 more matches
IDBCursor - Web APIs
Web › API › IDBCursor
note: not to be confused with idbcursorwithvalue which is just an idbcursor interface with an additional value property. the idbcursor interface of the indexeddb api represents a cursor for traversing or iterating over multiple records in a database. the cursor has a source that indicates which index or object store it is iterating over. it has a position within the range, and moves in a direction that is increasing or decreasing in the order of record keys. the cursor enables an application to asynchronously process all the records in the cursor's range. you can have an unlimited number of cursors at the same time. you always get the same idbcursor object representing a given cursor. operations are performed on the underlying index or object store. note: this feature is available in web wo...
...or idbindex that the cursor is iterating. this function never returns null or throws an exception, even if the cursor is currently being iterated, has iterated past its end, or its transaction is not active. idbcursor.direction read only returns the direction of traversal of the cursor. see constants for possible values. idbcursor.key read only returns the key for the record at the cursor's position. if the cursor is outside its range, this is set to undefined. the cursor's key can be any data type. idbcursor.primarykey read only returns the cursor's current effective primary key. if the cursor is currently being iterated or has iterated outside its range, this is set to undefined. the cursor's primary key can be any data type. idbcursor.request read only returns the idbrequest that wa...
....primarykey read only returns the cursor's current effective primary key. if the cursor is currently being iterated or has iterated outside its range, this is set to undefined. the cursor's primary key can be any data type. idbcursor.request read only returns the idbrequest that was used to obtain the cursor. ...
...And 2 more matches
KeyboardEvent - Web APIs
interaction the user had with a key on the keyboard at a low level, providing no contextual meaning to that interaction. when you need to handle text input, use the input event instead. keyboard events may not be fired if the user is using an alternate means of entering text, such as a handwriting system on a tablet or graphics tablet. ...
...t input, use the input event instead. keyboard events may not be fired if the user is using an alternate means of entering text, such as a handwriting system on a tablet or graphics tablet. ...
... space bar. dom_key_location_left 0x01 the key is one which may exist in multiple locations on the keyboard and, in this instance, is on the left side of the keyboard. examples include the left control key, the left command key on a macintosh keyboard, or the left shift key. dom_key_location_right 0x02 the key is one which may exist in multiple positions on the keyboard and, in this case, is located on the right side of the keyboard. examples include the right shift key and the right alt key (option on a mac keyboard). dom_key_location_numpad 0x03 the key is located on the numeric keypad, or is a virtual key associated with the numeric keypad if there's more than one place the key could originate from. the numlock ke...
...And 2 more matches
SVGSVGElement - Web APIs
the svgsvgelement interface provides access to the properties of <svg> elements, as well as methods to manipulate them. this interface contains also various miscellaneous commonly-used utility methods, such as matrix operations and the ability to control the time of redraw on visual rendering devices. ...
... them. this interface contains also various miscellaneous commonly-used utility methods, such as matrix operations and the ability to control the time of redraw on visual rendering devices. ...
...an svganimatedlength corresponding to the height attribute of the given <svg> element. svgsvgelement.contentscripttype an svganimatedlength corresponding to the contentscripttype attribute of the given <svg> element. svgsvgelement.contentstyletype an svganimatedlength corresponding to the contentstyletype attribute of the given <svg> element. svgsvgelement.viewport an svgrect containing the position and size of the viewport (implicit or explicit) that corresponds to the given <svg> element. when the browser is actually rendering the content, then the position and size values represent the actual values when rendering. the position and size values are unitless values in the coordinate system of the parent element. if no parent element exists (i.e., <svg> element represents the root of the doc...
...And 2 more matches
SVGTextContentElement - Web APIs
the svgtextcontentelement interface is implemented by elements that support rendering child text content. it is inherited by various text-related interfaces, such as svgtextelement, svgtspanelement, svgtrefelement, svgaltglyphelement and svgtextpathelement. ...
...y elements that support rendering child text content. it is inherited by various text-related interfaces, such as svgtextelement, svgtspanelement, svgtrefelement, svgaltglyphelement and svgtextpathelement. ...
...returns a float representing the computed length of the formatted text advance distance for a substring of text within the element. note that this method only accounts for the widths of the glyphs in the substring and any extra spacing inserted by the css 'letter-spacing' and 'word-spacing' properties. visual spacing adjustments made by the 'x' attribute is ignored. svgtextcontentelement.getstartpositionofchar() returns a dompoint representing the position of a typographic character after text layout has been performed. note: in svg 1.1 this method returned an svgpoint. svgtextcontentelement.getendpositionofchar() returns a dompoint representing the trailing position of a typographic character after text layout has been performed. note: in svg 1.1 this method returned an svgpoint. svgte...
...And 2 more matches
SVGTextElement - Web APIs
the svgtextelement interface corresponds to the <text> elements. ...
... the svgtextelement interface corresponds to the <text> elements. ...
..."#fff" stroke="#d4dde4" stroke-width="2px" /><text x="156" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgtextcontentelement</text></a><polyline points="51,89 41,84 41,94 51,89" stroke="#d4dde4" fill="none"/><line x1="41" y1="89" x2="11" y2="89" stroke="#d4dde4"/><a xlink:href="/docs/web/api/svgtextpositioningelement" target="_top"><rect x="-239" y="65" width="250" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="-114" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgtextpositioningelement</text></a><polyline points="-239,89 -249,84 -249,94 -239,89" stroke="#d4dde4" fill="none"/><l...
...And 2 more matches
WebGL2RenderingContext.vertexAttribIPointer() - Web APIs
ngcontext.vertexattribpointer(). the main difference is that while values specified by vertexattribpointer are always interpreted as floating-point values in the shader (even if they were originally specified as integers in the buffer), this method allows specifying values which are interpreted as integers in the shader. examples linear blend skinning //describe the layout of the buffer: //1. position gl.vertexattribpointer(0, 3, gl.float, false, 20, 0); gl.enablevertexattribarray(0); //2. bone weights, normalized to [0, 1] gl.vertexattribpointer(1, 4, gl.unsigned_byte, true, 20, 12); gl.enablevertexattribarray(1); //3. bone indices, interpreted as integer gl.vertexattribipointer(2, 4, gl.unsigned_byte, 20, 16); gl.enablevertexattribarray(2); //connect to attributes from the vertex shader gl.
..., false, 20, 0); gl.enablevertexattribarray(0); //2. bone weights, normalized to [0, 1] gl.vertexattribpointer(1, 4, gl.unsigned_byte, true, 20, 12); gl.enablevertexattribarray(1); //3. ...
..., 4, gl.unsigned_byte, 20, 16); gl.enablevertexattribarray(2); //connect to attributes from the vertex shader gl.bindattriblocation(shaderprogram, 0, "position"); gl.bindattriblocation(shaderprogram, 1, "boneweights"); gl.bindattriblocation(shaderprogram, 2, "boneindices"); <script id="shader-vs" type="x-shader/x-vertex">#version 300 es uniform mat4 mvmatrix; uniform mat4 bones[120]; in vec3 position; in vec4 boneweights; in uvec4 boneindices;//read as 4-component unsigned integer void main() { vec4 skinnedposition = bones[boneindices.s] * vec4(position, 1.0) * boneweights.s + bones[boneindices.t] * vec4(position, 1.0) * boneweights.t + bones[boneindices.p] * vec4(position, 1.0) * boneweights.p + bones[boneindices.q] * vec4(position, 1.0) * boneweights.q; ...
...And 2 more matches
WebGLRenderingContext.enableVertexAttribArray() - Web APIs
by the value of webglrenderingcontext.max_vertex_attribs. example this code — a snippet taken from the full example a basic 2d webgl animation example — shows the use of enablevertexarray() to activate the attribute that will be used by the webgl layer to pass individual vertexes from the vertex buffer into the vertex shader function. ...
... example this code — a snippet taken from the full example a basic 2d webgl animation example — shows the use of enablevertexarray() to activate the attribute that will be used by the webgl layer to pass individual vertexes from the vertex buffer into the vertex shader function. gl.bindbuffer(gl.array_buffer, vertexbuffer); avertexposition = gl.getattriblocation(shaderprogram, "avertexposition"); gl.enablevertexattribarray(avertexposition); gl.vertexattribpointer(avertexposition, vertexnumcomponents, gl.float, false, 0, 0); gl.drawarrays(gl.triangles, 0, vertexcount); this code snippet is taken from the function animatescene() in "a basic 2d webgl animation example." see that article for the full sample and to see the resulting animation in action. this code sets the buffer o...
...ents, gl.float, false, 0, 0); gl.drawarrays(gl.triangles, 0, vertexcount); this code snippet is taken from the function animatescene() in "a basic 2d webgl animation example." see that article for the full sample and to see the resulting animation in action. this code sets the buffer of vertexes that will be used to draw the triangles of the shape by calling bindbuffer(). ...
...And 2 more matches
Matrix math for the web - Web APIs
]; what does multiplying by the identity matrix look like? the easiest example is to multiply a single point by the identity matrix. since a 3d point only needs three values (x, y, and z), and the transformation matrix is a 4x4 value matrix, we need to add a fourth dimension to the point. by convention, this dimension is called the perspective, and is represented by the letter w. for a typical position, setting w to 1 will make the math work out. after adding the w component to the point, notice how neatly the matrix and the point line up: [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1] [4, 3, 2, 1] // point at [x, y, z, w] the w component has some additional uses that are out of scope for this article. check out the webgl model view projection article for a look into how it comes in ...
... have to be able to tilt or rotate the cup to pour the coffee into your mouth. we'll look at the type of matrix (cleverly called a rotation matrix) you use to do this later. let x = 50; let y = 100; let z = 0; let translationmatrix = [ 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, x, y, z, 1 ]; place the distances along the three axes in the corresponding positions in the translation matrix, then multiply it by the point or matrix you need to move through 3d space. manipulating the dom with a matrix a really easy way to start using a matrix is to use the css matrix3d() transform. first we'll set up a simple <div> with some content. the style is not shown, but it's set to a fixed width and height and is centered on the page. the <div> has a transition set...
...when matrices of a certain class are multiplied together they preserve the history of the transformations and are reversible. this means that if a translation, rotation, and scale matrix are all combined together, when the order of the matrices is reversed and re-applied then the original points are returned. the order that matrices are ...
...And 2 more matches
Using textures in WebGL - Web APIs
0.0, 1.0, 0.0, 1.0, 1.0, 0.0, 1.0, // bottom 0.0, 0.0, 1.0, 0.0, 1.0, 1.0, 0.0, 1.0, // right 0.0, 0.0, 1.0, 0.0, 1.0, 1.0, 0.0, 1.0, // left 0.0, 0.0, 1.0, 0.0, 1.0, 1.0, 0.0, 1.0, ]; gl.bufferdata(gl.array_buffer, new float32array(texturecoordinates), gl.static_draw); ... return { position: positionbuffer, texturecoord: texturecoordbuffer, indices: indexbuffer, }; first, this code creates a webgl buffer into which we'll store the texture coordinates for each face, then we bind that buffer as the array we'll be writing into. the texturecoordinates array defines the texture coordinates corresponding to each vertex of each face. note that the texture coordinates range fro...
...pping array, we pass the array into the buffer, so that webgl has that data ready for its use. updating the shaders the shader program also needs to be updated to use the textures instead of solid colors. the vertex shader we need to replace the vertex shader so that instead of fetching color data, it instead fetches the texture coordinate data. ...
...ad of solid colors. the vertex shader we need to replace the vertex shader so that instead of fetching color data, it instead fetches the texture coordinate data. const vssource = ` attribute vec4 avertexposition; attribute vec2 atexturecoord; uniform mat4 umodelviewmatrix; uniform mat4 uprojectionmatrix; varying highp vec2 vtexturecoord; void main(void) { gl_position = uprojectionmatrix * umodelviewmatrix * avertexposition; vtexturecoord = atexturecoord; } `; the key change here is that instead of fetching the vertex color, we're fetching the texture coordinates and passing them to the vertex shader; this will indicate the location within the texture corresponding to the vertex. the fragment shader the fragment shader likewise needs to be upda...
...And 2 more matches
Lighting a WebXR setting - Web APIs
me in which the player has a special pair of yellow-tinted glasses, you can add a yellow ambient light. saturn's fifth-largest moon, tethys, bathed in sunlight, coming from the lower left. diffuse light diffuse light is light which is evenly and directionally emitted from or reflected off a surface. this is the majority of the light we usually see. diffuse light comes from a particular position or direction and casts shadows. due to its directionality, the faces of an object facing a diffuse light source will be brighter than the other faces. because the intensity of diffuse light depends on the angle of incidence (the angle between the vector representing the direction from which the light reaches the surface and the surface's normal vector or the vector perpendicular to the surface),...
...sest point to the light source and dimmer the farther away it is. even if the surface is flat, the closest point to the light source is the center, with rays becoming increasingly long as the angle away from the normal changes. photo of a spotlight shining upon a stucco wall at night. spot light sources a spot light source (or spotlight) is a light source which is located at a specific position, emitting a cone of light in the direction of its orientation vector. a tapering rate parameter defines how quickly the brightness of the light falls off at the edges of the cone of light, and, as with point lights, an attenuation parameter controls how the light fades over distance. at the edge of the light cone, the light ceases to affect the surface at all. computational costs of lighting t...
... and applied as appropriate to the pixel before the pixel is stored into the framebuffer. the color of each pixel in the final, rendered, scene is calculated using some intricate math that factors in things like: the color of the texture element (the pixel within the texture mapped onto the object; also known as a texel) corresponding to the screen pixel, given the object geometry, the viewer position and orientation relative to each polygon, and so forth. the viewer position and distance. the surface material and reflectivity. the concavity or convexity of the surface at the target location. the position, color, directionality, and brightness of each light source in the scene. the color and brightness of any ambient light in the scene; this is light which is applied equally throughout th...
...And 2 more matches
Window.screenLeft - Web APIs
Web › API › Window › screenLeft
dowpos = window.screenleft returns a number equal to the number of css pixels from the left edge of the browser viewport to the left edge of the screen. examples in our screenleft-screentop example, you'll see a canvas onto which has been drawn a circle. ...
...ber equal to the number of css pixels from the left edge of the browser viewport to the left edge of the screen. examples in our screenleft-screentop example, you'll see a canvas onto which has been drawn a circle. in this example we are using screenleft/screentop plus window.requestanimationframe() to constantly redraw the circle in the same physical position on the screen, even if the window position is moved. ...
...t-screentop example, you'll see a canvas onto which has been drawn a circle. in this example we are using screenleft/screentop plus window.requestanimationframe() to constantly redraw the circle in the same physical position on the screen, even if the window position is moved. ...
...And 2 more matches
Window.screenTop - Web APIs
Web › API › Window › screenTop
windowpos = window.screentop returns a number equal to the number of css pixels from the top edge of the browser viewport to the top edge of the screen. examples in our screenleft-screentop example, you'll see a canvas onto which has been drawn a circle. ...
...umber equal to the number of css pixels from the top edge of the browser viewport to the top edge of the screen. examples in our screenleft-screentop example, you'll see a canvas onto which has been drawn a circle. in this example we are using screenleft/screentop plus window.requestanimationframe() to constantly redraw the circle in the same physical position on the screen, even if the window position is moved. ...
...t-screentop example, you'll see a canvas onto which has been drawn a circle. in this example we are using screenleft/screentop plus window.requestanimationframe() to constantly redraw the circle in the same physical position on the screen, even if the window position is moved. ...
...And 2 more matches
Window.screenX - Web APIs
Web › API › Window › screenX
returns a number equal to the number of css pixels from the left edge of the browser viewport to the left edge of the screen. examples in our screenleft-screentop (source code) example, you'll see a canvas onto which has been drawn a circle. ...
...ss pixels from the left edge of the browser viewport to the left edge of the screen. examples in our screenleft-screentop (source code) example, you'll see a canvas onto which has been drawn a circle. in this example we are using window.screenleft/window.screentop plus window.requestanimationframe() to constantly redraw the circle in the same physical position on the screen, even if the window position is moved. ...
...ample, you'll see a canvas onto which has been drawn a circle. in this example we are using window.screenleft/window.screentop plus window.requestanimationframe() to constantly redraw the circle in the same physical position on the screen, even if the window position is moved. ...
...And 2 more matches
Window.screenY - Web APIs
Web › API › Window › screenY
window.screeny returns a number equal to the number of css pixels from the top edge of the browser viewport to the top edge of the screen. examples in our screenleft-screentop example, you'll see a canvas onto which has been drawn a circle. ...
... the number of css pixels from the top edge of the browser viewport to the top edge of the screen. examples in our screenleft-screentop example, you'll see a canvas onto which has been drawn a circle. in this example we are using window.screenleft/window.screentop plus window.requestanimationframe() to constantly redraw the circle in the same physical position on the screen, even if the window position is moved. ...
...ample, you'll see a canvas onto which has been drawn a circle. in this example we are using window.screenleft/window.screentop plus window.requestanimationframe() to constantly redraw the circle in the same physical position on the screen, even if the window position is moved. ...
...And 2 more matches
XRReferenceSpace - Web APIs
following methods. 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). the new reference space can be used to transform a coordinate from the reference space of the object on which the method is called into a different coordinate space. this is useful for positioning objects while rendering, and to perform the needed transforms when changing the viewer's position and/or orientation in 3d space. events in addition to other events that may be sent to xrspace or eventtarget objects, the following also apply to xrreferencespace objects. reset the reset event is sent to an xrreferencespace object when the browser detects a discontinuity has occurred wh...
...ich interface is used to implement them. xrreferencespacetype description interface bounded-floor similar to the local type, except the user is not expected to move outside a predetermined boundary, given by the boundsgeometry in the returned object. xrboundedreferencespace local a tracking space whose native origin is located near the viewer's position at the time the session was created. the exact position depends on the underlying platform and implementation. the user isn't expected to move much if at all beyond their starting position, and tracking is optimized for this use case. for devices with six degrees of freedom (6dof) tracking, the local reference space tries to keep the origin stable relative to the environment. xrrefere...
...if that floor level isn't known, the user agent will estimate the floor level. ...
...And 2 more matches
XRViewerPose - Web APIs
each xrviewerpose can have multiple views to represent, for example, the slight separation between the left and right eye. 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. ...
...ch eye that view represents. taken together, these views can reproduce the 3d effect when displayed on the xr device. usage notes the xrviewerpose object is used to describe the state of a viewer of a webxr scene as it's tracked by the user's xr hardware. the viewer may be the virtual representation of the user, or it may represent another device or interface which may serve as the source of a position and orientation that make up a view upon the scene. for example, every player in a mmorpg might have an instance of xrviewerpose to provide a way to calculate what they can see; if the game provides a mechanism that tells the player if another player sees them, or that they see another player, this information becomes crucial. an xrviewerpose is always obtained and referenced relative to an exis...
... the scene. for example, every player in a mmorpg might have an instance of xrviewerpose to provide a way to calculate what they can see; if the game provides a mechanism that tells the player if another player sees them, or that they see another player, this information becomes crucial. an xrviewerpose is always obtained and referenced relative to an existing xrreferencespace. this ensures that positions and orientations are reported using the expected relative coordinate system. to render a scene using the xrviewerpose representing the user's head, one would iterate over the views in the views array, rendering them one after another. by calling viewport() on the webgl context, specifying the xrview as input, you can get the viewport to use when rendering in order to draw the frame for that eye...
...And 2 more matches
ARIA Test Cases - Accessibility
of how a mashup widget can be built (the widget source simply comes from another url, and is tied in using an iframe) yui "carousel" listbox -- a more advanced test case expected at behavior: (mz) screen reader should announce the label and role of the listbox when it gains focus. if an item is focused within the list, this should be announced next, followed by an indication of this item's position within the list if the screen reader supports this in other lists as well. as focus moves within the list, the screen reader should announce the relevant list items. (al) what about multiple selection? what should happen as the user selects or unselects the current item, does a select all, uses shift+arrow to select, etc.? markup used: role="listbox", "option" (listitem should only be used ...
... - orca - - - - radiogroup and radiobutton radio example using css background images radio example using img element radio example using aria-activedescendent property dojo nightly build expected at behavior: on initial focus, the screen reader should announce the label of the radio group and the focused radio button, whether it is selected or not, and its position. as focus moves among the radio buttons, the newly focused radio button's label, state and position should be indicated. markup used: notes: results: at firefox ie opera safari jaws 9 - - n/a n/a jaws 10 - - - - voiceover (leopard) n/a n/a - fail window-eyes - - - - nvda - ...
... - - - - orca - - - - slider single slider slider using in-line images for thumb dojo nightly build simple slider pretty slider mindtrove rating widget paciello group slider expected at behavior: the user can navigate to the slider control in all modes. when the user navigates to the slider, the screen reader should announce the label, role and position of the slider. when not in a virtual buffer mode, the user can control the slider using keys such as the arrow keys, home and end. in virtual buffer mode, the slider exists in the virtual buffer as a single entity, and any images or text that create the sliders appearance are not presented to the user separately. note: if this does not work, it means the browser is exposing the children instead...
...And 2 more matches
ARIA: gridcell role - Accessibility
in the list of columns, and aria-rowindex to describe a gridcell's order in the list of rows. 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. this sample code demonstrates a table-style grouping of information where the third and fourth columns have been removed. ...
...the ids provided for aria-describedby should correspond to parent elements intended to be the rows and columns. by referencing the parent elemen...
...l" aria-colindex="2">burks</div> <div role="gridcell" aria-colindex="5">new york</div> <div role="gridcell" aria-colindex="6">14127</div> </div> </div> … </div> describing the position of gridcells when the overall structure is unknown in situations where the table-style grouping of content does not provide information about the columns and rows, gridcells must have their positions programatically described by using aria-describedby. the ids provided for aria-describedby should correspond to parent elements intended to be the rows and columns. ...
...And 2 more matches
Architecture - Accessibility
resentation together. everything else uses whatever nsaccessible-derived implementation that's appropriate. if it has text siblings, then it gets exposed as the unicode char for an embedded object, which is '\xfffc' within the parent nshypertextaccessible. in addition, nsiaccessiblehyperlink is implemented on any non-text child inside a container that also has text. this allows at's to find its position within that text, because the hyperlink interface exposes a start and end index. in fact, the end index will always be 1 larger than the start index, because the object is always represented by a single '\xfffc' character. if you want to know that something is really a link, check to see if it is role_link. html containers are implemented by nshypertextaccessible. they support the nsiaccessible...
...this. iaccessible2: same as nsiaccessible. text and whitespace leaf nodes are exposed, but are redundant with the information in the parent object's nsiaccessibletext. this is done for backward compatibility with older msaa clients which didn't have access to a text interface. the children of a hypertext object are a superset of the links it exposes. the new system makes it easier to show caret positions etc., which will be an improvement in ia2 over msaa. example take the following html code: <div>hello<a href="http://www.mozilla.org/access">my link<img src="image.gif">is cool</a>bye</div> both the <a> and <img> are hyperlinks also, both the <div> and <a> are hypertexts so the <a> is both a hypertext and a hyperlink, because it contains text and is contained within text. this means that we h...
...ts together in the container. nsiaccessibleeditabletext is supported if the area is potentially editable. if it's actually editable it will also provide state_editable. nsaccessible still represents any node in the tree. if the node is embedded in a parent that is an nsiaccessiblehypertext, the node will be exposed as an nsiaccessiblehyperlink. consumers can use this interface to determine the position of the object in the parent's text. nstextaccessible serves 2 purposes it is used by nshypertextaccessible to collect information about itself it is still exposed in msaa for backward compatibility by old windows assistive technologies. those at's don't yet know about any iaccessibletext yet, and want to see the hierarchy how they always did -- with text in leaf nodes. how does an at deal w...
...And 2 more matches
Auto-placement in CSS Grid Layout - CSS: Cascading Style Sheets
in addition to the ability to place items accurately onto a created grid, the css grid layout specification contains rules that control what happens when you create a grid and do not place some or all of the child items. you can see auto-placement in action in the simplest of ways by creating a grid on a set of items. if you give the items no placement information they will position themselves on the grid, one in each grid cell. * {box-sizing: border-box;} .wrapper { border: 2px solid #f76707; border-radius: 5px; background-color: #fff4e6; } .wrapper > div { border: 2px solid #ffa94d; border-radius: 5px; background-color: #ffd8a8; padding: 1em; color: #d9480f; } .wrapper { display: grid; grid-template-columns: repeat(3, 1fr); grid-gap: 10px; } ...
... solid #ffa94d; border-radius: 5px; background-color: #ffd8a8; padding: 1em; color: #d9480f; } <div class="wrapper"> <div>one</div> <div>two</div> <div>three</div> <div>four</div> <div>five</div> <div>six</div> <div>seven</div> <div>eight</div> </div> the order of auto placed items a grid can contain a mixture of items. some of the items may have a position on the grid, but others may be auto-placed. this can be helpful, if you have a document order that reflects the order in which items sit on the grid you may not need to write css rules to place absolutely everything. the specification contains a long section detailing the grid item placement algorithm, however for most of us we just need to remember a few simple rules for our items. order modifi...
...you have a document order that reflects the order in which items sit on the grid you may not need to write css rules to place absolutely everything. the specification contains a long section detailing the grid item placement algorithm, however for most of us we just need to remember a few simple rules for our items. order modified document order grid places items that have not been given a grid position in what is described in the specification as “order modified document order”. this means that if you have used the order property at all, the items will be placed by that order, not their dom order. otherwise they will stay by default in the order that they are entered in the document source. items with placement properties the first thing grid will do is place any items that have a positio...
...And 2 more matches
CSS Grid Layout and Accessibility - CSS: Cascading Style Sheets
those of us who have been doing web development for more years than we care to remember might consider that css grid is a little bit like using “tables for layout”. back in the early days of web design, the way we constructed page layout was to use html tables, then fragment our design into the cells of those tables in order to create a layout. this had some advantages over the “css positioning” that came afterwards, in that we could take advantage of the alignment and full height columns offered by table display. the biggest downside however was that it tied our design to the mark-up, often creating accessibility issues as it did so. in order to lay the design out in the table we often broke up the content in ways that made no sense at all when read out by a screen reader for exam...
...possible that we could create an accessibility issue through our use of grids? re-ordering content in css grid layout we’ve already seen in these guides that grid gives us power to re-order the content of our page in various ways. we can use the order property, which will change how items auto-place. we can use grid-auto-flow: dense which will take items visually out of dom order. we can also position items using line-based placement of grid template areas, without considering their location in the source. the specification includes a section that covers reordering and accessibility. in the introduction to that section are details of what the specification expects browsers to do when the content is visually reordered using grid layout. grid layout gives authors great powers of rearrangement...
...ering any time you reorder things with grid layout – or with flexbox – you only perform visual reordering. the underlying source is what controls things like text to speech, and the tab order of the document. you can see how this works with a very simple example. in this example i have used grid to lay out a set of boxes that contain links. i have used the line-based placement properties to position box 1 on the second row of the grid. visually it now appears as the fourth item in the list. however, if i tab from link to link the tab order still begins with box 1, as it comes first in the source. * {box-sizing: border-box;} .wrapper { border: 2px solid #f76707; border-radius: 5px; background-color: #fff4e6; } .wrapper > div { border: 2px solid #ffa94d; border-radius:...
...And 2 more matches
The stacking context - CSS: Cascading Style Sheets
ntext in the previous part of this article, using z-index, the rendering order of certain elements is influenced by their z-index value. this occurs because these elements have special properties which cause them to form a stacking context. a stacking context is formed, anywhere in the document, by any element in the following scenarios: root element of the document (<html>). element with a position value absolute or relative and z-index value other than auto. element with a position value fixed or sticky (sticky for all mobile browsers, but not older desktop). element that is a child of a flex (flexbox) container, with z-index value other than auto. element that is a child of a grid (grid) container, with z-index value other than auto. element with a opacity value less than 1 (see the s...
... stacked, the whole element is considered in the stacking order of the parent stacking context. note: the hierarchy of stacking contexts is a subset of the hierarchy of html elements because only certain elements create stacking contexts. we can say that elements that do not create their own stacking contexts are assimilated by the parent stacking context. the example in this example, every positioned element creates its own stacking context, because of their positioning and z-index values. the hierarchy of stacking contexts is organized as follows: root div #1 div #2 div #3 div #4 div #5 div #6 it is important to note that div #4, div #5 and div #6 are children of div #3, so stacking of those elements is completely resolved within div#3. on...
... results in a rendering order of 4.1 div #6 - z-index is 3, stacked under an element with a z-index of 4, which results in a rendering order of 4.3 div #4 - z-index is 6, stacked under an element with a z-index of 4, which results in a rendering order of 4.6 div #1 - z-index is 5 example html <div id="div1"> <h1>division element #1</h1> <code>position: relative;<br/> z-index: 5;</code> </div> <div id="div2"> <h1>division element #2</h1> <code>position: relative;<br/> z-index: 2;</code> </div> <div id="div3"> <div id="div4"> <h1>division element #4</h1> <code>position: relative;<br/> z-index: 6;</code> </div> <h1>division element #3</h1> <code>position: absolute;<br/> z-index: 4;</code> <div id="div5"> <h...
...And 2 more matches
Shorthand properties - CSS: Cascading Style Sheets
and property, you can write more concise (and often more readable) style sheets, saving time and energy. the css specification defines shorthand properties to group the definition of common properties acting on the same theme. for instance, the css background property is a shorthand property that's able to define the values of background-color, background-image, background-repeat, and background-position. similarly, the most common font-related properties can be defined using the shorthand font, and the different margins around a box can be defined using the margin shorthand. 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 mea...
... similarly, shorthands handling properties related to corners of a box, like border-radius, always use a consistent 1-to-4-value syntax representing those corners: the 1-value syntax: border-radius: 1em — the unique value represents all corner...
... similarly, shorthands handling properties related to corners of a box, like border-radius, always use a consistent 1-to-4-value syntax representing those corners: the 1-value syntax: border-radius: 1em — the unique value represents all corners the 2-value s...
...And 2 more matches
WebKit CSS extensions - CSS: Cascading Style Sheets
m-origin-y -webkit-transform-origin-z u -webkit-user-drag -webkit-user-modify * a few are on the standards, unprefixed track ** new syntax has been standardized. property links to the new synax. old prefixed syntax is still supported in some browsers. webkit-prefixed properties on the standards track -webkit-appearance -webkit-font-size-delta -webkit-mask-composite -webkit-mask-position-x -webkit-mask-position-y -webkit-mask-repeat-x -webkit-mask-repeat-y formerly proprietary properties that are now standard note: to maximize the compatibility of your css, you should use the unprefixed standard properties instead of the prefixed ones listed below. a -webkit-align-content -webkit-align-items -webkit-align-self -webkit-animation -webkit-animation-delay -webkit-a...
...d-row-end -webkit-grid-row-gap -webkit-grid-row-start -webkit-grid-template -webkit-grid-template-areas -webkit-grid-template-columns -webkit-grid-template-rows h-l -webkit-hyphens -webkit-justify-content -webkit-justify-items -webkit-justify-self -webkit-line-break m -webkit-mask -webkit-mask-clip -webkit-mask-composite -webkit-mask-image -webkit-mask-origin -webkit-mask-position -webkit-mask-repeat -webkit-mask-size o-r -webkit-opacity -webkit-order -webkit-perspective -webkit-perspective-origin -webkit-ruby-position s -webkit-scroll-snap-type -webkit-shape-image-threshold -webkit-shape-margin -webkit-shape-outside t -epub-text-decoration -webkit-text-color-decoration -webkit-text-decoration-line -webkit-text-decoration-style -epub-text-emphas...
...ebkit-perspective-origin -webkit-ruby-position s -webkit-scroll-snap-type -webkit-shape-image-threshold -webkit-shape-margin -webkit-shape-outside t -epub-text-decoration -webkit-text-color-decoration -webkit-text-decoration-line -webkit-text-decoration-style -epub-text-emphasis -webkit-text-emphasis -epub-text-emphasis-color -webkit-text-emphasis-color -webkit-text-emphasis-position -epub-text-emphasis-style -webkit-text-emphasis-style -webkit-text-justify -webkit-text-orientation -webkit-text-size-adjust -webkit-text-underline-position -webkit-transform -webkit-transform-origin -webkit-transform-style -webkit-transition -webkit-transition-delay -webkit-transition-duration -webkit-transition-property -webkit-transition-timing-function u-w -webkit-user-sele...
...And 2 more matches
<basic-shape> - CSS: Cascading Style Sheets
functions the following shapes are supported. all <basic-shape> values use functional notation and are defined here using the value definition syntax. inset() inset( <shape-arg>{1,4} [round <border-radius>]? ) defines an inset rectangle. when all of the first four arguments are supplied they represent the top, right, bottom and left offsets from the reference box inward that define the positions of the edges of the inset rectangle. these arguments follow the syntax of the margin shorthand, that let you set all four insets with one, two or four values. the optional <border-radius> argument(s) define rounded corners for the inset rectangle using the border-radius shorthand syntax. a pair of insets in either dimension that add up to more than the used dimension (such as left and right ...
...the optional <border-radius> argument(s) define rounded corners for the inset rectangle using the border-radius shorthand syntax. a pair of insets in either dimension that add up to more than the used dimension (such as left and right insets of 75% apiece) define a shape enclosing no area. for this specification, this results in an empty float area. ...
... of 75% apiece) define a shape enclosing no area. for this specification, this results in an empty float area. circle() circle( [<shape-radius>]? [at <position>]? ) the <shape-radius> argument represents r, the radius of the circle. negative values are invalid. a percentage value here is resolved from the used width and height of the reference box as sqrt(width^2+height^2)/sqrt(2). the <position> argument defines the center of the circle. this defaults to center if omitted. ellipse() ellipse( [<shape-radius>{2}]? [at <position>]? ) the <shape-radius> arguments represent rx and ry, the x-axis and y-axis radii of the ellipse, in that order. negative values for either radius are invalid. percentage values here are resolved against the used width (for the rx value) and the used heigh...
...And 2 more matches
filter - CSS: Cascading Style Sheets
Web › CSS › filter
a value of 0% will create an image that is completely black. a v...
... function applies a linear multiplier to the input image, making it appear more or less bright. a value of 0% will create an image that is completely black. a value of 100% leaves the input unchanged. other values are linear multipliers on the effect. values of an amount over 100% are allowed, providing brighter results. the lacuna value for interpolation is 1. ...
... width:25%; height:auto; } #img3 { height:100%; } contrast() the contrast() function adjusts the contrast of the input image. a value of 0% will create an image that is completely gray. a value of 100% leaves the input unchanged. values of an amount over 100% are allowed, providing results with more contrast. the lacuna value for interpolation is 1. ...
...And 2 more matches
list-style - CSS: Cascading Style Sheets
: this property is applied to list items, i.e., elements with display: list-item; . by default this includes <li> elements. 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. ...
...s. 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. constituent properties this property is a shorthand for the following css properties: list-style-image list-style-position 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. if list-style-type and list-sty...
...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. if list-style-type and list-style-image are both set, then list-style-type is used as a fallback if the image is unavailable. values list-style-type see list-style-type. list-style-image see list-style-image. list-style-position see list-style-position. none no list style is used. accessibility concerns safari has an issue whereby unordered lists with a list-style value of none applied to them will not be recognized as a list in the accessibility tree. to address this, add a zero-width space as pseudo-content before each list item to ensure the list is recognized properly. this ensures the design is unaffected by t...
...And 2 more matches
mask-origin - CSS: Cascading Style Sheets
syntax one or more of the keyword values listed below, separated by ...
...x; 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. in other words, this property specifies the origin position of an image specified by the mask-image css property. ...
...nset; for elements rendered as a single box, this property specifies the mask positioning area. in other words, this property specifies the origin position of an image specified by the mask-image css property. for elements rendered as multiple boxes, such as inline boxes on several lines or boxes on several pages, it specifies which boxes box-decoration-break operates upon to determine the mask positioning area. syntax one or more of the keyword values listed below, separated by commas. values content-box the position is relative to the content box. padding-box the position is relative to the padding box. for single boxes 0 0 is the upper left corner of the padding edge, 100% 100% is the lower right corner. border-box the position is relative to the border box. margin-box the positi...
...And 2 more matches
mask-size - CSS: Cascading Style Sheets
Web › CSS › mask-size
ues are given, the first sets width and the second sets height. each value can be a <length>, a <percentage>, or auto. values <length> a <length> value scales the mask image to the specified length in the corresponding dimension. negative lengths are not allowed. <percentage> a <percentage> value scales the mask image in the corresponding dimension to the specified percentage of the mask positioning area, which is determined by the value of mask-origin. the mask positioning area is, by default, the area containing the content of the box and its padding; the area may also be changed to just the content or to the area containing borders, padding and content. negative percentages are not allowed. auto a keyword that scales the mask image in the corresponding directions in order to maintain...
...re not allowed. auto a keyword that scales the mask image in the corresponding directions in order to maintain its intrinsic proportion. contain a keyword that scales the image as large as possible and maintains image aspect ratio (image doesn't get squished). the image is letterboxed within the container. the image is automatically centered unless over-ridden by another property such as mask-position. cover a keyword that is the inverse of contain. scales the image as large as possible and maintains image aspect ratio (image doesn't get squished). the image "covers" the entire width or height of the container. when the image and container have different dimensions, the image is clipped either on left/right or at top/bottom. the interpretation of possible values depends on the image's intr...
...images with no intrinsic dimensions or intrinsic proportion. the rendered size of the mask image is then computed as follows: if both components of mask-size are specified and are not auto: the mask image renders at the specified size. if the mask-size is contain or cover: the image is rendered by preserving its intrinsic proportion at the largest size contained within or covering the mask positioning area. if the image has no intrinsic proportion, then it is rendered at the size of the mask positioning area. if the mask-size is auto or auto auto: if the image has both intrinsic dimensions, it is rendered at that size. if it has no intrinsic dimensions and no intrinsic proportion, it is rendered at the size of the mask positioning area. if it has no dimensions but has a proportion, it's r...
...And 2 more matches
shape-outside - CSS: Cascading Style Sheets
ffect is as if the value none had been specified. interpolation when animating between one <basic-shape> and a second, the rules below are applied. the values in the shape functions interpolate as a simple list. the list values interpolate as <length>, <percentage>, or calc() where possible. if list values are not one of those types but are identical (such as finding nonzero in the same list position in both lists), those values do interpolate. both shapes must use the same reference box. if both shapes are the same type, that type is ellipse() or circle(), and none of the radii use the closest-side or farthest-side keywords, interpolate between each value in the shape functions. if both shapes are of type inset(), interpolate between each value in the shape functions. if both shapes ar...
...)<image-set()> = image-set( <image-set-option># )<element()> = element( <id-selector> )<paint()> = paint( <ident>, <declaration-value>? )...
...)<image-set()> = image-set( <image-set-option># )<element()> = element( <id-selector> )<paint()> = paint( <ident>, <declaration-value>? )<cross-fade()> = cross-fade( <cf-mixing-image> , <cf-final-image>?
...And 2 more matches
Video player styling basics - Developer guides
as mentioned earlier, a data-state attribute is now used to indicate whether the ...
...ls container itself also needs some styling so that it is set up the correct way: .controls { width:100%; height:8.0971659919028340080971659919028%; /* of figure's height */ position:relative; } the height of the .controls class is set to be (a very precise!) percentage of the enclosing <figure> element (this was worked out with experimentation based on the required button height). its position is also specifically set to relative, which is required for its responsiveness (more on that later). as mentioned earlier, a data-state attribute is now used to indicate whether the video controls are visible or not and these also need to be styled: .controls[data-state=hidden] { display:none; } .controls[data-state=visible] { display:block; } there are a number of properties that also ...
...volume() but it also sets the state of the mute button depending on the video's current volume setting. checkvolume() is also called when the volumechange event is raised: video.addeventlistener('volumechange', function() { checkvolume(); }, false); progress bar a small change also needs to be made to the click handler for the <progress> element. ...
...And 2 more matches
Array.prototype.reduceRight() - JavaScript
, then accumulator will be equal to initialvalue and currentvalue will be equal to the last value in the array. if no initialvalue was provided, then accumulator will be equal to the last value in the array and currentvalue will be equal to the second-to-last value. if the array is empty and no initialvalue was provided, typeerror would be thrown. if the array has only one element (regardless of position) and no initialvalue was provided, or if initialvalue is provided but the array is empty, the solo value would be returned without calling callback. some example run-throughs of the function would look like this: [0, 1, 2, 3, 4].reduceright(function(accumulator, currentvalue, index, array) { return accumulator + currentvalue; }); the callback would be invoked four times, with the arguments ...
...) { return a + b; }); // sum is 6 flatten an array of arrays var flattened = [[0, 1], [2, 3], [4, 5]].reduceright(function(a, b) { return a.concat(b); }, []); // flattened 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 = (cal...
...= 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 functions. it’s a flowing right-to-left, calling each function with the output of the last one. ...
...And 2 more matches
Performance fundamentals - Web Performance
avoiding intermediate surfaces where they would create overhead (such as per-application "back buffers" in many other operating systems), and by using special memory for graphics buffers that can be directly accessed by the compositor hardware. complex scenes are rendered using the device's gpu for maximum performance. to improve power usage, simple scenes are rendered using special dedicated composition hardware, while the gpu idles or turns off. fully static content is the exception rather than the rule for rich applications. rich applications use dynamic content with animation and transition effects. transitions and animations are particularly important to applications: developers can use css to declare complicated behaviour with a simple, high-level syntax. in turn, gecko's graphics pipeline...
...ey are already running) and have better upp. specific coding tips for application performance the following practical tips will help improve one or more of the application performance factors discussed above. 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. in many cases, you can actually use css transitions to get the job done. this works well because the browser is designed to optimize these effects and use the gpu to handle them smoothly with minimal impact on processor performance. another benefit is that you can define these effects in css along with the rest of your app's look-and-feel, using a standardized...
... to be performed at set points in the animation process. you can easily trigger these animations with the :hover, :focus, or :target, or by dynamically adding and removing classes on parent elements. if you want to create animations on the fly or modify them in javascript, james long has written a simple library for that called css-animations.js. use css transforms instead of tweaking absolute positioning and fiddling with all that math yourself, use the transform css property to adjust the position, scale, and so forth of your content. the reason is, once again, hardware acceleration. the browser can do these tasks on your gpu, letting the cpu handle other things. in addition, transforms give you capabilities you might not otherwise have. not only can you translate elements in 2d space, but y...
...And 2 more matches
The building blocks of responsive design - Progressive web apps (PWAs)
: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. ...
... won't be lost under the navigation buttons (see below). this was necessary because mozilla brick (also see below) forces its components to be 100% of the screen width and height. we have used vw (viewport width) units for these — 1vw is equivalent to 1% of the viewport width. this makes the dimensions scale up and down nicely along with the viewport width. last for this section, we absolutely positioned all buttons at the bottom of the cards they are in, so the layout looks ok at different viewport size variations. we then add a rule that positions the second button in any card a button's width higher up the card. when you click on an image in the gallery it brings up options to delete or cancel deletion of the card, and you don't want two buttons on top of one another. x-card:nth-child(3) im...
...itions the second button in any card a button's width higher up the card. when you click on an image in the gallery it brings up options to delete or cancel deletion of the card, and you don't want two buttons on top of one another. x-card:nth-child(3) img { width: 50%; } this rule simply changes the width of the gallery images so now there are two per line. ...
...And 2 more matches
Paths - SVG: Scalable Vector Graphics
Web › SVG › Tutorial › Paths
nd hence in the user coordinate system. later, we will learn how paths can be transformed to suit other needs. line commands there are five line commands for <path> nodes. the first command is the "move to" or m, which was described above. it takes two parameters, a coordinate (x) and coordinate (y) to move to. if the cursor was already somewhere on the page, no line is drawn to connect the two positions. the "move to" command appears at the beginning of paths to specify where the drawing should start. for example: m x y (or) m dx dy in the following example there's only a point at (10,10). note, though, that it wouldn't show up if a path was just drawn normally. for example: <svg width="200" height="200" xmlns="http://www.w3.org/2000/svg"> <path d="m10 10"/> <!-- points --> <circl...
...how up if a path was just drawn normally. for example: <svg width="200" height="200" xmlns="http://www.w3.org/2000/svg"> <path d="m10 10"/> <!-- points --> <circle cx="10" cy="10" r="2" fill="red"/> </svg> there are three commands that draw lines. the most generic is the "line to" command, called with l. l takes two parameters—x and y coordinates—and draws a line from the current position to a new position. l x y (or) l dx dy there are two abbreviated forms for drawing horizontal and vertical lines. h draws a horizontal line, and v draws a vertical line. both commands only take one parameter since they only move in one direction. h x (or) h dx v y (or) v dy an easy place to start is by drawing a shape. we will start with a rectangle (the same type that could be mor...
..."m 10 10 h 90 v 90 h 10 l 10 10"/> <!-- points --> <circle cx="10" cy="10" r="2" fill="red"/> <circle cx="90" cy="90" r="2" fill="red"/> <circle cx="90" cy="10" r="2" fill="red"/> <circle cx="10" cy="90" r="2" fill="red"/> </svg> we can shorten the above path declaration a little bit by using the "close path" command, called with z. this command draws a straight line from the current position back to the first point of the path. it is often placed at the end of a path node, although not always. there is no difference between the uppercase and lowercase command. z (or) z so our path above could be shortened to: <path d="m 10 10 h 90 v 90 h 10 z" fill="transparent" stroke="black"/> the relative forms of these commands can also be used to draw the same picture. relative command...
...And 2 more matches
Popup Menus - Archive of obsolete content
re the mouse pointer is. tooltips will be placed slightly below the element so that the mouse pointer does not obscure it. there are cases however, where you will want to indicate in more detail where the popup appears. for example, the popup menu that appears when you click the back button in a browser should appear underneath the back button, not where the mouse pointer is. to change the popup position, you can use an additional attribute, position, on the menupopup. you can also add it to the menupopup element. this attribute is used to indicate the placement of the popup relative to the element invoking the popup. it can be set to a number of values, which are described briefly below: after_start the popup appears below the element with the left edges of the element and the popup window a...
...s of the element and the popup window aligned. start_after the popup appears to the left of the element with the bottom edges of the element and the popup window aligned. start_before the popup appears to the left of the element with the top edges of the element and the popup window aligned. overlap the popup appears on top of the element. at_pointer the popup appears at the mouse pointer position (at_pointer is not currently implemented with respect to the mouse pointer. it currently appears at the top of the anchor). after_pointer the popup appears at the same horizontal position as the mouse pointer but appears below the element. this is how tooltips appear (after_pointer is not currently implemented with respect to the mouse pointer. it currently offsets 21 pixels vertically from the...
...with respect to the mouse pointer. it currently appears at the top of the anchor). after_pointer the popup appears at the same horizontal position as the mouse pointer but appears below the element. this is how tooltips appear (after_pointer is not currently implemented with respect to the mouse pointer. it currently offsets 21 pixels vertically from the anchor, see bug 619887). by adding the position attribute to a popup element, you can specify precisely where the popup appears. you cannot specify an exact pixel position. the position attribute can be used with all three popup types, although you probably would not change the value for tooltips. ...
...for simplicity, we'll just replicate the contents of the edit menu. ...
richlistbox - Archive of obsolete content
the value of the disabled attribute. disablekeynavigation type: boolean gets or sets the value of the disablekeynavigation attribute. itemcount type: integer read only property holding the number of child items. scrollboxobject type: nsiscrollboxobject the scroll box object implements the nsiscrollboxobject interface, which may be used to retrieve and adjust the scroll position of the list box. selectedcount type: integer returns the number of items that are currently selected. selectedindex type: integer returns the index of the currently selected item. you may select an item by assigning its index to this property. by assigning -1 to this property, all items will be deselected. returns -1 if no items are selected selecteditem ...
... gets and sets the value of the tabindex attribute. 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. ...
... the item is already visible, no scrolling occurs. getindexoffirstvisiblerow() return type: integer returns the index of the first displayed row. note that this is not the same as the first row -- if the displayed items have been scrolled down, this function will retrieve the index of the first row that the user can see. getindexofitem( item ) return type: integer returns the zero-based position of the specified item. items are numbered starting at the first item displayed in the list. getitematindex( index ) return type: element returns the element that is at the specified index. getnumberofvisiblerows() return type: integer returns the number of rows that are currently visible to the user. getrowcount() return type: integer returns the total number of r...
...etrieve each selected item using this method. the argument index specifies the index in the list of the selected items, not the row number of the item. the item index is zero-based, thus this example will return the first selected item: getselecteditem(0). insertitemat( index, label, value ) return type: element this method creates a new item and inserts it at the specified position. you may optionally set a value. the new item element is returned. invertselection() return type: no return value reverses the selected state of all items. selected items become deselected, and deselected items become selected. movebyoffset( offset , isselecting, isselectingrange) return type: no return value if offset is positive, adjusts the focused item forward by that many items. if...
scrollbar - Archive of obsolete content
e home [ examples | attributes | properties | methods | related ] when a container's contents which are larger that the size of the container, scroll bars may be placed at the side of the container to allow the user to scroll around in the container. the scroll bar may also be used independently when a numeric value or percentage needs to be selected by the user. ...
...rcentage needs to be selected by the user. the user can adjust the position of the scroll bar by clicking arrows on either end of the scroll bar or by dragging the scroll bar thumb around. more information is available in the xul tutorial. attributes curpos, increment, maxpos, pageincrement examples <scrollbar curpos="5" maxpos="50"/> attributes curpos type: integer the current position of the scrollbar, which ranges from 0 to the value of the maxpos attribute. the default value is 0. increment type: integer the amount by which the curpos (for scroll bars) or value (for number boxes and scale) attribute changes when the arrows are clicked(or scales are dragged). the default value is 1. ...
...the default value is 100. pageincrement type: integer the amount by which the value of the curpos or value attribute changes when the tray of the scroll bar (the area in which the scroll bar thumb moves) is clicked, or when the page up or page down keys are pressed. the default value is 10. ...
..., 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
splitter - Archive of obsolete content
parent is collapsed so that its width or height is 0. after when the grippy is clicked, the element immediately after the splitter in the same parent is collapsed so that its width or height is 0. both either the element immediately before the splitter, or the element immediately after the splitter can be collapsed, if the size of that element would fall below the minimum size due to the position of the splitter. resizeafter type: one of the values below this attribute indicates which element to the right or below the splitter should be resized when the splitter is repositioned. closest the element immediately to the right or below the splitter resizes. farthest the element that is the farthest away from the splitter to the right or below the splitter resizes. g...
... grow the elements to the right or below the splitter do not change size (unless they are flexible) when the splitter is dragged, but instead the entire container changes size. flex the closest flexible element resizes. resizebefore type: one of the values below this attribute indicates which element to the left or above the splitter should be resized when the splitter is repositioned. closest the element immediately to the left or above the splitter resizes. farthest the element that is the farthest away from the splitter to the left or above the splitter resizes. flex the closest flexible element resizes. state type: one of the values below indicates whether the splitter has collapsed content or not. this attribute will be updated automatically...
...atically as the splitter is moved, and is generally used in a stylesheet to apply a different appearance for each state. open the content either before or after the splitter, depending on the value of the collapsed attribute, is currently displayed. collapsed the content either before or after the splitter is collapsed and is not visible. dragging the user is current adjusting the position of the splitter, typically by dragging it with the mouse. substate type: one of the values below on splitters which have state="collapsed" and collapse="both", determines which direction the splitter is actually collapsed in. since collapse="both" is a gecko 1.9+ feature, this will have no effect on earlier versions. before the element immediately before the splitter is coll...
..., 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
Building up a basic demo with the PlayCanvas engine - Game development
n(pc.resolution_auto); camera now when the setup code is in place we need to think about implementing the standard scene components: camera, lights and objects. let's start with the camera — add these lines to your code, below the previous ones. var camera = new pc.entity(); camera.addcomponent("camera", { clearcolor: new pc.color(0.8, 0.8, 0.8) }); app.root.addchild(camera); camera.setposition(0, 0, 7); the code above will create a new entity. note: an entity is any object used in the scene — it can be an object like a box, cylinder or cone, but it can also be a camera, light or sound source. then it adds a camera component to it with the light gray clearcolor — the color will be visible as the background. next, the camera object is added to the root of our application and po...
... try saving the file and loading it in your browser. ...
...rlapping the cylinder. then the material is created, given a gray color, and assigned to the cone entity. here's how it should look right now: this works, but it is a bit boring. in a game something is usually happening — we can see animations and such — so let's try to breathe a little life into those shapes by animating them. animation we already used translate or rotate to adjust the position of the shapes; we could also change their positions directly with setposition, or scale them. to show actual animation, we need to make changes to these values inside the rendering loop, so they are updated on every frame. there's a special update event that we can use for that — add the following code just below the previous additions: var timer = 0; app.on("update", function (deltatime) { ...
... we're wrapping the y scale value in math.abs to pass the absolute values (greater or equal to 0); sin varies between -1 and 0, and for negative values the cylinder scaling can render unexpectedly (in this case it looks black half the time.) now onto the movement part. moving beside rotation and scaling we can also move objects around the scene. add the following code to achieve that. cone.setposition(2, math.sin(timer*2), 0); this will move the cone up and down by applying the sin value to the y axis on each frame, with a little bit of adjustment to make it look cooler. try changing the value to see how it affects the animation. conclusion here's the final code listing, along with a viewable live example: you can also see it on github and fork the repository if you want to play with it...
Build the brick field - Game development
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. we will hold all our bricks in a two-dimensional array. it will contain the brick columns (c), which in turn will contain the brick rows (r), which in turn will each contain an object containing the x and y position to paint each brick on the screen. add the following just below your variables: var bricks = []; for(var c=0; c<brickcolumncount; c++) { bricks[c] = []; for(var r=0; r<brickrowcount; r++) { bricks[c][r] = { x: 0, y: 0 }; } } the code above will loop through the rows and columns and create the new bricks. note that the brick objects will also be used for collision detection p...
...; c<brickcolumncount; c++) { for(var r=0; r<brickrowcount; r++) { bricks[c][r].x = 0; bricks[c][r].y = 0; ctx.beginpath(); ctx.rect(0, 0, brickwidth, brickheight); ctx.fillstyle = "#0095dd"; ctx.fill(); ctx.closepath(); } } } again, we're looping through the rows and columns to set the x and y position of each brick, and we're also painting a brick on the canvas — size brickwidth x brickheight — with each loop iteration. the problem is that we're painting them all in one place, at coordinates (0,0). what we need to do is include some calculations that will work out the x and y position of each brick for each loop iteration: var brickx = (c*(brickwidth+brickpadding))+brickoffsetleft; var br...
...ize brickwidth x brickheight — with each loop iteration. the problem is that we're painting them all in one place, at coordinates (0,0). what we need to do is include some calculations that will work out the x and y position of each brick for each loop iteration: var brickx = (c*(brickwidth+brickpadding))+brickoffsetleft; var bricky = (r*(brickheight+brickpadding))+brickoffsettop; each brickx position is worked out as brickwidth + brickpadding, multiplied by the column number, c, plus the brickoffsetleft; the logic for the bricky is identical except that it uses the values for row number, r, brickheight, and brickoffsettop. now every single brick can be placed in its correct place row and column, with padding between each brick, drawn at an offset from the left and top canvas edges. the final...
...in this lesson is to add a call to drawbricks() somewhere in the draw() function, preferably at the beginning, between the clearing of the canvas and drawing the ball. add the following just above the drawball() call: drawbricks(); compare your code at this point, the game has got a little more interesting again : exercise: try changing the number of bricks in a row or a column, or their positions. next steps so now we have bricks! but the ball isn't interacting with them at all — we'll change that as we continue to the seventh chapter: collision detection. « previousnext » ...
Mouse controls - Game development
tening for mouse movement listening for mouse movement is even easier than listening for key presses: all we need is the listener for the mousemove event. add the following line in the same place as the other event listeners, just below the keyup event: document.addeventlistener("mousemove", mousemovehandler, false); anchoring the paddle movement to the mouse movement we can update the paddle position based on the pointer coordinates — the following handler function will do exactly that. 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 relativ...
...ng handler function will do exactly that. ...
...ex = 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 the canvas left edge and the mouse pointer. ...
...tal 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 the canvas left edge and the mouse pointer. 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. the paddle will now follow the position of the mouse cursor, but since we're restricting the movement to the size of the canvas, it won't disappear completely off either side. compare your code this is the latest...
Move the ball - Game development
the 2nd step out of 10 of the gamedev canvas tutorial. you can find the source code as it should look after completing this lesson at gamedev-canvas-workshop/lesson2.html. you already know how to draw a ball from working through the previous article, so now let's make it move. technically, we will be painting the ball on the screen, clearing it and then painting it again in a slightly different position every frame to make the impression of movement — just like how movement works with the movies. 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 javascri...
...the ball — add the following inside your draw() function: ctx.beginpath(); ctx.arc(50, 50, 10, 0, math.pi*2); ctx.fillstyle = "#0095dd"; ctx.fill(); ctx.closepath(); try your updated code now — the ball should be repainted on every frame. making it move you won't notice the ball being repainted constantly at the moment, as it's not moving. let's change that. first, instead of a hardcoded position at (50,50) we will define a starting point at the bottom center part of the canvas in variables called x and y, then use those to define the position the circle is drawn at. first, add the following two lines above your draw() function, to define x and y: var x = canvas.width/2; var y = canvas.height-30; next update the draw() function to use the x and y variables in the arc() method, as show...
...ll value to x and y after every frame has been drawn to make it appear that the ball is moving. let's define these small values as dx and dy and set their values to 2 and -2 respectively. add the following below your x and y variable definitions: var dx = 2; var dy = -2; the last thing to do is to update x and y with our dx and dy variable on every frame, so the ball will be painted in the new position on every update. add the following two new lines indicated below to your draw() function: function draw() { ctx.beginpath(); ctx.arc(x, y, 10, 0, math.pi*2); ctx.fillstyle = "#0095dd"; ctx.fill(); ctx.closepath(); x += dx; y += dy; } save your code again and try it in your browser. this works ok, although it appears that the ball is leaving a trail behind it: clea...
...aw() { ctx.clearrect(0, 0, canvas.width, canvas.height); ctx.beginpath(); ctx.arc(x, y, 10, 0, math.pi*2); ctx.fillstyle = "#0095dd"; ctx.fill(); ctx.closepath(); x += dx; y += dy; } save your code and try again, and this time you'll see the ball move without a trail. every 10 milliseconds the canvas is cleared, the blue circle (our ball) will be drawn on a given position and the x and y values will be updated for the next frame. cleaning up our code we will be adding more and more commands to the draw() function in the next few articles, so it's good to keep it as simple and clean as possible. let's start by moving the ball drawing code to a separate function. replace the existing draw() function with the following two functions: function drawball() { ctx...
CSS and JavaScript accessibility best practices - Learn web development
ts/information, as this will be no good for those who can't see the color. instead of marking required form fields in red, for example, mark them with an asterisk and in red. hiding things there are many instances where a visual design will require that not all content is shown at once. ...
... on the other hand, you shouldn't use visibility:hidden or display:none, because they do hide content from screen readers. ...
... real form validation would be much more complex than this — you'd want to check that the entered name actually looks like a name, the entered age is actually a number and is realistic (e.g. nonnegative and less than 4 digits). here we've just imp...
...ctually focus it. firefox doesn't focus the inputs properly at all in this context, so firefox users can't take advantage of this at present (although everything else works fine). the firefox issue should be fixed soon — work is being done to give firefox behaviour parity with other browsers (see bug 277178). in addition, the errorfield is placed at the top of the source order (although it is positioned differently in the ui using css), meaning that users can find out exactly what's wrong with their form submissions and get to the input elements in question by going back up to the start of the page. as a final note, we have used some wai-aria attributes in our demo to help solve accessibility problems caused by areas of content constantly updating without a page reload (screen readers won't p...
WAI-ARIA basics - Learn web development
likely to change, then it is also a good idea to indicate when it happens, and what the result is. for example, in our form-validation-checkbox-disabled.html demo there is a checkbox that when checked, enables another form input to allow further information be entered. we've set up a hidden live region: <p class="hidden-alert" aria-live="assertive"></p> which is hidden from view using absolute positioning. when this is checked/unchecked, we update the text inside the hidden live region to tell screenreader users what the result of checking this checkbox is, as well as updating the aria-disabled state, and some visual indicators too: function togglemusician(bool) { let instruitem = formitems[formitems.length-1]; if(bool) { instruitem.input.disabled = false; instruitem.label.style.co...
...her roles that can identify non-semantic element structures as common ui features that go beyond what's available in standard html, for example combobox, slider, tabpanel, tree. you can see a number of useful examples in the deque university code library, to give you an idea of how such controls can be made accessible. let's go through an example of our own. we'll return to our simple absolutely-positioned tabbed interface (see hiding things in our css and javascript accessibility article), which you can find at tabbed info box example (see source code). this example as-is works fine in terms of keyboard accessibility — you can happily tab between the different tabs and select them to show the tab contents. it is also fairly accessible too — you can scroll through the content and use the hea...
...le role="tabpanel" aria-hidden="true"> ... </article> </div> note: the most striking change here is that we've removed the links that were originally present in the example, and just used the list items as the tabs — this was done because it makes things less confusing for screenreader users (the links don't really take you anywhere; they just change the view), and it allows the setsize/position in set features to work better — when these were put on the links, the browser kept reporting "1 of 1" all the time, not "1 of 3", "2 of 3", etc. the new features are as follows: new roles — tablist, tab, tabpanel — these identify the important areas of the tabbed interface — the container for the tabs, the tabs themselves, and the corresponding tabpanels. aria-selected — defines ...
...ue of this attribute on the different tabs is updated via javascript. tabindex="0" — as we've removed the links, we need to give the list items this attribute to provide it with keyboard focus. aria-setsize — this property allows you to specify to screenreaders that an element is part of a series, and how many items the series has. aria-posinset — this property allows you to specify what position in a series an element is in. along with aria-setsize, it provides a screenreader with enough information to tell you that you are currently on item "1 of 3", etc. in many cases, browsers should be able to infer this information from the element hierarchy, but it certainly helps to provide more clues. in our tests, this new structure did serve to improve things overall. the tabs are now recogni...
CSS values and units - Learn web development
tual image file pointed to via a url() function, or a gradient. in the example below we have demonstrated an image and a gradient in use as a value for the css background-image property. note: there are some other possible values for <image>, however these are newer and currently have poor browser support. check out the page on mdn for the <image> data type if you want to read about them. ...
... pointed to via a url() function, or a gradient. in the example below we have demonstrated an image and a gradient in use as a value for the css background-image property. note: there are some other possible values for <image>, however these are newer and currently have poor browser support. check out the page on mdn for the <image> data type if you want to read about them. ...
... below we have demonstrated an image and a gradient in use as a value for the css background-image property. note: there are some other possible values for <image>, however these are newer and currently have poor browser support. check out the page on mdn for the <image> data type if you want to read about them. position the <position> data type represents a set of 2d coordinates, used to position an item such as a background image (via background-position). it can take keywords such as top, left, bottom, right, and center to align items with specific bounds of a 2d box, along with lengths, which represent offsets from the top and left-hand edges of the box. a typical position value consists of two values — the first sets the position horizontally, the second vertically. if you only spe...
... play around with these values to see how you can push the image around. ...
Looping code - Learn web development
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; } </style> </head> <body> <button>update</button> <canvas></canvas> <script> const btn = document.queryselector('button'); const canvas = document.queryselector('canvas'); const ctx = canvas.getcontext('2d'); let width = document.documentelement.clientwidth; let height = document.documentelement.clienth...
...gba(255,0,0,0.5)'; ctx.arc(random(width), random(height), random(50), 0, 2 * math.pi); ctx.fill(); } random(x), defined earlier in the code, returns a whole number between 0 and x-1. width and height are the width and height of the inner browser window. you should get the basic idea — we are using a loop to run 100 iterations of this code, each one of which draws a circle in a random position on the page. the amount of code needed would be the same whether we were drawing 100 circles, 1000, or 10,000. only one number has to change. if we weren't using a loop here, we'd have to repeat the following code for every circle we wanted to draw: ctx.beginpath(); ctx.fillstyle = 'rgba(255,0,0,0.5)'; ctx.arc(random(width), random(height), random(50), 0, 2 * math.pi); ctx.fill(); this would g...
...= 10) {\n para.textcontent = \'countdown \' + i;\n } else if(i === 0) {\n para.textcontent = \'blast off!\';\n } else {\n para.textcontent = i;\n }\n\n output.appendchild(para);\n\n i--;\n}'; let solutionentry = jssolution; textarea.addeventlistener('input', updatecode); window.addeventlistener('load', updatecode); // stop tab key tabbing out of textarea and // make it write a tab at the caret position instead textarea.onkeydown = function(e){ if (e.keycode === 9) { e.preventdefault(); insertatcaret('\t'); } if (e.keycode === 27) { textarea.blur(); } }; function insertatcaret(text) { const scrollpos = textarea.scrolltop; const caretpos = textarea.selectionstart; const front = (textarea.value).substring(0, caretpos); const back = (textarea.value).substring(textarea...
...gth);\n\nrefused.textcontent = refused.textcontent.slice(0,refused.textcontent.length-2) + \'.\';\nadmitted.textcontent = admitted.textcontent.slice(0,admitted.textcontent.length-2) + \'.\';'; let solutionentry = jssolution; textarea.addeventlistener('input', updatecode); window.addeventlistener('load', updatecode); // stop tab key tabbing out of textarea and // make it write a tab at the caret position instead textarea.onkeydown = function(e){ if (e.keycode === 9) { e.preventdefault(); insertatcaret('\t'); } if (e.keycode === 27) { textarea.blur(); } }; function insertatcaret(text) { const scrollpos = textarea.scrolltop; const caretpos = textarea.selectionstart; const front = (textarea.value).substring(0, caretpos); const back = (textarea.value).substring(textarea...
Beginning our React todo list - Learn web development
background-color: #ca3c3c; border-color: #bd2130; } .btn__filter { border-color: lightgrey; } .btn__primary { color: #fff; background-color: #000; } .btn-group { display: flex; justify-content: space-between; } .btn-group > * { flex: 1 1 49%; } .btn-group > * + * { margin-left: 0.8rem; } .label-wrapper { margin: 0; flex: 0 0 100%; text-align: center; } .visually-hidden { position: absolute !important; height: 1px; width: 1px; overflow: hidden; clip: rect(1px 1px 1px 1px); clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; } [class*="stack"] > * { margin-top: 0; margin-bottom: 0; } .stack-small > * + * { margin-top: 1.25rem; } .stack-large > * + * { margin-top: 2.5rem; } @media screen and (min-width: 550px) { .stack-small > * + * { margin-top: 1...
...in-bottom: 0; } .stack-small > * + * { margin-top: 1.25rem; } .stack-large > * + * { margin-top: 2.5rem; } @media screen and (min-width: 550px) { .stack-small > * + * { margin-top: 1.4rem; } .stack-large > * + * { margin-top: 2.8rem; } } .stack-exception { margin-top: 1.2rem; } /* end global styles */ .todoapp { background: #fff; margin: 2rem 0 4rem 0; padding: 1rem; position: relative; box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.2), 0 2.5rem 5rem 0 rgba(0, 0, 0, 0.1); } @media screen and (min-width: 550px) { .todoapp { padding: 4rem; } } .todoapp > * { max-width: 50rem; margin-left: auto; margin-right: auto; } .todoapp > form { max-width: 100%; } .todoapp > h1 { display: block; max-width: 100%; text-align: center; margin: 0; margin-bottom: 1re...
...odo > * { flex: 0 0 100%; } .todo-text { width: 100%; min-height: 4.4rem; padding: 0.4rem 0.8rem; border: 2px solid #565656; } .todo-text:focus { box-shadow: inset 0 0 0 2px; } /* checkbox styles */ .c-cb { box-sizing: border-box; font-family: arial, sans-serif; -webkit-font-smoothing: antialiased; font-weight: 400; font-size: 1.6rem; line-height: 1.25; display: block; position: relative; min-height: 44px; padding-left: 40px; clear: left; } .c-cb > label::before, .c-cb > input[type="checkbox"] { box-sizing: border-box; top: -2px; left: -2px; width: 44px; height: 44px; } .c-cb > input[type="checkbox"] { -webkit-font-smoothing: antialiased; cursor: pointer; position: absolute; z-index: 1; margin: 0; opacity: 0; } .c-cb > label { font-size: in...
...b > input[type="checkbox"] { -webkit-font-smoothing: antialiased; cursor: pointer; position: absolute; z-index: 1; margin: 0; opacity: 0; } .c-cb > label { font-size: inherit; font-family: inherit; line-height: inherit; display: inline-block; margin-bottom: 0; padding: 8px 15px 5px; cursor: pointer; touch-action: manipulation; } .c-cb > label::before { content: ""; position: absolute; border: 2px solid currentcolor; background: transparent; } .c-cb > input[type="checkbox"]:focus + label::before { border-width: 4px; outline: 3px dashed #228bec; } .c-cb > label::after { box-sizing: content-box; content: ""; position: absolute; top: 11px; left: 9px; width: 18px; height: 7px; transform: rotate(-45deg); border: solid; border-width: 0 0 5px 5px...
Starting our Svelte Todo list app - Learn web development
order-color: lightgrey; } .btn__primary { color: #fff; background-color: #000; } .btn__primary:disabled { color: darkgrey; background-color:#565656; } .btn-group { display: flex; justify-content: space-between; } .btn-group > * { flex: 1 1 49%; } .btn-group > * + * { margin-left: 0.8rem; } .label-wrapper { margin: 0; flex: 0 0 100%; text-align: center; } .visually-hidden { position: absolute !important; height: 1px; width: 1px; overflow: hidden; clip: rect(1px 1px 1px 1px); clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; } [class*="stack"] > * { margin-top: 0; margin-bottom: 0; } .stack-small > * + * { margin-top: 1.25rem; } .stack-large > * + * { margin-top: 2.5rem; } @media screen and (min-width: 550px) { .stack-small > * + * { margin-top: 1...
...n-bottom: 0; } .stack-small > * + * { margin-top: 1.25rem; } .stack-large > * + * { margin-top: 2.5rem; } @media screen and (min-width: 550px) { .stack-small > * + * { margin-top: 1.4rem; } .stack-large > * + * { margin-top: 2.8rem; } } .stack-exception { margin-top: 1.2rem; } /* end global styles */ .todoapp { background: #fff; margin: 2rem 0 4rem 0; padding: 1rem; position: relative; box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.2), 0 2.5rem 5rem 0 rgba(0, 0, 0, 0.1); } @media screen and (min-width: 550px) { .todoapp { padding: 4rem; } } .todoapp > * { max-width: 50rem; margin-left: auto; margin-right: auto; } .todoapp > form { max-width: 100%; } .todoapp > h1 { display: block; max-width: 100%; text-align: center; margin: 0; margin-bottom: 1re...
...odo > * { flex: 0 0 100%; } .todo-text { width: 100%; min-height: 4.4rem; padding: 0.4rem 0.8rem; border: 2px solid #565656; } .todo-text:focus { box-shadow: inset 0 0 0 2px; } /* checkbox styles */ .c-cb { box-sizing: border-box; font-family: arial, sans-serif; -webkit-font-smoothing: antialiased; font-weight: 400; font-size: 1.6rem; line-height: 1.25; display: block; position: relative; min-height: 44px; padding-left: 40px; clear: left; } .c-cb > label::before, .c-cb > input[type="checkbox"] { box-sizing: border-box; top: -2px; left: -2px; width: 44px; height: 44px; } .c-cb > input[type="checkbox"] { -webkit-font-smoothing: antialiased; cursor: pointer; position: absolute; z-index: 1; margin: 0; opacity: 0; } .c-cb > label { font-size: in...
...b > input[type="checkbox"] { -webkit-font-smoothing: antialiased; cursor: pointer; position: absolute; z-index: 1; margin: 0; opacity: 0; } .c-cb > label { font-size: inherit; font-family: inherit; line-height: inherit; display: inline-block; margin-bottom: 0; padding: 8px 15px 5px; cursor: pointer; touch-action: manipulation; } .c-cb > label::before { content: ""; position: absolute; border: 2px solid currentcolor; background: transparent; } .c-cb > input[type="checkbox"]:focus + label::before { border-width: 4px; outline: 3px dashed #228bec; } .c-cb > label::after { box-sizing: content-box; content: ""; position: absolute; top: 11px; left: 9px; width: 18px; height: 7px; transform: rotate(-45deg); border: solid; border-width: 0 0 5px 5px...
Styling Vue components with CSS - Learn web development
group > * { flex: 1 1 auto; } .btn-group > * + * { margin-left: 0.8rem; } .label-wrapper { margin: 0; flex: 0 0 100%; text-align: center; } [class*="__lg"] { display: inline-block; width: 100%; font-size: 1.9rem; } [class*="__lg"]:not(:last-child) { margin-bottom: 1rem; } @media screen and (min-width: 620px) { [class*="__lg"] { font-size: 2.4rem; } } .visually-hidden { position: absolute; height: 1px; width: 1px; overflow: hidden; clip: rect(1px 1px 1px 1px); clip: rect(1px, 1px, 1px, 1px); clip-path: rect(1px, 1px, 1px, 1px); white-space: nowrap; } [class*="stack"] > * { margin-top: 0; margin-bottom: 0; } .stack-small > * + * { margin-top: 1.25rem; } .stack-large > * + * { margin-top: 2.5rem; } @media screen and (min-width: 550px) { .stack-small...
...> * { margin-top: 0; margin-bottom: 0; } .stack-small > * + * { margin-top: 1.25rem; } .stack-large > * + * { margin-top: 2.5rem; } @media screen and (min-width: 550px) { .stack-small > * + * { margin-top: 1.4rem; } .stack-large > * + * { margin-top: 2.8rem; } } /* end global styles */ #app { background: #fff; margin: 2rem 0 4rem 0; padding: 1rem; padding-top: 0; position: relative; box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.2), 0 2.5rem 5rem 0 rgba(0, 0, 0, 0.1); } @media screen and (min-width: 550px) { #app { padding: 4rem; } } #app > * { max-width: 50rem; margin-left: auto; margin-right: auto; } #app > form { max-width: 100%; } #app h1 { display: block; min-width: 100%; width: 100%; text-align: center; margin: 0; margin-bottom: 1rem; ...
... solid #0b0c0c; border-radius: 0; -webkit-appearance: none; -moz-appearance: none; appearance: none; } .custom-checkbox > input:focus { outline: 3px dashed #fd0; outline-offset: 0; box-shadow: inset 0 0 0 2px; } .custom-checkbox { font-family: arial, sans-serif; -webkit-font-smoothing: antialiased; font-weight: 400; font-size: 1.6rem; line-height: 1.25; display: block; position: relative; min-height: 40px; margin-bottom: 10px; padding-left: 40px; clear: left; } .custom-checkbox > input[type="checkbox"] { -webkit-font-smoothing: antialiased; cursor: pointer; position: absolute; z-index: 1; top: -2px; left: -2px; width: 44px; height: 44px; margin: 0; opacity: 0; } .custom-checkbox > .checkbox-label { font-size: inherit; font-family: inherit...
...ex: 1; top: -2px; left: -2px; width: 44px; height: 44px; margin: 0; opacity: 0; } .custom-checkbox > .checkbox-label { font-size: inherit; font-family: inherit; line-height: inherit; display: inline-block; margin-bottom: 0; padding: 8px 15px 5px; cursor: pointer; touch-action: manipulation; } .custom-checkbox > label::before { content: ""; box-sizing: border-box; position: absolute; top: 0; left: 0; width: 40px; height: 40px; border: 2px solid currentcolor; background: transparent; } .custom-checkbox > input[type="checkbox"]:focus + label::before { border-width: 4px; outline: 3px dashed #228bec; } .custom-checkbox > label::after { box-sizing: content-box; content: ""; position: absolute; top: 11px; left: 9px; width: 18px; height: 7px;...
SourceMap.jsm
new sourcemapconsumer(rawsourcemap) the only parameter is the raw source map (either as a string which can be json.parse'd, or an object). ...
... new sourcemapconsumer(rawsourcemap) the only parameter is the raw source map (either as a string which can be json.parse'd, or an object). ...
...ces: an array of urls to the original source files. names: an array of identifiers that can be referenced by individual mappings. sourceroot: optional. the url root from which all sources are relative. mappings: a string of base64 vlqs which contain the actual mappings. file: the generated filename this source map is associated with. sourcemapconsumer.prototype.originalpositionfor(generatedposition) returns the original source, line, and column information for the generated source's line and column positions provided. the only argument is an object with the following properties: line: the line number in the generated source. column: the column number in the generated source. and an object is returned with the following properties: source: the orig...
...sociated with. sourceroot: an optional root for all relative urls in this source map. sourcemapgenerator.prototype.addmapping(mapping) add a single mapping from original source line and column to the generated source's line and column for this source map being created. the mapping object should have the following properties: generated: an object with the generated line and column positions. original: an object with the original line and column positions. source: the original source file (relative to the sourceroot). name: an optional original token name for this mapping. sourcemapgenerator.prototype.tostring() renders the source map being generated to a string. sourcenode sourcenodes provide a way to abstract over interpolating and/or concatenating snippet...
nsIAccessibleEditableText
accessible/public/nsiaccessibleeditabletext.idlscriptable an interface for editing text of an accessible object. the operations it supports includes setting text attributes and text contents while also replacing old text of an object with new text. it also includes and support basic operations such as, inserting text, copying text, cutting text, pasting text and deleting text at the specified position. ...
..., copying text, cutting text, pasting text and deleting text at the specified position. 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. read only. native code only! methods cop...
...cates the text cannot be deleted or copied into the clipboard. deletetext() deletes a range of text. void deletetext( in long startpos, in long endpos ); parameters startpos start offset of the text to be deleted. endpos end offset of the text to be deleted. exceptions thrown ns_error_failure indicates the text cannot be deleted. inserttext() inserts text at the specified position. ...
...oard. deletetext() deletes a range of text. void deletetext( in long startpos, in long endpos ); parameters startpos start offset of the text to be deleted. endpos end offset of the text to be deleted. exceptions thrown ns_error_failure indicates the text cannot be deleted. inserttext() inserts text at the specified position. void inserttext( in astring text, in long position ); parameters text text to be inserted. position the offset at which to insert the text. exceptions thrown ns_error_failure indicates the text cannot be inserted. pastetext() pastes text from the clipboard. void pastetext( in long position ); parameters position the offset at which to insert the text from the system clipboard into the text represented by this object. e...
nsIAccessibleText
the text. charactercount long read only. defaulttextattributes nsipersistentproperties return the text attributes that apply to the entire accessible. read only. selectioncount long read only. constants text offset constants constant value description text_offset_end_of_text -1 will be treated as the equal to the end of the text. text_offset_caret -2 will be treated as the caret position. text boundary constants constant value description boundary_char 0 boundary_word_start 1 boundary_word_end 2 boundary_sentence_start 3 do not use in new code. boundary_sentence_end 4 do not use in new code. boundary_line_start 5 boundary_line_end 6 boundary_attribute_range 7 coordinate type constants obsolete since gecko 1.9 (firefox 3)this feature is o...
...n long offset, out long rangestartoffset, out long rangeendoffset ); parameters offset rangestartoffset rangeendoffset return value getcharacteratoffset() it would be better to return an unsigned long here, to allow unicode chars > 16 bits. wchar getcharacteratoffset( in long offset ); parameters offset return value getcharacterextents() returns the bounding box of the specified position. the virtual character after the last character of the represented text, that is the one at position length is a special case. it represents the current input position and will therefore typically be queried by at more often than other positions. because it does not represent an existing character its bounding box is defined in relation to preceding characters. it should be roughly equivalent to ...
...ox of the referenced character. coordtype specifies if the coordinates are relative to the screen or to the parent window (see constants declared in nsiaccessiblecoordinatetype.constants). getoffsetatpoint() get the text offset at the given point, or return -1 if no character exists at that point. long getoffsetatpoint( in long x, in long y, in unsigned long coordtype ); parameters x the position's x value for which to look up the index of the character that is rendered on to the display at that point. y the position's y value for which to look up the index of the character that is rendered on to the display at that point. coordtype screen coordinates or window coordinates (see constants declared in nsiaccessiblecoordinatetype). return value offset - index of the character under the give...
... rendered on to the display at that point. coordtype screen coordinates or window coordinates (see constants declared in nsiaccessiblecoordinatetype). return value offset - index of the character under the given point or -1 if the point is invalid or there is no character under the point. getrangeextents() the virtual character after the last character of the represented text, that is the one at position length is a special case. it represents the current input position and will therefore typically be queried by at more often than other positions. because it does not represent an existing character its bounding box is defined in relation to preceding characters. it should be roughly equivalent to the bounding box of some character when inserted at the end of the text. its height typically being t...
nsIArray
indexes are zero-based, such that the last element in the array is stored at the index length-1. for an array which can be modified, see nsimutablearray. neither interface makes any attempt to protect the individual elements from modification. ...
...signed long startindex, in nsisupports element); void queryelementat(in unsigned long index, in nsiidref uuid, [iid_is(uuid), retval] out nsqiresult result); attributes attribute type description length unsigned long the number of elements in the array. read only. methods enumerate() enumerate the array. nsisimpleenumerator enumerate(); parameters none. return value a new enumerator positioned at the start of the array. exceptions thrown ns_error_failure if the array is empty (to make it easy to detect errors). ns_error_out_of_memory if there is not enough memory to complete the operation. indexof() get the position of a specific element. note that since null is a valid input, exceptions are used to indicate that an element is not found. unsigned long indexof( in unsigned long st...
...ment. note that since null is a valid input, exceptions are used to indicate that an element is not found. unsigned long indexof( in unsigned long startindex, in nsisupports element ); parameters startindex the initial element to search in the array. to start at the beginning, use 0 as the startindex. element the element you are looking for. return value a number >= startindex which is the position of the element in the array. exceptions thrown ns_error_failure if the element was not in the array. queryelementat() retrieve a specific element of the array, and queryinterface it to the specified interface. null is a valid result for this method, but exceptions are thrown in other circumstances. void queryelementat( in unsigned long index, in nsiidref uuid, [iid_is(uuid), retval] out n...
...s thrown ns_error_failure if the element was not in the array. queryelementat() retrieve a specific element of the array, and queryinterface it to the specified interface. null is a valid result for this method, but exceptions are thrown in other circumstances. void queryelementat( in unsigned long index, in nsiidref uuid, [iid_is(uuid), retval] out nsqiresult result ); parameters index position of element. uuid the iid of the requested interface. result the object, queryinterface'd to the requested interface. exceptions thrown ns_error_illegal_value when index > length-1. see also nsimutablearray ...
nsIProtocolProxyService
proxy auto config (pac) may perform a synchronous dns query, which may not return immediately. so, calling resolve wi...
.... this value may be used to tune the delay before this proxy is used again. the proxy that was unavailable. return value an nsiproxyinfo object or null for a direct connection. exceptions thrown ns_error_not_available if there is no alternate proxy available. registerfilter() this method may be used to register a proxy filter instance. ...
...xy that was unavailable. return value an nsiproxyinfo object or null for a direct connection. exceptions thrown ns_error_not_available if there is no alternate proxy available. registerfilter() this method may be used to register a proxy filter instance. each proxy filter is registered with an associated position that determines the order in which the filters are applied (starting from position 0). when resolve/asyncresolve is called, it generates a list of proxies for the given uri, and then it applies the proxy filters. the filters have the opportunity to modify the list of proxies. if two filters register for the same position, then the filters will be visited in the order in which they were registered. if the filter is already registered, then its position will be updated. after f...
...does not permit proxying via http. if a nsiprotocolhandler disallows all proxying, then filters will never have a chance to intercept proxy requests for such urls. note: it is possible to construct filters that compete with one another in undesirable ways. this api does not attempt to protect against such problems. it is recommended that any extensions that choose to call this method make their position value configurable at runtime (perhaps via the preferences service). void registerfilter( in nsiprotocolproxyfilter afilter, in unsigned long aposition ); parameters afilter the nsiprotocolproxyfilter instance to be registered. aposition the position of the filter. unregisterfilter() this method may be used to unregister a proxy filter instance. all filters will be automatically u...
nsITextInputProcessorNotification
rface may have some new attributes. so, nsitextinputprocessorcallback won't be changed for keeping backward compatibility. attributes attribute type description type acstring the type of request or notification to ime. see type values below. types "request-to-commit" this is required to be handled. when this is requested, the callback should commit composition synchronously, i.e., nsitextinputprocessor.commitcomposition() should be called. if the callback doesn't want to commit the composition synchronously, it's okay to commit it later (i.e., asynchronously). however, gecko will commit the composition with the last composing string internally. this is typically notified when user clicks somewhere, focus is moved, or web contents modify the value of ...
... nsitextinputprocessor.commitcomposition() should be called. if the callback doesn't want to commit the composition synchronously, it's okay to commit it later (i.e., asynchronously). however, gecko will commit the composition with the last composing string internally. this is typically notified when user clicks somewhere, focus is moved, or web contents modify the value of the editor during composition. "request-to-cancel" this is required to be handled. when this is requested, the callback should cancel composition synchronously, i.e., nsitextinputprocessor.cancelcomposition() should be called. if the callback doesn't want to cancel the composition synchronously, it's okay to cancel it later (i.e., asynchronously). however, gecko will cancel the composition with empty string internally. t...
... "notify-focus" when an editable editor gets focus, this is notified. "notify-blur" when an editable editor loses focus, this is notified. ...
... "notify-focus" when an editable editor gets focus, this is notified. ...
nsITreeBoxObject
void ensurerowisvisible(in long index); void ensurecellisvisible(in long row, in nsitreecolumn col); void scrolltorow(in long index); void scrollbylines(in long numlines); void scrollbypages(in long numpages); void scrolltocell(in long row, in nsitreecolumn col); void scrolltocolumn(in nsitreecolumn col); void scrolltohorizontalposition(in long horizontalposition); void invalidate(); void invalidatecolumn(in nsitreecolumn col); void invalidaterow(in long index); void invalidatecell(in long row, in nsitreecolumn col); void invalidaterange(in long startindex, in long endindex); void invalidatecolumnrange(in long startindex, in long endindex, in nsitreecolumn col); long...
...ing this attribute to a new value. focused boolean whether or not we are currently focused. treebody nsidomelement readonly: obtain the treebody content node. this is a node that corresponds to the treechildren tag. rowheight long readonly: obtain the height of a row. rowwidth long readonly: obtain the width of a row. horizontalposition long readonly: get the pixel position of the horizontal scrollbar. selectionregion nsiscriptableregion readonly: return the region for the visible parts of the selection, in device pixels. methods getfirstvisiblerow() get the index of the first visible row. long getfirstvisiblerow(); getlastvisiblerow() get the index of the last visible row. long getlastvisiblerow();...
...corner of the visible view. void scrolltocell(in long row, in nsitreecolumn col); parameters row the cell's row index col the nsitreecolumn of the cell scrolltocolumn() scrolls horizontally so that the specified column is at the left of the view (if possible). void scrolltocolumn(in nsitreecolumn col); parameters col the nsitreecolumn to scroll to scrolltohorizontalposition() scroll to a specific horizontal pixel position. void scrolltohorizontalposition(in long horizontalposition); parameters horizontalposition the number of pixels to scroll invalidate() invalidatecolumn() invalidaterow() invalidatecell() invalidaterange() invalidatecolumnrange() invalidation methods for fine-grained painting control. void invalidate(); void invalidatecolumn(in nsit...
...meters row the index of the row col the nsitreecolumn rowcountchanged() notify the tree that the number of rows changed. the view is responsible for calling this notification method when rows are added or removed. for non-contiguous additions/removals, this method should be called multiple times. void rowcountchanged(in long index, in long count); parameters index the position at which the new rows were added or at which rows were removed. count the number of rows added or removed. use negative values for removed rows. example you deleted the row with index rowindex. inform the tree about this change by calling rowcountchanged(rowindex+1, -1); beginupdatebatch() notify the tree that the view is about to perform a batch update, that is, add, remove or invalida...
Using the CSS Painting API - Web APIs
nterface, canvastext, and canvastextdrawingstyles apis. we define the fillstyle as being hsla(55, 90%, 60%, 1.0), which is a shade of yellow, and then call fillrect() to create a rectangle of that color. the fillrect() parameters are, in order, x-axis origin, y-axis origin, width, and height. fillrect(0, 15, 200, 20) results in the creation of a rectangle that is 200 units wide by 20 units tall, positioned 0 units from the left and 15 units from the top of the content box. we can use the css background-size and background-position properties to re-size or relocate this background image, but this is the default size and placement of the yellow box we created in our paint worklet. we tried to keep the example simple. for more options, look at the canvas documentation. we also add a little bit of ...
...ackground-image: paint(headerhighlight); } putting it together we can then add the fancy class to any element on the page to add a yellow box as a background: <h1 class="fancy">my cool header</h1> the following example will look like the image above in browsers supporting the css painting api. while you can't play with the worklet's script, you can alter the background-size and background-position to change the size and location of the background image. paintsize in the example above, we created a 20x200 unit box, painted 15 units from the top of the element it is the same regardless of the size of the element. if the text is small, the yellow box looks like a huge underline. if the text is huge, the box might look like an bar above the first three letters. it would be better if the bac...
...e paintsize, the dimensions (height and width) of the box being painted */ paint(ctx, size) { ctx.fillstyle = 'hsla(55, 90%, 60%, 1.0)'; ctx.fillrect( 0, size.height / 3, size.width * 0.4, size.height * 0.6 ); } }); this code example has two differences from our first example: we've included a second argument, which is the paint size. we've changed the dimensions and positioning of our rectangle to be relative to the size of the element box rather than absolute values. we can pass the second parameter into the paint() function to give us access to the width and the height of the element, via .width and .height properties. our header now has a highlight that changes according to it's size. css.paintworklet.addmodule('https://mdn.github.io/houdini-examples/csspaint...
...worklet.addmodule('https://mdn.github.io/houdini-examples/csspaint/intro/worklet/boxbg.js'); while you can't play with the worklet's script, you can alter the custom property values to change the colors and width of the background image. adding complexity the above examples might not seem very exciting, as you could recreate them in a few different ways with existing css properties, e.g. by positioning some decorative generated content with ::before, or including background: linear-gradient(yellow, yellow) 0 15px / 200px 20px no-repeat; what makes the css painting api so interesting and powerful is that you can create complex images, passing variables, that automatically resize. let's take a look at a more complex paint example. registerpaint('headerhighlight', class { static get inputpr...
Detecting device orientation - Web APIs
motion of the device. orientation example this example will work on any browser supporting the deviceorientation event and running on a device able to detect its orientation. ...
...event and running on a device able to detect its orientation. ...
... warning: chrome and firefox do not handle the angles the same wa...
...cemotionevent object passed as a parameter of the handlemotion function. the motion event contains four properties: devicemotionevent.acceleration devicemotionevent.accelerationincludinggravity devicemotionevent.rotationrate devicemotionevent.interval motion values explained the devicemotionevent objects provide web developers with information about the speed of changes for the device's position and orientation. the changes are provided along three axis (see orientation and motion data explained for details). for acceleration and accelerationincludinggravity, those axes correspond to the following: x: represents the axis from west to east y: represents the axis from south to north z: represents the axis perpendicular to the ground for rotationrate, the situation is a bit differen...
HTMLMediaElement - Web APIs
the htmlmediaelement interface adds to htmlelement the properties and methods needed to support basic media-related capabilities that are common to audio and video. the htmlvideoelement and htmlaudioelement elements both inherit this interface. ...
...htmlelement the properties and methods needed to support basic media-related capabilities that are common to audio and video. the htmlvideoelement and htmlaudioelement elements both inherit this interface. ...
...spitch). htmlmediaelement.readystate read only returns a unsigned short (enumeration) indicating the readiness state of the media. htmlmediaelement.seekable read only returns a timeranges object that contains the time ranges that the user is able to seek to, if any. htmlmediaelement.seeking read only returns a boolean that indicates whether the media is in the process of seeking to a new position. htmlmediaelement.sinkid read only returns a domstring that is the unique id of the audio device delivering output, or an empty string if it is using the user agent default. this id should be one of the mediadeviceinfo.deviceid values returned from mediadevices.enumeratedevices(), id-multimedia, or id-communications. htmlmediaelement.src is a domstring that reflects the src html attribute,...
...ets the eventhandler called when the media is encrypted. htmlmediaelement.onwaitingforkey sets the eventhandler called when playback is blocked while waiting for an encryption key. obsolete attributes these attributes are obsolete and should not be used, even if a browser still supports them. htmlmediaelement.initialtime read only returns a double that indicates the initial playback position in seconds. htmlmediaelement.mozchannels read only returns a double representing the number of channels in the audio resource (e.g., 2 for stereo). obsolete event handlers htmlmediaelement.onmozinterruptbegin sets the eventhandler called when the media element is interrupted because of the audio channel manager. this was firefox-specific, having been implemented for firefox os, a...
HTMLTableSectionElement - Web APIs
the htmltablesectionelement interface provides special properties and methods (beyond the htmlelement interface it also has available to it by inheritance) for manipulating the layout and presentation of sections, that is headers, footers and bodies, in an html table. ...
...es and methods (beyond the htmlelement interface it also has available to it by inheritance) for manipulating the layout and presentation of sections, that is headers, footers and bodies, in an html table. ...
...ted. htmltablesectionelement.valign is a domstring representing an enumerated value indicating how the content of the cell must be vertically aligned. it reflects the valign attribute and can have one of the following values: "top", "middle", "bottom", or "baseline". methods inherits methods from its parent, htmlelement. htmltablesectionelement.deleterow() removes the cell at the given position in the section. if the given position is greater (or equal as it starts at zero) than the amount of rows in the section, or is smaller than 0, it raises a domexception with the indexsizeerror value. htmltablesectionelement.insertrow() inserts a new row just before the given position in the section. if the given position is not given or is -1, it appends the row to the end of section. if the giv...
... specifications specification status comment html living standardthe definition of 'htmltablesectionelement' in that specification. ...
IDBCursorSync - Web APIs
) raises (idbdatabaseexception); attributes attribute type description count readonly unsigned long long the total number of objects that share the current key. direction readonly unsigned short the direction of traversal of the cursor. see constants for possible values. key readonly any the key for the record at the cursor's position. value any the value for the record at the cursor's position. 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. not_allowed_err if the underlying index or object store does not su...
...tes, and its direction is monotonically increasing in the order of keys. prev 2 this cursor includes duplicates, and its direction is monotonically decreasing in the order of keys. prev_no_duplicate 3 this cursor does not include duplicates, and its direction is monotonically decreasing in the order of keys. ...
...ion is monotonically decreasing in the order of keys. prev_no_duplicate 3 this cursor does not include duplicates, and its direction is monotonically decreasing in the order of keys. methods continue() advances the cursor to the next position along its direction, to the item whose key matches the optional key parameter. if no key is specified, advance to the immediate next position. returns false if the cursor has reached the end of its range; otherwise returns true. ...
... methods continue() advances the cursor to the next position along its direction, to the item whose key matches the optional key parameter. if no key is specified, advance to the immediate next position. returns false if the cursor has reached the end of its range; otherwise returns true. bool continue ( in optional any key ); parameters key the key to which to move the cursor's position. remove() deletes the record at the cursor's position, without changing the cursor's position void delete ( ) raises (databaseexception); exceptions this method can raise an idbdatabaseexception with the following code: not_allowed_err if the underlying index or object store does not support updating the record because it is open in the read_only or snapshot_read mode. ...
MSCandidateWindowShow - Web APIs
indows ui, this event is supported in windows 8.1 imes of all languages. syntax event property object.oncandidatewindowshow = handler; addeventlistener method object.addeventlistener("mscandidatewindowshow", handler, usecapture) parameters pevtobj [in] type: ihtmleventobj pointer to an ihtmleventobj interface for the current event. this event fires after the positioning information of the ime candidate window has been determined. you can obtain the positioning information using the getcandidatewindowclientrect method, and adjust your layout as needed to avoid any occlusions with the ime candidate window. web applications need only register for this event once per element (the handler will remain valid for the lifetime of the element). example in ie11, deve...
...y occlusions with the ime candidate window. web applications need only register for this event once per element (the handler will remain valid for the lifetime of the element). ...
...developers could listen to them and shift the suggestion ui accordingly. see also microsoft api extensions ime handling guide for gecko ...
...developers could listen to them and shift the suggestion ui accordingly. see also microsoft api extensions ime handling guide for gecko ...
Capabilities, constraints, and settings - Web APIs
stream from the <video> element by setting htmlmediaelement.srcobject to null. simple tab support in the editor this code adds simple support for tabs to the <textarea> elements by making the tab key insert two space characters when either constraint edit box is focused. ...
...ect to null. simple tab support in the editor this code adds simple support for tabs to the <textarea> elements by making the tab key insert two space characters when either constraint edit box is focused. ...
...r this code adds simple support for tabs to the <textarea> elements by making the tab key insert two space characters when either constraint edit box is focused. ...
...ert two space characters when either constraint edit box is focused. function keydownhandler(event) { if (event.key == "tab") { let elem = event.target; let str = elem.value; let position = elem.selectionstart; let newstr = str.substring(0, position) + " " + str.substring(position, str.length); elem.value = newstr; elem.selectionstart = elem.selectionend = position + 2; event.preventdefault(); } } videoconstrainteditor.addeventlistener("keydown", keydownhandler, false); audioconstrainteditor.addeventlistener("keydown", keydownhandler, false); show constrainable properties the browser supports the last significant piece of the puzzle: code that displays, for the user's reference, a list of the constrainable properties which their browser supports. ...
MouseEvent - Web APIs
p, mousedown. mouseevent derives from uievent, which in turn derives from event. though the mouseevent.initmouseevent() method is kept for backward compatibility, creating of a mouseevent object should be done using the mouseevent() constructor. several more specific events are based on mouseevent, including wheelevent and dragevent. ...
... compatibility, creating of a mouseevent object should be done using the mouseevent() constructor. several more specific events are based on mouseevent, including wheelevent and dragevent. ...
...mouseevent.clienty read only the y coordinate of the mouse pointer in local (dom content) coordinates. mouseevent.ctrlkey read only returns true if the control key was down when the mouse event was fired. mouseevent.metakey read only returns true if the meta key was down when the mouse event was fired. ...
...ead only returns true if the control key was down when the mouse event was fired. mouseevent.metakey read only returns true if the meta key was down when the mouse event was fired. mouseevent.movementx read only the x coordinate of the mouse pointer relative to the position of the last mousemove event. mouseevent.movementy read only the y coordinate of the mouse pointer relative to the position of the last mousemove event. 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. mouseevent.pagex read only the x coordinate of the mouse pointer relative to the whole documen...
Node - Web APIs
Web › API › Node
and entityreference. in some cases, a particular feature of the base node interface may not apply to one of its child interfaces; in that case, the inheriting node may return null or throw an exception, depending on circumstances. for example, attempting to add children to a node type that cannot have children will throw an exception. ...
... inheriting node may return null or throw an exception, depending on circumstances. for example, attempting to add children to a node type that cannot have children will throw an exception. ...
...e if it's the topmost node in the tree. this has been replaced by node.getrootnode(). methods in addition to the properties below, node inherits methods from its parent, eventtarget. node.appendchild(childnode) adds the specified childnode argument as the last child to the current node. if the argument referenced an existing node on the dom tree, the node will be detached from its current position and attached at the new position. node.clonenode() clone a node, and optionally, all of its contents. by default, it clones the content of the node. node.comparedocumentposition() compares the position of the current node against another node in any other document. node.contains() returns a boolean value indicating whether or not a node is a descendant of the calling node. node.getboxquads...
...cationthe definition of 'node' in that specification. obsolete the methods insertbefore(), replacechild(), removechild(), and appendchild() returns one more kind of error (not_supported_err) if called on a document. the normalize() method has been modified so that text node can also be normalized if the proper domconfiguration flag is set. added the following methods: comparedocumentposition(), issamenode(), lookupprefix(), isdefaultnamespace(), lookupnamespaceuri(), isequalnode(), getfeature(), setuserdata(), and getuserdata(). added the following properties: baseuri and textcontent. document object model (dom) level 2 core specificationthe definition of 'node' in that specification. obsolete the ownerdocument property was slightly modified so that documentfragmen...
Using the Permissions API - Web APIs
n the value of the state property of the permissionstatus object returned when the promise resolves, it reacts differently: "granted" the "enable geolocation" button is hidden, as it isn't needed if geolocation is already active. "prompt" the "enable geolocation" button is hidden, as it isn't needed if the user will be prompted to grant permission for geolocation. the geolocation.getcurrentposition() function is then run, which prompts the user for permission; it runs the revealposition() function if permission is granted (which shows the map), or the positiondenied() function if permission is denied (which makes the "enable geolocation" button appear). "denied" the "enable geolocation" button is revealed (this code needs to be here too, in case the permission state is already set to deni...
...this origin when the page is first loaded). ...
...n the page is first loaded). ...
...e is first loaded). ...
SVGTRefElement - Web APIs
the svgtrefelement interface corresponds to the <tref> elements. object-oriented access to the attributes of the <tref> element via the svg dom is not possible. ...
... the svgtrefelement interface corresponds to the <tref> elements. object-oriented access to the attributes of the <tref> element via the svg dom is not possible. ...
... specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the definition of 'svgtrefelement' in that specification. recomme...
...4e53" text-anchor="middle" alignment-baseline="middle">svgtrefelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface has no properties but inherits properties from its parent, svgtextpositioningelement and implements properties from svgurireference. methods this interface has no methods but inherits methods from its parent, svgtextpositioningelement and implements properties from svgurireference. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the definition of 'svgtrefelement' in that specification. recommendation initial definition ...
SVGTSpanElement - Web APIs
the svgtspanelement interface represents a <tspan> element. ...
... the svgtspanelement interface represents a <tspan> element. ...
..."#fff" stroke="#d4dde4" stroke-width="2px" /><text x="156" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgtextcontentelement</text></a><polyline points="51,89 41,84 41,94 51,89" stroke="#d4dde4" fill="none"/><line x1="41" y1="89" x2="11" y2="89" stroke="#d4dde4"/><a xlink:href="/docs/web/api/svgtextpositioningelement" target="_top"><rect x="-239" y="65" width="250" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="-114" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgtextpositioningelement</text></a><polyline points="-239,89 -249,84 -249,94 -239,89" stroke="#d4dde4" fill="none"/><l...
... methods this interface doesn't provide any specific methods. specifications specification status comment scalable vector graphics (svg) 2the definition of 'svgtspanelement' in that specification. candidate recommendation no changes scalable vector graphics (svg) 1.1 (second edition)the definition of 'svgtspanelement' in that specification. ...
TreeWalker - Web APIs
a treewalker can be created using the document.createtreewalker() method. properties this interface doesn't inherit any property. treewalker.root read only returns a node representing the root node as specified when the treewalker was created. treewalker.whattoshow read only returns an unsigned long being a bitmask made of constants describing the types of node that must be presented. non-matching nodes are skipped, but their children may be included, if relevant. ...
...e: constant numerical value description nodefilter.show_all -1 (that is the max value of unsigned long) shows all nodes. nodefilter.show_attribute 2 shows attribute attr nodes. this is meaningful only when creating a treewalker with an attr node as its root. in this case, it means that the attribute node will appear in the first position of the iteration or traversal. since attributes are never children of other nodes, they do not appear when traversing over the document tree. nodefilter.show_cdata_section 8 shows cdatasection nodes. nodefilter.show_comment 128 shows comment nodes. nodefilter.show_document 256 shows document nodes. nodefilter.show_document_...
... shows documentfragment nodes. nodefilter.show_document_type 512 shows documenttype nodes. nodefilter.show_element 1 shows element nodes. nodefilter.show_entity 32 shows entity nodes. this is meaningful only when creating a treewalker with an entity node as its root; in this case, it means that the entity node will appear in the first position of the traversal. since entities are not part of the document tree, they do not appear when traversing over the document tree. nodefilter.show_entity_reference 16 shows entityreference nodes. nodefilter.show_notation 2048 shows notation nodes. this is meaningful only when creating a treewalker with a notation node as its root; in this case, it means tha...
...t of the document tree, they do not appear when traversing over the document tree. nodefilter.show_entity_reference 16 shows entityreference nodes. nodefilter.show_notation 2048 shows notation nodes. this is meaningful only when creating a treewalker with a notation node as its root; in this case, it means that the notation node will appear in the first position of the traversal. since entities are not part of the document tree, they do not appear when traversing over the document tree. nodefilter.show_processing_instruction 64 shows processinginstruction nodes. nodefilter.show_text 4 shows text nodes. treewalker.filter read only returns a nodefilter used to select the relevant nodes. treewalker.expa...
Visual Viewport API - Web APIs
he visual viewport without affecting the layout viewport. what happens when a web page element needs to be visible on screen regardless of the visible portion of a web page? for example, what if you need a set of image controls to remain on screen regardless of the pinch zoom level of the device? current browsers vary in how they handle this. ...
... accessing the api window.visualviewport read only a read-only reference to the window's visualviewport object. if this property doesn't exist, the api is unsupported. interfaces visualviewport represents the visual viewport for a given window. ...
...al viewport that would normally be anchored to the layout viewport. accessing the api window.visualviewport read only a read-only reference to the window's visualviewport object. if this property doesn't exist, the api is unsupported. interfaces visualviewport represents the visual viewport for a given window. a window's visualviewport object provides information about the viewport's position and size, and receives the resize and event:visualviewport:scroll events you can onitor to know when chances occur to the window's viewport. example the code below is based on the sample the specification, though it adds a few things that make it function better. it shows a function called viewporthandler(). when called it queries the offsetleft and height properties for values it uses in a cs...
...resize and onscroll fire at the same time. using requestanimationframe() ensures that the transform ocurrs before the next render. let pendingupdate = false; function viewporthandler(event) { if (pendingupdate) return; pendingupdate = true; requestanimationframe(() => { pendingupdate = false; 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. var viewport = event.target; var offsetleft = viewport.offsetleft; var offsettop = viewport.height - layoutviewport.getboundingclientrect().height + viewport.offsettop; // you could also do this by setting style.left and style.top if you // use w...
Using shaders to apply color in WebGL - Web APIs
step is to add a splash of color to it. we can do this by revising the shaders. this example uses the glmatrix library to perform its matrix and vertex math. you'll need to include it if you create your own project based on this code. our sample loads a copy from a cdn in our html's <head>. applying color to the vertices in webgl objects are built using sets of vertices, each of which has a position and a color. by default, all other pixels' colors (and all its other attributes, including position) are computed using interpolation, automatically creating smooth gradients. previously, our vertex shader didn't apply any specific colors to the vertices. between this and the fragment shader assigning the fixed color of white to each pixel, the entire square was rendered as solid white. let's sa...
... function: function initbuffers(){ ... const colors = [ 1.0, 1.0, 1.0, 1.0, // white 1.0, 0.0, 0.0, 1.0, // red 0.0, 1.0, 0.0, 1.0, // green 0.0, 0.0, 1.0, 1.0, // blue ]; const colorbuffer = gl.createbuffer(); gl.bindbuffer(gl.array_buffer, colorbuffer); gl.bufferdata(gl.array_buffer, new float32array(colors), gl.static_draw); return { position: positionbuffer, color: colorbuffer, }; } this code starts by creating a javascript array containing four 4-value vectors, one for each vertex color. then a new webgl buffer is allocated to store these colors, and the array is converted into floats and stored into the buffer. to use these colors, the vertex shader needs to be updated to pull the appropriate color from the color buffer: ...
...} this code starts by creating a javascript array containing four 4-value vectors, one for each vertex color. then a new webgl buffer is allocated to store these colors, and the array is converted into floats and stored into the buffer. to use these colors, the vertex shader needs to be updated to pull the appropriate color from the color buffer: const vssource = ` attribute vec4 avertexposition; attribute vec4 avertexcolor; uniform mat4 umodelviewmatrix; uniform mat4 uprojectionmatrix; varying lowp vec4 vcolor; void main(void) { gl_position = uprojectionmatrix * umodelviewmatrix * avertexposition; vcolor = avertexcolor; } `; the key difference here is that for each vertex, we pass its color using a varying to the fragment shader. coloring the ...
... const fssource = ` void main() { gl_fragcolor = vec4(1.0, 1.0, 1.0, 1.0); } `; in order to pick up the interpolated color for each pixel, we need to change this to fetch the value from the vcolor varying: const fssource = ` varying lowp vec4 vcolor; void main(void) { gl_fragcolor = vcolor; } `; each fragment receives the interpolated color based on its position relative to the vertex positions instead of a fixed value. 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.getatt...
Using bounded reference spaces - Web APIs
ed behavior for users of these platforms. the space inside the boundary is then the user's safe movement area, within which they are tracked and their movements replicated into the virtual world. although the user's xr system may provide automated detection and protection against exiting the safe area, it is always good practice to handle this yourself, watching for collisions between the user's position and the boundary of the world, and providing guidance to move back toward the origin point, or at least to stay inside the safe zone. xr hardware that does not have an inherent boundary defined may or may not support the bounded reference space. if it does, it likely has a system in place to allow the user to specify or select the boundaries to apply if a bounded space is to be used. however, it...
...reference space, the user's xr device doesn't have built-in support for determining floor level, the webxr layer will still create a local-floor space. however, the floor level will be simulated by choosing and emulating the floor level and shifting the view upward by a fixed amount in order to ensure that the scene's contents render in the right place. keep in mind that by default, the viewer's position is placed immediately above the floor, like a camera lying on the ground. if you wish to simulate a human's perspective on the scene, you probably want to move the viewpoint upward by a distance that approximates human eye level by transforming it by providing an appropriate transform matrix to the xrreferencespace method requestoffsetreferencespace(). this would change the onrefspacecreated() m...
...oint upward by a distance that approximates human eye level by transforming it by providing an appropriate transform matrix to the xrreferencespace method requestoffsetreferencespace(). ...
...this approximates human height, though it assumes we've previously transformed the coordinate system so that the value of each coordinate is no longer...
XRInputSource.gripSpace - Web APIs
eturns an xrspace whose native origin tracks the pose used to render virtual objects so they appear to be held in (or part of) the user's hand. for example, if a user were holding a virtual straight rod, the native origin of this xrspace would be located at the approximate center of mass of the user's fist. syntax var xrspace = xrinputsource.gripspace; value an xrspace object representing the position and orientation of the input device in virtual space, suitable for rendering an image of the device into the scene. gripspace is null if the input source is inherently untrackable. for example, only inputs whose targetraymode is tracked-pointer provide a gripspace. imagine that the controller is shaped like a straight rod, held in the user's fist. the native origin of the grip space is located a...
...dering an image of the device into the scene. gripspace is null if the input source is inherently untrackable. for example, only inputs whose targetraymode is tracked-pointer provide a gripspace. imagine that the controller is shaped like a straight rod, held in the user's fist. the native origin of the grip space is located at the centroid—the center of mass—of the user's fist, tracking the position of the user's hand. the coordinate system for the left hand's grip space. the coordinate system for the right hand's grip space. as shown in the diagram above, the coordinate system is oriented as follows: the x-axis is perpendicular to the palm of the user's hand, with the direction extending outward from the back of the hand being +x if the controller is in the user's right ...
...grip. +z is in the direction of the user's thumb, and -z is in the opposite direction. the y-axis is implied by the relationship between the other two axes; as is always the case, it's the cross product of the other two axes (lying 90° away from both the x and z axes). examples in tis example, taken from the frame rendering callback, the gripspace is used to render a mesh that represents the position and orieintation of the controller in the virtual environment. for (let source in xrsession.inputsources) { if (source.gripspace) { let grippose = frame.getpose(source.gripspace, xrrefspace); if (grippose) { mydrawmeshusingtransform(controllermesh, grippose.transform.matrix); } } } for each input source which has a value for gripspace, this loop obtains the xrpose repres...
...tation of the controller in the virtual environment. for (let source in xrsession.inputsources) { if (source.gripspace) { let grippose = frame.getpose(source.gripspace, xrrefspace); if (grippose) { mydrawmeshusingtransform(controllermesh, grippose.transform.matrix); } } } for each input source which has a value for gripspace, this loop obtains the xrpose representing the position and orientation that are described by gripspace. if a valid pose is returned, a method mydrawmeshusingtransform() is called to draw the controller's mesh transformed using the grip pose's transform matrix. specifications specification status comment webxr device apithe definition of 'xrinputsource.gripspace' in that specification. working draft initial definition.
XRInputSource.targetRaySpace - Web APIs
the read-only xrinputsource property targetrayspace returns an xrspace (typically an xrreferencespace) representing the position and orientation of the target ray in the virtual space. its native origin tracks the position of the origin point of the target ray, and its orientation indicates the orientation of the controller device itself. these values, interpreted in the context of the input source's targetraymode, can be used both to fully interpret the device as an input source. <<<--- needs diagram showing targetrayspace relative to gripspace and world space --->>> to obtain an xrspace representing the input controller's position and orientation in virtual space, use the gripspace property. syntax let targetrayspace = xrinputsource.targetrayspace; value an xrspace object—typically an...
...nput source. <<<--- needs diagram showing targetrayspace relative to gripspace and world space --->>> to obtain an xrspace representing the input controller's position and orientation in virtual space, use the gripspace property. syntax let targetrayspace = xrinputsource.targetrayspace; value an xrspace object—typically an xrreferencespace or xrboundedreferencespace—which represents the position and orientation of the input controller's target ray in virtual space. the native origin of the returned xrspace is located at the point from which the target ray is emitted, and the orientation of the space indicates the direction in which the target ray is pointing. usage notes all input sources—regardless of their targetraymode—have a valid targetrayspace. the exact meaning of this spac...
...et ray space, since the gaze input comes from the viewer's head. this shared space represents the same location as the space returned by the xrsession method requestreferencespace(), but is maintained as a different object to allow for future enhancements to the api. the target ray space reported by tracked pointer inputs (targetraymode of tracked-pointer) is actually based upon the true spatial position and orientation of the input device. to determine the position and orientation of the target ray while rendering a frame, pass it into the xrframe method getpose() method, then use the returned xrpose object's transform to gather the spatial information you need. example this fragment of code shows part of a function to be called once every frame. it looks for inputs which have a non-null tar...
...s that project a target ray outward from the user. for each such input, this example looks for inputs whose targetraymode is tracked-pointer, indicating that the input is in fact intended to represent a targeting device rather than a gazing device, screen tap, or mouse click. for tracked pointers, a function myrendertargetrayasbeam() is called to render a beam from the input controller's virtual position outward in the direction it's pointing. the code should continue to perform tasks such as drawing controllers or any objects representative of the user's hands' positions in the virtual space, as well as any other input-related tasks. function updateinputsources(session, frame, refspace) { for (let source of session.getinputsources()) { let targetraypose = frame.getpose(inputsource.target...
XRPose - Web APIs
Web › API › XRPose
xrpose is a webxr api interface representing a position and orientation in the 3d space, relative to the xrspace within which it resides. the xrspace—which is either an xrreferencespace or an xrboundedreferencespace—defines the coordinate system used for the pose and, in the case of an xrviewerpose, its underlying views. to obtain the xrpose for the xrspace used as the local coordinate system of an object, call xrframe.getpose(), specifying that local xrspace and the space to which you wish to convert: thepose = xrframe.getpose(localspace, basespace); the pose for a viewer (or camera) is represented by the xrviewerpose subclass of xrpose. ...
...al coordinate system of an object, call xrframe.getpose(), specifying that local xrspace and the space to which you wish to convert: thepose = xrframe.getpose(localspace, basespace); the pose for a viewer (or camera) is represented by the xrviewerpose subclass of xrpose. ...
...pecifying that local xrspace and the space to which you wish to convert: thepose = xrframe.getpose(localspace, basespace); the pose for a viewer (or camera) is represented by the xrviewerpose subclass of xrpose. this is obtained using xrframe.getviewerpose() instead of getpose(), specifying a reference space which has been adjusted to position and orient the node to provide the desired viewing position and angle: viewerpose = xrframe.getviewerpose(adjreferencespace); here, adjreferencespace is a reference space which has been updated using the base frame of reference for the frame and any adjustments needed to position the viewer based on movement or rotation which is being supplied from a source other than the xr device, such as keyboard or mouse inputs. see the article movement, orientatio...
... frame and any adjustments needed to position the viewer based on movement or rotation which is being supplied from a source other than the xr device, such as keyboard or mouse inputs. see the article movement, orientation, and motion for further details and an example with thorough explanations of what's going on. properties xrpose.transform read only a xrrigidtransform which provides the position and orientation of the pose relative to the base xrspace. xrpose.emulatedposition read only a boolean value which is false if the position and orientation given by transform is obtained directly from a full six degree of freedom (6dof) xr device (that is, a device which tracks not only the pitch, yaw, and roll of the head but also the forward, backward, and side-to-side motion of the viewer). ...
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 transform of an xrview. the transform of an xrpose. the xrreferencespaceevent event's transform property, as found in the reset event received by an xrreferencespace. ...
...e places rather than bare arrays that providing the matrix data is that the xrrigidtransform automatically does things like computing the inverse of the transform. even better, once it's been computed, it's cached so that subsequent requests are significantly faster. constructor new xrrigidtransform() creates a new xrrigidtransform object which represents a transform that applies a specified position and/or orientation. attributes xrrigidtransform.position read only a dompointreadonly specifying a 3-dimensional point, expressed in meters, describing the translation component of the transform. the w attribute is always 1.0. xrrigidtransform.orientation read only a dompointreadonly which contains a unit quaternion describing the rotational component of the transform. as a unit qua...
...a matrix. xrrigidtransform.inverse read only returns a xrrigidtransform which is the inverse of this transform. that is, if applied to an object that had been previously transformed by the original transform, it will undo the transform and return the original object. usage notes when an xrrigidtransform is interpreted, the orientation is always applied to the affected object before the position is applied. 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. it then requests the first animation frame callback by calling the session's requestanimationframe() method. xrsession.requestreferencespace(refspacetype) .then((refspace) => { xrreferencespace = refspac...
... in relation to the current reference space to use when creating a new reference space. it then requests the first animation frame callback by calling the session's requestanimationframe() method. 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. working draft initial definition. ...
XRView.transform - Web APIs
Web › API › XRView › transform
the read-only transform property of the xrview interface is an xrrigidtransform object which provides the position and orientation of the viewpoint relative to the xrreferencespace specified when the xrframe.getviewerpose() method was called to obtain the view object. with the transform, you can then position the view as a camera within the 3d scene. if you instead need the more traditional view matrix, you can get using view.transform.inverse.matrix; this gets the underlying matrix of the transform's inverse. syntax let viewtransform = xrview.transform; value a xrrigidtransform object specifying the position and orientation of the viewpoint represented by the xrview. ...
...the more traditional view matrix, you can get using view.transform.inverse.matrix; this gets the underlying matrix of the transform's inverse. syntax let viewtransform = xrview.transform; value a xrrigidtransform object specifying the position and orientation of the viewpoint represented by the xrview. examples for each view making up the presented scene, the view's transform represents the position and orientation of the viewer or camera relative to the reference space's origin. you can then use the inverse of this matrix to transform the objects in your scene to adjust their placement and orientation to simulate the viewer's movement through space. in this example, we see an outline of a code fragment used while rendering an xrframe, which makes use of the view transform to place objects ...
...in the future with some additions to the api. for each view, we obtain its viewport and pass that to webgl using gl.viewport(). for the left eye, this will be the left half of the canvas, while the right eye will use the right half. then we iterate over each object that makes up the scene. each object's model view matrix is computed by multiplying its own matrix which describes the object's own position and orientation by the additional position and orientation adjustments needed to match the camera's movement. to convert the "camera focused" transform matrix into an "object focused" transform, we use the transform's inverse, thus taking the matrix returned by view.transform.inverse.matrix. the resulting model view matrix will apply all the transforms needed to move and rotate the object based o...
...this will simulate the movement of the camera even though we're actually moving the object. we then compute the normals for the model view matrix by inverting it, then transposing it. finally, we call the object's render() routine, passing along the modelviewmatrix and normalmatrix so the renderer can place and light the object properly. ...
-moz-image-rect - CSS: Cascading Style Sheets
irefox logo in four <div> blocks. clicking on their container causes the four segments to rotate around by swapping the background-image property values among the four <div> blocks. css the css defines one container style, then the styles for the four boxes that comprise the complete image. ...
...x; height:272px; top:100px; left:100px; position:absolute; font-size:16px; text-shadow:white 0px 0px 6px; text-align:center; } then the four boxes defining the segments of the image are defined. let's look at them one at a time. #box1 { background-image: -moz-image-rect(url(https://mdn.mozillademos.org/files/12053/firefox.png), 0%, 50%, 50%, 0%); width:133px; height:136px; position:absolute; } this is the top-left corner of the image. it defines a rectangle containing the top-left quarter of the image in the file firefox.jpg. #box2 { background-image: -moz-image-rect(url(https://mdn.mozillademos.org/files/12053/firefox.png), 0%, 100%, 50%, 50%); width:133px; height:136px; position:absolute; } this defines the top-right corner of the image. the other corners fo...
...z-image-rect(url(https://mdn.mozillademos.org/files/12053/firefox.png), 0%, 100%, 50%, 50%); width:133px; height:136px; position:absolute; } this defines the top-right corner of the image. ...
...er of the image. ...
:target - CSS: Cascading Style Sheets
Web › CSS › :target
v> <div class="lightbox" id="example2"> <figure> <a href="#" class="close"></a> <figcaption>cras risus odio, pharetra nec ultricies et, mollis ac augue. nunc et diam quis sapien dignissim auctor. ...
...uctor. ...
...box */ .lightbox { display: none; } /* opened lightbox */ .lightbox:target { position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; } /* lightbox content */ .lightbox figcaption { width: 25rem; position: relative; padding: 1.5em; background-color: lightpink; } /* close button */ .lightbox .close { position: relative; display: block; } .lightbox .close::after { right: -1rem; top: -1rem; width: 2rem; height: 2rem; position: absolute; display: flex; z-index: 1; align-items: center; justify-content: center; background-color: black; border-radius: 50%; color: white; content: "×"; cursor: pointer; } /* lightbox overlay */ .lightbox .close::before { left: 0; top: 0; ...
... living standard defines html-specific semantics. ...
CSS Box Alignment - CSS: Cascading Style Sheets
. fallback alignment if you set an alignment that cannot be fulfilled, then the fallback alignment will come into play and deal with the available space. this fallback alignment is specified individually for each layout method and detailed on the page for that method. types of alignment there are three different types of alignment that the specification details; these use keyword values. ...
...n alignment that cannot be fulfilled, then the fallback alignment will come into play and deal with the available space. this fallback alignment is specified individually for each layout method and detailed on the page for that method. types of alignment there are three different types of alignment that the specification details; these use keyword values. ...
...se use keyword values. positional alignment: specifying the position of an alignment subject with relation to its alignment container. baseline alignment: these keywords define alignment as a relationship among the baselines of multiple alignment subjects within an alignment context. distributed alignment: these keywords define alignment as a distribution of space among alignment subjects. positional alignment keyword values the following values are defined for positional alignment, and can be used as values for content alignment with justify-content and align-content and also for self alignment with justify-self and align-self. center start end self-start self-end flex-start for flexbox only flex-end for flexbox only left right other than the physical values of left and right...
...g individual alignment properties as the css box alignment properties are implemented differently depending on the specification they interact with, refer to the following pages for each layout type for details of how to use the alignment properties with it: box alignment in flexbox box alignment in css grid layout box alignment in multiple-column layout box alignment for block, absolutely positioned and table layout reference css properties justify-content align-content place-content justify-items align-items place-items justify-self align-self place-self row-gap column-gap gap glossary entries cross axis main axis alignment container alignment subject fallback alignment guides css flexbox guide: basic concepts of flexbox css flexbox guide: aligning item...
Layout using named grid lines - CSS: Cascading Style Sheets
s="wrapper"> <div class="box1">one</div> <div class="box2">two</div> <div class="box3">three</div> <div class="box4">four</div> </div> everything else about line-based placement still works in the same way and you can mix named lines and line numbers. naming lines is useful when creating a responsive design where you redefine the grid, rather than then needing to redefine the content position by changing the line number in your media queries, you can ensure that the line is always named the same in your definitions. giving lines multiple names you may want to give a line more than one name, perhaps it denotes the sidebar-end and the main-start for example. to do this add the names inside the square brackets with whitespace between them [sidebar-end main-start]. you can then refer to...
... areas created using the grid-area property, then a layout created in grid-template-areas. the area names are: hd ft main sd this gives us column and row lines: hd-start hd-end sd-start sd-end main-start main-end ft-start ft-end you can see the named lines in the image, note that some lines have two names - for example sd-end and main-start refer to the same column line. to position overlay using these implicit named lines is the same as positioning an item using lines that we have named. * {box-sizing: border-box;} .wrapper { border: 2px solid #f76707; border-radius: 5px; background-color: #fff4e6; } .wrapper > div { border: 2px solid #ffa94d; border-radius: 5px; background-color: #ffd8a8; padding: 1em; color: #d9480f; } .wrapper { display: grid; ...
...by selecting names that will make sense to you and your team you will help everyone to use the layouts you create more easily. multiple lines with the same name with repeat() if you want to give all of the lines in your grid a...
...ning the space to the 1fr column tracks. ...
Stacking context example 2 - CSS: Cascading Style Sheets
eate a stacking context are collapsed on their parent. ...
...//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; } #div2 { z-index: 2; } #div3 { z-index: 1; } #div4 { z-index: 10; } #div1,#div3 { height: 80px; position: relative; border: 1px dashed #669966; background-color: #ccffcc; padding-left: 5px; } #div2 { opacity: 0.8; position: absolute; width: 150px; height: 200px; top: 20px; left: 170px; border: 1px dashed #990000; background-color: #ffdddd; text-align: center; } #div4 { opacity: 0.8; position: absolute; width: 200px; height: 70px; top: 65px; left: 50px; border: 1px dashed #000099; background-color: #ddddff; text-align: left; padding-left: 10px; } </style></head> ...
...0000; background-color: #ffdddd; text-align: center; } #div4 { opacity: 0.8; position: absolute; width: 200px; height: 70px; top: 65px; left: 50px; border: 1px dashed #000099; background-color: #ddddff; text-align: left; padding-left: 10px; } </style></head> <body> <br /> <div id="div1"><br /> <span class="bold">div #1</span><br /> position: relative; <div id="div2"><br /> <span class="bold">div #2</span><br /> position: absolute;<br /> z-index: 2; </div> </div> <br /> <div id="div3"><br /> <span class="bold">div #3</span><br /> position: relative;<br /> z-index: 1; <div id="div4"><br /> <span class="bold">div #4</span><br /...
... <div id="div2"><br /> <span class="bold">div #2</span><br /> position: absolute;<br /> z-index: 2; </div> </div> <br /> <div id="div3"><br /> <span class="bold">div #3</span><br /> position: relative;<br /> z-index: 1; <div id="div4"><br /> <span class="bold">div #4</span><br /> position: absolute;<br /> z-index: 10; </div> </div> </body> </html> ...
CSS Properties Reference - CSS: Cascading Style Sheets
ncomplete. for more css properties see the main css reference and mozilla css extensions. the reference articles also include examples on how to use all the properties. ...
...s properties see the main css reference and mozilla css extensions. the reference articles also include examples on how to use all the properties. ...
... float cssfloat font font font-family fontfamily font-size fontsize font-variant fontvariant font-weight fontweight height height left left letter-spacing letterspacing line-height lineheight list-style liststyle list-style-image liststyleimage list-style-position liststyleposition list-style-type liststyletype margin margin margin-bottom marginbottom margin-left marginleft margin-right marginright margin-top margintop overflow overflow padding padding padding-bottom paddingbottom padding-left paddingleft padding-right padd...
...n-left marginleft margin-right marginright margin-top margintop 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 wi...
Basic Shapes - CSS: Cascading Style Sheets
e reference box. for circles, this is the closest side in any dimension. for ellipses, this is the closest side in the radius dimension. the keyword farthest-side uses the length from the center of the shape to the farthest side of the reference box. for circles, this is the farthest side in any dimension. for ellipses, this is the farthest side in the radius dimension. the second argument is a position. if omitted this will be set to center. however you can use any valid position here to indicate the position of the centre of the circle. our circle therefore accepts one radius value, which may be a length, a percentage or the closest-side or farthest side keyword then optionally the keyword at followed by a position value. in the below example i have created a circle on an item with a width o...
...entage or the closest-side or farthest side keyword then optionally the keyword at followed by a position value. in the below example i have created a circle on an item with a width of 100 pixels, plus a margin of 20 pixels. this gives a total width for the reference box of 140 pixels. i have given a value of 50% for the shape-radius value which means that our radius is 70px. i have then set the position value to 30%. in the live example you can play with increasing or decreasing the size of the circle by changing the size of the radius, moving the circle around with the position value, or setting a reference box as we did for inset(). as an additional example, if you use the keywords top left for position, you can make a quarter circle shape in the top left corner of the page. the example be...
...osition, you can make a quarter circle shape in the top left corner of the page. the example below uses generated content to create a quarter circle shape for text to flow around. the shape will be clipped by the margin box when describing reference boxes i explained that the margin-box will clip the shape. you can see this by moving the centre of our circle towards the content by setting the position to 60%. the centre of the circle is now nearer the content and the circle extends past the margin-box. this means that the extension becomes clipped and squared off. img { float: left; shape-outside: circle(50% at 60%); } ellipse() an ellipse is essentially a squashed circle and so ellipse() acts in a very similar way to circle() except that we have to specify two radii x and y in that ...
...ow nearer the content and the circle extends past the margin-box. this means that the extension becomes clipped and squared off. img { float: left; shape-outside: circle(50% at 60%); } ellipse() an ellipse is essentially a squashed circle and so ellipse() acts in a very similar way to circle() except that we have to specify two radii x and y in that order. these may then be followed by position values as with circle() to move the centre of the ellipse around. in the example below we have an ellipse with an x radius of 40%, a y radius of 50% and the position being left. this means that the centre of the ellipse is on the left edge of the box giving us a half ellipse shape to wrap our text around. you can change these values to see how the ellipse changes. the keyword values of closest...
border-image-slice - CSS: Cascading Style Sheets
when ...
... */ border-image-slice: 10% fill 7 12; /* global values */ border-image-slice: inherit; border-image-slice: initial; border-image-slice: unset; the border-image-slice property may be specified using one to four <number-percentage> values to represent the position of each image slice. negative values are invalid; values greater than their corresponding dimension are clamped to 100%. when one position is specified, it creates all four slices at the same distance from their respective sides. ...
...nitial; border-image-slice: unset; the border-image-slice property may be specified using one to four <number-percentage> values to represent the position of each image slice. negative values are invalid; values greater than their corresponding dimension are clamped to 100%. when one position is specified, it creates all four slices at the same distance from their respective sides. when two positions are specified, the first value creates slices measured from the top and bottom, the second creates slices measured from the left and right. ...
...ch image slice. negative values are invalid; values greater than their corresponding dimension are clamped to 100%. when one position is specified, it creates all four slices at the same distance from their respective sides. when two positions are specified, the first value creates slices measured from the top and bottom, the second creates slices measured from the left and right. when three positions are specified, the first value creates a slice measured from the top, the second creates slices measured from the left and right, the third creates a slice measured from the bottom. when four positions are specified, they create slices measured from the top, right, bottom, and left in that order (clockwise). the optional fill value, if used, can be placed anywhere in the declaration. values ...
mask-border-slice - CSS: Cascading Style Sheets
when ...
...yword */ 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. negative values are invalid; values greater than their corresponding dimension are clamped to 100%. when one position is specified, it creates all four slices at the same distance from their respective sides. ...
... 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. negative values are invalid; values greater than their corresponding dimension are clamped to 100%. when one position is specified, it creates all four slices at the same distance from their respective sides. when two positions are specified, the first value creates slices measured from the top and bottom, the second creates slices measured from the left and right. ...
...ch image slice. negative values are invalid; values greater than their corresponding dimension are clamped to 100%. when one position is specified, it creates all four slices at the same distance from their respective sides. when two positions are specified, the first value creates slices measured from the top and bottom, the second creates slices measured from the left and right. when three positions are specified, the first value creates a slice measured from the top, the second creates slices measured from the left and right, the third creates a slice measured from the bottom. when four positions are specified, they create slices measured from the top, right, bottom, and left in that order (clockwise). the optional fill value, if used, can be placed anywhere in the declaration. values ...
offset-anchor - CSS: Cascading Style Sheets
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. <position> a <position> defines an x/y coordinate, to place an item relative to the edges of an element's box. it can be defined using one to four values. for more specifics, see the <position> and background-position reference pages. note that the 3-value position syntax does not work for any usage of <position>, except for in background(-position). formal definition initial valueautoappli...
... for more specifics, see the <position> and background-position reference pages. note that the 3-value position syntax does not work for any usage of <position>, except for in background(-position). ...
...ition> and background-position reference pages. note that the 3-value position syntax does not work for any usage of <position>, except for in background(-position). ...
...round-position reference pages. note that the 3-value position syntax does not work for any usage of <position>, except for in background(-position). ...
offset - CSS: Cascading Style Sheets
Web › CSS › offset
the offset css shorthand property sets all the properties required for animating an element along a defined path. note: early versions of the spec called this property motion. ...
... the offset css shorthand property sets all the properties required for animating an element along a defined path. note: early versions of the spec called this property motion. ...
... 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 ab...
...idthandheightcomputed 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-shape> or <path()>offset-distance: a length, percentage or calc();offset-anchor: a positionoffset-rotate: as <angle>, <basic-shape> or <path()>creates stacking contextyes formal syntax [ <'offset-position'>? [ <'offset-path'> [ <'offset-distance'> | <'offset-rotate'> ]? ]? ]! [ / <'offset-anchor'> ]? examples animating an element along a path html ...
perspective - CSS: Cascading Style Sheets
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. 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. ...
...ch 3d element with z>0 becomes larger; each 3d-element with z<0 becomes smaller. the strength of the effect is determined by the value of this property. the parts of the 3d elements that are behind the user — i.e. their z-axis coordinates are greater than the value of the perspective css property — are not drawn. the vanishing point is by default placed at the center of the element, but its position can be changed using the perspective-origin property. using this property with a value different than 0 and none creates a new stacking context. also, in that case, the object will act as a containing block for position: fixed elements that it contains. formal definition initial valuenoneapplies totransformable elementsinheritednocomputed valuethe absolute length or noneanimation typea lengthc...
...how quick the cube shrinks is defined by the perspective property. the smaller its value is, the deeper the perspective is. html the html below creates four copies of the same box, with the perspective set at different values. ...
...x; } .pers500 { perspective: 500px; } .pers650 { perspective: 650px; } /* define the container div, the cube div, and a generic face */ .container { width: 200px; height: 200px; margin: 75px 0 0 75px; border: none; } .cube { width: 100%; height: 100%; backface-visibility: visible; perspective-origin: 150% 150%; transform-style: preserve-3d; } .face { display: block; position: absolute; width: 100px; height: 100px; border: none; line-height: 100px; font-family: sans-serif; font-size: 60px; color: white; text-align: center; } /* define each face based on direction */ .front { background: rgba(0, 0, 0, 0.3); transform: translatez(50px); } .back { background: rgba(0, 255, 0, 1); color: black; transform: rotatey(180deg) translatez(50px); } .ri...
place-self - CSS: Cascading Style Sheets
ctive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...ght 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. 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. in static position of absolutely-positioned layouts, the keyword behaves as stretch. for flex items, the keyword behaves as stretch. for grid items, this keyword leads to a behavior similar to the one of stretch, except for boxes with an aspect ratio or...
...reased equally (not proportionally), while still respecting the constraints imposed by max-height/max-width (or equivalent functionality), so that the combined size of all auto-sized items exactly fills the alignment container along the cross axis. formal definition initial valueas each of the properties of the shorthand:align-self: autojustify-self: autoapplies toblock-level boxes, absolutely-positioned boxes, and grid itemsinheritednocomputed valueas each of the properties of the shorthand:align-self: auto computes to itself on absolutely-positioned elements, and to the computed value of align-items on the parent (minus any legacy keywords) on all other boxes, or start if the box has no parent. its behavior depends on the layout model, as described for justify-self. otherwise the specified va...
...stify-items and align-items values of stretch — the defaults — which causes the grid items to stretch across the entire width of their cells. the second, third, and fourth grid items are then given different values of place-self, to show how these override the default placements. these values cause the grid items to span only as wide/tall as their content width/height, and align in different positions across their cells, in the block and inline directions. html <article class="container"> <span>first</span> <span>second</span> <span>third</span> <span>fourth</span> </article> css html { font-family: helvetica, arial, sans-serif; letter-spacing: 1px; } article { background-color: red; display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 80px; grid-gap: 10px...
scroll-snap-coordinate - CSS: Cascading Style Sheets
the scroll-snap-coordinate css property defines the x and y coordinate positions within an element that will align with its nearest ancestor scroll container's scroll-snap-destination for each respective axis. /* 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. syntax values none specifies that the element does not contribute to a snap point. <p...
...ap coordinates from the start edge of the element’s border box. for each pairing, the first value gives the x coordinate of the snap coordinate, the second value its y coordinate. ...
...e of the element’s border box. for each pairing, the first value gives the x coordinate of the snap coordinate, the second value its y coordinate. ...
......
will-change - CSS: Cascading Style Sheets
ly changed. these kinds of optimizations can increase the responsiveness of a page by doing potentially expensive work before they are actually required. important: will-change is intended to be used as a last resort, in order to try to deal with existing performance problems. it should not be used to anticipate performance problems. ...
... visual appearance of elements, when used with property values, that create a stacking context (e.g. will-change: opacity), as the stacking context is created up front. syntax values auto this keyword expresses no particular intent; the user agent should apply whatever heuristics and optimizations it normally does. the <animateable-feature> can be one of the following values: scroll-position indicates that the author expects to animate or change the scroll position of the element in the near future. contents indicates that the author expects to animate or change something about the element’s contents in the near future. <custom-ident> indicates that the author expects to animate or change the property with the given name on the element in the near future. if the property given...
... about the element’s contents in the near future. <custom-ident> indicates that the author expects to animate or change the property with the given name on the element in the near future. if the property given is a shorthand, it indicates the expectation for all the longhands the shorthand expands to. it cannot be one of the following values: unset, initial, inherit, will-change, auto, scroll-position, or contents. the spec doesn't define the behavior of particular value, but it is common for transform to be a compositing layer hint. chrome currently takes two actions, given particular css property idents: establish a new compositing layer or a new stacking context. via stylesheet it may be appropriate to include will-change in your style sheet for an application that does page flips on key...
...se caution with the will-change property directly in stylesheets. it may cause the browser to keep the optimization in memory for much longer than it is needed. .slide { will-change: transform; } formal definition initial valueautoapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax auto | <animateable-feature>#where <animateable-feature> = scroll-position | contents | <custom-ident> examples via script this is an example showing how to apply the will-change property through scripting, which is probably what you should be doing in most cases. var el = document.getelementbyid('element'); // set will-change when the element is hovered el.addeventlistener('mouseenter', hintbrowser); el.addeventlistener('animationend', removehint); function hintb...
<input type="tel"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › tel
use this html: <form> <div> <label for="telno">enter a telephone number (required): </label> <input id="telno" name="telno" type="tel" required> <span class="validity"></span> </div> <div> <button>submit</button> </div> </form> and let's include the following css to highlight valid entries with a checkmark and invalid entries with a cross: div { margin-bottom: 10px; position: relative; } input[type="number"] { width: 100px; } input + span { padding-right: 30px; } input:invalid+span:after { position: absolute; content: '✖'; padding-left: 5px; color: #8b0000; } input:valid+span:after { position: absolute; content: '✓'; padding-left: 5px; color: #009000; } the output looks like this: pattern validation if you want to further restrict enter...
...e same css as before, but our html is changed to look like this: <form> <div> <label for="telno">enter a telephone number (in the form xxx-xxx-xxxx): </label> <input id="telno" name="telno" type="tel" required pattern="[0-9]{3}-[0-9]{3}-[0-9]{4}"> <span class="validity"></span> </div> <div> <button>submit</button> </div> </form> div { margin-bottom: 10px; position: relative; } input[type="number"] { width: 100px; } input + span { padding-right: 30px; } input:invalid+span:after { position: absolute; content: '✖'; padding-left: 5px; color: #8b0000; } input:valid+span:after { position: absolute; content: '✓'; padding-left: 5px; color: #009000; } notice how the entered value is reported as invalid unless the pattern xxx-xxx-xxxx i...
...rk, and there would still be no foolproof guarantee that the users would enter their numbers correctly. it makes you wonder if it is worth going to all this trouble on the client-side, when you could just let the user enter their number in whatever format they wanted on the client-side and then validate and sanitize it on the server. but this choice is yours to make. ...
...orth going to all this trouble on the client-side, when you could just let the user enter their number in whatever format they wanted on the client-side and then validate and sanitize it on the server. but this choice is yours to make. div { margin-bottom: 10px; position: relative; } input[type="number"] { width: 100px; } input + span { padding-right: 30px; } input:invalid+span:after { position: absolute; content: '✖'; padding-left: 5px; color: #8b0000; } input:valid+span:after { position: absolute; content: '✓'; padding-left: 5px; color: #009000; } specifications specification status comment html living standardthe definition of '<input type="tel">' in that specification. living standard initial definition html 5.1the defin...
<video>: The Video Embed element - HTML: Hypertext Markup Language
Web › HTML › Element › video
t, the resource is fetched without a cors request (i.e. without sending the origin: http header), preventing its non-tainted used in <canvas> elements. if invalid, it is handled as if the enumerated keyword anonymous was used. see cors settings attributes for additional information. currenttime reading currenttime returns a double-precision floating-point value indicating the current playback position of the media specified in seconds. if the media has not started playing yet, the time offset at which it will begin is returned. setting currenttime sets the current playback position to the given time and seeks the media to that position if the media is currently loaded. if the media is being streamed, it's possible that the user agent may not be able to obtain some parts of the resource if th...
...r own custom controls using javascript and the htmlmediaelement api. see creating a cross-browser video player for more details. to allow precise control over your video (and audio) content, htmlmediaelements fire many different events. in addition to providing controllability, these events let you monitor the progress of both download and playback of the media, as well as the playback state and position. you can use the object-position property to adjust the positioning of the video within the element's frame, and the object-fit property to control how the video's size is adjusted to fit within the frame. to show subtitles/captions along with your video, you can use some javascript along with the <track> element and the webvtt format. see adding captions and subtitles to html5 video for more i...
...sing html <video> is the video and audio content beginner's tutorial. styling with css the <video> element is a replaced element — its display value is inline by default, but its default width and height in the viewport is defined by the video being embedded. there are no special considerations for styling <video>; a common strategy is to give it a display value of block to make it easier to position, size, etc., and then provide styling and layout information as required. video player styling basics provides some useful styling techniques. detecting track addition and removal you can detect when tracks are added to and removed from a <video> element using the addtrack and removetrack events. however, these events aren't sent directly to the <video> element itself. instead, they're sent to ...
...ify music and sound effects that communicate important information. this includes emotion and tone: 14 00:03:14 --> 00:03:18 [dramatic rock music] 15 00:03:19 --> 00:03:21 [whispering] what's that off in the distance? 16 00:03:22 --> 00:03:24 it's… it's a… 16 00:03:25 --> 00:03:32 [loud thumping] [dishes clattering] captions should not obstruct the main subject of the video. they can be positioned using the align vtt cue setting. mdn adding captions and subtitles to html5 video web video text tracks format (webvtt) webaim: captions, transcripts, and audio descriptions mdn understanding wcag, guideline 1.2 explanations understanding success criterion 1.2.1 | w3c understanding wcag 2.0 understanding success criterion 1.2.2 | w3c understanding wcag 2.0 technical summary ...
Array - JavaScript
but will set or access a variable associated with that array's object property collection. the array's object properties and list of array elements are separate, and the array's traversal and mutation operations cannot be applied to these named properties. ...
... beginning of an array let first = fruits.shift() // remove apple from the front // ["banana"] add an item to the beginning of an array let newlength = fruits.unshift('strawberry') // add to the front // ["strawberry", "banana"] find the index of an item in the array fruits.push('mango') // ["strawberry", "banana", "mango"] let pos = fruits.indexof('banana') // 1 remove an item by index position let removeditem = fruits.splice(pos, 1) // this is how to remove an item // ["strawberry", "mango"] remove items from an index position let vegetables = ['cabbage', 'turnip', 'radish', 'carrot'] console.log(vegetables) // ["cabbage", "turnip", "radish", "carrot"] let pos = 1 let n = 2 let removeditems = vegetables.splice(pos, n) // this is how to remove items, n defines the number of items ...
...) // this is how to remove an item // ["strawberry", "mango"] remove items from an index position let vegetables = ['cabbage', 'turnip', 'radish', 'carrot'] console.log(vegetables) // ["cabbage", "turnip", "radish", "carrot"] let pos = 1 let n = 2 let removeditems = vegetables.splice(pos, n) // this is how to remove items, n defines the number of items to be removed, // starting at the index position specified by pos and progressing toward the end of array. console.log(vegetables) // ["cabbage", "carrot"] (the original array is changed) console.log(removeditems) // ["turnip", "radish"] copy an array let shallowcopy = fruits.slice() // this is how to make a copy // ["strawberry", "mango"] accessing array elements javascript arrays are zero-indexed. the first element of an array is at i...
... to msgarray[0] and msgarray[99], changing the length of the array to 100. let msgarray = [] msgarray[0] = 'hello' msgarray[99] = 'world' if (msgarray.length === 100) { console.log('the length is 100.') } creating a two-dimensional array the following creates a chessboard as a two-dimensional array of strings. the first move is made by copying the 'p' in board[6][4] to board[4][4]. the old position at [6][4] is made blank. let board = [ ['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'] ] console.log(board.join('\n') + '\n\n') // move king's pawn f...
MathML attribute reference - MathML
in typography. maxsize <mo> the maximum size of the operator. unimplemented minlabelspacing <mtable> a length value specifing the minimum space between a label and the adjacent cell in the row. minsize <mo> the minimum size of the operator. movablelimits <mo> specifies whether attached under- and overscripts move to sub- and superscript positions. notation <menclose> a list of notations, separated by white space, to apply to the child elements. numalign <mfrac> the alignment of the numerator over the fraction. open <mfenced> a string for the opening delimiter. unimplemented overflow <math> if an expression is too long to fit in the allowed width, this attribute sets the prefer...
... a list of notations, separated by white space, to apply to the child elements. numalign <mfrac> the alignment of the numerator over the fraction. open <mfenced> a string for the opening delimiter. unimplemented overflow <math> if an expression is too long to fit in the allowed width, this attribute sets the preferred handling. unimplemented position <msgroup>, <msrow>, <mscarries>, <msline> rowalign <mtable>, <mtd>, <mtr> specifies the vertical alignment of table cells. rowlines <mtable> specifies table row borders. rowspacing <mtable> specifies the space between table rows. rowspan <mtd> a non-negative integer value that indicates on how many rows does the cell extend. ...
...ment which is addressed by the action. separator <mo> there is no visual effect for this attribute, but it specifies whether the operator is a separator (such as commas). separators <mfenced> a sequence of zero or more characters to be used for different separators. unimplemented shift <msgroup> unimplemented side <mtable> specifies the position where <mlabeledtr> label elements should be placed. unimplemented src <mglyph> the location of the image resource. unimplemented stackalign <mstack> stretchy <mo> specifies whether the operator stretches to the size of the adjacent element. subscriptshift <mmultiscripts>, <msub>, <msubsup> the minimum space by which to shift the subsc...
...ssion. supscriptshift <mmultiscripts>, <msup>, <msubsup> the minimum space by which to shift the superscript above the baseline of the expression. symmetric <mo> if stretchy is true, this attribute specifies whether the operator should be vertically symmetric around the imaginary math axis (centered fraction line). voffset <mpadded> sets the vertical position of the child content. width <mglyph>, <mpadded>, <mspace>, <mtable> specifies the desired width. see lengths for possible values. xlink:href all can be used to set a hyperlink to a specfied uri. however, authors are encouraged to use the href attribute instead. xmlns <math> specifies the uri for the mathml namespace (http://www.w3.org/1998/math/mathm...
The "codecs" parameter in common media types - Web media technologies
, the video data is entirely in the y plane and is therefore monochromatic. see yuv in digital video concepts for details on how the yuv color system works. the default value is 0 (not monochrome). ccc ccc indicates the chroma subsampling as three digits. the first digit is subsampling_x, the second is subsampling_y. if both of those are 1, the third is the value of chroma_sample_position; otherwise, the third digit is always 0. this, combined with the m component, can be used to construct the chroma subsampling format: determining the chroma subsampling format subsampling_x subsampling_y monochrome flag chroma subsampling format 0 0 0 yuv 4:4:4 1 0...
... the default value is 110 (4:2:0 chroma subsampling). cp the two-digit color_primar...
... the default value is 110 (4:2:0 chroma subsampling). cp the two-digit color_primaries value indicates the color system used by the...
... 1 0 0 yuv 4:2:2 1 1 0 yuv 4:2:0 1 1 1 yuv 4:0:0 (monochrome) the third digit in ccc indicates the chroma sample position, with a value of 0 indicating that the position is unknown and must be separately provided during decoding; a value of 1 indicating that the sample position is horizontally colocated with the (0, 0) luma sample; and a value of 2 indicating that the sample position is colocated with (0, 0) luma. the default value is 110 (4:2:0 chroma subsampling). cp the two-digit color_primaries value indicates the color system used by the media. for example, bt.2020/bt.2100 color, as used for hdr video, is 09. the information for this—and for ...
stroke-linecap - SVG: Scalable Vector Graphics
on a zero length subpath, the path will not be rendered...
...at all. ...
...nt. ...
...if you'd like to contribute to the data, please check out...
viewBox - SVG: Scalable Vector Graphics
Web › SVG › Attribute › viewBox
the value of the viewbox attribute is a list of four numbers: min-x, min-y, width and height. the numbers separated by whitespace and/or a comma, which specify a rectangle in user space which is mapped to the bounds of the viewport established for the associated svg element (not the browser viewport). ...
... corner of the viewport. --> <circle cx="50%" cy="50%" r="4" fill="white"/> </svg> the exact effect of this attribute is influenced by the preserveaspectratio attribute. note: values for width or height lower or equal to 0 disable rendering of the element. five elements are using this attribute: <marker>, <pattern>, <svg>, <symbol>, and <view>. marker for <marker>, viewbox defines the position and dimension for the content of the <marker> element. value <number>?, <number>?, <number>?, <number> default value none animatable yes pattern for <pattern>, viewbox defines the position and dimension for the content of the pattern tile. value <number>?, <number>?, <number>?, <number> default value none animatable ...
...lement. value <number>?, <number>?, <number>?, <number> default value none animatable yes pattern for <pattern>, viewbox defines the position and dimension for the content of the pattern tile. value <number>?, <number>?, <number>?, <number> default value none animatable yes svg for <svg>, viewbox defines the position and dimension for the content of the <svg> element. value <number>?, <number>?, <number>?, <number> default value none animatable yes symbol for <symbol>, viewbox defines the position and dimension for the content of the <symbol> element. value <number>?, <number>?, <number>?, <number> default value none animatable ...
...nt. value <number>?, <number>?, <number>?, <number> default value none animatable yes symbol for <symbol>, viewbox defines the position and dimension for the content of the <symbol> element. value <number>?, <number>?, <number>?, <number> default value none animatable yes view for <view>, viewbox defines the position and dimension for the content of the <view> element. value <number>?, <number>?, <number>?, <number> default value none animatable yes specification specification status comment scalable vector graphics (svg) 2the definition of 'viewbox' in that specification. candidate recommendation scalable vector graphics...
Basic shapes - SVG: Scalable Vector Graphics
« previousnext » there are several basic shapes used for most svg drawing. the purpose of these shapes is fairly obvious from their names. some of the parameters that determine their position and size are given, but an element reference would probably contain more accurate and complete descriptions along with other properties that won't be covered in here. however, since they're used in most svg documents, it's necessary to give them some sort of introduction. basic shapes to insert a shape, you create an element in the document. different elements correspond to different shapes and take different parameters to describe the size and position of those shapes. some are slightly redundant in that they can be created by other shapes, but they're all there for your convenience and t...
...0 65 205 50 195 35 205 40 190 30 180 45 180" stroke="green" fill="transparent" stroke-width="5"/> <path d="m20,230 q40,205 50,230 t90,230" fill="none" stroke="blue" stroke-width="5"/> </svg> note: the stroke, stroke-width, and fill attributes are explained later in the tutorial. rectangle the <rect> element draws a rectangle on the screen. there are 6 basic attributes that control the position and shape of the rectangles on screen. 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. <rect x="10" y="10" width="30" height="30"/> <rect x="60" y="10" rx="10" ry="10" width="30" height="30"/> x the x position of the top left corner of the rectangle. y the y position of the top left corner of the rectangle. width th...
...he rectangle. width the width of the rectangle height the height of the rectangle rx the x radius of the corners of the rectangle ry the y radius of the corners of the rectangle circle the <circle> element draws a circle on the screen. it takes 3 basic parameters to determine the shape and size of the element. <circle cx="25" cy="75" r="20"/> r the radius of the circle. cx the x position of the center of the circle. cy the y position of the center of the circle. ellipse an <ellipse> is a more general form of the <circle> element, where you can scale the x and y radius (commonly refferred to as the semimajor and semiminor axes in maths) of the circle separately. <ellipse cx="75" cy="75" rx="20" ry="5"/> rx the x radius of the ellipse. ry the y radius of the ellipse. c...
...enter of the circle. cy the y position of the center of the circle. ellipse an <ellipse> is a more general form of the <circle> element, where you can scale the x and y radius (commonly refferred to as the semimajor and semiminor axes in maths) of the circle separately. <ellipse cx="75" cy="75" rx="20" ry="5"/> rx the x radius of the ellipse. ry the y radius of the ellipse. cx the x position of the center of the ellipse. cy the y position of the center of the ellipse. line the <line> element takes the positions of two points as parameters and draws a straight line between them. <line x1="10" x2="50" y1="110" y2="150"/> x1 the x position of point 1. y1 the y position of point 1. x2 the x position of point 2. y2 the y position of point 2. polyline a <polyline> is a g...
MCD, Mission Control Desktop, AKA AutoConfig - Archive of obsolete content
ervers.ldapint"); lockpref("ldap_2.prefs_migrated", true); lockpref("ldap_2.servers.history.filename", "history.mab"); lockpref("ldap_2.servers.history.replication.lastchangenumber", 0); lockpref("ldap_2.servers.ldapint.auth.savepassword", true); lockpref("ldap_2.servers.ldapint.description", "ldap-int"); lockpref("ldap_2.servers.ldapint.filename", "abook-1.mab"); lockpref("ldap_2.servers.ldapint.position", 3); lockpref("ldap_2.servers.ldapint.uri", "ldap://ldap1.int-evry.fr:389/ou=people,dc=int-evry,dc=fr??sub"); lockpref("ldap_2.servers.pab.filename", "abook.mab"); lockpref("ldap_2.servers.pab.replication.lastchangenumber", 0); //news config lockpref("mail.server.server3.hostname", "news.int-evry.fr"); lockpref("mail.server.server3.max_cached_connections", 2); lockpref("mail.server.server3.name...
...ervers.ldapint"); lockpref("ldap_2.prefs_migrated", true); lockpref("ldap_2.servers.history.filename", "history.mab"); lockpref("ldap_2.servers.history.replication.lastchangenumber", 0); lockpref("ldap_2.servers.ldapint.auth.savepassword", true); lockpref("ldap_2.servers.ldapint.description", "ldap-int"); lockpref("ldap_2.servers.ldapint.filename", "abook-1.mab"); lockpref("ldap_2.servers.ldapint.position", 3); lockpref("ldap_2.servers.ldapint.uri", "ldap://ldap1.int-evry.fr:389/ou=people,dc=int-evry,dc=fr??sub"); lockpref("ldap_2.servers.pab.filename", "abook.mab"); lockpref("ldap_2.servers.pab.replication.lastchangenumber", 0); //news config lockpref("mail.server.server3.hostname", "news.int-evry.fr"); lockpref("mail.server.server3.max_cached_connections", 2); lockpref("mail.server.server3.name...
... "author" : " jeha...
Layout System Overview - Archive of obsolete content
t kind of frame to create (block, inline, table, etc.). the style context is associated with the frame via a reference because it is needed for many other computations during the formatting of the frames. once a frame is created for a content element, it must be formatted. we refer to this as 'laying out' the frame, or as 'reflowing' the frame. ...
...the in-flow case is considered the 'normal' case, and corresponds to normal html formatting. ...
... geometry of an element is not influenced by the geometry of the elements that precede it, or in any case, is influenced more locally. the in-flow case is considered the 'normal' case, and corresponds to normal html formatting. the later case, called 'out of flow' puts the document author in control of the layout, and the author must specify the locations and sizes of all of the elements that are positioned. there is, of course, some complexity involved with managing these two models simultaneously... so far the general flow of layout looks like this: obtain a document's content model utilize the style system to resolve the style of each element in the content model construct the frames that correspond to the content model, according to the resolved style data. perform the initial layout, or init...
Introducing the Audio API extension - Archive of obsolete content
var currentsampleoffset = audiooutput.mozcurrentsampleoffset(); audio data written using the mozwriteaudio() method needs to be written at a regular interval in equal portions, in order to keep a little ahead of the current sample offset (the ...
... < samples.length ; i++) { samples[i] = math.sin( i / 20 ); } output.mozwriteaudio(samples); } </script> </head> <body> <p>this demo plays a one second tone when you click the button below.</p> <button onclick="playtone();">play</button> </body> </html> the mozcurrentsampleoffset() method gives the audible position of the audio stream, meaning the position of the last heard sample. // get current audible position of the underlying audio stream, measured in samples. var currentsampleoffset = audiooutput.mozcurrentsampleoffset(); audio data written using the mozwriteaudio() method needs to be written at a regular interval in equal portions, in order to keep a little ahead of the current sample offset (the sample offset that is currently being play...
...all portions and wait for the value returned by mozcurrentsampleoffset() to be greater than 0. var prebuffersize = samplerate * 0.020; // initial buffer is 20 ms var autolatency = true, started = new date().valueof(); ... // auto latency detection if (autolatency) { prebuffersize = math.floor(samplerate * (new date().valueof() - started) / 1000); if (audio.mozcurrentsampleoffset()) { // play position moved? autolatency = false; } processing an audio stream since the mozaudioavailable event and the mozwriteaudio() method both use float32array values, it is possible to take the output of one audio stream and pass it directly (or process first and then pass) to a second. the first audio stream needs to be muted so that only the second audio element is heard. <audio id="a1" src="so...
textbox (Toolkit autocomplete) - Archive of obsolete content
ets and sets the value of the autocompletesearchparam attribute. selectionend type: integer get or set the end of the selected portion of the field's text. use in conjuction with the selectionstart property. the value specifies the index of the character after the selection. if this value is equal to the value of the selectionstart property, no text is selected, but the value indicates the position of the caret (cursor) within the textbox. selectionstart type: integer get or set the beginning of the selected portion of the field's text. use in conjuction with the selectionend property. the value specifies the index of the first selected character. showcommentcolumn type: boolean gets and sets the value of the showcommentcolumn (or showcommentcolumn) attribute. showimagecolu...
...value autocomplete to have an autocomplete textbox. 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. ...
...urn value selects all the text in the textbox. 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. related interfaces nsiaccessibleprovider, nsiautocompleteinput, nsidomxulmenulistelement articles how to implement custom autocomplete search component ...
Textbox (XPFE autocomplete) - Archive of obsolete content
f session names gets the value of the searchsessions attribute. selectionend type: integer get or set the end of the selected portion of the field's text. use in conjuction with the selectionstart property. the value specifies the index of the character after the selection. if this value is equal to the value of the selectionstart property, no text is selected, but the value indicates the position of the caret (cursor) within the textbox. selectionstart type: integer get or set the beginning of the selected portion of the field's text. use in conjuction with the selectionend property. the value specifies the index of the first selected character. sessioncount type: integer holds the number of sessions. showcommentcolumn type: boolean gets and sets the value of the show...
... gets and sets the value of the useraction attribute. 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. ...
...urn value selects all the text in the textbox. 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. syncsessions( autocompleteelement ) obsolete since gecko 26 return type: void copy the sessions from another autocomplete element. related interfaces nsiaccessibleprovider, nsidomxulmenulistelement ...
Manipulating Lists - Archive of obsolete content
s used only as an extra optional value associated with an item which you might wish to use in a script. similarly, there is also an insertitemat() and a removeitemat() function which inserts a new item and removes an existing item respectively. the syntax is as follows: list.insertitemat(3, "thursday", "thu"); list.removeitemat(3); the insertitemat() function takes an additional argument, the position to insert the new item. the new item is inserted at this index, so, in the example, the new item will be added at position 3 while the item previously at that position will now be at position 4. remember that the first item is 0. the removeitemat() function will remove the item at a specific index. these three methods are also available for several other xul elements and work in the same manner.
...r modifying the selected items. for instance, the additemtoselection() function adds a new item to the set of selected items, without clearing the existing selection. the removeitemfromselection() function removes a single item from the selection. list scrolling if there are more rows in the listbox than can be displayed, a scroll bar will appear to allow the user to scroll the list. the scroll position may be adjusted using a couple of listbox methods. the scrolltoindex() method scrolls to a given row. this listbox will scroll such that the row will be the top row visible, unless the row is near the end of the list of items. the ensureindexisvisible() method is similar in that it also scrolls to show a row, but this method does not scroll if the item is already visible. thus, the former functi...
...ethod is similar in that it also scrolls to show a row, but this method does not scroll if the item is already visible. thus, the former function is used to scroll to a specific row while the latter is used just to make sure that a row is visible. there is also an ensureindexisvisible() that takes an item as an argument instead of an index. ...
More Button Features - Archive of obsolete content
will look at some additional features of buttons. adding an image you can add an image to a button by specifying a url in the image attribute. the image is loaded from the url, which can be a relative or absolute url, and then the image is displayed on the button. the button below will have both a label and the image 'happy.png'. the image will appear to the left of the label. you can change this position by using two other attributes. this will be explained in a moment. example 1 : source view <button label="help" image="happy.png"/> button with css image another way to specify the image is by using the css list-style-image style property on the button. this is designed to allow the 'skin' (in this case, the appearance of the image) to be changed without changing the xul file. an example is show...
...file. an example is shown below. example 2 : source view <button id="find-button" label="find" style="list-style-image: url('happy.png')"/> in this case, the image 'happy.png' is displayed on the button. the style attribute functions similar to its html counterpart. in general, it can be used on all xul elements. note that you really should put the style declarations in a separate style sheet. positioning the images by default, the image on a button will appear to the left of the text label. there are two attributes that can be used to control this position. the dir attribute controls the direction of the image and text. by setting this attribute to the value reverse, the image will be placed on the right side of the text. by using the value normal, or leaving the attribute out entirely, the im...
...he appearance will be different. the image to the right shows the difference. the left one is a 'menu' and the second one is a 'menu-button'. it has an arrow indicating the presence of a menu. for the 'menu', the user may click anywhere on the button to show the menu. for the 'menu-button', the user must click the arrow to show the menu. next, we will learn more details about how xul elements are positioned in a window. « previousnext » ...
More Event Handlers - Archive of obsolete content
use the dblclick event instead. the click event will be fired once for the first click, again for the second click, and again for the third click, but the dblclick event will only be fired once for a double click. the button and detail properties only apply to the mouse button related events, not mouse movement events. for the mousemove event, for example, both properties will be set to 0. mouse position event properties however, all mouse events will be supplied with properties that hold the coordinates of the mouse position where the event occurred. there are two sets of coordinates. the first is the screenx and screeny properties and are relative to the top left corner of the screen. the second set, clientx and clienty, are relative to the top left corner of the document. here is an example wh...
...use is usually moved some distance past the border by the time the next event fires. obviously, it would be much too inefficient to send a mousemove event for every pixel the mouse is moved. element relative coordinates you will often want to get the coordinates of an event relative to the element where the event occurred rather than the entire window. you can do this by subtracting the element's position from the event position, as in the following code. var element = event.target; var elementx = event.clientx - element.boxobject.x; var elementy = event.clienty - element.boxobject.y; xul elements have a box object that can be retrieved using the boxobject property. we'll learn more about the box object in a later section, but it holds information pertaining to how the element is displayed, inclu...
...osition, as in the following code. var element = event.target; var elementx = event.clientx - element.boxobject.x; var elementy = event.clienty - element.boxobject.y; xul elements have a box object that can be retrieved using the boxobject property. we'll learn more about the box object in a later section, but it holds information pertaining to how the element is displayed, including the x and y position of the element. in this example code, these coordinates are subtracted from the event coordinates to get the event position relative to the element. load events the load event is sent to the document (the window tag) once the xul file has finished loading and just before the content is displayed. this event is commonly used to initialize fields and perform other tasks that need to be done before ...
arrowscrollbox - Archive of obsolete content
if false, the mouse must be hovered over the arrows to scroll automatically. disabled type...
... observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width disabled type: boolean gets and sets the value of the disabled attribute. scrollboxobject type: nsiscrollboxobject the scroll box object implements the nsiscrollboxobject interface, which may be used to retrieve and adjust the scroll position of the list box. scrollincrement type: integer a read only property that lets you retrieve the number of pixels by which scrolling will occur when the arrowscrollbox is clicked. 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 ...
... many lines. scrollbypixels( pixels ) return type: no return value scrolls the contents of the arrowscrollbox by a certain number of pixels. use a positive value as the pixels argument to scroll forward that many pixels, or a negative value to scroll backward that many pixels. ...
columns - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] defines the columns of a grid. child column elements define the individual columns to appear in the grid. the columns element may be nested inside another columns element. other elements placed inside a columns element occupy the full height of the grid and are placed in their corresponding positions between the columns. more information about columns is available in the xul tutorial. example see grid for an example. 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, max...
...n example. ...
..., 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
dialog - Archive of obsolete content
esskeyextra1, buttonaccesskeyextra2, buttonaccesskeyhelp, buttonalign, buttondir, buttondisabledaccept, buttonlabelaccept, buttonlabelcancel, buttonlabeldisclosure, buttonlabelextra1, buttonlabelextra2, buttonlabelhelp, buttonorient, buttonpack, buttons, defaultbutton, title properties buttons, defaultbutton methods acceptdialog, canceldialog, centerwindowonscreen, getbutton, movetoalertposition examples <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?> <dialog id="donothing" title="dialog example" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" buttons="accept,cancel" buttonlabelcancel="cancel" buttonlabelaccept="save"> <dialogheader title="options" description="my preferences"/> <groupbox> <captio...
...ormally this attribute should not be set, but if it is, it specifies the default button in the dialog. typically, this means that the button will be activated when the enter key is pressed. this should be set to one of the same values as those for the buttons attribute. ...
...oses it, similar to pressing the ok button. canceldialog() return type: no return value cancels the dialog and closes it, similar to pressing the cancel button. centerwindowonscreen() return type: no return value centers the dialog on the screen. getbutton( type ) return type: button element returns the button element in the dialog corresponding to the given type. movetoalertposition() return type: no return value moves and resizes the dialog to a position and size suitable for an alert box. related elements dialogheader ...
listbox - Archive of obsolete content
gets and sets the value of the tabindex attribute. 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. ...
...if the item is already visible, no scrolling occurs. getindexoffirstvisiblerow() return type: integer returns the index of the first displayed row. note that this is not the same as the first row -- if the displayed items have been scrolled down, this function will retrieve the index of the first row that the user can see. getindexofitem( item ) return type: integer returns the zero-based position of the specified item. items are numbered starting at the first item displayed in the list. getitematindex( index ) return type: element returns the element that is at the specified index. getnumberofvisiblerows() return type: integer returns the number of rows that are currently visible to the user. getrowcount() return type: integer returns the total number of rows...
...retrieve each selected item using this method. the argument index specifies the index in the list of the selected items, not the row number of the item. the item index is zero-based, thus this example will return the first selected item: getselecteditem(0). insertitemat( index, label, value ) return type: element this method creates a new item and inserts it at the specified position. you may optionally set a value. the new item element is returned. invertselection() return type: no return value reverses the selected state of all items. selected items become deselected, and deselected items become selected. movebyoffset( offset , isselecting, isselectingrange) return type: no return value if offset is positive, adjusts the focused item forward by that many items. if o...
menulist - Archive of obsolete content
o the value field. this is rendered as a textbox with a drop-down arrow beside it. the user may enter text into the textbox or select one of the choices by clicking from the drop-down. focused type: boolean this attribute is true if the element is focused. image type: uri the uri of the image to appear on the element. if this attribute is empty or left out, no image appears. the position of the image is determined by the dir and orient attributes. label type: string the label that will appear on the element. if this is left out, no text appears. for an editable menuitem element the value of this attribute is copied to the menulist.value property upon user selection of the menuitem. oncommand type: script code this event handler is called when the command is a...
... gets and sets the value of the tabindex attribute. 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. ...
...abel, value, description ) return type: element creates a new menuitem element and adds it to the end of the menulist. you may optionally set a value and description. the function returns the new item. contains( item ) return type: boolean returns true if the menulist contains the specified menuitem as one of its items. getindexofitem( item ) return type: integer returns the zero-based position of the specified item. items are numbered starting at the first item displayed in the list. getitematindex( index ) return type: element returns the element that is at the specified index. insertitemat( index, label, value ) return type: element this method creates a new item and inserts it at the specified position. you may optionally set a value. the new item element i...
rows - Archive of obsolete content
Archive › Mozilla › XUL › rows
ws element. the children of these nested rows are counted as normal rows as if they were part of the parent. however, nesting rows elements allows groups of rows to have a separate appearance such as a different border, or separate scrolling may be defined for these rows. non-row related elements placed inside a rows element occupy the full width of the grid and are placed in their corresponding positions between the rows. more information is available in the xul tutorial. example see grid for an example. 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, maxw...
...n example. ...
..., 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
stack - Archive of obsolete content
Archive › Mozilla › XUL › stack
« xul reference home [ examples | attributes | properties | methods | related ] an element that renders its children on top of each other. the first element is placed on the bottom and each successive child is placed above the previous. all elements are displayed at once. child elements may also be placed at absolute positions within the stack. the top, right, bottom, and left attributes on a child of the stack specify the position of that element. 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. note that bottom and right attributes, unlike rect, are relative to the bottom and right of the stack. when using these attributes to set width or height, both attributes for the given a...
... </stack> 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, hidden, id, , , left, , ma...
..., 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
stringbundle - Archive of obsolete content
localized strings. 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 user's locale. this is an object which implements nsilocale. s...
...propertyelement objects. methods getformattedstring( key, strarray ) return type: string looks up the format string for the given key name in the string bundle and returns a formatted copy where each occurrence of %s (uppercase) is replaced by each successive element in the supplied array. alternatively, numbered indices of the format %n$s (e.g. ...
...$s, %2$s, etc.) can be used to specify the position of the corresponding parameter explicitly. if you need to handle substitutions involving plurals, take a look at localization and plurals. getstring( key ) return type: string returns the string with the given key name from the string bundle. ...
textbox - Archive of obsolete content
: boolean gets and sets the value of the searchbutton attribute. selectionend type: integer get or set the end of the selected portion of the field's text. use in conjuction with the selectionstart property. the value specifies the index of the character after the selection. if this value is equal to the value of the selectionstart property, no text is selected, but the value indicates the position of the caret (cursor) within the textbox. selectionstart type: integer get or set the beginning of the selected portion of the field's text. use in conjuction with the selectionend property. the value specifies the index of the first selected character. size type: integer gets and sets the value of the size attribute. spinbuttons type: element the read-only prop...
...turn value selects all the text in the textbox. 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. ...
... 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. ...
Table Reflow Internals - Archive of obsolete content
er posts a dirty reflow command with itself as the target. style changes through the dom - javascript, browser change font (ctrl+/-), a preference changes, etc. review of reflow reflow starts with pres shell which reflows the reflow root (usually the viewport frame), which reflows it children, etc. ususally it starts when the pres shell processes its queue of reflow commands. ...
..., browser change font (ctrl+/-), a preference changes, etc. review of reflow reflow starts with pres shell which reflows the reflow root (usually the viewport frame), which reflows it children, etc. ususally it starts when the pres shell processes its queue of reflow commands. the reflower positions reflowee (if it can) before actually reflowing in case views are involved (e.g. absolutely positioned elements) reflows reflowee and passes a reflow state (in) and a reflow metrics (in/out) review of reflow the reflow state: is a node in a tree structurally equivalent to the frame tree of reflow participants contains: reflow type, avail size, various computed values, resolved style structs possible request for preferred size and more. review of reflow the reflow metrics contains: m...
...cept it can reoccur. incremental - has a reflow path (tree) where each node has a command with a target frame, reflow command types are: dirty - something changed inside a target (e.g. it gains, loses children) style changed - a target changed stylisticly (recall, size is a style property) content changed - a target's content changed (e.g. ...
Browser Detection and Cross Browser Support - Archive of obsolete content
ve 7 and opera width = windowref.innerwidth; } example 2 - object based feature detection cross browser support this example also illustrates the use of feature detection and shows the complications that can arise from the non standard implementations in other browsers. ...
...lm.style.left = x + 'px'; elm.style.top = y + 'px'; } } else if (typeof(elm.left) == 'number') { // navigator 4 elm.left = x; elm.top = y; } } standards only consider how simple this function is if you code it according to the w3c standards. function moveelement(id, x, y) { // move the element with id to x,y // where x,y are the horizontal // and vertical position in pixels var elm = document.getelementbyid(id); if (elm) { elm.style.left = x + 'px'; elm.style.top = y + 'px'; } } ask yourself this: "is supporting non-standard browsers worth the development and maintenance costs?" example 3 - detecting specific gecko branches // return the rv value of a gecko user agent // as a floating point number. // returns -1 for non-gecko browser...
...ator.vendor == 'cs 2000 7.0') { found = true; } } } } example 4 - the international herald-tribune this site illustrates many of the techniques described in this article. they use downlevel pages for less capable browsers combined with object based feature detection to produce a compelling and interesting site. examples from devedge * xbdom * xbmarquee * xbpositionableelement * xbanimatedelement conclusion as we have seen in this article, the browser detection story is still quite complicated due to differences between the modern browsers such as gecko/internet explorer 6 and the older or non-standard browsers such as netscape navigator 4. you may say to yourself "if only all browsers were as good as gecko and internet explorer 6, then my job would be...
-ms-filter - Archive of obsolete content
=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. code example: http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/refs/filter_s.htm <body> <p>click the image to start the filter.</p> // call the function. ...
...e. code example: http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/refs/filter_s.htm <body> <p>click the image to start the filter.</p> // call the function. ...
... <div id="filterfrom" style="position: absolute; width: 200px; height: 250px; background-color: white; filter: revealtrans()"> <img id="imagefrom" style="position: absolute; top: 20px; left: 20px;" src="sphere.jpg" alt="sphere"> <div id="filterto" style="position: absolute; width: 200px; height: 250px; top: 20px; left: 20px; background: white; visibility: hidden;"> </div> </div> <script type="text/javascript"> let filterimg = document.queryselector('#filterfrom'); filterimg.addeventlistener('click', dofilter); function dofilter () { filterfro...
azimuth - Archive of obsolete content
Archive › Web › CSS › azimuth
in combination with elevation, the azimuth css property enables different audio sources to be positioned spatially for aural presentation. this is important in that it provides a natural way to tell several voices apart, as each can be positioned to originate at a different location on the sound stage. stereo output produce a lateral sound stage, while binaural headphones and multi-speaker setups allow for a fully three-dimensional stage. ...
...tage, while binaural headphones and multi-speaker setups allow for a fully three-dimensional stage. initial valuecenterapplies toall elementsinheritedyescomputed valuenormalized angleanimation typediscrete syntax <angle> | [ [ left-side | far-left | left | center-left | center | center-right | right | far-right | right-side ] | behind ] | leftwards | rightwards values angle audible source position is described as an angle within the range -360deg to 360deg. the value 0deg means directly ahead in the center of the sound stage (this is the default value). 90deg is to the right, 180deg is behind, and 270deg or -90deg is to the left. positional keywords left-side: same as 270deg. left-side behind: same as 270deg. far-left: same as 300deg. far-left behind: same as 240deg. left: same ...
.... center-left behind: same as 200deg. center: same as 0deg. center behind: same as 180deg. center-right: same as 20deg. center-right behind: same as 160deg. right: same as 40deg. right behind: same as 140deg. far-right: same as 60deg. far-right behind: same as 120deg. right-side: same as 90deg. right-side behind: same as 90deg. behind: same as 180deg. also used as a modifier for other positional keyword values, as above. leftwards: moves the sound counter-clockwise by 20 degrees, relative to the current angle. rightwards: moves the sound clockwise by 20 degrees, relative to the current angle. examples h1 { azimuth: 30deg; } td.a { azimuth: far-right; } /* 60deg */ #12 { azimuth: behind far-right; } /* 120deg */ p.comment { azimuth: behind; } /* 180deg */ speci...
Styling the Amazing Netscape Fish Cam Page - Archive of obsolete content
fish created three problems: the double border was completely covered up by the image. the text of the h3 was basically touching the right side of the floated image... ...or it would have been, except in some browsers the heading was drawn over the floated image, in contradiction to the css specification. ...
...age back on top of the heading turned out to be a matter of relatively positioning the floated image, and then giving it a z-index value. in order to create visual appeal, i decided to offset the top let corners of the fish image and fish name. with just a few simple margin and padding changes, this was possible. div.card {float: left; width: 45%; margin: 1em 2% 0 2%;} div.card img {float: left; position: relative; z-index: 10; margin: 4px 0 0 0; border: 1px solid #339;} div.card h3 {margin: 0 0 0 4px; padding: 0.2em 0 1px 150px; border: 1px solid #339; border-left: 5px double #339; background: #eec url(body-bg-tan.jpg) bottom left no-repeat fixed; color: #339;} note how the image is pushed downward four pixels, while the h3 is pushed rightward four pixels. at the same time, the heading'...
... added a half-em margins on card paragraphs, and then changed the left margin to be 160px, which makes sure the text in the paragraphs won't wrap under the floated images. this is desirable for the cases where only one word would wrap under an image. it's better to keep the text as if it's in a column of its own. div.card {float: left; width: 45%; margin: 1em 2% 0 2%;} div.card img {float: left; position: relative; z-index: 10; margin: 4px 0 0 0; border: 1px solid #339;} div.card h3 {margin: 0 0 0 4px; padding: 0.2em 0 1px 150px; border: 1px solid #339; border-left: 5px double #339; background: #eec url(body-bg-tan.jpg) bottom left no-repeat fixed; color: #339;} div.card p {margin: 0.5em 0.5em 0.5em 160px;} and voila! the cards are done. conclusion redesigning a classic is something li...
Building up a basic demo with PlayCanvas editor - Game development
now we can apply the colored material to the shape by clicking and dragging its icon from the bottom part of the screen (the little dot on the left hand side of the material's name — it can be a bit fiddly to select; just persevere) onto the box on the scene. so, at this point we've created a blue box. click on the box to bring up its entity sidebar — you'll see options for changing its position, rotation, and scale. try applying the rotation values x: 10 and y: 20. now click on the play arrow in the top right corner of the scene to launch and render the scene — it will be opened in a separate browser tab. this looks great! let's add more shapes to the scene to make it look more interesting. adding more shapes to make way for more shapes, move the box to the left to make some...
...0 and y: 20. now click on the play arrow in the top right corner of the scene to launch and render the scene — it will be opened in a separate browser tab. this looks great! let's add more shapes to the scene to make it look more interesting. adding more shapes to make way for more shapes, move the box to the left to make some room for the next shape. you can do this by giving it an x position value of -2. adding other shapes involves a very similar process to adding the box. click on the root folder in the hierarchy panel (to make sure that the new shape appears in the root, and not as a child of the box) then click on the big add entity (plus) button and select cylinder from the dropdown list — it will add a new cylinder shape to the scene. now follow the same steps as we did bef...
...s a nice scaling effect as a result. remember to add the cylinderanimation.js file to the cylinder object to apply the given animations. the cone time to play with the last object — the cone. create a coneanimation.js file and double click it to open it in the editor. next, add the following line to the initialize() function: this.timer = 0; to move the cone up and down we will use the setposition() method — add the code below to the update() function: this.timer += dt; this.entity.setposition(2, math.sin(this.timer*2), 0); the position of the cone will be animated on each frame by being passed the math.sin() value of the timer at each point in time — we have doubled the this.timer value to make it move higher. add the coneanimation.js script to the cone object, as before. test the...
Mobile touch controls - Game development
e touch events reference article provides more examples and information. pure javascript demo let's implement the mobile support in a little demo available on github, so we can move the player's ship by touching the screen on a mobile device. we will use two events: touchstart and,touchmove both handled by one function. ...
...nvas.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. to see if it's working correctly we can output the x and y positions using the output element. the preventdefault() function is needed to prevent the browser from moving — without it you'd have the default behaviour, and the canvas would be dragged arou...
...bled = true; player.input.enabledrag(); player.events.ondragstart.add(ondragstart, this); player.events.ondragstop.add(ondragstop, this); function ondragstart(sprite, pointer) { // do something when dragging } we can pull the ship around and do something in the meantime, and react when the drag is stopped. hauling in phaser, if enabled, will work out of the box — you don't have to set the position of the sprite yourself manually, so you could leave the ondragstart() function empty, or place some debug output to see if it's working correctly. the pointer element contains the x and y variables storing the current position of the dragged element. dedicated plugins you could go even further and use dedicated plugins like virtual joystick — this is a paid, official phaser plugin, but you ca...
Square tilemaps implementation: Scrolling maps - Game development
not done so already. the camera the camera is an object that holds information about which section of the game world or level is currently being shown. ...
...y being shown. cameras can either be free-form, controlled by the player (such as in strategy games) or follow an object (such as the main character in platform games.) regardless of the type of camera, we would always need information regarding its current position, viewport size, etc. in the demo provided along with this article, these are the parameters the camera has: x and y: the current position of the camera. in this implementation, we are assuming that (x,y) points to the top left corner of visible portion of the map. width and height: the size of the camera's viewport. maxx and maxy: the limit for the camera's position — the lower limit will nearly always be (0,0), and in this case the upper limit is equal to the size of the world minus the size of the camera's viewport. renderi...
...ol * 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. the main difference is that we are adding the offsetx and offsety values to the target x and y coordinates, and these values are rounded, to avoid artifacts that would result from the camera pointing at positions with floating point numbers. for (var c = startcol; c <= endcol; c++) { for (var r = startrow; r <= endrow; r++) { var tile = map.gettile(c, r); var x = (c - startcol) * map.tsize + offsetx; var y = (r - startrow) * map.tsize + offsety; if (tile !== 0) { // 0 => empty tile this.ctx.drawimage( this.tileat...
Tiles and tilemaps overview - Game development
ucture or object. these data objects (map object example) should include: tile size: the size of each tile in pixels across / pixels down. image atlas: the image atlas that will be used (one or many.) map dimensions: the dimensions of the map, either in tiles across / tiles down, or pixels across / pixels down. visual grid: includes indices showing what type of tile should be placed on each position in the grid. logic grid: this can be a collision grid, a path-finding grid, etc., depending on the type of game. note: for the visual grid, a special value (usually a negative number, 0 or null) is needed to represent empty tiles. square tiles square-based tilemaps are the most simple implementation. a more generic case would be rectangular-based tilemaps — instead of square — but they...
...* map.tilesize; drawtile(tile, x, y); } } you can read more about this and see an example implementation in square tilemaps implementation: static maps. scrolling tilemaps scrolling tilemaps only show a small portion of the world at a time. they can follow a character — like in platformers or rpgs — or allow the player to control the camera — like in strategy or simulation games. ...
...lementation in square tilemaps implementation: static maps. scrolling tilemaps scrolling tilemaps only show a small portion of the world at a time. they can follow a character — like in platformers or rpgs — or allow the player to control the camera — like in strategy or simulation games. positioning and camera in all scrolling games, we need a translation between world coordinates (the position where sprites or other elements are located in the level or game world) and screen coordinates (the actual position where those elements are rendered on the screen). the world coordinates can be expressed in terms of tile position (row and column of the map) or in pixels across the map, depending on the game. to be able to transform world coordinates into screen coordinates, we need the coordinat...
Example 2 - Learn web development
<option>apple</option> </select> <div class="select"> <span class="value">cherry</span> <ul class="optlist hidden"> <li class="option">cherry</li> <li class="option">lemon</li> <li class="option">banana</li> <li class="option">strawberry</li> <li class="option">apple</li> </ul> </div> <form> css content .widget select, .no-widget .select { position : absolute; left : -5000em; height : 0; overflow : hidden; } /* --------------- */ /* required styles */ /* --------------- */ .select { position: relative; display : inline-block; } .select.active, .select:focus { box-shadow: 0 0 3px 1px #227755; outline: none; } .select .optlist { position: absolute; top : 100%; left : 0; } .select .optlist.hidden { max-h...
...,.45); /* 0 1px 2px */ background : #f0f0f0; background : -webkit-linear-gradient(90deg, #e3e3e3, #fcfcfc 50%, #f0f0f0); background : linear-gradient(0deg, #e3e3e3, #fcfcfc 50%, #f0f0f0); } .select .value { display : inline-block; width : 100%; overflow : hidden; white-space : nowrap; text-overflow : ellipsis; vertical-align: top; } .select:after { content : "▼"; position: absolute; z-index : 1; height : 100%; width : 2em; /* 20px */ top : 0; right : 0; padding-top : .1em; -moz-box-sizing : border-box; box-sizing : border-box; text-align : center; border-left : .2em solid #000; border-radius: 0 .1em .1em 0; background-color : #000; color : #fff; } .select .optlist { z-index : 2; list-style: none; margin : 0; paddi...
... <option>apple</option> </select> <div class="select"> <span class="value">cherry</span> <ul class="optlist hidden"> <li class="option">cherry</li> <li class="option">lemon</li> <li class="option">banana</li> <li class="option">strawberry</li> <li class="option">apple</li> </ul> </div> <form> css content .widget select, .no-widget .select { position : absolute; left : -5000em; height : 0; overflow : hidden; } result for no js ...
Advanced text formatting - Learn web development
<dt>eggs</dt>\n <dd>the glue that binds the cake together.</dd>\n <dt>coffee</dt>\n <dd>the drink that gets the world running in the morning.</dd>\n <dd>a light brown color.</dd>\n</dl>'; const solutionentry = htmlsolution; textarea.addeventlistener('input', updatecode); window.addeventlistener('load', updatecode); // stop tab key tabbing out of textarea and // make it write a tab at the caret position instead textarea.onkeydown = function(e){ if (e.keycode === 9) { e.preventdefault(); insertatcaret('\t'); } if (e.keycode === 27) { textarea.blur(); } }; function insertatcaret(text) { const scrollpos = textarea.scrolltop; const caretpos = textarea.selectionstart; const front = (textarea.value).substring(0, caretpos); const back = (textarea.value).substring(textare...
...king.com">the need to eliminate negative self talk</q> (as mentioned in <a href="http://www.affirmationsforpositivethinking.com"><cite>affirmations for positive thinking</cite></a>.)</p>'; const solutionentry = htmlsolution; textarea.addeventlistener('input', updatecode); window.addeventlistener('load', updatecode); // stop tab key tabbing out of textarea and // make it write a tab at the caret position instead textarea.onkeydown = function(e){ if (e.keycode === 9) { e.preventdefault(); insertatcaret('\t'); } if (e.keycode === 27) { textarea.blur(); } }; function insertatcaret(text) { const scrollpos = textarea.scrolltop; const caretpos = textarea.selectionstart; const front = (textarea.value).substring(0, caretpos); const back = (textarea.value).substring(textare...
...ution.value = 'show solution'; } updatecode(); }); const htmlsolution = '<p><abbr title="national aeronautics and space administration">nasa</abbr> sure does some exciting work.</p>'; const solutionentry = htmlsolution; textarea.addeventlistener('input', updatecode); window.addeventlistener('load', updatecode); // stop tab key tabbing out of textarea and // make it write a tab at the caret position instead textarea.onkeydown = function(e){ if (e.keycode === 9) { e.preventdefault(); insertatcaret('\t'); } if (e.keycode === 27) { textarea.blur(); } }; function insertatcaret(text) { const scrollpos = textarea.scrolltop; const caretpos = textarea.selectionstart; const front = (textarea.value).substring(0, caretpos); const back = (textarea.value).substring(textare...
Getting started with HTML - Learn web development
solution.value = 'hide solution'; } else { textarea.value = userentry; solution.value = 'show solution'; } updatecode(); }); var htmlsolution = '<em>this is my text.</em>'; var solutionentry = htmlsolution; textarea.addeventlistener('input', updatecode); window.addeventlistener('load', updatecode); // stop tab key tabbing out of textarea and // make it write a tab at the caret position instead textarea.onkeydown = function(e){ if (e.keycode === 9) { e.preventdefault(); insertatcaret('\t'); } if (e.keycode === 27) { textarea.blur(); } }; function insertatcaret(text) { var scrollpos = textarea.scrolltop; var caretpos = textarea.selectionstart; var front = (textarea.value).substring(0, caretpos); var back = (textarea.value).substring(textarea.select...
...ue = 'show solution'; } updatecode(); }); var htmlsolution = '<p>a link to my <a href="https://www.mozilla.org/" title="the mozilla homepage" target="_blank">favorite website</a>.</p>'; var solutionentry = htmlsolution; textarea.addeventlistener('input', updatecode); window.addeventlistener('load', updatecode); // stop tab key tabbing out of textarea and // make it write a tab at the caret position instead textarea.onkeydown = function(e){ if (e.keycode === 9) { e.preventdefault(); insertatcaret('\t'); } if (e.keycode === 27) { textarea.blur(); } }; function insertatcaret(text) { var scrollpos = textarea.scrolltop; var caretpos = textarea.selectionstart; var front = (textarea.value).substring(0, caretpos); var back = (textarea.value).substring(textarea.select...
...">rush</a>.\ my favourite rush album is currently <a href="http://www.deezer.com/album/942295">moving pictures</a>.</p>\ <img src="https://udn.realityripple.com/samples/4b/9bb5edda5d.jpg">'; var solutionentry = htmlsolution; textarea.addeventlistener('input', updatecode); window.addeventlistener('load', updatecode); // stop tab key tabbing out of textarea and // make it write a tab at the caret position instead textarea.onkeydown = function(e){ if (e.keycode === 9) { e.preventdefault(); insertatcaret('\t'); } if (e.keycode === 27) { textarea.blur(); } }; function insertatcaret(text) { var scrollpos = textarea.scrolltop; var caretpos = textarea.selectionstart; var front = (textarea.value).substring(0, caretpos); var back = (textarea.value).substring(textarea.select...
Images in HTML - Learn web development
\n alt="the head and torso of a dinosaur skeleton; it has a large head with long sharp teeth"\n width="200"\n height="171"\n title="a t-rex on display in the manchester university museum">'; var solutionentry = htmlsolution; textarea.addeventlistener('input', updatecode); window.addeventlistener('load', updatecode); // stop tab key tabbing out of textarea and // make it write a tab at the caret position instead textarea.onkeydown = function(e){ if (e.keycode === 9) { e.preventdefault(); insertatcaret('\t'); } if (e.keycode === 27) { textarea.blur(); } }; function insertatcaret(text) { var scrollpos = textarea.scrolltop; var caretpos = textarea.selectionstart; var front = (textarea.value).substring(0, caretpos); var back = (textarea.value).substring(textarea.select...
...f a dinosaur skeleton; it has a large head with long sharp teeth"\n width="200"\n height="171">\n <figcaption>a t-rex on display in the manchester university museum</figcaption>\n</figure>'; var solutionentry = htmlsolution; textarea.addeventlistener('input', updatecode); window.addeventlistener('load', updatecode); // stop tab key tabbing out of textarea and // make it write a tab at the caret position instead textarea.onkeydown = function(e){ if (e.keycode === 9) { e.preventdefault(); insertatcaret('\t'); } if (e.keycode === 27) { textarea.blur(); } }; function insertatcaret(text) { var scrollpos = textarea.scrolltop; var caretpos = textarea.selectionstart; var front = (textarea.value).substring(0, caretpos); var back = (textarea.value).substring(textarea.select...
...embed images into webpages (and javascript, but that's another story entirely). the css background-image property, and the other background-* properties, are used to control background image placement. for example, to place a background image on every paragraph on a page, you could do this: p { background-image: url("images/dinosaur.jpg"); } the resulting embedded image, is arguably easier to position and control than html images. so why bother with html images? as hinted to above, css background images are for decoration only. if you just want to add something pretty to your page to enhance the visuals, this is fine. though, such images have no semantic meaning at all. they can't have any text equivalents, are invisible to screen readers, and so on. this is where html images shine! summing u...
Third-party APIs - Learn web development
of different controls available; by default it just shows a zoom control. 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. ...
...and 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. you can adjust the position by specifying an options object as a parameter for the control containing a position property, the value of which is a string specifying a position for the control. try this, for example: map.addcontrol(l.mapquest.control({ position: 'bottomright' })); there are other types of control available, for example mapquest.searchcontrol() and mapquest.satellitecontrol(), and some are quite complex and powerful. have a play around and see what you can come up with. adding a custom m...
...you to use some kind of developer key, for reasons of security and accountability. to sign up for an nytimes api key, following the instructions at https://developer.nytimes.com/get-started. let's request a key for the article search api — create a new app, selecting this as the api you want to use (fill in a name and description, toggle the switch under the "article search api" to the on position, and then click "create"). get the api key from the resulting page. now, to start the example off, make copies of nytimes_start.html and nytimes.css in a new directory on your computer. if you've already cloned the examples repository, you'll already have a copy of these files, which you can find in the javascript/apis/third-party-apis/nytimes directory. initially the <script> element...
Adding features to our bouncing balls demo - Learn web development
his method will do the same thing as the first part of ball()'s update() function — look to see whether the evil circle is going to go off the edge of the screen, and stop it from doing so. again, you can mostly just copy the ball.prototype.update definition, but there are a few changes you should make: get rid of the last two lines — we don't want to automatically update the evil circle's position on every frame, because we will be moving it in some other way, as you'll see below. inside the if() statements, if the tests return true we don't want to update velx/vely; we want to instead change the value of x/y so the evil circle is bounced back onto the screen slightly. adding or subtracting (as appropriate) the evil circle's size property would make sense. setcontrols() this method wil...
... _this.y -= _this.vely; } else if (e.key === 's') { _this.y += _this.vely; } } so when a key is pressed, the event object's keycode property is consulted to see which key is pressed. if it is one of the four represented by the specified keycodes, then the evil circle will move left/right/up/down. for a bonus point, can you tell us why we've had to set let _this = this; in the position it is in? it is something to do with function scope. collisiondetect() this method will act in a very similar way to ball()'s collisiondetect() method, so you can use a copy of that as the basis of this new method. but there are a couple of differences: in the outer if statement, you no longer need to check whether the current ball in the iteration is the same as the ball that is doing the c...
...current ball exists. call the evil ball instance's draw(), checkbounds(), and collisiondetect() methods on every iteration of the loop. implementing the score counter to implement the score counter, follow the following steps: in your html file, add a <p> element just below the <h1> element containing the text "ball count: ". in your css file, add the following rule at the bottom: p { position: absolute; margin: 0; top: 35px; right: 5px; color: #aaa; } in your javascript, make the following updates: create a variable that stores a reference to the paragraph. keep a count of the number of balls on screen in some way. increment the count and display the updated number of balls each time a ball is added to the scene. decrement the count and display the updated nu...
Handling common accessibility problems - Learn web development
note: a high contrast ratio will also allow anyone using a smartphone or tablet with a glossy screen to better read pages when in a bright environment, such as sunlight. hiding content there are many instances where a visual design will require that not all content is shown at once. ...
... on the other hand, you shouldn't use visibility:hidden or display:none, because they do hide content from screenreaders. ...
... the basic ones you'll need for web page testing are in the following table. in the keyboard shortcuts, "nvda" means "the nvda modifier". most common nvda keyboard shortcuts keyboard shortcut description nvda + q turn nvda off again after you've started it. nvda + up cursor read the current line. nvda + down cursor start reading at the current position. up cursor and down cursor, or shift + tab and tab move to previous/next item on page and read it. left cursor and right cursor move to previous/next character in current item and read it. shift + h and h move to previous/next heading and read it. shift + k and k move to previous/next link and read it. shift + d and d move to previous/ne...
The Firefox codebase: CSS Guidelines
fox front-end engineers. basics here are some basic tips that can optimize reviews if you are changing css: avoid !important but if you have to use it, make sure it's obvious why you're using it (ideally with a comment). the overriding css section contains more information about this. avoid magic numbers; prefer automatic sizing or alignment methods. some examples to avoid: absolutely positioned elements hardcoded values such as: vertical-align: -2px; . the reason you should avoid such "hardcoded" values is that, they don't necessarily work for all font-size configurations. avoid setting styles in javascript. it's generally better to set a class and then specify the styles in css. classlist is generally better than classname. there's less chance of overwriting an existing cla...
...his: xul|tab:hover { background-color: var(--in-content-box-background-hover); } not this: #certificateerrordebuginformation { background-color: var(--in-content-box-background-hover); } localization text direction for margins, padding and borders, use inline-start/inline-end rather than left/right. example: use margin-inline-start: 3px; instead of margin-left: 3px. for rtl-aware positioning (left/right), use inset-inline-start/inset-inline-end. for rtl-aware float layouts, float: inline-start|inline-end can be used instead of float: left|right. the rtl-aware equivalents of border-{top/bottom}-{left/right}-radius are border-{start/end}-{start/end}-radius when there is no special rtl-aware property available, use the pseudo :-moz-locale-dir(ltr|rtl) (for xul files) or :dir(ltr|r...
...iving hints as to how something should act, however -moz-appearance: none; is probably saying 'ignore browser preconceptions - i want a blank sheet', so that's more visual. however -moz-appearance values aren't implemented and don't behave consistently across platforms, so idealism aside -moz-appearance should always be in theme css. [2] however there is probably a better way than using absolute positioning. colors for common areas of the firefox interface (panels, toolbar buttons, etc.), mozilla-central often comes with some useful css variables that are adjusted with the correct values for different platform configurations, so using those css variables can definitively save some testing time, as you can assume they already work correctly. using the currentcolor keyword or inheriting is als...
mozbrowserasyncscroll
only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. details read only object a custom object. details the details property returns an anonymous javascript object with the following properties: top the scroll top position in css pixels of the document within the browser <iframe>. left the scroll left position in css pixels of the document within the browser <iframe>. width the width in css pixels of the visible part of the document within the browser <iframe>. height the height in css pixels of the visible part of the document within the browser <iframe>. scrollwidth the total content width in css pixels o...
.... this indicates that the content is over-scrolled, which occurs when the page "rubber-bands" after being scrolled all the way to the bottom. similarly, left + width may be greater than scrollwidth, and both left and top may be negative. note: for performance reasons, this event is asynchronous. ...
...and top may be negative. note: for performance reasons, this event is asynchronous. that means that the value retrieved through the event object can be different than the real current position of the scroll when the event is processed. ...
mozbrowserscroll
of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. details read only object a custom object. ...
...hether the event is cancellable or not. details read only object a custom object. details the details property returns an anonymous javascript object with the following properties: top a number representing the new vertical scroll position of the <iframe> viewport — in css pixels — from the top of the viewport. left a number representing the new horizontal scroll position of the <iframe> viewport — in css pixels — from the left of the viewport. ...
... vertical scroll position of the <iframe> viewport — in css pixels — from the top of the viewport. left a number representing the new horizontal scroll position of the <iframe> viewport — in css pixels — from the left of the viewport. ...
MozBeforePaint
nd hardware won't let the browser display more frames than that anyway. limiting the frame rate avoids wasting work, thereby saving cpu usage and power and improving overall system performance. example this example performs a simple animation, moving a box a short distance after a short period of time. ...
...when the animation sequence completes, removes the event listener. you may take a look at this example live if you like. ...
...window.mozrequestanimationframe(); } else { window.removeeventlistener("mozbeforepaint", step, false); } } window.addeventlistener("mozbeforepaint", step, false); window.mozrequestanimationframe(); </script> </body> </html> as you can see, each time the mozbeforepaint event fires, our step() method is called. this computes the current position for the animating box and updates the box's position on screen, and, if the animation sequence is not yet complete, calls window.requestanimationframe() to schedule the next animation frame to be drawn. when the animation sequence completes, removes the event listener. you may take a look at this example live if you like. ...
JNI.jsm
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. cdata get(number aindex); parameters aindex the position in the array to obtain. return value returns primitive cdata. .getelements() returns a new cdata object of the section of the array specified by astart and ending at position astart + alength. void setelements(number astart, number alength); parameters astart the position to start setting elements of the array in. alength the number of elements to copy from astart. if 0 is supplied,...
...ber alength); parameters astart the position to start setting elements of the array in. alength the number of elements to copy from astart. if 0 is supplied, an empty cdata array is returned. return value a new cdata array object based on the array. .set() sets an element in the array at given aindex to the given aval. void set(number aindex, cdata aval); parameters aindex the position in the array to change. aval a value to set it to. return value this function has no return value, if you try to store the return value in a variable, it will be undefined. .setelements() sets a section of a typed array to specified values. this function starts on the position of astart in the array and sets it to the values in avalsarray. this is done by calling .set for each element with...
... avalsarray a javascript array holding the values to set. return value this function has no return value, if you try to store the return value in a variable, it will be undefined. ...
Creating localizable web applications
that will be substituted by the date upon interpretation of the code (snippet 3). snippet 4. good: <h3> <?printf( /* l10n: %s is the author's username */ _("created by <a href=\"%s\">%s</a>"), $locale_conf->url('/gallery/designer/' . $persona['author']), $persona['display_username']);?> </h3> in this example the link is in the _() call so that localizers can adjust the position of the author's name, depending on the grammar of their language. use printf() for string substitution whenever there is content that will change, either upon interpretation of the code or as part of development, don't use concatenation. instead, use printf() and string formatting. for instance, don't put uris into msgid's. if you do, if the static uri changes, you'll have to regenerate the *.p...
...o to numbers. image 1. bad: image 2. bad: if you wish to use a non-standard font (as in the image above), take advantage of the css's on-line fonts feature available via @font-face. image 3. bad: the trouble with the above image is the "for firefox" part, which should be made localizable. keep in mind that you should allow to localize the whole "for firefox" part, not only the "for" preposition to which you'd concatenate the "firefox" part. that's because some languages might require changing the word order, and others might require putting the word firefox in the correct grammatical case. image 4. bad: image 5 & snippet 1. good: image file (/img/tignish/firefox/performance-chart.png): html: (in this case, no gettext was used and the localizers worked on pure html files) <div i...
...w you can test a persona before you submit it? <b><a href=\"%s\">find out how!</a>&raquo;</b>"), $locale_conf->url('/demo_create_3#test'));?> </div> snippet 2. good: css: div.tut_didyouknow { background: url(/static/img/question-64.png) no-repeat 0 0; padding-left: 64px; } html[dir='rtl'] div.tut_didyouknow { background-image: url(/static/img/question-64.png); background-position: 100% 0; padding-left: 0; padding-right: 64px; } html/php: <div class="tut_didyouknow"> <?printf (_("did you know you can test a persona before you submit it? <b><a href=\"%s\">find out how!</a>&raquo;</b>"), $locale_conf->url('/demo_create_3#test'));?> </div> notice that the icon has been moved to css, so that it doesn't sit in a <img/> element. this is generally considere...
Research and prep
determining a user's choice of default search engines, content and protocol handlers (rss readers, web mail and web calendar), bookmarks, and links to recommended sites on the in-product pages as it relates to their locale. it is one of the most customizable and localizable parts of the product l10n process, as it goes beyond string translation. we believe that localization teams are in the best position to provide recommendations on what local providers we can use for web services because you're in the market, work in the language, and know your users. this is, therefore, meant to be a guideline for how you should be formulating your recommendations. here's the basic process: file a bug under mozilla localizations>[your_locale] to request updates to your locale's productization preferences. if...
...site provider to include it. ensure that your suggestions follow these parameters: search there are typically five search plug-ins listed for firefox desktop (only four for firefox mobile): generic search the default option should expose the quickest path to the best result on the world wide web for the user (indexing a large portion of the global www). ...
... e-commerce search these search engines should allow users to get connected to new and used products they want to buy as quickly and painlessly as possible in a "trusted" site -- for example, choosing the most popular auction, general shopping, or classified type sites that have the desired user experience are good choices. ...
Mozilla internal string guide
ring classes) in the string. .isempty() - the fastest way of determining if the string has any value. use this instead of testing string.length == 0 .equals(string) - true if the given string has the same value as the current string. common methods that modify the string: .assign(string) - assigns a new value to the string. .append(string) - appends a value to the string. .insert(string, position) - inserts the given string before the code unit at position. .truncate(length) - shortens the string to the given length. complete documentation can be found in the appendix. read-only strings the const attribute on a string determines if the string is writable. if a string is defined as a const nsastring then the data in the string cannot be manipulated. if one tries to call a non-const me...
... } you may change the length of a string via setlength(). note that iterators become invalid after changing the length of a string: /** * replace every tab character in `data` with four spaces. */ void replacetabs2(nsastring& data) { int len = data.length(); char16_t *cur = data.beginwriting(); char16_t *end = data.endwriting(); // because `cur` may change during the loop, track the position // within the string. 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,...
... nsliteralcstring similar to nsdependent[c]string, but pre-calculates length at build time. appendix b - nsastring reference read-only methods. length() isempty() isvoid() - xpconnect will convert void nsastrings to javascript null. beginreading(iterator) endreading(iterator) equals(string[, comparator]) first() last() countchar() left(outstring, length) mid(outstring, position, length) right(outstring, length) findchar(character) methods that modify the string. assign(string) append(string) insert(string) cut(start, length) replace(start, length, string) truncate(length) setisvoid(true) - make it null. xpconnect will convert void nsastrings to javascript null. beginwriting(iterator) endwriting(iterator) setcapacity() - inform the string about buffer siz...
IAccessible2
rits from: iaccessible last changed in gecko 1.9 (firefox 3) method overview [propget] hresult attributes([out] bstr attributes ); [propget] hresult extendedrole([out] bstr extendedrole ); [propget] hresult extendedstates([in] long maxextendedstates, [out, size_is(,maxextendedstates), length_is(, nextendedstates)] bstr extendedstates, [out] long nextendedstates ); [propget] hresult groupposition([out] long grouplevel, [out] long similaritemsingroup, [out] long positioningroup ); [propget] hresult indexinparent([out] long indexinparent ); [propget] hresult locale([out] ia2locale locale ); [propget] hresult localizedextendedrole([out] bstr localizedextendedrole ); [propget] hresult localizedextendedstates([in] long maxlocalizedextendedstates, [out, size_is(,maxlocalizedextendedstat...
...dedstates this parameter is ignored. refer to @ref _arrayconsideration "special consideration when using arrays" for more details. extendedstates this array is allocated by the server. free it with cotaskmemfree. nextendedstates the number of extended states returned; the size of the returned array. return value s_false if there are no states, [out] values are null and 0 respectively. s_ok. groupposition() returns grouping information. used for tree items, list items, tab panel labels, radio buttons, and so on. also used for collections of non-text objects. [propget] hresult groupposition( [out] long grouplevel, [out] long similaritemsingroup, [out] long positioningroup ); parameters grouplevel 1 based, 0 indicates that this value is not applicable. similaritemsingroup 1 based, 0 indicate...
...this is an index into the objects in the current group, not an index into all the objects at the same group level. return value s_false if no values are valid. ...
nsIAccessible
e tree by the following methods and attributes. nsiaccessible.parent to get the parent accessible nsiaccessible.nextsibling, nsiaccessible.previoussibling to get sibling accessibles nsiaccessible.firstchild, nsiaccessible.lastchild to get first and last child nsiaccessible.children, nsiaccessible.getchildat(), nsiaccessible.childcount to navigate through the children by index accessible position you can use nsiaccessible.indexinparent to get accessible index in its parent. use nsiaccessible.groupposition() to get information about this accessible in its group. relations many accessibles are linked with each other, for example, if one accessible gives the accessible name for another accessible (for example, html:label and html control) then these accessibles are related, please refer to r...
...fit into existing api methods, please refer to attributes documentation for more information. you can use nsiaccessible.attributes to get a map of attributes. keyboard shortcuts some actions on accessibles can be performed by keyboard shortcuts. following methods are used to get them nsiaccessible.defaultkeybinding(), nsiaccessible.getkeybindings(), nsiaccessible.keyboardshortcut. size and screen position you can use nsiaccessible.getbounds() to get size and coordinates of the accessible. layout oriented methods nsiaccessible.getchildatpoint() to get child accessible from point nsiaccessible.getaccessibletoleft(), nsiaccessible.getaccessibletoright(), nsiaccessible.getaccessibleabove() or nsiaccessible.getaccessiblebelow() to get left, right, top or below placed accessible methods ge...
....getaccessibleabove() or nsiaccessible.getaccessiblebelow() to get left, right, top or below placed accessible methods getkeybindings provides array of localized string of global keyboard accelerator for the given action index supported by accessible. getstate provides a bit fields of accessible states which describe boolean properties of accessible. groupposition this method returns grouping information. used for tree items, list items, tab panel labels, radio buttons, etc. also used for collectons of non-text objects. getchildatpoint this method returns an accessible child which contains the coordinate at (x, y) in screen pixels. getchildat this method returns nth accessible child using zero-based index or last chil...
nsIAccessibleImage
accessible/public/nsiaccessibleimage.idlscriptable this interface allows in-process accessibility clients to retrieve information about an image. 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview void getimageposition(in unsigned long coordtype, out long x, out long y); void getimagesize(out long width, out long height); methods getimageposition() returns the coordinates of the image accessible. this method is the same as nsiaccessible.getbounds() excepting coordinate origin parameter. void getimageposition( in unsigned long coordtype, out long x, out long y ); parameters coordtype specifies coordinates origin (for available constants refer to nsiaccessiblecoordinatetype). x the x coordinat...
... exceptions thrown ns_error_failure indicates that the accessible is unattached from the accessible tree. getimagesize() returns the size of the image accessible. this method is the same as nsiaccessible.getbounds(). void getimagesize( out long width, out long height ); parameters width the width of the image accessible. ...
... exceptions thrown ns_error_failure indicates that the accessible is unattached from the accessible tree. getimagesize() returns the size of the image accessible. this method is the same as nsiaccessible.getbounds(). ...
nsIDOMWindow
me domstring get or set the name of this window. this attribute is "replaceable" in javascript. parent nsidomwindow the window's parent window. if there is no parent window, or if the parent is of a different type, this is the current window. the window hierarchy does not cross chrome-content boundaries. read only. scrollx long the current horizontal (x) scroll position, in pixels. this attribute is "replaceable" in javascript. read only. scrolly long the current vertical (y) scroll position, in pixels. this attribute is "replaceable" in javascript. read only. scrollbars nsidombarprop the object that controls whether or not scrollbars are shown in the window. this attribute is "replaceable" in javascript. read only. session...
...g pseudoelt optional ); parameters elt pseudoelt optional return value getselection() returns the nsiselection object indicating what if any content is currently selected in the window. nsiselection getselection(); parameters none. return value the nsiselection object for the window. scrollby() scrolls the window by a given number of pixels relative to the current scroll position. void scrollby( in long xscrolldif, in long yscrolldif ); parameters xscrolldif the number of pixels by which to scroll horizontally. yscrolldif the number of pixels by which to scroll vertically. scrollbylines() scrolls the window by the specified number of lines. void scrollbylines( in long numlines ); parameters numlines the number of lines by which to scroll. scroll...
...ameters numlines the number of lines by which to scroll. scrollbypages() scrolls the window by the specified number of pages. void scrollbypages( in long numpages ); parameters numpages the number of pages by which to scroll. scrollto() scrolls the window to an absolute pixel offset. void scrollto( in long xscroll, in long yscroll ); parameters xscroll the horizontal position to which to scroll, in pixels. yscroll the vertical position to which to scroll, in pixels. sizetocontent() makes the window's size fit the contents of the window. void sizetocontent(); parameters none. see also dom ...
nsIDragService
1 the drag and drop operation should copy the object. dragdrop_action_move 2 the drag and drop operation should move the object. dragdrop_action_link 4 the drag and drop operation should link the object. dragdrop_action_uninitialized 64 the action is not initialized. methods native code only!dragmoved programmatically changes the drag position of the drag session. this is used on mac and windows to update the position of a popup being used as a drag image during the drag operation. it's not used on gtk, which handles the drag popup itself. [noscript] void dragmoved( in long ax, in long ay ); parameters ax the x coordinate to which to move the popup being dragged. ay the y coordinate to which to move the popup being dragged...
... aregion a region containing rectangles for cursor feedback, in window coordinates. aactiontype specified which of copy/move/link are allowed. invokedragsessionwithimage() starts a modal drag session using an image. a custom image may be specified using the aimage argument. 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. the nod...
...agey, in nsidomdragevent adragevent, in nsidomdatatransfer adatatransfer ); parameters adomnode the source node on which the drag gesture was started. atransferables an array of transferables to be dragged. aregion a region containing rectangles for cursor feedback, in window coordinates. aactiontype specified which of copy/move/link are allowed. aimage image object. aimagex x position of image. aimagey y position of image. adragevent the drag gesture event that initiated the drag. adatatransfer a data transfer object that is available on the current drag session. invokedragsessionwithselection() start a modal drag session using the selection as the drag image. the adragevent must be supplied as the current screen coordinates of the event are needed to calculate the i...
nsIMessenger
ifferent protocols such as imap, pop3, or local mail sources. nsimsgmessageservice messageservicefromuri(in acstring auri); parameters auri the url of the message or attachment to get the service for. return value the nsimsgmessageservice responsible for the url. msghdrfromuri() nsimsgdbhdr msghdrfromuri(in acstring auri); getmsguriatnavigatepos() gets the message a particular position in the navigation history. for example, back-forward history needs a list of visited messages, and where it is in the list. unfortunately, you must call this before navigating to a position, because calling this has the side effect of making us adjust our current history position, and not adding the loaded message to the history queue. acstring getmsguriatnavigatepos(in long apos); parameters...
...tion history. for example, back-forward history needs a list of visited messages, and where it is in the list. unfortunately, you must call this before navigating to a position, because calling this has the side effect of making us adjust our current history position, and not adding the loaded message to the history queue. acstring getmsguriatnavigatepos(in long apos); parameters apos the position to get the url from relative to the current history cursor. +1 is forward, -1 is back. return value the url at that point in the history. getfolderuriatnavigatepos() gets the folder url at a particular position in the navigation history. acstring getfolderuriatnavigatepos(in long apos); parameters apos the position to get the url from relative to the current history cursor. +1 is ...
... acount the number of items in the history. ahistory an array of strings containing information about each entry in the history. ...
nsIMsgFolder
stsemaphore(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 boolean markflagged); void markthreadread(in nsimsgthread thread); void setlabelformessages(in nsisupportsarray messages,...
... cancompact boolean readonly: rootfolder nsimsgfolder readonly: the phantom server folder. constants constant value description nsmsgbiffstate_newmail 0 user has new mail waiting. nsmsgbiffstate_nomail 1 no new mail is waiting. nsmsgbiffstate_unknown 2 we dunno whether there is new mail. nsmsgdispositionstate_none -1 nsmsgdispositionstate_replied 0 nsmsgdispositionstate_forwarded 1 allmessagecountnotifications 0 turn notifications on/off for various notification types. currently only supporting allmessagecountnotifications which refers to both total and unread message counts. methods startfolderloading() void startfolderloading(); ...
...ea.dat) void writetofoldercache(in nsimsgfoldercache foldercache, in boolean deep); getnumnewmessages() the number of new messages since this folder was last visited long getnumnewmessages(in boolean deep); setnumnewmessages() void setnumnewmessages(in long numnewmessages); generatemessageuri() acstring generatemessageuri(in nsmsgkey msgkey); addmessagedispositionstate() void addmessagedispositionstate(in nsimsgdbhdr amessage, in nsmsgdispositionstate adispositionflag); markmessagesread() void markmessagesread(in nsisupportsarray messages, in boolean markread); markallmessagesread() void markallmessagesread(); markmessagesflagged() void markmessagesflagged(in nsisupportsarray messages, ...
nsIPromptService
string atext, in pruint32 acount, [array, size_is(acount)] in wstring aselectlist, out long aoutselection); constants the following flags are combined to form the abuttonflags parameter passed to confirmex. all flags are defined as unsigned long constants and can be accessed as components.interfaces.nsipromptservice.flagname from javascript and as nsipromptservice::flagname from c++. button position flags on linux and mac, button 2 is on the left of the prompt, while buttons 1 and 0 are on the right. on windows and os/2, the buttons are centred in the order 0, 2, 1. constant value description button_pos_0 1 this is usually the button used to confirm the prompt. it typically has the label "ok", "yes", or "save". button_pos_1 256 this is the button ...
...label "cancel" or "no". it is equivalent to pressing the escape key (or cmd+. on the mac), or closing the window through the os controls. button_pos_2 65536 this button can be used to give the user a choice of options, but still allowing the user to cancel the prompt. for instance, it might have the label "don't save". 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_title_ok 1 these flags are used to select standard labels from the user's current locale. button_title_cancel 2 button_title_yes 3 button_title_no 4 button_title_save 5 button_title_dont_save 6 button_title_revert ...
...ation can decide what order the buttons appear in, and it may not be simply right-to-left (2, 1, 0) or left-to-right (0, 1, 2). see bug 624043 for more on this. button 0 is the default button unless one of the button default flags is specified (see button default flags). a button may use a predefined title, specified by one of the button title flags values. each title value can be multiplied by a position value to assign the title to a particular button. if button_title_is_string is used for a button, the string parameter for that button will be used. if the value for a button position is zero, the button will not be shown. the following example creates a dialog with an ok button and a custom button description. abuttonflags = (button_pos_0) * (button_title_ok) + (button_pos_1) * (button_title_is...
nsITreeView
the behavior where drops are only allowed on items, such as the mailnews folder pane, always return false when the orientation is not drop_on. note: drop_on will only be passed to candrop() if the item is a container; see iscontainer(). boolean candrop( in long index, in long orientation, in nsidomdatatransfer datatransfer ); parameters index the index of the row. orientation the position around the given row. defined in constants. datatransfer this parameter, added in gecko 1.9.2, provides the data being dragged, so that it can be examined to determine if a drop is possible. return value true if a drop is allowed at the current location; otherwise false. candropbeforeafter() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) ...
...he view when a header is clicked. void cycleheader( in nsitreecolumn col ); parameters col the column to cycle. drop() called when the user drops something on this view. the orientation paramater specifies before/on/after the given row. void drop( in long row, in long orientation, in nsidomdatatransfer datatransfer ); parameters row the index of the row. orientation the position around the given row. defined in constants. datatransfer this parameter, added in gecko 1.9.2, provides the data that has been dropped. getcellproperties() an atomized list of properties for a given cell. each property, x, that the view gives back will cause the css ::moz-tree-cell-*(x) pseudoelement to be matched on the treechildren element. see getrowproperties() for an example. astring...
...stbox. for tree views with multi-level data, it's advisable to distinguish between a row which is an empty container (i.e., a row with the potential to hold children but that currently has none), and a non-empty container (i.e., a row that positively does currently have children). the tree frame code that handles drag and drop, for example, uses this method to determine how to interpret the drop position. note: nsitreeview implementations must be prepared to handle a call to toggleopenstate for any row index which returns true for a call to iscontainer, even if iscontainerempty returns true. boolean iscontainer( in long index ); parameters index the index of the row being asked about. return value true if the row is a container. otherwise false. iscontainerempty() one of the method...
Drawing and Event Handling - Plugins
not supported on the x window system platform prior to gecko 1.9 alpha 7 (bug 137189). the npwindow structure when a plug-in is loaded, it is drawn into a target area. this target is either the windowed plug-in's native window, or the drawable of a windowless plug-in. the npwindow structure represents either the native window or a drawable. this structure contains information about coordinate position, size, the state of the plug-in (windowed or windowless), and some platform-specific information. note: when a plug-in is drawn to a window, the plug-in is responsible for preserving state information and ensuring that the original state is restored. for windowless plug-ins, the browser calls the npp_setwindow method with an npwindow structure that represents a drawable. for windowed plug-ins...
...twindow 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. ...
...wever, the browser can create invisible instances for which npp_setwindow is never called and a window is never created. this happens when plug-ins are invoked with an html object element that has been hidden with css rules (see plug-in display modes in the introduction) or with an embed element whose hidden attribute has been set. the browser should call npp_setwindow again whenever the size or position of the instance changes, passing it the same npwindow object each time, but with different values. the browser can also call npp_setwindow multiple times with different values for the window, including null. for example, if a user removes an instance from the page, the browser should call npp_setwindow with a window value of null. this value prevents the instance from drawing further until it is...
Debugger.Script - Firefox Developer Tools
debugger.script instances, without worrying about interfering with other debuggers.) a debugger.script instance is a strong reference to a jsscript object; it protects the script it refers to from being garbage collected. note that spidermonkey may use the same debugger.script instances for equivalent functions or evaluated code—that is, scripts representing the same source code, at the same position in the same source file, evaluated in the same lexical environment. debugger.script for webassembly for debugger.script instances referring to a block of webassembly code, they are distinguished by their format property being "wasm". currently only entire modules evaluated via new webassembly.module are represented. debugger.script objects for webassembly are uncovered via onnewscript when a ...
..., "wasm". function properties of the debugger.script prototype object the functions described below may only be called with a this value referring to a debugger.script instance; they may not be used as methods of other kinds of objects. 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 a source line numberline has no code, thenl has noline property. if there is code forline, then l[line] is an array of offsets of byte code instructions that are entry points to that line. for example, suppose we have a script for the following source code: a=[] for (i=1; i < 10; i++) // it's hip to be square. a[i] = i...
...y 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. if the instance refers to webassembly code, throw a typeerror. getallcolumnoffsets(): if the instance refers to a jsscript, return an array describing the relationship between bytecode instruction offsets and source code positions in this script. unlike getalloffsets(), which returns all offsets that are entry points for each line, getallcolumnoffsets() returns all offsets that are entry points for each (line, column) pair. the elements of the array are objects, each of which describes a single entry point, and contains the following properties: linenumber: the line number for which offset is an entry point ...
Animating CSS properties - Firefox Developer Tools
gles to hit a smooth frame rate. the css rendering waterfall the process the browser uses to update the page when a css property has changed can be described as a waterfall consisting of the following steps: recalculate style: every time a css property for an element changes, the browser must recalculate computed styles. layout: next, the browser uses the computed styles to figure out the position and geometry for the elements. this operation is labeled "layout" but is also sometimes called "reflow". paint: finally, the browser needs to repaint the elements to the screen. one last step is not shown in this sequence: the page may be split into layers, which are painted independently and then combined in a process called "composition". this sequence needs to fit into a single frame, since...
...hat 60 frames per second is the rate at which animations will appear smooth. for a rate of 60 frames per second, that gives the browser 16.7 milliseconds to execute the complete flow. css property cost in the context of the rendering waterfall, some properties are more expensive than others: property type cost examples properties that affect an element's geometry or position trigger a style recalculation, a layout and a repaint. left max-width border-width margin-left font-size properties that don't affect geometry or position, but are not rendered in their own layer, do not trigger a layout. color properties that are rendered in their own layer don't even trigger a repaint, because th...
... transform opacity the css triggers website shows how much of the waterfall is triggered for each css property, with information for most css properties by browser engine. ...
CanvasRenderingContext2D - Web APIs
ing 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.fillrect() draws a filled rectangle at (x, y) position whose size is determined by width and height. canvasrenderingcontext2d.strokerect() paints a rectangle which has a starting point at (x, y) and has a w width and an h height onto the canvas, using the current stroke style. drawing text the following methods draw text. see also the textmetrics object for text properties. canvasrenderingcontext2d.filltext() draws (fills) a given text at th...
...determined by width and height. canvasrenderingcontext2d.strokerect() paints a rectangle which has a starting point at (x, y) and has a w width and an h height onto the canvas, using the current stroke style. drawing text the following methods draw text. see also the textmetrics object for text properties. canvasrenderingcontext2d.filltext() draws (fills) a given text at the given (x, y) position. canvasrenderingcontext2d.stroketext() draws (strokes) a given text at the given (x, y) position. canvasrenderingcontext2d.measuretext() returns a textmetrics object. line styles the following methods and properties control how lines are drawn. canvasrenderingcontext2d.linewidth width of lines. default 1.0. canvasrenderingcontext2d.linecap type of endings on the end of lines. possibl...
...e current path. canvasrenderingcontext2d.arc() adds a circular arc to the current path. canvasrenderingcontext2d.arcto() adds an arc to the current path with the given control points and radius, connected to the previous point by a straight line. canvasrenderingcontext2d.ellipse() adds an elliptical arc to the current path. canvasrenderingcontext2d.rect() creates a path for a rectangle at position (x, y) with a size that is determined by width and height. drawing paths canvasrenderingcontext2d.fill() fills the current sub-paths with the current fill style. canvasrenderingcontext2d.stroke() strokes the current sub-paths with the current stroke style. canvasrenderingcontext2d.drawfocusifneeded() if a given element is focused, this method draws a focus ring around the current path. ...
Basic animations - Web APIs
closepath(); } } function anim() { requestanimationframe(anim); c.fillstyle = "rgba(0,0,0,0.05)"; c.fillrect(0, 0, cn.width, cn.height); a.foreach(function(e, i) { e.dr(); }); } </script> <style> #cw { position: fixed; z-index: -1; } body { margin: 0; padding: 0; background-color: rgba(0,0,0,0.05); } </style> </head> <body> <canvas id="cw"></canvas> </body> </html> output snake game <!doctype html> <html lang="en"> <head> <meta charset="utf-8"...
... score :<span id="score">0</span> </div> <div class="touch off" onclick="touch(this)">touch</div> </div> <canvas id="main"></canvas> </body> <style> body { margin: 0; overflow: hidden; background: #000 } .banner { text-align: center; color: #fff; background: #3f51b5; line-height: 29px; position: fixed; left: 0; top: 0; right: 0; font-family: monospace; height: 30px; opacity: .4; display: flex; transition: .5s } .banner:hover { opacity: 1 } div#selector>div { flex-basis: 30% } @keyframes diss { from { opacity: 1 } to { opacity: 0 ...
... border: dashed 3px #fff; height: 48%; width: 48%; display: flex; align-content: center; justify-content: center; align-self: center; align-items: center; font-size: -webkit-xxx-large; font-weight: 900; color: #fff; transition: .5s; opacity: .1; border-radius: 7px } .keypress { position: fixed; width: 100vw; height: 100vh; top: 0; left: 0; display: flex; flex-wrap: wrap; justify-content: space-around; opacity: 1; user-select: none } .keypress>div:hover { opacity: 1 } .touch { background: #8bc34a } .off { background: #f44336 } .hide { opacity...
Transformations - Web APIs
« previousnext » earlier in this tutorial we've learned about the canvas grid and the coordinate space. until now, we only used the default grid and changed the size of the overall canvas for our needs. with transformations there are more powerful ways to translate the origin to a different position, rotate the grid and even scale it. saving and restoring state before we look at the transformation methods, let's look at two other methods which are indispensable once you start generating ever more complex drawings. save() saves the entire state of the canvas. restore() restores the most recently saved canvas state. canvas states are stored on a stack. every time the save() method is called, the current drawing state is pushed onto the stack. a drawing state consists of ...
...ion to return to the original state. also if you're translating inside a loop and don't save and restore the canvas state, you might end up missing part of your drawing, because it was drawn outside the canvas edge. a translate example this example demonstrates some of the benefits of translating the canvas origin. without the translate() method, all of the rectangles would be drawn at the same position (0,0). the translate() method also gives us the freedom to place the rectangle anywhere on the canvas without having to manually adjust coordinates in the fillrect() function. this makes it a little easier to understand and use. in the draw() function, we call the fillrect() function nine times using two for loops. in each loop, the canvas is translated, the rectangle is drawn, and the canvas is...
...the fillrect() function. this makes it a little easier to understand and use. in the draw() function, we call the fillrect() function nine times using two for loops. in each loop, the canvas is translated, the rectangle is drawn, and the canvas is returned back to its original state. note how the call to fillrect() uses the same coordinates each time, relying on translate() to adjust the drawing position. function draw() { var ctx = document.getelementbyid('canvas').getcontext('2d'); for (var i = 0; i < 3; i++) { for (var j = 0; j < 3; j++) { ctx.save(); ctx.fillstyle = 'rgb(' + (51 * i) + ', ' + (255 - 51 * i) + ', 255)'; ctx.translate(10 + j * 50, 10 + i * 50); ctx.fillrect(0, 0, 25, 25); ctx.restore(); } } } <canvas id="canvas" width="150" height...
Document.caretRangeFromPoint() - Web APIs
the caretrangefrompoint() method of the document interface returns a range object for the document fragment under the specified coordinates. syntax var range = document.caretrangefrompoint(float x, float y); parameters x a horizontal position within the current viewport. y a vertical position within the current viewport. returns one of the following: a range. null, if x or y are negative, outside viewport, or there is no text entry node. 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. at vero eos et accusam et justo duo dolores et ea rebum. stet clita kasd gube...
...m dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. at vero eos et accusam et justo duo dolores et ea rebum. ...
...sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. at vero eos et accusam et justo duo dolores et ea rebum. ...
Document.createNodeIterator() - Web APIs
constant numerical value description nodefilter.show_all -1 (that is the max value of unsigned long) shows all nodes. nodefilter.show_attribute 2 shows attribute attr nodes. this is meaningful only when creating a treewalker with an attr node as its root. in this case, it means that the attribute node will appear in the first position of the iteration or traversal. since attributes are never children of other nodes, they do not appear when traversing over the document tree. nodefilter.show_cdata_section 8 shows cdatasection nodes. nodefilter.show_comment 128 shows comment nodes. nodefilter.show_document 256 shows document nodes. nodefilter.show_docu...
... shows documentfragment nodes. nodefilter.show_document_type 512 shows documenttype nodes. nodefilter.show_element 1 shows element nodes. nodefilter.show_entity 32 shows entity nodes. this is meaningful only when creating a treewalker with an entity node as its root; in this case, it means that the entity node will appear in the first position of the traversal. since entities are not part of the document tree, they do not appear when traversing over the document tree. nodefilter.show_entity_reference 16 shows entityreference nodes. nodefilter.show_notation 2048 shows notation nodes. this is meaningful only when creating a treewalker with a notation node as its root; in this case, it means tha...
...t of the document tree, they do not appear when traversing over the document tree. nodefilter.show_entity_reference 16 shows entityreference nodes. nodefilter.show_notation 2048 shows notation nodes. this is meaningful only when creating a treewalker with a notation node as its root; in this case, it means that the notation node will appear in the first position of the traversal. since entities are not part of the document tree, they do not appear when traversing over the document tree. nodefilter.show_processing_instruction 64 shows processinginstruction nodes. nodefilter.show_text 4 shows text nodes. filter optional an object implementing the nodefilter interface. its acceptnode() method will be call...
Document.createTreeWalker() - Web APIs
onstant. constant numerical value description nodefilter.show_all -1 (that is the max value of unsigned long) shows all nodes. nodefilter.show_attribute 2 shows attribute attr nodes. this is meaningful only when creating a treewalker with an attr node as its root; in this case, it means that the attribute node will appear in the first position of the iteration or traversal. since attributes are never children of other nodes, they do not appear when traversing over the document tree. nodefilter.show_cdata_section 8 shows cdatasection nodes. nodefilter.show_comment 128 shows comment nodes. nodefilter.show_document 256 shows document nodes. nodefilter.show_document_...
... shows documentfragment nodes. nodefilter.show_document_type 512 shows documenttype nodes. nodefilter.show_element 1 shows element nodes. nodefilter.show_entity 32 shows entity nodes. this is meaningful only when creating a treewalker with an entity node as its root; in this case, it means that the entity node will appear in the first position of the traversal. since entities are not part of the document tree, they do not appear when traversing over the document tree. nodefilter.show_entity_reference 16 shows entityreference nodes. nodefilter.show_notation 2048 shows notation nodes. this is meaningful only when creating a treewalker with a notation node as its root; in this case, it means tha...
...t of the document tree, they do not appear when traversing over the document tree. nodefilter.show_entity_reference 16 shows entityreference nodes. nodefilter.show_notation 2048 shows notation nodes. this is meaningful only when creating a treewalker with a notation node as its root; in this case, it means that the notation node will appear in the first position of the traversal. since entities are not part of the document tree, they do not appear when traversing over the document tree. nodefilter.show_processing_instruction 64 shows processinginstruction nodes. nodefilter.show_text 4 shows text nodes. filter optional a nodefilter, that is an object with a method acceptnode, which is called by the tree...
Document.execCommand() - Web APIs
the compatibility table for usage details. decreasefontsize adds a <small> tag around the selection or at the insertion point. (not supported by internet explorer.) defaultparagraphseparator changes the paragraph separator used when new paragraphs are created in editable text regions. see differences in markup generation for more details. delete deletes the current selection. enableabsolutepositioneditor enables or disables the grabber that allows absolutely-positioned elements to be moved around. the grabber is disabled by default since firefox 64 (bug 1490641). enableinlinetableediting enables or disables the table row/column insertion and deletion controls. the controls are disabled by default since firefox 64 (bug 1490641). enableobjectresizing enables or disables the resize handle...
...the handles are disabled by default since firefox 64 (bug 1490641). fontname changes the font name for the selection or at the insertion point. this requires a font name string (like "arial") as a value argument. fontsize changes the font size for the selection or at the insertion point. ...
...if one exists (in firefox, <blockquote> is the exception — it will wrap any containing block element). requires a tag-name string as a value argument. virtually all block-level elements can be used. (internet explorer and edge support only heading tags h1–h6, address, and pre, which must be wrapped in angle brackets, such as "<h1>".) forwarddelete deletes the character ahead of the cursor's position, identical to hitting the delete key on a windows keyboard. heading adds a heading element around a selection or insertion point line. requires the tag-name string as a value argument (i.e. "h1", "h6"). (not supported by internet explorer and safari.) hilitecolor changes the background color for the selection or at the insertion point. requires a color value string as a value argument. usecss...
Document: keydown event - Web APIs
event handler property onkeydown the keydown and keyup events provide a code indicating which key is pressed, while keypress indicates which character was entered. for example, a lowercase "a" will be reported as 65 by keydown and keyup, but as 97 by keypress. an uppercase "a" is reported as 65 by all events. ...
...ndicates which character was entered. for example, a lowercase "a" will be reported as 65 by keydown and keyup, but as 97 by keypress. an uppercase "a" is reported as 65 by all events. since firefox 65, the keydown and keyup events are now fired during ime composition, to improve cross-browser compatibility for cjkt users (bug 354358, also see keydown and keyup events are now fired during ime composition for more useful details). ...
...as 65 by keydown and keyup, but as 97 by keypress. an uppercase "a" is reported as 65 by all events. since firefox 65, the keydown and keyup events are now fired during ime composition, to improve cross-browser compatibility for cjkt users (bug 354358, also see keydown and keyup events are now fired during ime composition for more useful details). 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. <p>focus ...
Document: keyup event - Web APIs
ported as 65 by keydown and keyup, but as 97 by keypress. an uppercase "a" is reported as 65 by all events. note: if you're looking for a way to react to changes in an input's value, you should use the input event. some changes are not detectable by keyup, for example pasting text from the context menu in a text input. ...
... way to react to changes in an input's value, you should use the input event. some changes are not detectable by keyup, for example pasting text from the context menu in a text input. since firefox 65, the keydown and keyup events are now fired during ime composition, to improve cross-browser compatibility for cjkt users (bug 354358, also see keydown and keyup events are now fired during ime composition for more useful details). ...
... changes are not detectable by keyup, for example pasting text from the context menu in a text input. since firefox 65, the keydown and keyup events are now fired during ime composition, to improve cross-browser compatibility for cjkt users (bug 354358, also see keydown and keyup events are now fired during ime composition for more useful details). 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. addeventlistener keyup example <p>focus the ifr...
Document - Web APIs
Web › API › Document
rface represents any web page loaded in the browser and serves as an entry point into the web page's content, which is the dom tree. the dom tree includes elements such as <body> and <table>, among many others. it provides functionality globally to the document, like how to obtain the page's url and create new elements in the document. ...
...cludes elements such as <body> and <table>, among many others. it provides functionality globally to the document, like how to obtain the page's url and create new elements in the document. ...
...t. methods included from documentorshadowroot the document interface includes the following methods defined on the documentorshadowroot mixin. note that this is currently only implemented by chrome; other browsers still implement them on the document interface. documentorshadowroot.getselection() returns a selection object representing the range of text selected by the user, or the current position of the caret. documentorshadowroot.elementfrompoint() returns the topmost element at the specified coordinates. documentorshadowroot.elementsfrompoint() returns an array of all elements at the specified coordinates. documentorshadowroot.caretpositionfrompoint() returns a caretposition object containing the dom node containing the caret, and caret's character offset within that node. event...
EffectTiming.fill - Web APIs
Web › API › EffectTiming › fill
imingproperties = { fill: "none" | "forwards" | "backwards" | "both" | "auto" } value a domstring indicating the fill type to use in order to properly render an affected element when outside the animation's active interval (that is, when it's not actively animating). the default is "auto". "none" the animation's effects are only visible while the animation is iterating or its playhead is positioned over an iteration. the animation's effects are not visible when its playstate is pending with a delay, when its playstate is finished, or during its enddelay or delay. in other words, if the animation isn't in its active interval, the affected element is not visible. "forwards" the affected element will continue to be rendered in the state of the final animation framecontinue to be applied t...
...that css looks like this: #box { width: 200px; height: 200px; left: 50px; top: 50px; border:...
... align-self: center; color: white; font: bold 2em "lucida grande", "open sans", sans-serif; } while there's other css involved in this example, the part that really matters for our purposes is the css that styles the "box" element that we'll be animating. that css looks like this: #box { width: 200px; height: 200px; left: 50px; top: 50px; border: 1px solid #7788ff; margin: 0; position: relative; background-color: #2233ff; display: flex; justify-content: center; } all this does is specify the size, border, and color information, as well as indicate that the box should be centered both vertically and horizontally inside its container. note that there's no rotation applied. javascript content now let's check out the javascript. first we'll define the two objects that des...
Element.insertAdjacentElement() - Web APIs
'afterbegin': just inside the targetelement, before its first child. 'beforeend': just inside the targetelement, after its last child. 'afterend': after the targetelement itself. element the element to be inserted into the tree. ...
... 'afterbegin': just inside the targetelement, before its first child. 'beforeend': just inside the targetelement, after its last child. 'afterend': after the targetelement itself. element the element to be inserted into the tree. ...
... 'afterbegin': just inside the targetelement, before its first child. 'beforeend': just inside the targetelement, after its last child. 'afterend': after the targetelement itself. element the element to be inserted into the tree. return value the element that was inserted, or null, if the insertion failed. exceptions exception explanation syntaxerror the position specified is not a recognised value. typeerror the element specified is not a valid element. visualization of position names <!-- beforebegin --> <p> <!-- afterbegin --> foo <!-- beforeend --> </p> <!-- afterend --> note: the beforebegin and afterend positions work only if the node is in a tree and has an element parent. example beforebtn.addeventlistener('click', fun...
Element: keydown event - Web APIs
ypress indicates which character was entered. for example, a lowercase "a" will be reported as 65 by keydown and keyup, but as 97 by keypress. an uppercase "a" is reported as 65 by all events. keyboard events are only generated by <inputs>, <textarea> and anything with the contenteditable attribute or with tabindex="-1". ...
...ss. an uppercase "a" is reported as 65 by all events. keyboard events are only generated by <inputs>, <textarea> and anything with the contenteditable attribute or with tabindex="-1". since firefox 65, the keydown and keyup events are now fired during ime composition, to improve cross-browser compatibility for cjkt users (bug 354358, also see keydown and keyup events are now fired during ime composition for more useful details). ...
...rated by <inputs>, <textarea> and anything with the contenteditable attribute or with tabindex="-1". since firefox 65, the keydown and keyup events are now fired during ime composition, to improve cross-browser compatibility for cjkt users (bug 354358, also see keydown and keyup events are now fired during ime composition for more useful details). ...
Element: keyup event - Web APIs
event handler property onkeyup the keydown and keyup events provide a code indicating which key is pressed, while keypress indicates which character was entered. for example, a lowercase "a" will be reported as 65 by keydown and keyup, but as 97 by keypress. an uppercase "a" is reported as 65 by all events. ...
...ndicates which character was entered. for example, a lowercase "a" will be reported as 65 by keydown and keyup, but as 97 by keypress. an uppercase "a" is reported as 65 by all events. since firefox 65, the keyup and keydown events are now fired during ime composition, to improve cross-browser compatibility for cjkt users (bug 354358, also see keydown and keyup events are now fired during ime composition for more useful details). ...
...d as 65 by keydown and keyup, but as 97 by keypress. an uppercase "a" is reported as 65 by all events. since firefox 65, the keyup and keydown events are now fired during ime composition, to improve cross-browser compatibility for cjkt users (bug 354358, also see keydown and keyup events are now fired during ime composition for more useful details). ...
GlobalEventHandlers.onanimationend - Web APIs
note that there's nothing there about animation...
..., "arial", sans-serif; } #text { width: 46px; padding: 10px; position: relative; text-align: center; align-self: center; color: white; font: bold 1.4em "lucida grande", "open sans", sans-serif; } leaving out some bits of the css that don't matter for the discussion here, let's take a look at the styles for the box that we're animating. first is the box itself. we set its size, position, color, and layout. note that there's nothing there about animation. that's because we don't want the box to start animating right away. we'll add the animation style later to start animating the box. ...
...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. ...
GlobalEventHandlers.onanimationiteration - Web APIs
note that there's nothing there about animation. ...
...s", "arial", sans-serif; } #text { width: 46px; padding: 10px; position: relative; text-align: center; align-self: center; color: white; font: bold 1.4em "lucida grande", "open sans", sans-serif; } leaving out some bits of the css that don't matter for the discussion here, let's take a look at the styles for the box that we're animating. first is the box itself. we set its size, position, color, and layout. note that there's nothing there about animation. that's because we don't want the box to start animating right away. we'll add the animation style later to start animating the box. ...
...that we're animating. first is the box itself. we set its size, position, color, and layout. note that there's nothing there about animation. that's because we don't want the box to start animating right away. we'll add the animation style later to start animating the box. #box { width: var(--boxwidth); height: var(--boxwidth); left: 0; top: 0; border: 1px solid #7788ff; margin: 0; position: relative; background-color: #2233ff; display: flex; justify-content: center; animation: 2s ease-in-out 0s infinite alternate both paused slidebox; } the animation's keyframes are defined next; they describe an animation which causes the box to migrate from the top-left corner of the container to the bottom-right corner. @keyframes slidebox { from { left:0; top:0; } to { ...
GlobalEventHandlers.onanimationstart - Web APIs
note that there's nothing there about animation...
..., "arial", sans-serif; } #text { width: 46px; padding: 10px; position: relative; text-align: center; align-self: center; color: white; font: bold 1.4em "lucida grande", "open sans", sans-serif; } leaving out some bits of the css that don't matter for the discussion here, let's take a look at the styles for the box that we're animating. first is the box itself. we set its size, position, color, and layout. note that there's nothing there about animation. that's because we don't want the box to start animating right away. we'll add the animation style later to start animating the box. ...
...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. ...
HTMLAnchorElement - Web APIs
ce represents hyperlink elements and provides special properties and methods (beyond those of the regular htmlelement object interface that they inherit from) for manipulating the layout and presentation of such elements. ...
...ce that they inherit from) for manipulating the layout and presentation of such elements. ...
...ibute, specifying the relationship of the target object to the linked object. htmlanchorelement.rellist read only returns a domtokenlist that reflects the rel html attribute, as a list of tokens. htmlhyperlinkelementutils.search is a usvstring representing the search element, including leading question mark ('?'), if any, of the referenced url. htmlelement.tabindex is a long containing the position of the element in the tabbing navigation order for the current document. htmlanchorelement.target is a domstring that reflects the target html attribute, indicating where to display the linked resource. htmlanchorelement.text is a domstring being a synonym for the node.textcontent property. htmlanchorelement.type is a domstring that reflects the type html attribute, indicating the mime type...
HTMLAreaElement - Web APIs
the htmlareaelement interface provides special properties and methods (beyond those of the regular object htmlelement interface it also has available to it by inheritance) for manipulating the layout and presentation of <area> elements. ...
...rovides special properties and methods (beyond those of the regular object htmlelement interface it also has available to it by inheritance) for manipulating the layout and presentation of <area> elements. ...
...ment to the linked resource, as a list of tokens. htmlhyperlinkelementutils.search is a usvstring containing the search element (including leading question mark '?'), if any, of the referenced url. htmlareaelement.shape is a domstring that reflects the shape html attribute, indicating the shape of the hot-spot, limited to known values. htmlelement.tabindex is a long containing the element's position in the tabbing order. htmlareaelement.target is a domstring that reflects the target html attribute, indicating the browsing context in which to open the linked resource. htmlareaelement.type is a domstring that reflects the type html attribute, indicating the mime type of the linked resource. htmlhyperlinkelementutils.username is a usvstring containing the username specified before the dom...
HTMLButtonElement - Web APIs
the htmlbuttonelement interface provides properties and methods (beyond the regular htmlelement interface it also has available to it by inheritance) for manipulating <button> elements. ...
... the htmlbuttonelement interface provides properties and methods (beyond the regular htmlelement interface it also has available to it by inheritance) for manipulating <button> elements. ...
...at are labels for this button. htmlbuttonelement.menu is a htmlmenuelement representing the menu element to be displayed if the button is clicked and is of type="menu". htmlbuttonelement.name is a domstring representing the name of the object when submitted with a form. html5 if specified, it must not be the empty string. htmlbuttonelement.tabindex is a long that represents this element's position in the tabbing order. htmlbuttonelement.type is a domstring indicating the behavior of the button. this is an enumerated attribute with the following possible values: submit: the button submits the form. this is the default value if the attribute is not specified, html5 or if it is dynamically changed to an empty or invalid value. reset: the button resets the form. button: the button do...
HTMLElement.offsetLeft - Web APIs
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). therefore, a box with the left, top, width and height of offsetleft, offsettop, offsetwidth and offsetheight will not be a bounding box for a span with wrapped text. sy...
...e the dimensions of the bounding border box (use element.getboundingclientrect() to get its position). therefore, a box with the left, top, width and height of offsetleft, offsettop, offsetwidth and offsetheight will not be a bounding box for a span with wrapped text. syntax left = element.offsetleft; left is an integer representing the offset to the left in pixels from the closest relatively positioned parent element. example var colortable = document.getelementbyid("t1"); var toleft = colortable.offsetleft; if (toleft > 5) { // large left offset: do something here } this example shows a 'long' sentence that wraps within a div with a blue border, and a red box that one might think should describe the boundaries of the span. <div style="width: 300px; border-color:blue; border-style:s...
...offset: do something here } this example shows a 'long' sentence that wraps within a div with a blue border, and a red box that one might think should describe the boundaries of the span. <div style="width: 300px; border-color:blue; border-style:solid; border-width:1;"> <span>short span. ...
HTMLElement.offsetParent - Web APIs
the element is <body> or <html>. ...
... the element is <body> or <html>. ...
... the element is <body> or <html>. offsetparent is useful because offsettop and offsetleft are relative to its padding edge. syntax parentobj = element.offsetparent; parentobj is an object reference to the element in which the current element is offset. ...
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. working draft browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out http...
...(having display:none does not affect this browser.) ...
...(having display:none does not affect this browser.) ...
HTMLElement - Web APIs
the htmlelement interface represents any html element. some elements directly implement this interface, while others implement it via an interface that inherits it. ...
... the htmlelement interface represents any html element. some elements directly implement this interface, while others implement it via an interface that inherits it. ...
...ement.properties read only returns a htmlpropertiescollection… htmlelement.spellcheck is a boolean that controls spell-checking. it is present on all html elements, though it doesn't have an effect on all of them. htmlelement.style is a cssstyledeclaration, an object representing the declarations of an element's style attributes. htmlorforeignelement.tabindex is a long representing the position of the element in the tabbing order. htmlelement.title is a domstring containing the text that appears in a popup box when mouse is over the element. htmlelement.translate is a boolean representing the translation. event handlers most event handler properties, of the form onxyz, are defined on the documentandelementeventhandlers, globaleventhandlers or toucheventhandlers interfaces and i...
HTMLInputElement - Web APIs
the htmlinputelement interface provides special properties and methods for manipulating the options, layout, and presentation of <input> elements. ...
... the htmlinputelement interface provides special properties and methods for manipulating the options, layout, and presentation of <input> elements. ...
...adonly boolean: returns / sets the element's readonly attribute, indicating that the user cannot modify the value of the control. html5this is ignored if the value of the type attribute is hidden, range, color, checkbox, radio, file, or a button type. selectionstart unsigned long: returns / sets the beginning index of the selected text. when nothing is selected, this returns the position of the text input cursor (caret) inside of the <input> element. selectionend unsigned long: returns / sets the end index of the selected text. when there's no selection, this returns the offset of the character immediately following the current text input cursor position. selectiondirection string: returns / sets the direction in which selection occurred. possible values a...
HTMLLIElement - Web APIs
the htmllielement interface exposes specific properties and methods (beyond those defined by regular htmlelement interface it also has available to it by inheritance) for manipulating list elements. ...
... the htmllielement interface exposes specific properties and methods (beyond those defined by regular htmlelement interface it also has available to it by inheritance) for manipulating list elements. ...
...ill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. htmllielement.type is a domstring representing the type of the bullets, "disc", "square" or "circle". 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. htmllielement.value is a long indicating the ordinal position of the list element inside a given <ol>. it reflects the value attribute of the html <li> element, and can be smaller than 0. if the <li> element is not a child of an <ol> element, the property has no meaning. methods no specific method; inherits properties from its parent, htmlelement. specifications specification status comment html living standardthe definition of ...
HTMLMarqueeElement - Web APIs
the htmlmarqueeelement interface provides methods to manipulate <marquee> elements. it inherits properties and methods from the htmlelement interface. ...
... the htmlmarqueeelement interface provides methods to manipulate <marquee> elements. it inherits properties and methods from the htmlelement interface. ...
...s truespeed is true. htmlmarqueeelement.truespeed by default, scrolldelay values lower than 60 are ignored. if truespeed is true, then those values are not ignored. htmlmarqueeelement.vspace sets the vertical margin. htmlmarqueeelement.width sets the width in pixels or percentage value. event handlers htmlmarqueeelement.onbounce fires when the marquee has reached the end of its scroll position. it can only fire when the behavior attribute is set to alternate. htmlmarqueeelement.onfinish fires when the marquee has finished the amount of scrolling that is set by the loop attribute. it can only fire when the loop attribute is set to some number that is greater than 0. htmlmarqueeelement.onstart fires when the marquee starts scrolling. methods inherits methods from its parent, htmle...
HTMLObjectElement - Web APIs
the htmlobjectelement interface provides special properties and methods (beyond those on the htmlelement interface it also has available to it by inheritance) for manipulating the layout and presentation of <object> element, representing external resources. ...
...perties and methods (beyond those on the htmlelement interface it also has available to it by inheritance) for manipulating the layout and presentation of <object> element, representing external resources. ...
... a long representing the horizontal space in pixels around the control. htmlobjectelement.name returns a domstring that reflects the name html attribute, specifying the name of the browsing context. htmlobjectelement.standby is a domstring that reflects the standby html attribute, specifying a message to display while the object loads. htmlobjectelement.tabindex is a long representing the position of the element in the tabbing navigation order for the current document. htmlobjectelement.type is a domstring that reflects the type html attribute, specifying the mime type of the resource. htmlobjectelement.typemustmatch is a boolean that reflects the typemustmatch html attribute, indicating if the resource specified by data must only be played if it matches the type attribute. htmlobject...
HTMLOptionElement - Web APIs
the htmloptionelement interface represents <option> elements and inherits all classes and methods of the htmlelement interface. ...
... the htmloptionelement interface represents <option> elements and inherits all classes and methods of the htmlelement interface. ...
...navailable to be selected. an option can also be disabled if it is a child of an <optgroup> element that is disabled. htmloptionelement.form read only is a htmlformelement representing the same value as the form of the corresponding <select> element, if the option is a descendant of a <select> element, or null if none is found. htmloptionelement.index read only is a long representing the position of the option within the list of options it belongs to, in tree-order. if the option is not part of a list of options, like when it is part of the <datalist> element, the value is 0. htmloptionelement.label read only is a domstring that reflects the value of the label html attribute, which provides a label for the option. if this attribute isn't specifically set, reading it returns the elemen...
HTMLOutputElement - Web APIs
the htmloutputelement interface provides properties and methods (beyond those inherited from htmlelement) for manipulating the layout and presentation of <output> elements. ...
... the htmloutputelement interface provides properties and methods (beyond those inherited from htmlelement) for manipulating the layout and presentation of <output> elements. ...
...lement and returns a boolean holding the check result. htmloutputelement.reportvalidity() this method reports the problems with the constraints on the element, if any, to the user. if there are problems, fires an invalid event at the element, and returns false; if there are no problems, it returns true. when the problem is reported, the user agent may focus the element and change the scrolling position of the document or perform some other action that brings the element to the user's attention. user agents may report more than one constraint violation if this element suffers from multiple problems at once. if the element is not rendered, then the user agent may report the error for the running script instead of notifying the user. htmloutputelement.setcustomvalidity() sets a custom validity m...
HTMLProgressElement - Web APIs
the htmlprogresselement 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 <progress> elements. ...
... 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 <progress> elements. ...
..." text-anchor="middle" alignment-baseline="middle">htmlprogresselement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. htmlprogresselement.max is a double value reflecting the content attribute of the same name, limited to numbers greater than zero. its default value is 1.0. htmlprogresselement.positionread only returns a double value returning the result of dividing the current value (value) by the maximum value (max); if the progress bar is an indeterminate progress bar, it returns -1. htmlprogresselement.value is a double value that reflects the current value; if the progress bar is an indeterminate progress bar, it returns 0. htmlprogresselement.labelsread only returns nodelist contai...
HTMLTableCellElement - Web APIs
the htmltablecellelement 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 table cells, either header or data cells, in an html document. ...
... methods (beyond the regular htmlelement interface it also has available to it by inheritance) for manipulating the layout and presentation of table cells, either header or data cells, in an html document. ...
... be used in other contexts, such as when describing the headers that apply to a data cell. this is used to offer a shorter term for use by screen readers in particular, and is a valuable accessibility tool. usually the value of abbr is an abbreviation or acronym, but can be any text that's appropriate contextually. htmltablecellelement.cellindex read only a long integer representing the cell's position in the cells collection of the <tr> the cell is contained within. if the cell doesn't belong to a <tr>, it returns -1. htmltablecellelement.colspan an unsigned long integer indicating the number of columns this cell must span; this lets the cell occupy space across multiple columns of the table. it reflects the colspan attribute. htmltablecellelement.headers read only is a domsettabletokenli...
HTMLTableElement - Web APIs
the htmltableelement interface provides special properties and methods (beyond the regular htmlelement object interface it also has available to it by inheritance) for manipulating the layout and presentation of tables in an html document. ...
...vides special properties and methods (beyond the regular htmlelement object interface it also has available to it by inheritance) for manipulating the layout and presentation of tables in an html document. ...
...ement. if none is found, a new one is created and inserted in the tree as the first child of the <table> element. htmltableelement.deletecaption() removes the first <caption> that is a child of the element. htmltableelement.insertrow() returns an htmltablerowelement representing a new row of the table. it inserts it in the rows collection immediately before the <tr> element at the given index position. if necessary a <tbody> is created. if the index is -1, the new row is appended to the collection. if the index is smaller than -1 or greater than the number of rows in the collection, a domexception with the value indexsizeerror is raised. htmltableelement.deleterow() removes the row corresponding to the index given in parameter. if the index value is -1 the last row is removed; if it smaller ...
HTMLTextAreaElement - Web APIs
the htmltextareaelement interface provides special properties and methods for manipulating the layout and presentation of <textarea> elements. ...
... the htmltextareaelement interface provides special properties and methods for manipulating the layout and presentation of <textarea> elements. ...
... argument. selectionstart unsigned long: returns / sets the index of the beginning of selected text. if no text is selected, contains the index of the character that follows the input cursor. on being set, the control behaves as if setselectionrange() had been called with this as the first argument, and selectionend as the second argument. tabindex long: returns / sets the position of the element in the tabbing navigation order for the current document. textlength read only long: returns the codepoint length of the control's value. same as reading value.length type read only string: returns the string textarea. validationmessage read only string: returns a localized message that describes the validation constraints that the control doe...
IDBCursorWithValue - Web APIs
the idbcursorwithvalue interface of the indexeddb api represents a cursor for traversing or iterating over multiple records in a database. it is the same as the idbcursor, except that it includes the value property. the cursor has a source that indicates which index or object store it is iterating over. it has a position within the range, and moves in a direction that is increasing or decreasing in the order of record keys. the cursor enables an application to asynchronously process all the records in the cursor's range. you can have an unlimited number of cursors at the same time. you always get the same idbcursorwithvalue object representing a given cursor. operations are performed on the underlying index or object store. note: this feature is available in web workers. <div id="interfac...
... an application to asynchronously process all the records in the cursor's range. you can have an unlimited number of cursors at the same time. you always get the same idbcursorwithvalue object representing a given cursor. operations are performed on the underlying index or object store. note: this feature is available in web workers. ...
...always get the same idbcursorwithvalue object representing a given cursor. operations are performed on the underlying index or object store. note: this feature is available in web workers. ...
InputEvent - Web APIs
the inputevent interface represents an event notifying of editable content change. ...
... the inputevent interface represents an event notifying of editable content change. ...
...ng information about richtext or plaintext data being added to or removed from editable content. inputevent.inputtyperead only returns the type of change for editable content such as, for example, inserting, deleting, or formatting text. see the property page for a complete list of input types. inputevent.iscomposingread only returns a boolean value indicating if the event is fired after compositionstart and before compositionend. methods this interface inherits methods from its parents, uievent and event. inputevent.gettargetranges() returns an array of static ranges that will be affected by a change to the dom if the input event is not canceled. specifications specification status comment input events level 2the definition of 'inputevent' in that speci...
Intersection Observer API - Web APIs
. the last box has thresholds each 25%. ...
...te id="boxtemplate"> <div class="samplebox"> <div class="label topleft"></div> <div class="label topright"></div> <div class="label bottomleft"></div> <div class="label bottomright"></div> </div> </template> <main> <div class="contents"> <div class="wrapper"> </div> </div> </main> .contents { position: absolute; width: 700px; height: 1725px; } .wrapper { position: relative; top: 600px; } .samplebox { position: relative; left: 175px; width: 150px; background-color: rgb(245, 170, 140); border: 2px solid rgb(201, 126, 17); padding: 4px; margin-bottom: 6px; } #box1 { height: 200px; } #box2 { height: 75px; } #box3 { height: 150px; } #box4 { height: 100px; } .label { font: 14px "open sans", "arial", sans-serif; position: absolu...
...ox" + (i+1); template.queryselector(".samplebox").id = boxid; wrapper.appendchild(document.importnode(template, true)); // set up the observer for this box observeroptions.threshold = thresholdsets[i]; observers[i] = new intersectionobserver(intersectioncallback, observeroptions); observers[i].observe(document.queryselector("#" + boxid)); } // scroll to the starting position document.scrollingelement.scrolltop = wrapper.firstelementchild.getboundingclientrect().top + window.scrolly; document.scrollingelement.scrollleft = 750; } intersectioncallback = (entries) => { entries.foreach((entry) => { let box = entry.target; let visiblepct = (math.floor(entry.intersectionratio * 100)) + "%"; box.queryselector(".topleft").innerhtml = visiblepct; box.q...
MediaSessionActionDetails - Web APIs
skipping through it. this property can be used to indicate that you should use the shortest possible method to seek the media. fastseek is not included on the final action in the seek sequence in this situation. ...
...this property is not present for other action types. media action types a media session action's type is specified using a string from the mediasessionaction enumerated type. values each of the actions is a common media session control request. ...
...ese in order to allow that type of action to be performed. the following strings identify the currently available types of media session action: nexttrack advances playback to the next track. pause pauses playback of the media. play begins (or resumes) playback of the media. previoustrack moves back to the previous track. seekbackward seeks backward through the media from the current position. the mediasessionactiondetails property seekoffset specifies the amount of time to seek backward. seekforward seeks forward from the current position through the media. the mediasessionactiondetails property seekoffset specifies the amount of time to seek forward. seekto moves the playback position to the specified time within the media. the time to which to seek is specified in the mediasess...
MouseEvent() - Web APIs
the mouseevent() constructor creates a new mouseevent. syntax event = new mouseevent(typearg, mouseeventinit); values typearg is a domstring representing the name of the event. ...
...a domstring representing the name of the event. 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. ...
...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. "ctrlkey", optional and defaulting to false, of type boolean, that indicates if the ctrl...
NodeIterator.whatToShow - Web APIs
sk are: constant numerical value description nodefilter.show_all -1 (that is the max value of unsigned long) shows all nodes. nodefilter.show_attribute 2 shows attribute attr nodes. this is meaningful only when creating a nodeiterator or treewalker with an attr node as its root; in this case, it means that the attribute node will appear in the first position of the iteration or traversal. since attributes are never children of other nodes, they do not appear when traversing over the document tree. nodefilter.show_cdata_section 8 shows cdatasection nodes. nodefilter.show_comment 128 shows comment nodes. nodefilter.show_document 256 shows document nodes. nodefilter.show_document_fragment 1024 ...
... shows documentfragment nodes. nodefilter.show_document_type 512 shows documenttype nodes. nodefilter.show_element 1 shows element nodes. nodefilter.show_entity 32 shows entity nodes. this is meaningful only when creating a nodeiterator or treewalker with an entity node as its root; in this case, it means that the entity node will appear in the first position of the traversal. since entities are not part of the document tree, they do not appear when traversing over the document tree. nodefilter.show_entity_reference 16 shows entityreference nodes. nodefilter.show_notation 2048 shows notation nodes. this is meaningful only when creating a nodeiterator or treewalker with a notation node as its root; in this case, it mea...
...he document tree, they do not appear when traversing over the document tree. nodefilter.show_entity_reference 16 shows entityreference nodes. nodefilter.show_notation 2048 shows notation nodes. this is meaningful only when creating a nodeiterator or treewalker with a notation node as its root; in this case, it means that the notation node will appear in the first position of the traversal. since entities are not part of the document tree, they do not appear when traversing over the document tree. nodefilter.show_processing_instruction 64 shows processinginstruction nodes. nodefilter.show_text 4 shows text nodes. example var nodeiterator = document.createnodeiterator( document.body, nodefilter.show_element + nodefilter.
NodeIterator - Web APIs
constant numerical value description nodefilter.show_all -1 (that is the max value of unsigned long) shows all nodes. nodefilter.show_attribute 2 shows attribute attr nodes. this is meaningful only when creating a nodeiterator with an attr node as its root; in this case, it means that the attribute node will appear in the first position of the iteration or traversal. since attributes are never children of other nodes, they do not appear when traversing over the document tree. nodefilter.show_cdata_section 8 shows cdatasection nodes. nodefilter.show_comment 128 shows comment nodes. nodefilter.show_document 256 shows document nodes. nodefilter.show_document_...
...shows documentfragment nodes. nodefilter.show_document_type 512 shows documenttype nodes. nodefilter.show_element 1 shows element nodes. nodefilter.show_entity 32 shows entity nodes. this is meaningful only when creating a nodeiterator with an entity node as its root; in this case, it means that the entity node will appear in the first position of the traversal. since entities are not part of the document tree, they do not appear when traversing over the document tree. nodefilter.show_entity_reference 16 shows entityreference nodes. nodefilter.show_notation 2048 shows notation nodes. this is meaningful only when creating a nodeiterator with a notation node as its root; in this case, it means t...
...of the document tree, they do not appear when traversing over the document tree. nodefilter.show_entity_reference 16 shows entityreference nodes. nodefilter.show_notation 2048 shows notation nodes. this is meaningful only when creating a nodeiterator with a notation node as its root; in this case, it means that the notation node will appear in the first position of the traversal. since entities are not part of the document tree, they do not appear when traversing over the document tree. nodefilter.show_processing_instruction 64 shows processinginstruction nodes. nodefilter.show_text 4 shows text nodes. nodeiterator.filter read only returns a nodefilter used to select the relevant nodes. nodeiterator.
PannerNode.PannerNode() - Web APIs
. ...
...neroptions dictionary object defining the properties you want the pannernode to have (it also inherits the options defined in the audionodeoptions dictionary.): panningmodel: the pannernode.panningmodel you want the pannernode to have (the default is equalpower.) distancemodel: the pannernode.distancemodel you want the pannernode to have (the default is inverse.) positionx: the pannernode.positionx you want the pannernode to have (the default is 0.) positiony: the pannernode.positiony you want the pannernode to have (the default is 0.) positionz: the pannernode.positionz you want the pannernode to have (the default is 0.) orientationx: the pannernode.orientationx you want the pannernode to have (the default is 1.) orientationy: the pannernode.orientationy you want the pannernode to...
...s value can be in the range 0–1. return value a new pannernode object instance. exceptions rangeerror the refdistance, maxdistance, or rollofffactor properties have been given a value that is outside the accepted range. invalidstateerror the coneoutergain property has been given a value outside the accepted range (0–1). example var ctx = new audiocontext(); var options = { positionx : 1, maxdistance: 5000 } var mypanner = new pannernode(ctx, options); specifications specification status comment web audio apithe definition of 'pannernode()' in that specification. working draft ...
Selection - Web APIs
Web › API › Selection
a selection object represents the range of text selected by the user or the current position of the caret. to obtain a selection object for examination or manipulation, call window.getselection(). a user may make a selection from left to right (in document order) or right to left (reverse of document order). the anchor is where the user began the selection and the focus is where the user ends the selection. if you make a selection with a desktop mouse, the anchor is placed where you pressed the mouse button, and the focus is placed where you released the mouse button. anchor and focus should not be confused with the start and end positions of a selection. the anchor can be placed before the focus or vice-versa, depending on the direction you made your selection. properties selec...
...ber representing the offset of the selection's anchor within the focusnode. if focusnode is a text node, this is the number of characters within focusnode preceding the focus. if focusnode is an element, this is the number of child nodes of the focusnode preceding the focus. selection.iscollapsedread only returns a boolean indicating whether the selection's start and end points are at the same position. selection.rangecountread only returns the number of ranges in the selection. selection.typeread only returns a domstring describing the type of the current selection. methods selection.addrange() a range object that will be added to the selection. selection.collapse() collapses the current selection to a single point. selection.collapsetoend() collapses the selection to the end o...
...ection. selection.removerange() removes a range from the selection. selection.removeallranges() removes all ranges from the selection. selection.selectallchildren() adds all the children of the specified node to the selection. selection.setbaseandextent() sets the selection to be a range including all or parts of two specified dom nodes, and any content located between them. selection.setposition() collapses the current selection to a single point. this is an alias for collapse() — see selection.collapse() for more details. selection.tostring() returns a string currently being represented by the selection object, i.e. the currently selected text. notes string representation of a selection calling the selection.tostring() method returns the text contained within the selection, e.g...
StaticRange - Web APIs
the dom staticrange interface extends abstractrange to provide a method to specify a range of content in the dom whose contents don't update to reflect changes which occur within the dom tree. it offers the same set of properties and methods as abstractrange. abstractrange and staticrange are not available from web workers. ...
...ate to reflect changes which occur within the dom tree. it offers the same set of properties and methods as abstractrange. abstractrange and staticrange are not available from web workers. ...
...over text { fill: #0095dd; pointer-events: all;} constructor staticrange() creates a new staticrange object given the staticrangeinit dictionary specifying the default values for its properties. properties the properties below are inherited from its parent interface, abstractrange. staticrange.collapsed read only returns a boolean value which is true if the range's start and end positions are the same, resulting in a range of length 0. staticrange.endcontainer read only returns the dom node which contains the ending point of the range. 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 ran...
TouchEvent - Web APIs
nts an uievent which is sent when the state of contacts with a touch-sensitive surface changes. this surface can be a touch screen or trackpad, for example. the event can describe one or more points of contact with the screen and includes support for detecting movement, addition and removal of contact points, and so forth. ...
... or more points of contact with the screen and includes support for detecting movement, addition and removal of contact points, and so forth. touches are represented by the touch object; each touch is described by a position, size and shape, amount of pressure, and target element. lists of touches are represented by touchlist objects. ...
...es are represented by the touch object; each touch is described by a position, size and shape, amount of pressure, and target element. lists of touches are represented by touchlist objects. ...
Touch events - Web APIs
teraction, an application receives touch events during the start, move, and end phases. touch events are similar to mouse events except they support simultaneous touches and at different locations on the touch surface. the touchevent interface encapsulates all of the touchpoints that are currently active. the touch interface, which represents a single touchpoint, includes information such as the position of the touch point relative to the browser viewport. definitions surface the touch-sensitive surface. this may be a screen or trackpad. touch point a point of contact with the surface. this may be a finger (or elbow, ear, nose, whatever, but typically a finger) or stylus. interfaces touchevent represents an event that occurs when the state of touches on the surface changes. touch...
...awing the start point for the draw as a small circle; we're using a 4-pixel wide line, so a 4-pixel radius circle will show up neatly. drawing as the touches move each time one or more fingers move, a touchmove event is delivered, resulting in our handlemove() function being called. its responsibility in this example is to update the cached touch information and to draw a line from the previous position to the current position of each touch. function handlemove(evt) { evt.preventdefault(); var el = document.getelementbyid("canvas"); var ctx = el.getcontext("2d"); var touches = evt.changedtouches; for (var i = 0; i < touches.length; i++) { var color = colorfortouch(touches[i]); var idx = ongoingtouchindexbyid(touches[i].identifier); if (idx >= 0) { console.log("cont...
...n array for the previous information about each touch to determine the starting point for each touch's new line segment to be drawn. this is done by looking at each touch's touch.identifier property. this property is a unique integer for each touch and remains consistent for each event during the duration of each finger's contact with the surface. this lets us get the coordinates of the previous position of each touch and use the appropriate context methods to draw a line segment joining the two positions together. after drawing the line, we call array.splice() to replace the previous information about the touchpoint with the current information in the ongoingtouches array. handling the end of a touch when the user lifts a finger off the surface, a touchend event is sent. we handle this by cal...
TreeWalker.whatToShow - Web APIs
he possible values are: constant numerical value description nodefilter.show_all -1 (that is the max value of unsigned long) shows all nodes. nodefilter.show_attribute 2 shows attribute attr nodes. this is meaningful only when creating a treewalker with an attr node as its root; in this case, it means that the attribute node will appear in the first position of the iteration or traversal. since attributes are never children of other nodes, they do not appear when traversing over the document tree. nodefilter.show_cdata_section 8 shows cdatasection nodes. nodefilter.show_comment 128 shows comment nodes. nodefilter.show_document 256 shows document nodes. nodefilter.show_document_fragment 1024 ...
...gment 1024 shows documentfragment nodes. nodefilter.show_document_type 512 shows documenttype nodes. nodefilter.show_element 1 shows element nodes. nodefilter.show_entity 32 shows entity nodes. this is meaningful only when creating a treewalker with an entity node as its root; in this case, it means that the entity node will appear in the first position of the traversal. since entities are not part of the document tree, they do not appear when traversing over the document tree. nodefilter.show_entity_reference 16 shows entityreference nodes. nodefilter.show_notation 2048 shows notation nodes. this is meaningful only when creating a treewalker with a notation node as its root; in this case, it means that the nota...
...re not part of the document tree, they do not appear when traversing over the document tree. nodefilter.show_entity_reference 16 shows entityreference nodes. nodefilter.show_notation 2048 shows notation nodes. this is meaningful only when creating a treewalker with a notation node as its root; in this case, it means that the notation node will appear in the first position of the traversal. since entities are not part of the document tree, they do not appear when traversing over the document tree. nodefilter.show_processing_instruction 64 shows processinginstruction nodes. nodefilter.show_text 4 shows text nodes. syntax nodetypes = treewalker.whattoshow; example var treewalker = document.createtreewalker( document.body, ...
UIEvent - Web APIs
Web › API › UIEvent
the uievent interface represents simple user interface events. uievent derives from event. although the uievent.inituievent() method is kept for backward compatibility, you should create a uievent object using the uievent() constructor. several interfaces are direct or indirect descendants of this one: mouseevent, touchevent, focusevent, keyboardevent, wheelevent, inputevent, and compositionevent. ...
...ievent derives from event. although the uievent.inituievent() method is kept for backward compatibility, you should create a uievent object using the uievent() constructor. several interfaces are direct or indirect descendants of this one: mouseevent, touchevent, focusevent, keyboardevent, wheelevent, inputevent, and compositionevent. ...
...e uievent() constructor. several interfaces are direct or indirect descendants of this one: mouseevent, touchevent, focusevent, keyboardevent, wheelevent, inputevent, and compositionevent. ...
VTTCue - Web APIs
Web › API › VTTCue
its properties from texttrackcue. vttcue.region a vttregion object describing the video's sub-region that the cue will be drawn onto, or null if none is assigned. vttcue.vertical returns an enum representing the cue writing direction. vttcue.snaptolines returns true if the vttcue.line attribute is an integer number of lines or a percentage of the video size. vttcue.line returns the line positioning of the cue. this can be the string auto or a number whose interpretation depends on the value of vttcue.snaptolines. vttcue.linealign returns an enum representing the alignment of the vttcue.line. vttcue.position returns the indentation of the cue within the line. this can be the string auto or a number representing the percentage of the vttcue.region, or the video size if vttcue.region is...
...the default is auto. ...
...the default is auto. vttcue.size returns a double representing the size of the cue, as a percentage of the video size. vttcue.textalign returns an enum representing the alignment of all the lines of text within the cue box. vttcue.text returns a domstring with the contents of the cue. ...
VisualViewport - Web APIs
ve the user experience when zooming in on pages. a live sample is also available. var bottombar = document.getelementbyid('bottombar'); var viewport = window.visualviewport; function resizehandler() { if (viewport.scale > 1.3) bottombar.style.display = "none"; else bottombar.style.display = "block"; } window.visualviewport.addeventlistener('resize', resizehandler); simulating position: device-fixed this example, also taken from the visual viewport readme, shows how to use this api to simulate position: device-fixed, which fixes elements to the visual viewport. a live sample is also available. var bottombar = document.getelementbyid('bottombar'); var viewport = window.visualviewport; function viewporthandler() { var layoutviewport = document.getelementbyid('layoutviewport')...
...ple, also taken from the visual viewport readme, shows how to use this api to simulate position: device-fixed, which fixes elements to the visual viewport. a live sample is also available. 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. var offsetleft = viewport.offsetleft; var offsettop = viewport.height - layoutviewport.getboundingclientrect().height + viewport.offsettop; // you could also do this by setting style.left and style.top if you // use width: 100% instead. bottombar.style.transform...
... specifications specification status comment visual viewport apithe definition of 'visualviewport' in that specification. draft initial definition. ...
WebGLRenderingContext - Web APIs
ed webglprogram object. webglrenderingcontext.shadersource() sets the source code in a webglshader. webglrenderingcontext.useprogram() uses the specified webglprogram as part the current rendering state. webglrenderingcontext.validateprogram() validates a webglprogram. uniforms and attributes webglrenderingcontext.disablevertexattribarray() disables a vertex attribute array at a given position. webglrenderingcontext.enablevertexattribarray() enables a vertex attribute array at a given position. webglrenderingcontext.getactiveattrib() returns information about an active attribute variable. webglrenderingcontext.getactiveuniform() returns information about an active uniform variable. webglrenderingcontext.getattriblocation() returns the location of an attribute variable. webglre...
...ctive uniform variable. webglrenderingcontext.getattriblocation() returns the location of an attribute variable. webglrenderingcontext.getuniform() returns the value of a uniform variable at a given location. webglrenderingcontext.getuniformlocation() returns the location of a uniform variable. webglrenderingcontext.getvertexattrib() returns information about a vertex attribute at a given position. webglrenderingcontext.getvertexattriboffset() returns the address of a given vertex attribute. webglrenderingcontext.uniform[1234][fi][v]() specifies a value for a uniform variable. webglrenderingcontext.uniformmatrix[234]fv() specifies a matrix value for a uniform variable. webglrenderingcontext.vertexattrib[1234]f[v]() specifies a value for a generic vertex attribute. webglrenderingco...
...d clientheight properties, respectively. in contrast, no such assignment is done for the second canvas. the internal width and height properties of the canvas remain at default values, which are different than the actual size of the canvas element in the browser window. the effect is clearly visible when using scissor() and clear() to draw a square in the center of the canvas, by specifying its position and size in pixels. in the first canvas, we get the desired result. in the second, the square has the wrong shape, size, and position. <p>compare the two canvases.</p> <canvas>your browser does not seem to support html5 canvas.</canvas> <canvas>your browser does not seem to support html5 canvas.</canvas> body { text-align : center; } canvas { display : inline-block; width : 120px...
WebGLShader - Web APIs
gl.getshaderinfolog( shader ); throw 'could not compile webgl program. \n\n' + info; } return shader; } see webglprogram for information on attaching the shaders. examples creating a vertex shader note that there are many other strategies for writing and accessing shader source code strings. these example are for illustration purposes only. ...
...ld not compile webgl program. \n\n' + info; } return shader; } see webglprogram for information on attaching the shaders. examples creating a vertex shader note that there are many other strategies for writing and accessing shader source code strings. these example are for illustration purposes only. ...
...ile webgl program. \n\n' + info; } return shader; } see webglprogram for information on attaching the shaders. examples creating a vertex shader note that there are many other strategies for writing and accessing shader source code strings. these example are for illustration purposes only. ...
Basic concepts behind Web Audio API - Web APIs
oat32array array passed into it. analysernode.getbytetimedomaindata() copies the current waveform, or time-domain, data into a uint8array (unsigned byte array) passed into it. note: for more information, see our visualizations with web audio api article. ...
... into a uint8array (unsigned byte array) passed into it. note: for more information, see our visualizations with web audio api article. spatialisations an audio spatialisation (handled by the pannernode and audiolistener nodes in the web audio api) allows us to model the position and behavior of an audio signal at a certain point in space, and the listener hearing that audio. ...
...these respectively define the direction of the top of the listener's head, and the direction the listener's nose is pointing, and are at right angles to one another. ...
Example and tutorial: Simple synth keyboard - Web APIs
erating notes. the volume control first we create the <div> to contain the settings bar, so it can be styled as needed. then we establish a box that will be presented on the left side of the bar and place a label and an <input> element of type "range". the range element will typically be presented as a slider control; we configure it to allow any value between 0.0 and 1.0, stepping by 0.01 each position. <div class="settingsbar"> <div class="left"> <span>volume: </span> <input type="range" min="0.0" max="1.0" step="0.01" value="0.5" list="volumes" name="volume"> <datalist id="volumes"> <option value="0.0" label="mute"> <option value="1.0" label="100%"> </datalist> </div> we specify a default value of 0.5, and we provide a <datalist> element which is con...
...rflow-y: hidden; width: 660px; height: 110px; white-space: nowrap; margin: 10px; } .keyboard { width: auto; padding: 0; margin: 0; } .key { cursor: pointer; font: 16px "open sans", "lucida grande", "arial", sans-serif; border: 1px solid black; border-radius: 5px; width: 20px; height: 80px; text-align: center; box-shadow: 2px 2px darkgray; display: inline-block; position: relative; margin-right: 3px; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; } .key div { position: absolute; bottom: 0; text-align: center; width: 100%; pointer-events: none; } .key div sub { font-size: 10px; pointer-events: none; } .key:hover { background-color: #eef; } .key:active { background-color: #000; color: #...
... bottom: 0; text-align: center; width: 100%; pointer-events: none; } .key div sub { font-size: 10px; pointer-events: none; } .key:hover { background-color: #eef; } .key:active { background-color: #000; color: #fff; } .octave { display: inline-block; padding: 0 6px 0 0; } .settingsbar { padding-top: 8px; font: 14px "open sans", "lucida grande", "arial", sans-serif; position: relative; vertical-align: middle; width: 100%; height: 30px; } .left { width: 50%; position: absolute; left: 0; display: table-cell; vertical-align: middle; } .left span, .left input { vertical-align: middle; } .right { width: 50%; position: absolute; right: 0; display: table-cell; vertical-align: middle; } .right span { vertical-align: middle; } .right input {...
Window.pageYOffset - Web APIs
cilisis risus. duis condimentum sapien non felis cursus blandit. integer euismod lectus a ipsum pellentesque lacinia.</p> `; document.getelementbyid("frame").contentdocument .body.innerhtml = contenthtml; in this example, an <iframe> is created and filled with content, then a specific element within the document is scrolled into view in the frame. once that's done, the vertical scroll position is checked by looking at the value of pageyoffset in the frame's contentwindow. html the html is extremely simple and has just two elements: an <iframe> that contains the document we're going to scroll, and a <div> into which we'll output the value of pageyoffset when we've finished the scroll. <iframe id="frame"> </iframe> <div id="info"> </div> javascript var frame = document.getelementby...
...ar target = framedoc.getelementbyid("overview"); framedoc.scrollingelement.scrolltop = target.offsettop; info.innertext = "y offset after scrolling: " + frame.contentwindow.pageyoffset + " pixels"; the javascript code begins by getting into frame and info the <iframe> element that contains our content as well as the <div> element into which we'll output the result of our scroll position check. it then gets a reference to the element we want to scroll into view calling getelementbyid() on the frame's htmliframeelement.contentdocument. with the target element in hand, we set the scrolltop of the frame's scrollingelement to the offsettop of the target element. by doing so, we set the vertical scrolling position of the frame's document so that it's the same as the top edge of the t...
... scroll into view calling getelementbyid() on the frame's htmliframeelement.contentdocument. with the target element in hand, we set the scrolltop of the frame's scrollingelement to the offsettop of the target element. by doing so, we set the vertical scrolling position of the frame's document so that it's the same as the top edge of the target element. this will automatically set the scrolling position to the maximum possible value if the attempted scroll would exceed the maximum. this prevents us from falling off the edge of the document. nobody wants to know what's out there. there might be dragons. css iframe { width: 620px; height: 450px; border: 1px solid black; } #info { margin-top: 20px; font: 16px "open sans", "helvetica", "arial"; } result the result follows. note that...
Window - Web APIs
Web › API › Window
code running within a given tab always represents the tab in which the code is running. that said, even in a tabbed browser, some properties and methods still apply to the overall window that contains the tab, such as resizeto() and innerheight. generally, anything that can't reasonably pertain to a tab pertains to the window instead. ...
...thods still apply to the overall window that contains the tab, such as resizeto() and innerheight. generally, anything that can't reasonably pertain to a tab pertains to the window instead. ...
...n event handler property for hashchange events on the window; called when the part of the url after the hash mark ("#") changes. globaleventhandlers.oninput called when the value of an <input> element changes globaleventhandlers.onkeydown called when you begin pressing any key. see keydown event. globaleventhandlers.onkeypress called when a key (except shift, fn, and capslock) is in pressed position. see keypress event. globaleventhandlers.onkeyup called when you finish releasing any key. see keyup event. windoweventhandlers.onlanguagechange an event handler property for languagechange events on the window. globaleventhandlers.onload called after all resources and the dom are fully loaded. will not get called when the page is loaded from cache, such as with back button. windoweventhan...
Using XMLHttpRequest - Web APIs
ww-form-urlencoded foo=bar&baz=the+first+line.%0d%0athe+second+line.%0d%0a method: post; encoding type: text/plain: content-type: text/plain foo=bar baz=the first line. the second line. method: post; encoding type: multipart/form-data: content-type: multipart/form-data; boundary=---------------------------314911788813839 -----------------------------314911788813839 content-disposition: form-data; name="foo" bar -----------------------------314911788813839 content-disposition: form-data; name="baz" the first line. the second line. -----------------------------314911788813839-- however, if you are using the get method, a string like the following will be simply added to the url: ?foo=bar&baz=the%20first%20line.%0athe%20second%20line. a little vanilla framework all thes...
...*/ fo...
...e++].name))); } } else if ((sfieldtype !== "radio" && sfieldtype !== "checkbox") || ofield.checked) { /* note: this will submit _all_ submit buttons. detecting the correct one is non-trivial. ...
XRPermissionDescriptor.optionalFeatures - Web APIs
ich interface is used to implement them. xrreferencespacetype description interface bounded-floor similar to the local type, except the user is not expected to move outside a predetermined boundary, given by the boundsgeometry in the returned object. xrboundedreferencespace local a tracking space whose native origin is located near the viewer's position at the time the session was created. the exact position depends on the underlying platform and implementation. the user isn't expected to move much if at all beyond their starting position, and tracking is optimized for this use case. for devices with six degrees of freedom (6dof) tracking, the local reference space tries to keep the origin stable relative to the environment. xrrefere...
...if that floor level isn't known, the user agent will estimate the floor level. ...
...oor level is non-zero, the browser is expected to round it such a way as to avoid fingerprinting (likely to the nearest centimeter). xrreferencespace unbounded a tracking space which allows the user total freedom of movement, possibly over extremely long distances from their origin point. the viewer isn't tracked at all; tracking is optimized for stability around the user's current position, so the native origin may drift as needed to accommodate that need. xrreferencespace viewer a tracking space whose native origin tracks the viewer's position and orientation. this is used for environments in which the user can physically move around, and is supported by all instances of xrsession, both immersive and inline, though it's most useful for inline sessions. it's particul...
XRPermissionDescriptor.requiredFeatures - Web APIs
ich interface is used to implement them. xrreferencespacetype description interface bounded-floor similar to the local type, except the user is not expected to move outside a predetermined boundary, given by the boundsgeometry in the returned object. xrboundedreferencespace local a tracking space whose native origin is located near the viewer's position at the time the session was created. the exact position depends on the underlying platform and implementation. the user isn't expected to move much if at all beyond their starting position, and tracking is optimized for this use case. for devices with six degrees of freedom (6dof) tracking, the local reference space tries to keep the origin stable relative to the environment. xrrefere...
...if that floor level isn't known, the user agent will estimate the floor level. ...
...oor level is non-zero, the browser is expected to round it such a way as to avoid fingerprinting (likely to the nearest centimeter). xrreferencespace unbounded a tracking space which allows the user total freedom of movement, possibly over extremely long distances from their origin point. the viewer isn't tracked at all; tracking is optimized for stability around the user's current position, so the native origin may drift as needed to accommodate that need. xrreferencespace viewer a tracking space whose native origin tracks the viewer's position and orientation. this is used for environments in which the user can physically move around, and is supported by all instances of xrsession, both immersive and inline, though it's most useful for inline sessions. it's particul...
XRPermissionStatus.granted - Web APIs
ich interface is used to implement them. xrreferencespacetype description interface bounded-floor similar to the local type, except the user is not expected to move outside a predetermined boundary, given by the boundsgeometry in the returned object. xrboundedreferencespace local a tracking space whose native origin is located near the viewer's position at the time the session was created. the exact position depends on the underlying platform and implementation. the user isn't expected to move much if at all beyond their starting position, and tracking is optimized for this use case. for devices with six degrees of freedom (6dof) tracking, the local reference space tries to keep the origin stable relative to the environment. xrrefere...
...if that floor level isn't known, the user agent will estimate the floor level. ...
...oor level is non-zero, the browser is expected to round it such a way as to avoid fingerprinting (likely to the nearest centimeter). xrreferencespace unbounded a tracking space which allows the user total freedom of movement, possibly over extremely long distances from their origin point. the viewer isn't tracked at all; tracking is optimized for stability around the user's current position, so the native origin may drift as needed to accommodate that need. xrreferencespace viewer a tracking space whose native origin tracks the viewer's position and orientation. this is used for environments in which the user can physically move around, and is supported by all instances of xrsession, both immersive and inline, though it's most useful for inline sessions. it's particul...
XRReferenceSpaceType - Web APIs
ich interface is used to implement them. xrreferencespacetype description interface bounded-floor similar to the local type, except the user is not expected to move outside a predetermined boundary, given by the boundsgeometry in the returned object. xrboundedreferencespace local a tracking space whose native origin is located near the viewer's position at the time the session was created. the exact position depends on the underlying platform and implementation. the user isn't expected to move much if at all beyond their starting position, and tracking is optimized for this use case. for devices with six degrees of freedom (6dof) tracking, the local reference space tries to keep the origin stable relative to the environment. xrrefere...
...if that floor level isn't known, the user agent will estimate the floor level. ...
...oor level is non-zero, the browser is expected to round it such a way as to avoid fingerprinting (likely to the nearest centimeter). xrreferencespace unbounded a tracking space which allows the user total freedom of movement, possibly over extremely long distances from their origin point. the viewer isn't tracked at all; tracking is optimized for stability around the user's current position, so the native origin may drift as needed to accommodate that need. xrreferencespace viewer a tracking space whose native origin tracks the viewer's position and orientation. this is used for environments in which the user can physically move around, and is supported by all instances of xrsession, both immersive and inline, though it's most useful for inline sessions. it's particul...
XRRigidTransform.matrix - Web APIs
the read-only xrrigidtransform property matrix returns the transform matrix represented by the object. the returned matrix can then be premultiplied with a column vector to rotate the vector by the 3d rotation specified by the orientation, then translate it by the position. syntax let matrix = xrrigidtransform.matrix; value a float32array containing 16 entries which represents the 4x4 transform matrix which is described by the position and orientation properties. usage notes matrix format all 4x4 transform matrices used in webgl are stored in 16-element float32arrays. the values are stored into the array in column-major order; that is, each column is written into the array top-down before moving to the right one column and writing the next column into the array. thus, for an array [...
...ing the matrix in this section, intended for more advanced readers, we cover how the api calculates the matrix for the specified transform. it begins by allocating a new matrix and writing a 4x4 identity matrix into it: [1000010000100001]\begin{bmatrix} 1 & 0 & 0 & 0\\ 0 & 1 & 0 & 0\\ 0 & 0 & 1 & 0\\ 0 & 0 & 0 & 1 \end{bmatrix} this is a transform that will not change either the orientation or position of any point, vector, or object to which it's applied. next, the position is placed into the right-hand column, like this, resulting in a translation matrix that will transform a coordinate system by the specified distance in each dimension, with no rotational change. here px, py, and pz are the values of the x, y, and z members of the dompointreadonly position. [100px010py001pz0001]\begin{bmat...
...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. the matrix is then passed into a library function that uses webgl to render an object matching a given name using the transform matrix specified to position and orient it. let transform = new xrrigidtransform( {x: 0, y: 0.5, z: 0.5}, {x: 0, y: -0.5, z: -0.5, w: 1}); drawglobject("magic-lamp", transform.matrix); specifications specification status comment webxr device apithe definition of 'xrrigidtransform.matrix' in that specification. working draft initial definition. ...
XRSession.requestReferenceSpace() - Web APIs
ich interface is used to implement them. xrreferencespacetype description interface bounded-floor similar to the local type, except the user is not expected to move outside a predetermined boundary, given by the boundsgeometry in the returned object. xrboundedreferencespace local a tracking space whose native origin is located near the viewer's position at the time the session was created. the exact position depends on the underlying platform and implementation. the user isn't expected to move much if at all beyond their starting position, and tracking is optimized for this use case. for devices with six degrees of freedom (6dof) tracking, the local reference space tries to keep the origin stable relative to the environment. xrrefere...
...if that floor level isn't known, the user agent will estimate the floor level. ...
...oor level is non-zero, the browser is expected to round it such a way as to avoid fingerprinting (likely to the nearest centimeter). xrreferencespace unbounded a tracking space which allows the user total freedom of movement, possibly over extremely long distances from their origin point. the viewer isn't tracked at all; tracking is optimized for stability around the user's current position, so the native origin may drift as needed to accommodate that need. xrreferencespace viewer a tracking space whose native origin tracks the viewer's position and orientation. this is used for environments in which the user can physically move around, and is supported by all instances of xrsession, both immersive and inline, though it's most useful for inline sessions. it's particul...
ARIA: cell role - Accessibility
an element with role="rowgroup", and should be nested within a grid, table or treegrid. if a cell contains column or row header information, use the colheader or rowheader roles, respecitively. if the cell does not contain header information and is nested in a grid or treegrid, the role of gridcell may be more appropriate. a cell can contain a number of property attributes clarifying the cell's position within the tabular data structure, including aria-colindex, aria-colspan, aria-rowindex, and aria-rowspan. using the native html table element (<table>) along with the table row element (<tr>) and table cell element (<td>) whenever possible is strongly encouraged. associated wai-aria roles, states, and properties context roles role="row" an element with role="row" is a row of cells with...
...ia-rowspan similar to the html <th> and <td> rowspan attribute, it defines the number of rows spanned by the cell. aria-colindex attribute the aria-colindex attribute is only needed if columns are hidden from the dom. the attribute takes as its value an integer between 1 and the total number of columns within the table, grid or treegrid. the aria-colindex defines an element's column index or position with respect to the total number of columns within a row. if all the columns are in the dom, this attribute is not necessary. aria-rowindex attribute the aria-rowindex attribute is only needed if rows are hidden from the dom, to indicate which row, in the list of total rows, the current cell is in. the attribute, takes as its value an integer between 1 and the total number of rows within th...
...s within a row. if all the columns are in the dom, this attribute is not necessary. aria-rowindex attribute the aria-rowindex attribute is only needed if rows are hidden from the dom, to indicate which row, in the list of total rows, the current cell is in. the attribute, takes as its value an integer between 1 and the total number of rows within the table, grid, or treegrid, indicating the position, or index, of the cell. 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. if the rows that are visible are contiguous, and there are no cells with a colspan or rowspan greater than one, this property can be added to the parent rows ...
Using multiple backgrounds - CSS: Cascading Style Sheets
asy: .myclass { background: background1, background 2, ..., backgroundn; } you can do this with both the shorthand background property and the individual properties thereof except for background-color. that is, the following background properties can be specified as a list, one per background: background, background-attachment, background-clip, background-image, background-origin, background-position, background-repeat, background-size. example in this example, three backgrounds are stacked: the firefox logo, an image of bubbles, and a linear gradient: html <div class="multi-bg-example"></div> css .multi-bg-example { width: 100%; height: 400px; background-image: url(https://mdn.mozillademos.org/files/11305/firefox.png), url(https://mdn.mozillademos.org/files/11307/bubbles.pn...
...each subsequent sub-property (background-repeat and backgr...
...so the first listed value for background-repeat applies to the first (frontmost) background, and so forth. ...
CSS Backgrounds and Borders - CSS: Cascading Style Sheets
ling backgrounds with color or an image (clipped or resized), or modifying them in other ways. these styles can also decorate borders with lines or images, and make them square or rounded. ...
... color or an image (clipped or resized), or modifying them in other ways. these styles can also decorate borders with lines or images, and make them square or rounded. ...
...pped or resized), or modifying them in other ways. these styles can also decorate borders with lines or images, and make them square or rounded. ...
Introduction to formatting contexts - CSS: Cascading Style Sheets
orders, and padding interact with other blocks in the same context. creating a new block formatting context the <html> element is not the only element capable of creating a block formatting context. any block-level element can be made to create a bfc by the application of certain css properties. ...
...th other blocks in the same context. creating a new block formatting context the <html> element is not the only element capable of creating a block formatting context. any block-level element can be made to create a bfc by the application of certain css properties. ...
...the same context. creating a new block formatting context the <html> element is not the only element capable of creating a block formatting context. any block-level element can be made to create a bfc by the application of certain css properties. ...
Grid template areas - CSS: Cascading Style Sheets
in the previous guide we looked at grid lines, and how to position items against those lines. when you use css grid layout you always have lines, and this can be a straightforward way to place items on your grid. however, there is an alternate method to use for positioning items on the grid which you can use alone or in combination with line-based placement. this method involves placing our items using named template areas, and we will find out exactly how this method works. you will see very quickly why we sometimes call this the ascii-art method of grid layout! naming a grid area you have already encountered the grid-area property. this is the property that can take as a value all four of the lines used to position a grid area. .box1 { grid-area: 1 / 1 / 4 / 2; } what we are doin...
... same number of cells for each row, if empty with a full stop character demonstrating that the cell is to be left empty. you will also create an invalid grid if your areas are not rectangular. redefining the grid using media queries as our layout is now contained in one part of the css, this makes it very easy to make changes at different breakpoints. you can do this by redefining the grid, the position of items on the grid, or both at once. when doing this, define the names for your areas outside of any media queries. that way the content area would always be called main no matter where on the grid it is placed. for our layout above, we might like to have a very simple layout at narrow widths, defining a single column grid and stacking up our items. * {box-sizing: border-box;} .wrapper { ...
... sd sd main main main main main main" minmax(100px, auto) "ft ft ft ft ft ft ft ft ft" minmax(100px, auto) / 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr ; } we will revisit the other functionality offered by this shorthand later in these guides when we take a look at auto placement and the grid-auto-flow property. if you have worked through these initial guides you now should be in a position to create grid layouts using line-based placement or named areas. take some time to build some common layout patterns using grid, while there are lots of new terms to learn, the syntax is relatively straightforward. as you develop examples, you are likely to come up with some questions and use cases for things we haven't covered yet. in the rest of these guides we will be looking at some more of ...
Subgrid - CSS: Cascading Style Sheets
a nested grid does normally. the grid area on the parent expands to be large enough for this nested grid. note that line numbering restarts inside the subgrid — column line 1, when inside the subgrid, is the first line of the subgrid. the subgridded element doesn't inherit the line numbers of the parent grid. this means that you can safely lay out a component that may be placed in different positions on the main grid, knowing that the line numbers on the component will always be the same. 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. so the column tracks behave as a regular nested grid, but the rows are tied to the two tracks that the child spans. a subgrid in both dimensions you...
...ubgrid has row-gap set to 0. if you inspect this in the firefox grid inspector you can see how the line of the grid is in the correct place down the center of the gap, so when we set the gap to 0, it acts in a similar way to applying a negative margin to an element, giving the space from the gap back to the item. named grid lines when using css grid you can name lines on your grid and then position items based on those names rather than the line number. the line names on the parent grid are passed into the subgrid, and you can place items using them. in the below example i have named lines on the parent col-start and col-end and then used those to place the subitem. you can also specify line names on the subgrid. this is achieved by adding a list of line names enclosed in square brackets...
... the subgrid. this is achieved by adding a list of line names enclosed in square brackets after the subgrid keyword. if you have four lines in your subgrid, to name them all you could use the syntax grid-template-columns: subgrid [line1] [line2] [line3] [line4] lines specified on the subgrid are added to any lines specified on the parent so you can use either or both. to demonstrate this, i have positioned one item in the example below using the parent lines, and one using the subgrid lines. using subgrids other than needing to take care of items that do not fit in your subgrid, a subgrid acts very similarly to any nested grid; the only difference is that the track sizing of the subgrid is set on the parent grid. as with any nested grid however, the size of content in the subgrid can change t...
CSS Grid Layout - CSS: Cascading Style Sheets
basic example the example below shows a three-column track grid with new rows created at a minimum of 100 pixels and a maximum of auto. ...
... basic example the example below shows a three-column track grid with new rows created at a minimum of 100 pixels and a maximum of auto. items have been placed onto the grid using line-based placement. ...
... basic example the example below shows a three-column track grid with new rows created at a minimum of 100 pixels and a maximum of auto. items have been placed onto the grid using line-based placement. ...
Implementing image sprites in CSS - CSS: Cascading Style Sheets
image sprites are used in numerous web apps where multiple images are used. rather than include each image as a separate image file, it is much more memory- and bandwidth-friendly to send them as a single image; using background position as a way to distinguish between individual images in the same image file, so the number of http requests is reduced. note: when using http/2, it may in fact be more bandwidth-friendly to use multiple small requests. ...
... distinguish between individual images in the same image file, so the number of http requests is reduced. note: when using http/2, it may in fact be more bandwidth-friendly to use multiple small requests. ...
...ed. note: when using http/2, it may in fact be more bandwidth-friendly to use multiple small requests. implementation suppose an image is given to every item with class toolbtn: .toolbtn { background: url(myfile.png); display: inline-block; height: 20px; width: 20px; } a background position can be added either as two x, y values after the url()() in the background, or as background-position. for example: #btn1 { background-position: -20px 0px; } #btn2 { background-position: -40px 0px; } this would move the element with the id 'btn1' 20 pixels to the left and the element with the id 'btn2' 40 pixels to the left (assuming they have the class toolbtn assigned and are affected by the image rule above). similarly, you can also make hover states with: #btn:hover { background-po...
Value definition syntax - CSS: Cascading Style Sheets
eral entities, combinators, and multipliers, then transform them as a single component. they are used to group components to bypass the precedence rules. bold [ thin && <length> ] this example matches the following values: bold thin 2vh bold 0 thin bold thin 3.5em but not: thin bold 3em, as bold is juxtaposed with the component defined by the brackets, it must appear before it. juxtaposition placing several keywords, literals or data types, next to one another, only separated by one or several spaces, is called juxtaposition. all juxtaposed components are mandatory and should appear in the exact order. bold <length> , thin this example matches the following values: bold 1em, thin bold 0, thin bold 2.5cm, thin bold 3vh, thin but not: thin 1em, bold, as the entities must...
... double ampersand separating two or more components, by a double ampersand, &&, means that all these entities are mandatory but may appear in any order. bold && <length> this example matches the following values: bold 1em bold 0 2.5cm bold 3vh bold but not: bold, as both components must appear in the value. bold 1em bold, as both components must appear only one time. note: juxtaposition has precedence over the double ampersand, meaning that bold thin && <length> is equivalent to [ bold thin ] && <length>. it describes bold thin <length> or <length> bold thin but not bold <length> thin. double bar separating two or more components by a double bar, ||, means that all entities are options: at least one of them must be present, and they may appear in any order. typically this is ...
...maller? ]! this example matches the following values: bold smaller bold smaller but not: neither bold nor smaller, as one of them must appear. smaller bold, as bold is juxtaposed and must appear before the smaller keyword. bold smaller bold, as bold and smaller may only appear once. summary sign name description example combinators juxtaposition components are mandatory and should appear in that order solid <length> && double ampersand components are mandatory but may appear in any order <length> && <string> || double bar at least one of the components must be present, and they may appear in any order. <'border-image-outset'> || <'border-image-slice'> | single bar exactly one of th...
background-origin - CSS: Cascading Style Sheets
ored when background-attachment is fixed. 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. values border-box the background is positioned relative to the border box. padding-box the background is positioned relative to the padding box. content-box the background is positioned relative to the content box. formal definition initial valuepadding-boxapplies toall elements. it also applies to ::first-letter and ::first-line.inheritednocomputed valueas specifiedanimation typediscrete formal syntax <box>#where <box> = border-bo...
...tent box. formal definition initial valuepadding-boxapplies toall elements. ...
... candidate recommendation initial definition. ...
calc() - CSS: Cascading Style Sheets
Web › CSS › calc
er> is expected, the value will be rounded to the nearest integer. for example: .modal { z-index: calc(3 / 2); } this will give .modal a final z-index value of 2. note: the chrome browser currently won’t accept some values returned by calc() when an integer is expected. this includes any division, even if it results in an integer. ie. z-index: calc(4 / 2); will not be accepted. ...
...example: .modal { z-index: calc(3 / 2); } this will give .modal a final z-index value of 2. note: the chrome browser currently won’t accept some values returned by calc() when an integer is expected. this includes any division, even if it results in an integer. ie. z-index: calc(4 / 2); will not be accepted. examples positioning an object on screen with a margin calc() makes it easy to position an object with a set margin. ...
...is includes any division, even if it results in an integer. ie. z-index: calc(4 / 2); will not be accepted. examples positioning an object on screen with a margin calc() makes it easy to position an object with a set margin. ...
caption-side - CSS: Cascading Style Sheets
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. values top the caption box should be positioned above the table. bottom the caption box should be positioned below the table. left the caption box should be positioned on the left side of the table. this value was proposed for css 2, but removed from the final css 2.1 specification. it is non-standard. right the caption box should be positioned on the right side of the table. this value was proposed for css 2, but removed f...
...on box should be positioned on the left side of the table. this value was proposed for css 2, but removed from the final css 2.1 specification. it is non-standard. right the caption box should be positioned on the right side of the table. this value was proposed for css 2, but removed from the final css 2.1 specification. it is non-standard. top-outside the caption box should be positioned above the table, while the width and horizontal alignment behavior are not bound to the table's horizontal layout. the css 2.1 specification notes that the css 2 specification described a different behavior for the top value, which will be reintroduced by this value in a future specification. ...
... the css 2.1 specification notes that the css 2 specification described a different behavior for the bottom value, which will be reintroduced by this value in a future specification. ...
clip - CSS: Cascading Style Sheets
Web › CSS › clip
/* 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. values <<shape>()> a rectangular <<shape>()> of the form rect(<top> <right> <bottom> <left>). ...
...t of the padding box. the <top>, <right>, <bottom>, and <left> values may be either a <length> or auto. if any side's value is auto, the element is clipped to that side's inside border edge. auto the element does not clip (default). this is different from rect(auto, auto, auto, auto), which clips to the element’s inside border edges. ...
... valueautoapplies toabsolutely positioned elementsinheritednocomputed valueauto if specified as auto, otherwise a rectangle with four values, each of which is auto if specified as auto or the computed length otherwiseanimation typea rectangle formal syntax <shape> | autowhere <shape> = rect(<top>, <right>, <bottom>, <left>) examples clipping an image css .dotted-border { border: dotted; position: relative; width: 536px; height: 350px; } #top-left, #middle, #bottom-right { position: absolute; top: 0; } #top-left { left: 360px; clip: rect(0 175px 113px 0); } #middle { left: 280px; clip: rect(119px 255px 229px 80px); } #bottom-right { left: 200px; clip: rect(235px 335px 345px 160px); } html <p class="dotted-border"> <img src="https://udn.realityripple.com/sample...
content - CSS: Cascading Style Sheets
Web › CSS › content
normal computes to none for the :...
...olution><id-selector> = <hash-token><cf-mixing-image> = <percentage>? && <image><cf-final-image> = <image> | <color><linear-gradient()> = linear-gradient( [ <angle> | to <side-or-corner> ]? , <color-stop-list> )<repeating-linear-gradient()> = repeating-linear-gradient( [ <angle> | to <side-or-corner> ]? , <color-stop-list> )<radial-gradient()> = radial-gradient( [ <ending-shape> | <size> ]? [ at <position> ]? , <color-stop-list> )<repeating-radial-gradient()> = repeating-radial-gradient( [ <ending-shape> | <size> ]? [ at <position> ]? , <color-stop-list> )<conic-gradient()> = conic-gradient( [ from <angle> ]? [ at <position> ]?, <angular-color-stop-list> )<counter-style> = <counter-style-name> | symbols()where <rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]? ) | rgb( <number>{3} [ / <alpha-valu...
...hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsla( <hue>, <percentage>, <percentage>, <alpha-value>? )<side-or-corner> = [ left | right ] | [ top | bottom ]<color-stop-list> = [ <linear-color-stop> [, <linear-color-hint>]? ]# , <linear-color-stop><ending-shape> = circle | ellipse<size> = closest-side | farthest-side | closest-corner | farthest-corner | <length> | <length-percentage>{2}<position> = [ [ left | center | right ] | [ top | center | bottom ] | [ left | center | right | <length-percentage> ] [ top | center | bottom | <length-percentage> ]? | [ [ left | right ] <length-percentage> ] && [ [ top | bottom ] <length-percentage> ] ]<angular-color-stop-list> = [ <angular-color-stop> [, <angular-color-hint>]? ]# , <angular-color-stop><counter-style-name> = <custom-ident>where <alpha-v...
cross-fade() - CSS: Cascading Style Sheets
tl<image-src> = <url> | <string><image-set-option> = [ <image> | <string> ] <resolution><id-selector> = <hash-token><linear-gradient()> = linear-gradient( [ <angle> | to <side-or-corner> ]? , <color-stop-list> )<repeating-linear-gradient()> = repeating-linear-gradient( [ <angle> | to <side-or-corner> ]? , <color-stop-list> )<radial-gradient()> = radial-gradient( [ <ending-shape> | <size> ]? ...
...ient()> = linear-gradient( [ <angle> | to <side-or-corner> ]? , <color-stop-list> )<repeating-linear-gradient()> = repeating-linear-gradient( [ <angle> | to <side-or-corner> ]? , <color-stop-list> )<radial-gradient()> = radial-gradient( [ <ending-shape> | <size> ]? [ at <position> ]? , <color-stop-list> )<repeating-radial-gradient()> = repeating-radial-gradient( [ <ending-shape> | <size> ]? [ at <position> ]? , <color-stop-list> )<conic-gradient()> = conic-gradient( [ from <angle> ]? [ at <position> ]?, <angular-color-stop-list> )<alpha-value> = <number> | <percentage><hue> = <number> | <angle>where <side-or-corner> = [ left | right ] | [ top | bottom ]<color-stop-list> = [ <linear-color-stop> [, <linear-color-hint>]? ]# , <linear-color-stop><ending-shape> = circle | ellipse<size> = closest-side |...
...| [ [ left | right ] <length-percentage> ] && [ [ top | bottom ] <length-percentage> ] ]<angular-color-stop-list> = [ <angular-color-stop> [, <angular-color-hint>]? ...
display - CSS: Cascading Style Sheets
Web › CSS › display
it is a non-replaced element). valid <display-inside> values: flow the element lays out its contents using flow layout (block-and-inline layout). if its outer display type is inline or run-in, and it is participating in a block or inline formatting context, then it generates an inline box. otherwise it generates a block container box. depending on the value of other properties (such as position, float, or overflow) and whether it is itself participating in a block or inline formatting context, it either establishes a new block formatting context (bfc) for its contents or integrates its contents into its parent formatting context. flow-root the element generates a block element box that establishes a new block formatting context, defining where the formatting root lies. table these...
...if you specify an element to be display: grid, you would expect that the box created on the grid container would be a block level box. list item <display-listitem> the element generates a block box for the content and a separate list-item inline box. a single value of list-item will cause the element to behave like a list item. this can be used together with list-style-type and list-style-position. list-item can also be combined with any <display-outside> keyword and the flow or flow-root <display-inside> keywords. note: in browsers that support the two-value syntax, if no inner value is specified it will default to flow. if no outer value is specified, the principal box will have an outer display type of block. internal <display-internal> some layout models such as table and ruby...
...eading technology. short note on what css display properties do to table semantics — the paciello group hidden content for better a11y | go make things mdn understanding wcag, guideline 1.3 explanations understanding success criterion 1.3.1 | w3c understanding wcag 2.0 formal definition initial valueinlineapplies toall elementsinheritednocomputed valueas the specified value, except for positioned and floating elements and the root element. in both cases the computed value may be a keyword other than the one specified.animation typediscrete formal syntax [ <display-outside> | <display-inside> ] | <display-listitem> | <display-internal> | <display-box> | <display-legacy>where <display-outside> = block | inline | run-in<display-inside> = flow | flow-root | table | flex | grid | ruby<disp...
grid-column-end - CSS: Cascading Style Sheets
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...& <custom-ident>? contributes the nth grid line to the grid item’s placement. if a negative integer is given, it instead counts in reverse, starting from the end edge of the explicit grid. if a name is given as a <custom-ident>, only lines with that name are counted. if not enough lines with that name exist, all implicit grid lines are assumed to have that name for the purpose of finding this position. an <integer> value of 0 is invalid. span && [ <integer> || <custom-ident> ] contributes a grid span to the grid item’s placement such that the column end edge of the grid item’s grid area is n lines from the start edge. if a name is given as a <custom-ident>, only lines with that name are counted. if not enough lines with that name exist, all implicit grid lines on the side of the exp...
...nes with that name exist, all implicit grid lines on the side of the explicit grid corresponding to the search direction are assumed to have that name for the purpose of counting this span. if the <integer> is omitted, it defaults to 1. negative integers or 0 are invalid. the <custom-ident> cannot take the span value. ...
grid-column-start - CSS: Cascading Style Sheets
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...teger> && <custom-ident>? contributes the nth grid line to the grid item’s placement. if a negative integer is given, it counts in reverse, starting from the end edge of the explicit grid. if a name is given as a <custom-ident>, only lines with that name are counted. if not enough lines with that name exist, all implicit grid lines are assumed to have that name for the purpose of finding this position. an <integer> value of 0 is invalid. span && [ <integer> || <custom-ident> ] contributes a grid span to the grid item’s placement, such that the column start edge of the grid item’s grid area is n lines from the end edge. if a name is given as a <custom-ident>, only lines with that name are counted. if not enough lines with that name exist, all implicit grid lines on the side of the ex...
...es with that name exist, all implicit grid lines on the side of the explicit grid corresponding to the search direction are assumed to have that name for the purpose of counting this span. if the <integer> is omitted, it defaults to 1. negative integers and 0 are invalid. the <custom-ident> cannot take the span value. ...
grid-row-end - CSS: Cascading Style Sheets
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...& <custom-ident>? contributes the nth grid line to the grid item’s placement. if a negative integer is given, it instead counts in reverse, starting from the end edge of the explicit grid. if a name is given as a <custom-ident>, only lines with that name are counted. if not enough lines with that name exist, all implicit grid lines are assumed to have that name for the purpose of finding this position. an <integer> value of 0 is invalid. span && [ <integer> || <custom-ident> ] contributes a grid span to the grid item’s placement such that the row end edge of the grid item’s grid area is n lines from the start edge. if a name is given as a <custom-ident>, only lines with that name are counted. if not enough lines with that name exist, all implicit grid lines on the side of the explic...
...ines with that name are counted. if not enough lines with that name exist, all implicit grid lines on the side of the explicit grid corresponding to the search direction are assumed to have that name for the purpose of counting this span. if the <integer> is omitted, it defaults to 1. negative integers or 0 are invalid. ...
grid-row-start - CSS: Cascading Style Sheets
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...& <custom-ident>? contributes the nth grid line to the grid item’s placement. if a negative integer is given, it instead counts in reverse, starting from the end edge of the explicit grid. if a name is given as a <custom-ident>, only lines with that name are counted. if not enough lines with that name exist, all implicit grid lines are assumed to have that name for the purpose of finding this position. an <integer> value of 0 is invalid. span && [ <integer> || <custom-ident> ] contributes a grid span to the grid item’s placement; such that the row start edge of the grid item’s grid area is n lines from the end edge. if a name is given as a <custom-ident>, only lines with that name are counted. if not enough lines with that name exist, all implicit grid lines on the side of the expli...
...s with that name exist, all implicit grid lines on the side of the explicit grid, corresponding to the search direction, are assumed to have that name for the purpose of counting this span. if the <integer> is omitted, it defaults to 1. negative integers or 0 are invalid. the <custom-ident> cannot take the span value. ...
inset - CSS: Cascading Style Sheets
Web › CSS › inset
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. ...
... editor's draft initial definition ...
... editor's draft initial definition ...
place-items - CSS: Cascading Style Sheets
e example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... in table cell layouts, this keyword has no mean...
...rit; 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. normal the effect of this keyword is dependent of the layout mode we are in: in block-level layouts, the keyword is a synonym of start. in absolutely-positioned layouts, the keyword behaved like start on replaced absolutely-positioned boxes, and as stretch on all other absolutely-positioned boxes. in table cell layouts, this keyword has no meaning as this property is ignored. in flexbox layouts, this keyword has no meaning as this property is ignored. in grid layouts, this keyword leads to a behavior similar to the one of stretch, except for boxe...
repeating-conic-gradient() - CSS: Cascading Style Sheets
nd 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. <position> using the same length, order and keyterm values as the background-position property, the position defines center of the gradient. if omitted, the default value is center, meaing the gradient will be centered, . <angular-color-stop> a color-stop's <color> value, followed by one or two optional stop positions, (an <angle> along the gradient's circumference axis). the last color stop minus the f...
... conic gradient are specified with an <angle>. units include deg for degrees, grad for gradients, rad for radians, and turn for turns. there are 360 degrees, 400 gradians, 2π radians, and 1 turn in a circle. browsers supporting repeating conic gradients also accept percent values, with 100% equaling 360 degrees, but this is not in the specification. radial and conic gradient syntax provides for positioning the center of the gradient anywhere within, or even outside, the image. the values for the position are similar to the syntax for 2-value background-position. the gradient arc is part of the circumference of the gradient. 0 degress is north, or 12:00pm. the colors of the gradient are determined by the angled color stops, their starting points, ending points, and, in between, and optional angl...
...rmined by the angled color stops, their starting points, ending points, and, in between, and optional angled color-stop points. the transitions between colors can be altered with color hints between adjacent colors' color stops. customizing gradients by adding more angled color-stop points on the gradient arc, you can create a highly customized transition between multiple colors. a color-stop's position can be explicitly defined by using an <angle>. if you don't specify the location of a color stop, it is placed halfway between the one that precedes it and the one that follows it. like the non-repeating gradient counterpart, if you don't specify an angle for the first or last color stop, the values are will be 0deg and 360deg. if you don't declare an angle for either, you'll get a non-repeating ...
repeating-linear-gradient() - CSS: Cascading Style Sheets
le is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. the length of the gradient that repeats is the distance between the first and last color stop. if the first color does not have a color-stop-length, the color-stop-length defaults to 0. with each repetition, the positions of the color stops are shifted by a multiple of the length of the basic linear gradient. thus, the position of each ending color stop coincides with a starting color stop; if the color values are different, this will result in a sharp visual transition. this can be altered with repeating the first color again as the last color. as with any gradient, a repeating linear gradient has no intrinsic ...
... turning green after 40%, and finishing red. this gradient doesn't repeat because the last color stop defaults to 100% */ repeating-linear-gradient(0deg, blue, green 40%, red); /* a gradient repeating five times, going from the left to right, starting red, turning green, and back to red */ repeating-linear-gradient(to right, red 0%, green 10%, red 20%); values <side-or-corner> the position of the gradient line's starting point. if specified, it consists of the word to and up to two keywords: one indicates the horizontal side (left or right), and the other the vertical side (top or bottom). the order of the side keywords does not matter. if unspecified, it defaults to to bottom. the values to top, to bottom, to left, and to right are equivalent to the angles 0deg, 180deg, 270deg, a...
...he values to top, to bottom, to left, and to right are equivalent to the angles 0deg, 180deg, 270deg, and 90deg respectively. the other values are translated into an angle. <angle> the gradient line's angle of direction. a value of 0deg is equivalent to to top; increasing values rotate clockwise from there. <linear-color-stop> a color-stop's <color> value, followed by one or two optional stop positions, (each being either a <percentage> or a <length> along the gradient's axis). a percentage of 0%, or a length of 0, represents the start of the gradient; the value 100% is 100% of the image size, meaning the gradient will not repeat. <color-hint> th color-hint is an interpolation hint defining how the gradient progresses between adjacent color stops. the length defines at which point between tw...
translateZ() - CSS: Cascading Style Sheets
the translatez() css function repositions an element along the z-axis in 3d space, i.e., closer to or farther away from the viewer. its result is a <transform-function> data type. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. this transformation is defined by a <length> which specifies how far inward or outward the element or elements move. 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. note: translatez(tz) is equivalent to translate3d(0, 0, tz)...
...eous coordinates on ℝℙ2 cartesian coordinates on ℝ3 homogeneous coordinates on ℝℙ3 this transformation applies to the 3d space and can't be represented on the plane. a translation is not a linear transformation in ℝ3 and can't be represented using a cartesian-coordinate matrix. 10000100001t0001 examples in this example, two boxes are created. ...
...formation in ℝ3 and can't be represented using a cartesian-coordinate matrix. 10000100001t0001 examples in this example, two boxes are created. one is positioned normally on the page, without being translated at all. the second is altered by applying perspective to create a 3d space, then moved towards the user. html <div>static</div> <div class="moved">moved</div> css div { position: relative; width: 60px; height: 60px; left: 100px; background-color: skyblue; } .moved { transform: perspective(500px) translatez(200px); background-color: pink; } what really matters here is the class "moved"; let's take a look at what it does. first, the perspective() function positions the viewer relative to the plane that lies where z=0 (in essence, the surface of the screen). ...
transform-style - CSS: Cascading Style Sheets
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. if flattened, the element's children will not exist on their own in the 3d-space. as this property is not inherited, it must be set for all non-leaf descendants of the element. ...
... 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. preserve-3d indicates that the children of the element should be positioned in the 3d-space. formal definition initial valueflatapplies totransformable elementsinheritednocomputed valueas specifiedanimation typediscretecreates stacking contextyes formal syntax flat | preserve-3d examples transform style demonstration in this example we have a 3d cube created using transforms. the parent container of the cube faces has transform-style: preserve-3d set on it by d...
...ection> <div class="checkbox"> <label for="preserve"><code>preserve-3d</code></label> <input type="checkbox" id="preserve" checked> </div> css #example-element { margin: 50px; width: 100px; height: 100px; transform-style: preserve-3d; transform: rotate3d(1, 1, 1, 30deg); } .face { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; position: absolute; backface-visibility: inherit; font-size: 60px; color: #fff; } .front { background: rgba(90,90,90,.7); transform: translatez(50px); } .back { background: rgba(0,210,0,.7); transform: rotatey(180deg) translatez(50px); } .right { background: rgba(210,0,0,.7); transform: rotatey(90deg) translatez(50px); } .left { background: rgba(0,0,210,.7); transform: ro...
writing-mode - CSS: Cascading Style Sheets
d below. the flow direction in horizontal scripts is also affected by the directionality of that script, either left-to-right (ltr, like english and most other languages) or right-to-left (rtl, like hebrew or arabic). values horizontal-tb for ltr scripts, content flows horizontally from left to right. for rtl scripts, content flows horizontally from right to left. the next horizontal line is positioned below the previous line. vertical-rl for ltr scripts, content flows vertically from top to bottom, and the next vertical line is positioned to the left of the previous line. for rtl scripts, content flows vertically from bottom to top, and the next vertical line is positioned to the right of the previous line. vertical-lr for ltr scripts, content flows vertically from top to bottom, and the...
... sideways-rl for ltr scripts, content flows vertically from bottom to top. ...
... sideways-rl for ltr scripts, content flows vertically from bottom to top. for rtl scripts, content flows vertically from top to bottom. all the glyphs, even those in vertical scripts, are set sideways toward the right. ...
Audio and video manipulation - Developer guides
ated (for example, an echo created by clapping your hands in a tunnel). example var convolver = context.createconvolver(); convolver.buffer = this.impulseresponsebuffer; // connect the graph. source.connect(convolver); convolver.connect(context.destination); see this codepen for an applied (but very, very silly; like, little kids will giggle kind of silly) example. spatial audio we can also position audio using a panner node. a panner node—pannernode—lets us define a source cone as well as positional and directional elements, all in 3d space as defined using 3d cartesian coordinates. example var panner = context.createpanner(); panner.coneoutergain = 0.2; panner.coneouterangle = 120; panner.coneinnerangle = 0; panner.connect(context.destination); source.connect(panner); source.start(0...
... javascript codecs it's also possible to manipulate audio at a low level using javascript. this can be useful should you want to create audio codecs. ...
... javascript codecs it's also possible to manipulate audio at a low level using javascript. this can be useful should you want to create audio codecs. ...
Challenge solutions - Developer guides
: 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. solution the following rule achieves this effect: ul { border: 10px solid lightblue; width: 100px; } layout default image position fixed image position challenge change your sample document, doc2.html, adding this tag to it near the end, just before </body>: <img id="fixed-pin" src="yellow-pin.png" alt="yellow map pin"> predict where the image will appear in your document. then refresh your browser to see if you were correct. solution the image appears to the right of the second list. challenge add a rule to your...
...ixed-pin" src="yellow-pin.png" alt="yellow map pin"> predict where the image will appear in your document. then refresh your browser to see if you were correct. solution the image appears to the right of the second list. challenge add a rule to your stylesheet that places the image in the top right of your document. solution the following rule achieves the desired result: #fixed-pin { position:fixed; top: 3px; right: 3px; } tables borders on data cells only challenge change the stylesheet to make the table have a green border around only the data cells. solution the following rule puts borders around only <td> elements that are inside the <tbody> element of the table with id=demo-table: #demo-table tbody td { border:1px solid #7a7; } media separate print style ...
... = 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 when the mouse pointer is over any one of them, without changing the way the outer petals work. solution move the position of the :hover pseudo-class from a specific petal, to all petals #inner-petals { --segment-fill-fill-hover: pink; } /* non-standard way for some older browsers */ #inner-petals:hover .segment-fill { fill: pink; stroke: none; } ...
HTML attribute: pattern - HTML: Hypertext Markup Language
s. ...
... relying on the title attribute for the visual display of text content is generally discouraged as many user a...
...dity"></span> <p>usernames must be lowercase and 4-8 characters in length.</p> </div> <div> <button>submit</button> </div> </form> div { margin-bottom: 10px; position: relative; } p { font-size: 80%; color: #999; } input + span { padding-right: 30px; } input:invalid+span:after { position: absolute; content: '✖'; padding-left: 5px; } input:valid+span:after { position: absolute; content: '✓'; padding-left: 5px; } this renders like so: accessibility concerns when a control has a pattern attribute, the title attribute, if used, must describe the pattern. relying on the title attribute for the visual display of text content is generally discouraged as many user agents do not expose the attribute in an accessible manner. some browsers show a tooltip w...
<a>: The Anchor element - HTML: Hypertext Markup Language
Web › HTML › Element › a
se clone https://github.com/mdn/interactive-examples and send us a pull request. attributes this element's attributes include the global attributes. downloadhtml5 prompts the user to save the linked url instead of navigating to it. can be used with or without a value: without a value, the browser will suggest a filename/extension, generated from various sources: the content-disposition http header the final segment in the url path the media type (from the (content-type header, the start of a data: url, or blob.type for a blob: url) defining a value suggests it as the filename. / and \ characters are converted to underscores (_). filesystems may forbid other characters in filenames, so browsers will adjust the suggested name if necessary. notes: downloa...
...ntent-type header, the start of a data: url, or blob.type for a blob: url) defining a value suggests it as the filename. / and \ characters are converted to underscores (_). filesystems may forbid other characters in filenames, so browsers will adjust the suggested name if necessary. notes: download only works for same-origin urls, or the blob: and data: schemes. if content-disposition has a different filename than download, the header takes priority. (if content-disposition: inline, firefox prefers the header while chrome prefers download.) href the url that the hyperlink points to. links are not restricted to http-based urls — they can use any url scheme supported by browsers: sections of a page with fragment urls pieces of media files with media fragments ...
...dvanced warning when opening a new window skip links a skip link is a link placed as early as possible in <body> content that points to the beginning of the page's main content. usually, css hides a skip link offscreen until focused. <body> <a href="#content">skip to main content</a> <header> … </header> <main id="content"> <!-- the skip link jumps to here --> .skip-link { position: absolute; top: -3em; background: #fff; } .skip-link:focus { top: 0; } skip links let keyboard users bypass content repeated throughout multiple pages, such as header navigation. skip links are especially useful for people who navigate with the aid of assistive technology such as switch control, voice command, or mouth sticks/head wands, where the act of moving through repetitive links ca...
<audio>: The Embed Audio element - HTML: Hypertext Markup Language
Web › HTML › Element › audio
t, the resource is fetched without a cors request (i.e. without sending the origin: http header), preventing its non-tainted used in <canvas> elements. if invalid, it is handled as if the enumerated keyword anonymous was used. see cors settings attributes for additional information. currenttime reading currenttime returns a double-precision floating-point value indicating the current playback position, in seconds, of the audio. if the audio's metadata isn't available yet—thereby preventing you from knowing the media's start time or duration—currenttime instead indicates, and can be used to change, the time at which playback will begin. otherwise, setting currenttime sets the current playback position to the given time and seeks the media to that position if the media is currently loaded. ...
...'s possible that the user agent may not be able to obtain some parts of the resource if that data has expired from the media buffer. other audio may have a media timeline that doesn't start at 0 seconds, so setting currenttime to a time before that would fail. for example, if the audio's media timeline starts at 12 hours, setting currenttime to 3600 would be an attempt to set the current playback position well before the beginning of the media, and would fail. the getstartdate() method can be used to determine the beginning point of the media timeline's reference frame. disableremoteplayback a boolean attribute used to disable the capability of remote playback in devices that are attached using wired (hdmi, dvi, etc.) and wireless technologies (miracast, chromecast, dlna, airplay, etc). see ...
...tion on using html <audio> is the video and audio content beginner's tutorial. styling with css the <audio> element has no intrinsic visual output of its own unless the controls attribute is specified, in which case the browser's default controls are shown. the default controls have a display value of inline by default, and it is often a good idea set the value to block to improve control over positioning and layout, unless you want it to sit within a text block or similar. you can style the default controls with properties that affect the block as a single unit, so for example you can give it a border and border-radius, padding, margin, etc. you can't however style the individual components inside the audio player (e.g. change the button size or icons, change the font, etc.), and the controls...
<input type="number"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › number
we've set the step value to 0.01, so that values like 1.78 are not seen as invalid. we've also provided a placeholder for that input. we've hidden the feet and inches inputs initially using style="display: none;", so that meters is the default entry type. now, onto the css. this looks very similar to the validation styling we saw before; nothing remarkable here. ...
... we've hidden the feet and inches inputs initially using style="display: none;", so that meters is the default entry type. now, onto the css. this looks very similar to the validation styling we saw before; nothing remarkable here. ...
...meters is the default entry type. now, onto the css. this looks very similar to the validation styling we saw before; nothing remarkable here. ...
<input type="url"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › url
in our simplified form, the user needs to enter the url of the page that has a problem, and a message describing what is wrong. but we want the url to only successfully validate if the entered url is in a myco domain. since inputs of type url validate against both the standard url validation and the specified pattern, you can implement this easily. ...
...ly successfully validate if the entered url is in a myco domain. since inputs of type url validate against both the standard url validation and the specified pattern, you can implement this easily. ...
...date against both the standard url validation and the specified pattern, you can implement this easily. ...
<input type="week"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › week
ere's the css used in the above example. here we make use of the :valid and :invalid css properties to style the input based on whether or not the current value is valid. we had to put the icons on a <span> next to the input, not on the input itself, because in chrome the generated content is placed inside the form control, and can't be styled or shown effectively. ...
... or not the current value is valid. we had to put the icons on a <span> next to the input, not on the input itself, because in chrome the generated content is placed inside the form control, and can't be styled or shown effectively. div { margin-bottom: 10px; position: relative; } input[type="number"] { width: 100px; } input + span { padding-right: 30px; } input:invalid+span:after { position: absolute; content: '✖'; padding-left: 5px; } input:valid+span:after { position: absolute; content: '✓'; padding-left: 5px; } the result here is that only weeks between w01 and w52 in 2017 will be seen as valid and be selectable in supporting browsers. making week values required in addition you can use the required attribute to make filling in the week mandatory. as a result, s...
...me="week"> </select> </span> <span> <label for="year">year:</label> <select id="year" name="year"> <option value="2017" selected>2017</option> <option value="2018">2018</option> </select> </span> </div> </div> </form> the week values are dynamically generated by the javascript code below. div { margin-bottom: 10px; position: relative; } input[type="number"] { width: 100px; } input + span { padding-right: 30px; } input:invalid+span:after { position: absolute; content: '✖'; padding-left: 5px; } input:valid+span:after { position: absolute; content: '✓'; padding-left: 5px; } the other part of the code that may be of interest is the feature detection code. to detect whether the browser supports ...
Expressions and operators - JavaScript
umbers. for example, the decimal number nine has a binary representation of 1001. bitwise operators perform their operations on such binary representations, but they return standard javascript numerical values. the following table summarizes javascript's bitwise operators. ...
...such binary representations, but they return standard javascript numerical values. the following table summarizes javascript's bitwise operators. bitwise operators operator usage description bitwise and a & b returns a one in each bit position for which the corresponding bits of both operands are ones. bitwise or a | b returns a zero in each bit position for which the corresponding bits of both operands are zeros. bitwise xor a ^ b returns a zero in each bit position for which the corresponding bits are the same. [returns a one in each bit position for which the corresponding bits are different.] bitwise not ~ a inverts the bits of its operand. left shift a << b shifts a in binary representation b ...
...t 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). ~x evaluates to the same value that -x - 1 evaluates to. bitwise shift operators the bitwise shift operators take two operands: the first is a quantity to be shifted, and the second specifies the number of bit positions by which the first operand is to be shifted. the direction of the shift operation is controlled by the operator used. shift operators convert their operands to thirty-two-bit integers and return a result of the same type as the left operand. the shift operators are listed in the following table. bitwise shift operators operator description example left shift (...
Animation performance and frame rate - Web Performance
to hit a smooth frame rate. the rendering waterfall the process a browser uses to paint changes to a page when an element is animating css properties can be described as a waterfall consisting of the following steps: recalculate style: when a property for an element changes, the browser must recalculate computed styles. layout: next, the browser uses the computed styles to figure out the position and geometry for the elements. this operation is labeled "layout" but is also sometimes called "reflow". paint: finally, the browser needs to repaint the elements to the screen. one last step is not shown in this sequence: the page may be split into layers, which are painted independently and then combined in a process called "composition". the process a browser uses to paint updated changes t...
...vas animation can be described as a waterfall consisting of the following steps: these sequenced need to fit into a single frame, since the screen isn't updated until it is complete. css property cost in the context of the rendering waterfall, some properties are more expensive than others: property type cost examples properties that affect an element's geometry or position trigger a style recalculation, a layout and a repaint. left max-width border-width margin-left font-size properties that don't affect geometry or position, but are not rendered in their own layer, do not trigger a layout. color properties that are rendered in their own layer don't even trigger a repaint, because th...
... transform opacity the css triggers website shows how much of the waterfall is triggered for each css property, with information for most css properties by browser engine. ...
Mobile first - Progressive web apps (PWAs)
the bottom, even though it is at the top in the source order. and it works in ie8+. display: table makes the <article> and its children display in a table layout, without abusing table markup. display: table-caption makes the <nav> element think it's the caption of the table, and caption-side: bottom makes it jump down to the bottom of the table. one word of warning about this technique though - positioning doesn't work as expected on elements with display: table set on them. i have included two links in my markup: <a id="top" href="#bottom">jump to menu</a> … <a id="bottom" href="#top">back to top</a> the first one is to jump down from the top of the article to the navigation menu, and the second one is to jump back up to the top of the article again. i had to make sure both of these were ...
... id="top" href="#bottom">jump to menu</a> … <a id="bottom" href="#top">back to top</a> the first one is to jump down from the top of the article to the navigation menu, and the second one is to jump back up to the top of the article again. ...
...ation menu, and the second one is to jump back up to the top of the article again. i had to make sure both of these were not direct children of the <article>, otherwise the following would not work: #bottom, #top { font-size: 0.8em; position:absolute; right: 1em; text-decoration: none; } #top { color: white; top: 0.5em; } #bottom { bottom: 0.5em; } i also set their parents to be positioned relatively, so they would become the positioning contexts of the absolutely positioned elements (you don't want them to be positioned relative to the <body> element.) adding a mobile first layout the above layout is fine for narrower layouts, but it doesn't work very well when you get wider than about 480px. to create something more suitable for desktop, i put in the following media queries: ...
d - SVG: Scalable Vector Graphics
Web › SVG › Attribute › d
parameters. svg defines 6 types of path commands, for a total of 20 commands: moveto: m, m lineto: l, l, h, h, v, v cubic bézier curve: c, c, s, s quadratic bézier curve: q, q, t, t elliptical arc curve: a, a closepath: z, z note: commands are case-sensitive. an upper-case command specifies absolute coordinates, while a lower-case command specifies coordinates relative to the current position. it is always possible to specify a negative value as an argument to a command: negative angles will be anti-clockwise; absolute negative x and y values are interpreted as negative coordinates; relative negative x values move to the left, and relative negative y values move upwards. moveto path commands moveto instructions can be thought of as picking up the drawing instrument, and setti...
...en po and the new current point (pn; {xn, yn}). command parameters notes m (x, y)+ move the current point to the coordinate x,y. any subsequent coordinate pair(s) are interpreted as parameter(s) for implicit absolute lineto (l) command(s) (see below). formula: pn = {x, y} m (dx, dy)+ move the current point by shifting the last known position of the path by dx along the x-axis and by dy along the y-axis. any subsequent coordinate pair(s) are interpreted as parameter(s) for implicit relative lineto (l) command(s) (see below). formula: pn = {xo + dx, yo + dy} examples html,body,svg { height:100% } <svg viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <path fill="none" stroke="red" d="m 10,10 h 10 ...
... command parameters notes z, z close the current subpath by connecting the last point of the path with its initial point. if the two points are at different coordinates, a straight line is drawn between those two points. note: the appearance of a shape closed with closepath may be different to that of one closed by drawing a li...
dx - SVG: Scalable Vector Graphics
Web › SVG › Attribute › dx
the dx attribute indicates a shift along the x-axis on the position of an element or its content. ...
... the dx attribute indicates a shift along the x-axis on the position of an element or its content. ...
...o the preceding glyph. if there are less values than glyphs, the remaining glyphs use a value of 0. if there are more values than glyphs, extra values are ignored. ...
glyph-orientation-horizontal - SVG: Scalable Vector Graphics
this attribute is applied only to text written in a horizontal writing-mode. ...
... this attribute is applied only to text written in a horizontal writing-mode. ...
... this attribute is applied only to text written in a horizontal writing-mode. note: as a presentation attribute, glyph-orientation-horizontal can be used as a css property. ...
glyph-orientation-vertical - SVG: Scalable Vector Graphics
this attribute is applied only to text written in a vertical writing-mode. note: as a presentation attribute, glyph-orientation-vertical can be used as a css property. ...
... this attribute is applied only to text written in a vertical writing-mode. note: as a presentation attribute, glyph-orientation-vertical can be used as a css property. ...
... this attribute is applied only to text written in a vertical writing-mode. note: as a presentation attribute, glyph-orientation-vertical can be used as a css property. ...
Gradients in SVG - SVG: Scalable Vector Graphics
</defs> <rect id="rect1" x="10" y="10" rx="15" ry="15" width="100" height="100"/> <rect x="10" y="120" rx="15" ry="15" width="100" height="100" fill="url(#gradient2)"/> </svg> screenshotlive sample above is an example of a linear gradient being applied to a <rect> element. inside the linear gradient are several <stop> nodes. 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. this can be assigned directly or through css. the two methods have been intermixed for the purposes of this example. for instance, this one tells the gradient to start at the color red, change to transparent-black in the middle, and end at the color blue. you can insert as many stop colors as you like to create a ble...
...or blue. 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). duplicate values will use the stop that is assigned furthest down the xml tree. also, like with fill and stroke, you can specify a stop-opacity attribute to set the opacity at that position (again, in ff3 you can also use rgba values to do this). <stop offset="100%" stop-color="yellow" stop-opacity="0.5"/> to use a gradient, we have to reference it from an object's fill or stroke attributes. this is done the same way you reference elements in css, using a url. in this case, the url is just a reference to our gradient, which i've given the creative id, "gradient". to attach it, s...
...ill="url(#radialgradient1)"/> <rect x="10" y="120" rx="15" ry="15" width="100" height="100" fill="url(#radialgradient2)"/> </svg> screenshotlive sample the stops used here are the same as before, but now the object will be red in the center, and in all directions gradually change to blue at the edge. like linear gradients, the <radialgradient> node can take several attributes to describe its position and orientation. however, unlike linear gradients, it's a bit more complex. the radial gradient is again defined by two points, which determine where its edges are. the first of these defines a circle around which the gradient ends. it requires a center point, designated by the cx and cy attributes, and a radius, r. setting these three attributes will allow you to move the gradient around and cha...
ui/button/toggle - Archive of obsolete content
on("change", subsequentchanges); } function subsequentchanges(state) { console.log("you changed '" + state.label + "' again"); } the listener is passed a state object that contains all the button's properties. you can generate click and change events programmatically with the button's click() method. ...
...a disabled button will not generate click or change events and its icon will appear disabled: updating state you can update all the button's properties, except for its id. depending on your application, you migh...
Forms related code snippets - Archive of obsolete content
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.parentnode.insertbefore(otable, otarget); }; ainstances.push(this); } datepicker.prototype.writedays = function () { const nendblanks = (this.current.getday() + bzeroismonday * 6) % 7, nend = amonthlengths[thi...
...lared with the let statement, constants declared with const will be block-scoped. we used it only for didactic purpose. if you want a full browser compatibility of this library, please replace all the const statements with the var statements. ...
Adding menus and submenus - Archive of obsolete content
menus on those windows. you can do this with a menubar. the menubar element should be a child of a toolbox element because it is treated like another toolbar on systems other than mac os x. mac os x treats menus in a very different way than other systems. if your extension involves menus in any way, you should test it on mac os x to make sure everything works adequately. ...
...attribute or the list-style-image css property. menu icons are typically 16px by 16px. menus on mac os x as mentioned earlier, menus are very different on mac os x. this is because menus on mac are located in a single menu bar which is controlled by the operating system, as opposed to menus in other systems, which are entirely controlled by firefox. mac os x also has menu standards, such as the positioning of certain items that are not used in other systems. here's a list of the known issues we've run into when handling menus on mac: the about, preferences and quit menu items are located under the "firefox" menu, not the usual places you would find them. you can access these items by id through the dom, but their parent menu is not easily accessible. we've run into bugs when adding, removing...
Adding sidebars - Archive of obsolete content
ground object: <stack> <hbox flex="1"> <image src="chrome://xulschoolhello/skin/stack-bg.png" flex="1" /> </hbox> <hbox> <!-- some content here. --> </hbox> </stack> this workaround is necessary because you can't have an background image stretch using css. ...
...rc="chrome://xulschoolhello/skin/stack-bg.png" flex="1" /> </hbox> <hbox> <!-- some content here. --> </hbox> </stack> this workaround is necessary because you can't have an background image stretch using css. a less common use for the stack element is to use the left and top attributes on its children in order to have absolute positioning for the content on the layers. this kind of positioning can be useful for various artistic effects, as well as some type of desktop-like or dashboard-like interface, where items are located in positions determined by the user, and they can overlap with each other. this can become complicated very easily, though. remember that you can't have flexibility and absolute positioning at the same time. trees the bookmarks and history sidebars in firefox...
User Notifications and Alerts - Archive of obsolete content
x 3 on ubuntu linux, but we haven't tested all distributions and firefox versions. because of the inconsistent support and temporary nature of these alerts, we don't recommend using this service to show information the user needs to know and can't get in any other way. custom alerts creating custom solutions for alerting the user is not complicated, given the advantages of xul overlays and css positioning. however, these solutions are prone to be buggy and have accessibility issues. you should use the 2 alternatives mentioned above whenever possible. if none of those fit your needs then this is an acceptable solution. an easy way to display alerts is to include a hidden box in your overlay, which you can fill with any content you need before removing the hidden attribute so that it is displaye...
...ed to the user. the best locations for this kind of box are above and below the tab browser. below is preferrable because it only cuts the bottom part of the current page, as opposed to pushing down all tabs and content. notification boxes are a good guideline to what you should aim for: thin, informative and easy to dismiss. another option is to also add a hidden box to the overlay, but use css positioning to locate it where you want. this usually means that the box will be hovering on top of the page's content, and there are a few things you must know about this. first of all, switching tabs will probably make your alert disappear. this is probably due to the fact that the browser tab box uses a deck internally, and that affects z-indexing. you'll have to code around this using tab events in or...
Search Extension Tutorial (Draft) - Archive of obsolete content
if (reason == addon_uninstall || reason == addon_disable) { let engine = services.search.getenginebyname(engine_de...
...s been successfully added function searchobserver(engine, topic, data) { if (data != "engine-added") return; engine.queryinterface(ci.nsisearchengine); if (engine.name == engine_details.name) { // remove our observer now that we're done with it. ...
Inner-browsing extending the browser navigation paradigm - Archive of obsolete content
r application is able to handle it. special markup to support the model it's important to add special markup that fulfills the requirements of the application. this example uses an iframe element as the mechanism to establish the communication with the server side application. so the following piece of html defines an iframe element which is not visible to the user: <div style="visibility:hidden; position:absolute; top:-1000px; left:-1000px"> <iframe id="bridgeframe" src=""></iframe> </div> the javascript code located in the data loader component will be interacting with this iframe element, requesting data from the server. note that when the data is available (a web page is loaded into the iframe) this will not affect the web page context because the iframe is not visible. data loader component t...
...evalue; linkk=article.getattribute("url"); strvalue="<div class='nde-blurb'><h3><a href='"+linkk+"'>"+valuee+"</a></h3><p>"+paraa+"</p></div>"; document.getelementbyid("container").innerhtml+=strvalue; } } if(previousele) { previousele.style.backgroundcolor="white"; } ele.style.backgroundcolor="#ddeeff"; previousele=ele; } var previousele=null; </script> <style> .tab { position:relative;top:1px; border: 1px solid #dddddd; color:white; background-color:white; padding-left: 5px; border-bottom:white;padding-right: 5px; padding-top:3px; text-decoration:none;} .tab:hover { background-color:#ddeeff; } </style> </head> <body > <h2>latest headlines - inner-browsing example </h2> <p>click the tabbed menu to dynamically load the headlines into this web page.</p> <br /> <!-- ...
Source code directories overview - Archive of obsolete content
te to the document (e.g. document.goofy = 1), this code will create the "goofy" node, put it on the "document" node and manipulate it according to any later javascript commands. editor contains c interfaces, c code and xul for the embeddable editor component which can edit both plain text and html. it is used for the html editor (i.e. composer in mozilla classic), for plain text and html mail composition and for text fields and text areas throughout the product. the editor is designed like a "browser window with editing features" with extra classes for editing text and managing undo/redo. embedding contains c interfaces and code for generic high-level browser functions (e.g. forward, back, history). the [#seamonkey-webshell webshell] code wraps these interfaces according to the particular platfo...
... components (like messenger), to plug-ins or helper apps. view contains c interfaces and code for different types of views (e.g. scrolling view). a view contains content but does not contain the title bar, borders or other decorations (which are contained by frames). this code serves to manipulate the individual content that it contains. for example, a scrolling view will find out the scroll bar positions and tell its content where to draw according the scroll bar thumbs. webshell contains c interfaces, c code, linux shell scripts and other files for embedding mozilla in other programs on various different platforms in various different ways (e.g. as plug-in, as activex component, as xpcom classes). widget contains c interfaces and code for platform independent controls (widgets), such as scrol...
Finding the file to modify - Archive of obsolete content
now that we have a hackable mozilla, it's time to find the file we want to hack. mozilla's ui is divided into three layers: the structure, the style, and the behavior. the structure layer identifies the widgets (menus, buttons, etc.) and their position in the ui relative to each other, the style layer defines how the widgets look (size, color, style, etc.) and their overall position (alignment), and the behavior layer specifies how the widgets behave and how users can use them to accomplish their goals. ...
...the structure layer consists of xul files. ...
Block and Line Layout Cheat Sheet - Archive of obsolete content
argins can be calculated. the absence of this flag implies that child margin calculations should ignore the frame and look further up the parent chain. used in nsblockreflowcontext::computecollapsedtopmargin(). this flag causes the nsblockreflowstate's constructor to set the brs_istopmarginroot and brs_isbottommarginroot flags. ...
... nslinebox a block consists of lines and other blocks, stacked vertically. a block frame has one nslinebox for each line, and one nslinebox for each block child. these are stored as a doubly-linked list in the mlines member of nsblockframe. ...
Menu - Archive of obsolete content
Archive › Mozilla › Jetpack › UI › Menu
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. the position at which the items are added is at jetpack's discretion. this method and set() are the recommended methods of adding items to a menu. parameters items a single menuitem or an array of menuitems. clear() removes all items from the menu, even items not added by the feature. contexton(node) binds the menu to a given node as its context menu. parameters node the menu i...
... the menu is attached to this node, which may be either a raw dom node or a dom node wrapped by jquery. hide() hides the menu if it is showing. insertbefore(newitems, target) inserts new items before an existing item. parameters newitems a single menuitem or an array of menuitems. target indicates the existing item. see targets. if no such target exists, the position at which the items are added is at the discretion of jetpack. item(target) returns an item in the menu. the item may be modified. if the menu is hidden, it will reflect the changes when it is next shown. if the menu is visible, it will reflect the changes immediately. parameters target indicates the existing item. see targets. return value a menuitem object, or null if no such t...
Migrate apps from Internet Explorer to Mozilla - Archive of obsolete content
ts references to all elements with the same tag name through getelementsbytagname(). the method returns an array in javascript, and can be called on the document element or other nodes to search only their subtree. to get an array of all elements in the dom tree, you can use getelementsbytagname("*"). the dom level 1 methods, as shown in table 1, are commonly used to move an element to a certain position and toggle its visibility (menus, animations). netscape 4 used the <layer> tag, which mozilla does not support, as an html element that can be positioned anywhere. in mozilla, you can position any element using the <div> tag, which internet explorer uses as well and which you'll find in the html specification. table 1. methods used to access elements method description docu...
...font used in the selected text. the font name to use (arial, for example) fontsize changes the font size used in the selected text. the font size to use fontcolor changes the font color used in the selected text. the color to use indent indents the block where the caret is. --- inserthorizontalrule inserts an <hr> element at the cursor's position. --- insertimage inserts an image at the cursor's position. url of the image to use insertorderedlist inserts an ordered list (<ol>) element at the cursor's position. --- insertunorderedlist inserts an unordered list (<ul>) element at the cursor's position. --- italic toggles the selection's italicize attribute. --- justifyce...
File object - Archive of obsolete content
odified a date object representing the time when the file was last modified. file.size the length of the file in bytes; undefined(?) for directories and pipelines. file.hasrandomaccess true if random access is supported for this file. binary (utf-8) files and pipelines (including file.intput) do not support random access. file.hasautoflush force a flush on each line break? (readonly) file.position the file position. writing to the property moves the file pointer. file.isnative true if the file is backed by a native stdio file stream. (i.e. file.input, file.output, file.error or a pipeline) methods file.open() opens the file, specifying file mode and type. file.close() closes the file. file.remove() removes the file, provided it is not open. file.copyto() creates a verbatim c...
... file, specifying file mode and type. file.close() closes the file. file.remove() removes the file, provided it is not open. file.copyto() creates a verbatim copy of the file at a new location. file.renameto() removes the file. file.flush() flushes the operating system's write buffers for the file and blocks until any pending data has been committed to disk. file.seek() moves the file position pointer forward or backwards. file.read() read a fixed number of bytes from the file. file.readln() read line from the file. file.readall() read the entire file in, returning an array of lines. file.write() write bytes to the file. file.writeln() write bytes to the file, followed by a line separator, flushing the buffer if file.hasautoflush. file.writeall() writes an array of lines to...
String Quick Reference - Archive of obsolete content
why: avoid copying and conversion from...
...why: avoid copying and conversion from literal char-based strings to utf16 strings. ...
Example Sticky Notes - Archive of obsolete content
a particular binding by its id: -moz-binding: url(notes.xml#default) this id is local within the binding file (not visible in the target document dom tree). --> <resources> <!-- obtaining the stylesheet we'll use to (re)style the bound element. --> <stylesheet src="notes.css"/> </resources> <content> <!-- this svg graphics will be added automatically around each bound element. the position of the original content is indicated by <children/> tag. --> <svg:svg width="60px" height="60px"> <svg:g fill-opacity="0.6" stroke="#ffffff" stroke-width="1px"> <svg:circle cx="25px" cy="12px" r="12" fill="#ff0000" transform="translate(0,0)"/> <svg:circle cx="25px" cy="12px" r="12" fill="#00ff00" transform="translate(7,12)"/> <svg:circle cx="25px" cy="12px" r="12" fill="#0000ff" trans...
...on ' + event.type + ' priority set to: ' + this.priority); window.alert(str); ]]></handler> <handler event="mouseover"><![cdata[ this.$bg = this.style.backgroundcolor || '#ffff00'; this.style.backgroundcolor = '#ffcc00'; ]]></handler> <handler event="mouseout"><![cdata[ this.style.backgroundcolor = this.$bg; ]]></handler> </handlers> </binding> </bindings> notes.css .sticker { position: relative; left: 0px; right: 0px; float: left; clear: none; width: 10em; height: 10em; overflow: visible; margin: 1em 1em; padding: 0.5em 0.5em; border: 2px solid blue; background-color: yellow; font: 1em normal "times new roman",serif; font-style: italic; cursor: default; } view this example ...
confirm - Archive of obsolete content
typically in the form of a prompt for the user (e.g., "are you sure you want to delete the selected file(s)?"). adialogtitle the string to be used as the dialog title. defaults to "confirm" (or the localized equivalent). abuttonflags a set of flags defining the buttons that should appear in the dialog. ...
... be used as the dialog title. defaults to "confirm" (or the localized equivalent). abuttonflags a set of flags defining the buttons that should appear in the dialog. the value is calculated by multiplying the corresponding button position constant with a button title constant for each button, then adding the results and any additional options (see other constants). ...
showPopup - Archive of obsolete content
« xul reference home showpopup( element, x, y, popuptype, anchor, align ) deprecated since gecko 1.9 return type: no return value deprecated in favor of openpopup and openpopupatscreen opens a popup element. there are two ways of specifying where the popup appears, either at a specific screen position, or relative to some element in the window. if either x or y are set to values, the popup will appear at the screen coordinate (x,y). if x and y are -1, the popup will be positioned relative to the element specified as the first argument. this is what you might do to show a popup below a button, for example. in this latter case, the anchor and align arguments may be used to further control where the popup appears relative to the element. the anchor argument corresponds to the popupanch...
... where the popup appears relative to the element. the anchor argument corresponds to the popupanchor attribute on the element. the align argument corresponds to the popupalign attribute on the element. the anchor and align arguments are ignored if either x or y are not -1. 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. the popuptype should be one of the strings popup, context, or tooltip. each type of popup is intended to be displayed only temporarily; they are not expected to be displayed permanently. ...
Methods - Archive of obsolete content
etsession 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 removeprogresslistener removesessi...
... 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 dom:element.getuserdata dom:element.hasattribute dom:element.hasattributens dom:element.hasattributes dom:element.haschildnode...
Popup Guide - Archive of obsolete content
h field could be used to allow searching and will disappear when a search term has been entered. a panel is created using the panel element. floating panels a floating popup is a type of panel with a titlebar and acts like an auxiliary window. usually it would contain tools related to the main window, or an inspector which displays properties of a selected element. tooltips when the mouse is positioned over a ui control, a tooltip provides a small box with descriptive help about that control. when the mouse is moved away from the control, the tooltip automatically disappears. a tooltip can be created by setting the tooltiptext attribute on an element or by using the tooltip element. working with popups the following additional information is available about manipulating menus and popups. ...
...are opened automatically when they are associated with an element. to open a popup using script use the openpopup method or the openpopupatscreen method. for detailed information about how to open a popup see opening a popup or opening a menu. closing a menu or popup for information about closing a popup, see closing a popup or closing a menu. how popups are placed to read about how the position of a popup on screen is determined, and how to align popups to other elements, see positioning popups. determining if a popup is open to determine if a popup or menu is open, see determining if a popup is open. moving a popup popups may be moved using the moveto method. see moving a popup. resizing a popup the size of a popup may be adjusted using the sizeto method. see resizing a ...
currentIndex - Archive of obsolete content
if the caret isn't present for any row (for example, because the tree has never been focused), the value will be -1. you cannot rely on this property to change or determine a tree selection, except for trees with seltype="single". ...
...if the caret isn't present for any row (for example, because the tree has never been focused), the value will be -1. you cannot rely on this property to change or determine a tree selection, except for trees with seltype="single". ...
Sorting and filtering a custom tree view - Archive of obsolete content
" onclick="sort(this)" class="sortdirectionindicator"/> </treecols> <treechildren id="tree-children"/> </tree> </window> sort.js var table = null; var data = null; var tree; var filtertext = ""; function init() { tree = document.getelementbyid("tree"); loadtable(); } //this function is called every time the tree is sorted, filtered, or reloaded function loadtable() { //remember scroll position. this is useful if this is an editable table //to prevent the user from losing the row they edited var topvisiblerow = null; if (table) { topvisiblerow = gettopvisiblerow(); } if (data == null) { //put object loading code here. for our purposes, we'll hard code it. data = []; //the property names match the column ids in the xul. this way, we don't have to deal with //mapping betwee...
...: "none"}); } if (filtertext == "") { //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(ro...
Tree Widget Changes - Archive of obsolete content
the nsitreecolumn and nsitreecolumns interfaces can be found at layout/xul/base/src/tree/public/nsitreecolumns.idl. the column objects are created automatically, so you don't have to write any extra code. you can get the columns object which implements the nsitreecolumns interface for a tree using the tree's columns property. from there you can get specific columns, the current sort column, and position and size info about the columns. for the most part these objects are readonly; you can modify the columns by just adjusting the treecol attributes directly. the tree and view methods no longer take ids as arguments when columns are used. instead, they use nsitreecolumns. for example, nsitreeview.getcellvalue() takes a row index and a nsitreecolumn as arguments, whereas before it took a row index...
... nscomptr<nsiatom> atom; acol->getatom(getter_addrefs(atom)); if (atom = kmycol) ... one feature that has been added is restorenaturalorder which may be used to restore th...
Focus and Selection - Archive of obsolete content
r is 0, the second is 1 and so on. tbox.setselectionrange(4,8); this example will select the fifth character displayed, as well as the sixth, seventh and eighth. if there were only six characters entered into the field, only the fifth and sixth characters would be selected. no error would occur. if you use the same value for both parameters, the start and end of the selection changes to the same position. this results in changing the cursor position within the textbox. for example, the line below can be used to move the cursor to the beginning of the text. tbox.setselectionrange(0,0); you can retrieve the current selection by using the selectionstart and selectionend properties. these properties are set to the starting and ending positions of the current selection respectively. if both are set t...
... example, the line below can be used to move the cursor to the beginning of the text. tbox.setselectionrange(0,0); you can retrieve the current selection by using the selectionstart and selectionend properties. these properties are set to the starting and ending positions of the current selection respectively. if both are set to the same value no text is selected, and the cursor is moved to that position. once you have the start and end positions, you can pull out the substring from the whole text. you can retrieve and modify the contents of the textbox by using the value property. one additional useful property of textboxes is the textlength property, which holds the total number of characters in the field. next, we'll find out how to use commands. « previousnext » ...
Persistent Data - Archive of obsolete content
a window. the information is collected and stored in a rdf file (localstore.rdf) in the same directory as other user preferences. it holds state information about each window. this method has the advantage that it works with mozilla user profiles, so that each user can have different settings. xul allows you to save the state of any element. you will typically want to save toolbar states, window positions and whether certain panels are displayed or not, but you can save almost anything. persist attribute to allow the saving of state, you simply add a persist attribute to the element which holds a value you want to save. the persist attribute should be set to a space-separated list of attributes of the element that you want to save. the element must also have an id attribute in order to identify i...
...nd the height will be saved. you could add additional attributes by adding a space and another attribute name to the persist attribute. you can add the persist attribute to any element and store any attribute. you might use unusual values if you adjust attributes using a script. our find files example let's add the persist attribute to some of the elements in the find files dialog. to save the position of the window. to do this, we need to modify the window. <window id="findfile-window" title="find files" persist="screenx screeny width height" orient="horizontal" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> this will cause the x and y position of the window and the width and height of the window to be saved. we could extend it further to save the collaps...
Scroll Bars - Archive of obsolete content
ement="10"/> the attributes are as follows: id the unique identifer of the scroll bar orient this specifies the direction of the scroll bar. the default is horizontal, which creates a scroll bar that extends from left to right. you can also specify vertical which creates a scroll bar that extends from top to bottom. curpos this indicates the current position of the scroll bar thumb (the box that you can slide back and forth.) the value ranges from 0 to the value of maxpos. this value does not need a unit. the default value is 0. maxpos this indicates the maximum position of the scroll bar thumb. the is a numeric value and does not have a unit. the default value is 100. increment the value here specifies how much the va...
...e is 20. when clicking on one of the scroll bar arrows, the value would change by 1 either up or down. by paging through the scroll bar, the value will change by 10. when the user clicks the scroll bar arrows, the thumb will move by the amount specified by the value increment. increasing the value of this attribute will cause the scroll bar to move farther with each click. the leftmost or topmost position of the scroll bar has the value 0 and the rightmost or bottommost position of the scroll bar has the value given by maxpos. by adjusting the values of the scroll bar, you can have the thumb positioned just as you want it and the change when the user clicks the arrows just as you want it. next, we'll find out how to create toolbars. « previousnext » ...
Skinning XUL Files by Hand - Archive of obsolete content
c files are necessary for a particular part of the application or window. the skin is just the style or appearance of an interface, where the chrome is the style, content, and structure. the chrome is everything in the front end of an application. much of what makes xul look (and act!) the way it does comes from the css for each xul element. css2, for example, gives you control over the absolute positioning of any element within its parent element. also, most of the behavior that buttons exhibit comes from styles and an event model based on javascript that dynamically switches between these styles. mozilla's current global skin defines this basic behavior for several classes of button. a button is styled by the global skin when its class attribute is set to a class which is defined in the global ...
...ically and much more completely by a mechanism called thechrome registry. this needs rewording: , which, like the windows registry, is a database in which information about a user's software and environment can be recorded and accessed as necessary. software components and users will be able to update the chrome registry and change the global skin. and with the advent of new css2 conventions like positioning, the changes you can make to the presentation and behavior of the basic structure in a xul file is dramatic. the syntax for creating all this information with text -- added to the distributed nature and the sheer volume of text required to define a single chrome -- can sometimes make the progress seem slow. but the advantages of using xul so far outweigh those of using the standard c++ toolki...
Using Spacers - Archive of obsolete content
may have special requirements on the user interface. if adding support for multiple languages, the text for one language may require more room than another. applications that need to support multiple platforms and languages usually have their windows laid out with lots of space to allow for this. some platforms and user interface toolkits provide components that are smart enough to resize and re-position themselves to fit the needs of the user. (java uses layout managers for example.) xul provides the capability for elements to position and resize automatically. as we've seen, the find files window has appeared in a size that will fit the elements inside it. each time we add something, the window gets bigger. xul uses a layout system called the 'box model'. we'll talk more about this in the next ...
...for now, just know that the window element is a type of box. before we get into detail about boxes, we'll introduce another xul element that is useful for layout, the spacer. a spacer is very simple and only requires one attribute, which will be explained in a moment. ...
XUL Tutorial - Archive of obsolete content
ed for the mozilla application and is used to describe its user interface. ...
...ture the chrome url manifest files simple elements creating a window adding buttons adding labels and images input controls numeric controls list controls progress meters adding html elements using spacers more button features the box model the box model element positioning box model details groupboxes adding more elements more layout elements stacks and decks stack positioning tabboxes grids content panels splitters toolbars and menus toolbars simple menu bars more menu features popup menus scrolling menus events and scripts adding event handlers more event handlers keyboard shortcuts focus and selection commands updating commands broadcasters and observers document object model document object model modifying a xul interface manipulat...
Using the Editor from XUL - Archive of obsolete content
ed: in nshtmleditor::installeventlisteners(), we install the following. these get installed for all types of editor (i.e. for text widgets and composer): nstexteditorkeylistener (as a nsidomkeylistener) nstexteditormouselistener (as a nsidommouselistener) nstexteditorfocuslistener (as a nsidomfocuslistener) nstexteditortextlistener (as a nsidomtextlistener) nstexteditorcompositionlistener (as a nsidomcompositionlistener) nstexteditordraglistener (as a nsidomdraglistener) in nseditorshell::preparedocumentforediting(), we install a mouse listener. this only happens for situations where the nseditorshell is used (i.e. not for text widgets): nseditorshellmouselistener (as a nsidommouselistener) note: starting in gecko 12, the editor refuses ...
...ture). this happens in response to mouseclick with button 2. it also forces an ime commit. nstexteditorfocuslistener editor responds to focus and blur events by showing and hiding the caret or selection as appropriate. nstexteditortextlistener the nsidomtextlistener interface that this implements is used by the ime code. in response to the handletext event, the editor sets the inline input composition string. nstexteditorcompositionlistener nstexteditorcompositionlistener implements another ime-related interface, nsidomcompositionlistener. this is called by ime at the start, end, and to query the current composition. nstexteditordraglistener the drag listener handles drag and drop events in the editor. it responds to the start of a drag in draggesture by adding data to the drag, notifies t...
action - Archive of obsolete content
ple 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, hidden, id, , , left, , max...
...d, 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
assign - Archive of obsolete content
able such as "?name". ...
..., 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
bbox - Archive of obsolete content
Archive › Mozilla › XUL › bbox
le 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, hidden, id, , , left, , ma...
..., 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
binding - Archive of obsolete content
it can be a variable reference, an rdf resource uri, or an rdf literal value. predicate type: uri the predicate or property to match. this must be...
...ed, 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
bindings - Archive of obsolete content
it can be a variable reference, an rdf resource uri, or an rdf literal value. predicate type: uri the predicate or property to match. this must be a uri o...
..., 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
box - Archive of obsolete content
Archive › Mozilla › XUL › box
x> </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, database, datasources, dir, , , flex, height, hidden, id, , , left, , ma...
..., 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
broadcaster - Archive of obsolete content
le 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, hidden, id, , , left, , ma...
..., 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
broadcasterset - Archive of obsolete content
le 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, hidden, id, , , left, , ma...
..., 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
button - Archive of obsolete content
emove, refresh, go-forward, go-back, properties, select-font, select-color, network. if you are using a button that matches one of these common usages, use the icon attribute to indicate this. see the appearance of the different icons on some available platforms. image type: uri the uri of the image to appear on the element. if this attribute is empty or left out, no image appears. the position of the image is determined by the dir and orient attributes. label type: string the label that will appear on the element. if this is left out, no text appears. for an editable menuitem element the value of this attribute is copied to the menulist.value property upon user selection of the menuitem. open type: boolean for the menu type buttons, the open attribute is set to t...
...tribute. orient type: string gets and sets the value of the orient attribute. tabindex type: integer gets and sets the value of the tabindex attribute. type type: string gets and sets the value of the type attribute. ...
caption - Archive of obsolete content
use the max-width css property (or the maxwidth attribute) to override this size. for example, for a menuitem in a menu you can add the following css rule when you want to use the value none: menupopup > menuitem, menupopup > menu { max-width: none; } image type: uri the uri of the image to appear on the element. if this attribute is empty or left out, no image appears. the position of the image is determined by the dir and orient attributes. label type: string the label that will appear on the element. if this is left out, no text appears. for an editable menuitem element the value of this attribute is copied to the menulist.value property upon user selection of the menuitem. tabindex type: integer the tab order of the element. the tab order is the or...
...tribute. 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. tabindex type: integer gets and sets the value of the tabindex attribute. ...
column - Archive of obsolete content
n example. ...
..., 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
conditions - Archive of obsolete content
le 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, hidden, id, , , left, , ma...
..., 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
content - Archive of obsolete content
if set, the conditions will only match if the template builder is parsing content for an element directly inside this tag. for example, by using a v...
...name for the content. when a rule is evaluated, it scans through each resource in the rdf datasource looking for a match. each resource is placed in the variable specified in the uri attribute in turn. then, the other rules are evaluated for a match. this attribute should always be present. ...
deck - Archive of obsolete content
Archive › Mozilla › XUL › deck
t item is at index 0. 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. you may select an item by assigning its index to this property. by assigning -1 to this property, all i...
..., 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
dropmarker - Archive of obsolete content
inherited properties align, , allowevents, , boxobject, builder, , , , class...
..., 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
grid - Archive of obsolete content
Archive › Mozilla › XUL › 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, database, datasources, dir, , , flex, height, hidden, id, , , left, , ma...
..., 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
grippy - Archive of obsolete content
le 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, hidden, id, , , left, , ma...
..., 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
groupbox - Archive of obsolete content
inherited properties align, , allowevents, , boxobject, builder, , , , class...
..., 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
hbox - Archive of obsolete content
Archive › Mozilla › XUL › hbox
> </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, database, datasources, dir, , , flex, height, hidden, id, , , left, , ma...
..., 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
iframe - Archive of obsolete content
contentdocument type: document this read-only property cont...
... type: nsiwebnavigation this read-only property contains the nsiwebnavigation object for the document. most of its methods are callable directly on the element itself, such as goback and goforward. it also contains the load constants used by reloadwithflags and loaduriwithflags. ...
keyset - Archive of obsolete content
if this attribute is set, the element is disabled. disabled elements are usually drawn with grayed-out text. if the element is disabled, ...
..., 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
listcell - Archive of obsolete content
till respond to mouse events. to enable the element, leave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. image type: uri the uri of the image to appear on the element. if this attribute is empty or left out, no image appears. the position of the image is determined by the dir and orient attributes. label type: string the label that will appear on the element. if this is left out, no text appears. for an editable menuitem element the value of this attribute is copied to the menulist.value property upon user selection of the menuitem. type type: string this attribute is reserved for use by anonymous children o...
..., 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
listcol - Archive of obsolete content
/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, database, datasources, dir, , , flex, height, hidden, id, , , left, , ma...
..., 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
listcols - Archive of obsolete content
/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, database, datasources, dir, , , flex, height, hidden, id, , , left, , ma...
..., 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
listhead - Archive of obsolete content
e additional state. 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. disabled type: boolean gets and sets the value of the disa...
..., 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
listheader - Archive of obsolete content
on of the menuitem. 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. inherited properties align, , allowevents, , boxobject, builder, , , , class...
..., 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
listitem - Archive of obsolete content
still respond to mouse events. to enable the element, leave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. image type: uri the uri of the image to appear on the element. if this attribute is empty or left out, no image appears. the position of the image is determined by the dir and orient attributes. label type: string the label that will appear on the element. if this is left out, no text appears. for an editable menuitem element the value of this attribute is copied to the menulist.value property upon user selection of the menuitem. preference type: id connects the element to a corresponding preference. this a...
... gets and sets the value of the tabindex attribute. 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. ...
member - Archive of obsolete content
container type: ? a variable referenc...
..., 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
menu - Archive of obsolete content
Archive › Mozilla › XUL › menu
or menuitem and menuseparator elements in firefox 3. 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. ...
...placechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata appenditem( label, value ) return type: element creates a new item and adds it to the end of the existing list of items. you may optionally set a value. the function returns the newly created element. getindexofitem( item ) return type: integer returns the zero-based position of the specified item. items are numbered starting at the first item displayed in the list. getitematindex( index ) return type: element returns the element that is at the specified index. insertitemat( index, label, value ) return type: element this method creates a new item and inserts it at the specified position. you may optionally set a value. the new item element i...
menuitem - Archive of obsolete content
still respond to mouse events. to enable the element, leave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. image type: uri the uri of the image to appear on the element. if this attribute is empty or left out, no image appears. the position of the image is determined by the dir and orient attributes. note: the menuitem must have a class of menuitem-iconic for the image to appear. key type: id set to the id of a key element whose key shortcut is displayed in the menuitem. label type: string the label that will appear on the element. if this is left out, no text appears. for an editable menuitem element the value...
..., 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
menuseparator - Archive of obsolete content
till respond to mouse events. to enable the element, leave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. image type: uri the uri of the image to appear on the element. if this attribute is empty or left out, no image appears. the position of the image is determined by the dir and orient attributes. label type: string the label that will appear on the element. if this is left out, no text appears. for an editable menuitem element the value of this attribute is copied to the menulist.value property upon user selection of the menuitem. selected type: boolean indicates whether the element is selected or not. thi...
... gets and sets the value of the tabindex attribute. 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. ...
notification - Archive of obsolete content
n use to close the box. attributes image, label, priority, persistence, type, value properties accessibletype, control, image, label, priority, persistence, type, value methods close examples <notification label="this is a warning"/> attributes image type: uri the uri of the image to appear on the element. if this attribute is empty or left out, no image appears. the position of the image is determined by the dir and orient attributes. label type: string the label that will appear on the element. if this is left out, no text appears. for an editable menuitem element the value of this attribute is copied to the menulist.value property upon user selection of the menuitem. persistence type: integer the persistence may be set to a non-zero value so ...
... gets and sets the value of the type attribute. 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. ...
notificationbox - Archive of obsolete content
this property is read-only. allnotifications type: nodelist nodelist of a...
...ications. this property is read-only. notificationshidden type: boolean indicating whether the notification area should be hidden. events alertactive type: event fired when a notification element is shown. alertclose type: event fired when a notification element is closed. ...
observes - Archive of obsolete content
bserver is observing. ...
..., 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
page - Archive of obsolete content
Archive › Mozilla › XUL › page
le 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, hidden, id, , , left, , ma...
..., 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
popupset - Archive of obsolete content
ipmenu"/> 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, hidden, id, , , left, , ma...
..., 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
preferences - Archive of obsolete content
nch (nsiprefbranch2). ...
...tes code specified in onchanged attribute of the element. see also the description of change event of <preference>. void observe(in nsisupports asubject, in string atopic, in wstring adata); nsiobserver method used internally to react to changes to preferences listed as children of this element. ...
prefpane - Archive of obsolete content
ber one?" preference="pref_one"/> ... more ui elements ... </prefpane> attributes helpuri type: uri the uri of the help page associated with a preference panel. the uri will be opened using the help viewer when the help button is pressed. image type: uri the uri of the image to appear on the element. if this attribute is empty or left out, no image appears. the position of the image is determined by the dir and orient attributes. label type: string the label that will appear on the element. if this is left out, no text appears. for an editable menuitem element the value of this attribute is copied to the menulist.value property upon user selection of the menuitem. onpaneload type: script code code defined here is called when...
...an example of a widget that has state changes tracked for it includes the checkbox element, whose state is tracked automatically when the "command" event fires. void writepreferences(in boolean flushtodisk); writes all changes in this pane to preferences, optionally flushes to disk. ...
progressmeter - Archive of obsolete content
t quarter of the bar. 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. max type: integer gets and sets the value of the max attri...
..., 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
query - Archive of obsolete content
Archive › Mozilla › XUL › query
ithin the expression. ...
..., 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
queryset - Archive of obsolete content
e queries. ...
..., 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
radio - Archive of obsolete content
Archive › Mozilla › XUL › radio
up type: string group name buttons with type="radio" and the same value for their group attribute are put into the same group. only one button from each group can be checked at a time. if the user selects one the buttons, the others in the group are unchecked. image type: uri the uri of the image to appear on the element. if this attribute is empty or left out, no image appears. the position of the image is determined by the dir and orient attributes. label type: string the label that will appear on the element. if this is left out, no text appears. for an editable menuitem element the value of this attribute is copied to the menulist.value property upon user selection of the menuitem. selected type: boolean indicates whether the element is selected or not. thi...
... gets and sets the value of the tabindex attribute. 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. ...
radiogroup - Archive of obsolete content
gets and sets the value of the tabindex attribute. 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. ...
...ue. the function returns the newly created element. checkadjacentelement( dir ) return type: no return value deselects the currently selected radio button in the group and selects the one adjacent to it. if the argument dir is true, the next radio button is selected. if it is false, the previous radio button is selected. getindexofitem( item ) return type: integer returns the zero-based position of the specified item. items are numbered starting at the first item displayed in the list. getitematindex( index ) return type: element returns the element that is at the specified index. insertitemat( index, label, value ) return type: element this method creates a new item and inserts it at the specified position. you may optionally set a value. the new item element...
resizer - Archive of obsolete content
get an extra resizer. ...
..., 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
row - Archive of obsolete content
Archive › Mozilla › XUL › row
n example. ...
..., 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
scale - Archive of obsolete content
Archive › Mozilla › XUL › scale
1. min type: integer the minimum value the control's value may take. the default value is 0. type: integer the maximum value that the scale or number box may be set to. the default value is 100 for scales and infinity for number boxes. movetoclick type: boolean if true, clicking the slide area of the scale moves the thumb directly to that position. if false, clicking the slide area moves the thumb only one increment in that direction. if not specified, the default value is used, which varies for each platform. pageincrement type: integer the amount by which the value of the curpos or value attribute changes when the tray of the scroll bar (the area in which the scroll bar thumb moves) is clicked, or when the page up or page down k...
... gets and sets the value of the tabindex attribute. 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. ...
script - Archive of obsolete content
ing a version number). ...
..., 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
scrollcorner - Archive of obsolete content
le 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, hidden, id, , , left, , ma...
..., 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
separator - Archive of obsolete content
laced elements. ...
..., 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
spacer - Archive of obsolete content
/> </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, database, datasources, dir, , , flex, height, hidden, id, , , left, , ma...
..., 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
spinbuttons - Archive of obsolete content
atepicker. ...
..., 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
statusbar - Archive of obsolete content
inherited properties align, , allowevents, , boxobject, builder, , , , classna...
...ed, 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
<statusbarpanel> - Archive of obsolete content
o use the max-width css property (or the maxwidth attribute) to override this size. for example, for a menuitem in a menu you can add the following css rule when you want to use the value none: menupopup > menuitem, menupopup > menu { max-width: none; } image type: uri the uri of the image to appear on the element. if this attribute is empty or left out, no image appears. the position of the image is determined by the dir and orient attributes. label type: string the label that will appear on the element. if this is left out, no text appears. for an editable menuitem element the value of this attribute is copied to the menulist.value property upon user selection of the menuitem. properties image type: image url gets and sets the value of...
..., 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
stringbundleset - Archive of obsolete content
le 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, hidden, id, , , left, , ma...
..., 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
tab - Archive of obsolete content
Archive › Mozilla › XUL › tab
that the tab is in the process of appearing or disappearing. 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. image type: uri the uri of the image to appear on the element. if this attribute is empty or left out, no image appears. the position of the image is determined by the dir and orient attributes. label type: string the label that will appear on the element. if this is left out, no text appears. for an editable menuitem element the value of this attribute is copied to the menulist.value property upon user selection of the menuitem. last-tab type: boolean this attribute will be set to true for the last tab. ...
... gets and sets the value of the tabindex attribute. 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. ...
tabpanel - Archive of obsolete content
le 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, hidden, id, , , left, , ma...
..., 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
tabpanels - Archive of obsolete content
t item is at index 0. 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. selectedindex type: integer returns the index of the currently selected ite...
...deselected. returns -1 if no items are selected selectedpanel type: element holds a reference to the currently selected panel within a <tabbox> element. assigning a value to this property will modify the selected panel. a select event will be sent when the selected panel is changed. ...
tabs - Archive of obsolete content
Archive › Mozilla › XUL › tabs
gets and sets the value of the tabindex attribute. 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. ...
...b. if the wrap argument is true, the adjustment will wrap around when the first or last tab is reached. appenditem( label, value ) return type: element creates a new item and adds it to the end of the existing list of items. you may optionally set a value. the function returns the newly created element. getindexofitem( item ) return type: integer returns the zero-based position of the specified item. items are numbered starting at the first item displayed in the list. getitematindex( index ) return type: element returns the element that is at the specified index. insertitemat( index, label, value ) return type: element this method creates a new item and inserts it at the specified position. you may optionally set a value. the new item element...
template - Archive of obsolete content
s first rule is used. ...
..., 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
textnode - Archive of obsolete content
operty (predicate). ...
..., 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
titlebar - Archive of obsolete content
properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, cont...
..., 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
toolbarbutton - Archive of obsolete content
oup type: string group name buttons with type="radio" and the same value for their group attribute are put into the same group. only one button from each group can be checked at a time. if the user selects one the buttons, the others in the group are unchecked. image type: uri the uri of the image to appear on the element. if this attribute is empty or left out, no image appears. the position of the image is determined by the dir and orient attributes. label type: string the label that will appear on the element. if this is left out, no text appears. for an editable menuitem element the value of this attribute is copied to the menulist.value property upon user selection of the menuitem. oncommand type: script code this event handler is called when the command is a...
...en attribute. orient type: string gets and sets the value of the orient attribute. tabindex type: integer gets and sets the value of the tabindex attribute. type type: string gets and sets the value of the type attribute. ...
toolbargrippy - Archive of obsolete content
inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , coll...
..., 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
toolbaritem - Archive of obsolete content
baritem> 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, hidden, id, , , left, , ma...
..., 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
toolbarpalette - Archive of obsolete content
rpalette> 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, hidden, id, , , left, , ma...
..., 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
toolbarseparator - Archive of obsolete content
inherited properties align, , allowevents, , boxobject, builder, , , , classnam...
...ed, 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
toolbarset - Archive of obsolete content
mple 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, hidden, id, , , left, , maxh...
...ed, 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
toolbarspacer - Archive of obsolete content
inherited properties align, , allowevents, , boxobject, builder, , , , class...
..., 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
toolbarspring - Archive of obsolete content
inherited properties align, , allowevents, , boxobject, builder, , , , classna...
...ed, 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
toolbox - Archive of obsolete content
customtoolbarcount firefox only type: integer the number of custom t...
...oolbar elements that should be considered to be members of this toolbox, even if they are not actually children of the toolbox. palette firefox only type: element the toolbarpalette within the toolbox. toolbarset firefox only type: element the toolbarset within the toolbox. ...
tree - Archive of obsolete content
Archive › Mozilla › XUL › tree
lable, since there are no dom nodes to retrieve. in newer versions of mozilla, the contentview property is actually a synonym for the view property, since the two interfaces are flattened together into a single interface in javascript. this property is read-only. currentindex type: integer set to the row index of the tree caret in the tree. for trees with focus, the caret's position is indicated by the focus ring, but unfocused trees won't show a focus ring, naturally. for unfocused trees, the (undrawn) caret's position can still be obtained by this property. if the caret isn't present for any row (for example, because the tree has never been focused), the value will be -1. you cannot rely on this property to change or determine a tree selection, except for trees with s...
...ty. trees built from rdf or those which use treeitems directly will already have a view. functions available in the view allow one to retrieve the data within the cells, and determine which rows are nested within others. for a complete list of view functions, see the nsitreeview interface. ...
treechildren - Archive of obsolete content
e to do this instead. ...
..., 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
treecol - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a column of a tree. it displays the column header and holds the size and other information about the column. you can also place splitter elements between the columns to allow column resizing. you should always place an id attribute on a treecol element to ensure that the column positioning is handled properly. more information is available in the xul tutorial. attributes crop, cycler, dragging, editable, fixed, hidden, hideheader, ignoreincolumnpicker, label, primary, sort, sortactive, sortdirection, src, type, width properties accessibletype style classes treecol-image examples this example shows a checkbox in the first column, requires the style below. <tree flex="1" editable...
..., 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
treecols - Archive of obsolete content
on the column picker. 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. inherited properties align, , allowevents, , boxobject, builder, , , , class...
..., 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
treerow - Archive of obsolete content
, see styling a tree. ...
..., 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
treeseparator - Archive of obsolete content
, see styling a tree. ...
..., 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
triple - Archive of obsolete content
an rdf resource uri. ...
..., 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
vbox - Archive of obsolete content
Archive › Mozilla › XUL › vbox
> </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, database, datasources, dir, , , flex, height, hidden, id, , , left, , ma...
..., 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
where - Archive of obsolete content
Archive › Mozilla › XUL › where
the value to compare. ...
..., 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
window - Archive of obsolete content
inactive (background). moreover this hides separator between titlebar and window contents. this affects only on mac os x. lightweightthemes type: boolean true if the window supports lightweight themes, otherwise false. lightweightthemesfooter type: id specifies the id of an element to which a lightweight theme's footer image will be applied. screenx type: integer the horizontal position at which the window appears on the screen. screeny type: integer the vertical position at which the window appears on the screen. sizemode type: one of the values below the state of the window. it can have one of the following values: maximized the window is maximized, and occupies the full size of the screen. normal the window appears in a normal state at the desired ...
..., 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
Gecko Compatibility Handbook - Archive of obsolete content
nd netscape navigator 4 share support for a large part of the html 3.2 standard and basic javascript. while they support the css 1 standard to some degree, the implementations are not complete and have non-standard features added. neither internet explorer 4 or netscape navigator 4 support the w3 dom. instead, each browser supports its own proprietary api for manipulating the content, style and position of html elements in a web page. in addition, internet explorer 4 and netscape navigator 4 use completely different methods of embedding third-party software into the browser. gecko is a cross-platform browser engine, compatible with a number of windows versions including windows xp, as well as mac and linux. because of gecko's cross-platform nature, functionality is generally very much the sam...
... dhtml menus implemented using hiermenu have problems the hiermenu version is obsolete. the earliest version of hiermenu only supported netscape navigator 4.x and internet explorer 4.x and above. 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. the most recent versions of hiermenu fully support all gecko-based browsers. upgrade to the most recent version of hiermenu common coding and server problems this section details solutions to the most common problems affecting standards-based browsers as well as issues that may specifically affect gecko browsers. proprietary html problem: using browser-specific p...
Extentsions FAQ - Archive of obsolete content
html code on a specific page that does not use greasemonkey? var newnode = document.createelement(" ... html content here ... "); var replaceme = document.getelementbyid("replaceme"); replaceme.parentnode.replacechild(newnode, replaceme); is it possible to place an image in the window that can be moved to anywhere in the window, and always remain on top of everything else?(similiar to using position:absolute and-index:100000 in html) you can almost do this with a stack: <window ...> <stack flex="1"> <image top="40" left="80"/> <vbox> other content here </vbox> </stack> </window> the only restriction is that your image can't overlap the right or bottom of the window. there are workarounds to this restriction by messing around with overflow or negativ...
...can only be accessed from the main thread. 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? you can capture the even of tab closing. you can get the tab that is being closed. this should be enough for you. is it possible to fix the size exactly at 16x16 pixels avoiding any resize? simply position the image and it will no longer be stretched to the size of the stack. <image left="0" top="0"> would seem to suffice. could there be more than two images to reflect more than two states?does the rules in the css file have to be in any particular order (if two rules match, which is chosen)? i have two states switching images in the tool bar and would have no problem implementing a third, so y...
-ms-ime-align - Archive of obsolete content
in some cases, the ime may enforce a reasonable minimum size. ...
...in some cases, the ime may enforce a reasonable minimum size. ...
::-ms-browse - Archive of obsolete content
the ::-ms-browse css pseudo-element is a microsoft extension that represents the button that opens the file picker of <input type="file">. permitted properties only the following css properties can be used in a rule with ::-ms-browse in its selector. other properties are ignored. ...
... the ::-ms-browse css pseudo-element is a microsoft extension that represents the button that opens the file picker of <input type="file">. permitted properties only the following css properties can be used in a rule with ::-ms-browse in its selector. other properties are ignored. ...
::-ms-check - Archive of obsolete content
css pseudo-element is a microsoft extension that represents checkboxes and radio button groups created by <input type="checkbox"> and <input type="radio">. this pseudo-element is supported only in internet explorer and microsoft edge. allowable properties only the following css properties can be used in a rule with ::-ms-check in its selector. other properties are ignored. ...
...crosoft extension that represents checkboxes and radio button groups created by <input type="checkbox"> and <input type="radio">. this pseudo-element is supported only in internet explorer and microsoft edge. allowable properties only the following css properties can be used in a rule with ::-ms-check in its selector. other properties are ignored. ...
::-ms-clear - Archive of obsolete content
type="month"> <input type="number"> <input type="search"> <input type="tel"> <input type="time"> <input type="url"> <input type="week"> allowable properties only the following css properties can be used in a rule with ::-ms-clear in its selector. other properties are ignored. ...
...type="number"> <input type="search"> <input type="tel"> <input type="time"> <input type="url"> <input type="week"> allowable properties only the following css properties can be used in a rule with ::-ms-clear in its selector. other properties are ignored. ...
::-ms-expand - Archive of obsolete content
hat represents the button of a <select> menu control that opens or closes the drop-down menu. typically it is a triangle that points downward. allowable properties only the following css properties can be used in a rule with ::-ms-expand in its selector. other properties are ignored. ...
...on of a <select> menu control that opens or closes the drop-down menu. typically it is a triangle that points downward. allowable properties only the following css properties can be used in a rule with ::-ms-expand in its selector. other properties are ignored. ...
::-ms-fill-lower - Archive of obsolete content
browser compatibility historically supported in internet explorer and edge before version 79. ...
... browser compatibility historically supported in internet explorer and edge before version 79. ...
::-ms-fill-upper - Archive of obsolete content
browser compatibility historically supported in internet explorer and edge before version 79. see als...
... browser compatibility historically supported in internet explorer and edge before version 79. see also ::-ms-fill-lower ::-...
::-ms-fill - Archive of obsolete content
rties only the following css properties can be used in a rule with ::-ms-fill in its selector. other properties are ignored. ...
...ss properties can be used in a rule with ::-ms-fill in its selector. other properties are ignored. ...
::-ms-reveal - Archive of obsolete content
...
... ...
::-ms-thumb - Archive of obsolete content
see also ::-ms-track ::-ms-fill-upper ::-ms-fill-lower ::-webkit-slider-thumb ::-moz-range-thumb css-t...
... see also ::-ms-track ::-ms-fill-upper ::-ms-fill-lower ::-webkit-slider-thumb ::-moz-range-thumb css-tricks: styling cross-browse...
CSS - Archive of obsolete content
Archive › Web › CSS
the extension is implemented in microsoft edge and internet explorer 11.-ms-overflow-stylethe -ms-overflow-style css property is a microsoft extension controlling the behavior of scrollbars when the content of an element overflows.-ms-scroll-chainingthe -ms-scroll-chaining css property is a microsoft extension that specifies the scrolling behavior that occurs when a user hits the scrol...
...ontrol. a slider control is one possible representation of <input type="range">.::-ms-valuethe ::-ms-value css pseudo-element is a microsoft extension that applies rules to the value of a text or password <input> control or the content of a <select> control.@mediaparent for archived media features.azimuthin combination with elevation, the azimuth css property enables different audio sources to be positioned spatially for aural presentation. this is important in that it provides a natural way to tell several voices apart, as each can be positioned to originate at a different location on the sound stage. stereo output produce a lateral sound stage, while binaural headphones and multi-speaker setups allow for a fully three-dimensional stage.display-insidethe display-inside css property specifies the ...
Object.observe() - Archive of obsolete content
o, ' + 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)); }, ['reposit...
...strawman proposal specification. ...
Index - Game development
g started working with 3d. 23 glsl shaders beginner, glsl, opengl, shader, texture shader, three.js, vertex shader shaders use glsl (opengl shading language), a special opengl shading language with syntax similar to c. glsl is executed directly by the graphics pipeline. there are two types of shaders: vertex shaders and fragment (pixel) shaders. vertex shaders transform shape positions into 3d drawing coordinates. fragment shaders compute the renderings of a shape's colors and other attributes. 25 async scripts for asm.js games, javascript, asm.js, async every medium or large game should compile asm.js code as part of an async script to give the browser the maximum flexibility to optimize the compilation process. in gecko, async compilation allows the java...
... added keyboard controls, but we could easily add mouse controls too. 67 move the ball 2d, beginner, canvas, games, javascript, loop, tutorial, movement you already know how to draw a ball from working through the previous article, so now let's make it move. technically, we will be painting the ball on the screen, clearing it and then painting it again in a slightly different position every frame to make the impression of movement — just like how movement works with the movies. 68 paddle and keyboard controls beginner, canvas, controls, games, graphics, javascript, tutorial, keyboard the ball is bouncing off the walls freely and you can watch it indefinitely, but currently there's no interactivity. it's not a game if you cannot control it! so let's add s...
3D collision detection - Game development
llision detection in 3d environments. followup articles will cover implementations in specific 3d libraries. axis-aligned bounding boxes as with 2d collision detection, axis-aligned bounding boxes (aabb) are the quickest algorithm to determine whether the two game entities are overlapping or not. this consists of wrapping game entities in a non-rotated (thus axis-aligned) box and checking the positions of these boxes in the 3d coordinate space to see if they are overlapping. the axis-aligned constraint is there because of performance reasons. the overlapping area between two non-rotated boxes can be checked with logical comparisons alone, whereas rotated boxes require additional trigonometric operations, which are slower to calculate. if you have entities that will be rotating, you can eith...
...phere.y) + (z - sphere.z) * (z - sphere.z)); return distance < sphere.radius; } using a physics engine 3d physics engines provide collision detection algorithms, most of them based on bounding volumes as well. the way a physics engine works is by creating a physical body, usually attached to a visual representation of it. this body has properties such as velocity, position, rotation, torque, etc., and also a physical shape. this shape is the one that is considered in the collision detection calculations. we have prepared a live collision detection demo (with source code) that you can take a look at to see such techniques in action — this uses the open-source 3d physics engine cannon.js. ...
Explaining basic 3D theory - Game development
this article explains all of the basic theory that's useful to know when you are getting started working with 3d. coordinate system 3d essentially is all about representations of shapes in a 3d space, with a coordinate system used to calculate their position. webgl uses the right-hand coordinate system — the x axis points to the right, the y axis points up, and the z axis points out of the screen, as seen in the above diagram. objects different types of objects are built using vertices. a vertex is a point in space having its own 3d position in the coordinate system and usually some additional information that defines it. every vertex is described by these attributes: position: identifies it in a 3d space (x, y, z). color: holds an rgba value (r, g and b for the red, green, an...
...heir coordinates in the 3d space for the viewer to see. it's like taking a photo of the given scenery you have prepared — you have to place the objects first, configure the camera, and then take the shot. there are four stages to this processing: the first one involves arranging the objects in the world, and is called model transformation. then there's view transformation which takes care of positioning and setting the orientation of the camera in the 3d space. the camera has three parameters — location, direction, and orientation — which have to be defined for the newly created scene. projection transformation (also called perspective transformation) then defines the camera settings. it sets up what can be seen by the camera — the configuration includes field of view, aspect ratio a...
3D games on the Web - Game development
e devices you use. there's an ongoing effort on releasing webgl 2.0 (based on opengl es 3.0) in the near future, which will bring many improvements and will help developers build games for the modern web using current, powerful hardware. explaining the basic 3d theory the basics of 3d theory centers around shapes represented in a 3d space, with a coordinate system being used to calculate their positions. see our explaining basic 3d theory article for all the information you need. advanced concepts you can do a lot more with webgl. there are some advanced concepts which you should dive into and learn more about — like shaders, collision detection, or the latest hot topic: virtual reality on the web. shaders it's worth mentioning shaders, which are a separate story on their own. shaders use...
...s, collision detection, or the latest hot topic: virtual reality on the web. shaders it's worth mentioning shaders, which are a separate story on their own. shaders use glsl, a special opengl shading language, with syntax similar to c, that is executed directly by the graphics pipeline. they can be split into vertex shaders and fragment shaders (or pixel shaders) — the former transforms shape positions to real 3d drawing coordinates, while the latter computes rendering colors and other attributes. you should definitely check out glsl shaders article to learn more about them. collision detection it's hard to imagine a game without collision detection — we always need to work out when something is hitting something else. we have information available for you to learn from: 2d collision de...
Desktop mouse and keyboard controls - Game development
} 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. then the pressed key variables are checked and the playerx and playery variables (that we define earlier just after leftpressed and the others) holding the position of the ship are adjusted by a given amount, let's say 5 pixels. then the player's ship is drawn on the screen and the next draw is called from within the requestanimationframe. we could write our own keycode object containing the key codes, for example: var keyboardhelper = { left: 37, up: 38, right: 39, down: 40 }; that way instead of using the codes to compare the input in the handler functi...
...clicked. we can assign actions directly to the buttons: this.buttonshoot = this.add.button(this.world.width*0.5, 0, 'button-alpha', null, this); this.buttonshoot.oninputdown.add(this.shootingpressed, this); this.buttonshoot.oninputup.add(this.shootingreleased, this); the button used for shooting works perfectly fine on both the mobile and desktop approach. if you want to use the mouse's cursor position on the screen you can do so with this.game.input.mousepointer. let's assume you'd like to shoot a bullet when the right half of the screen is clicked with a mouse — it would be something like this: if(this.game.input.mousepointer.isdown) { if(this.game.input.mousepointer.x > this.world.width*0.5) { // shoot } } if you'd like to differentiate the mouse buttons being pressed, th...
Bounce off the walls - Game development
first. we need to check, on every frame, whether the ball is touching the top edge of the canvas — if yes, we'll reverse the ball movement so it will start to move in the opposite direction and stay within the visible boundaries. 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. if the ball was moving upwards with a speed of 2 pixels per frame, now it will be moving "up" with a speed of -2 pixels, which actually equals to moving down at a speed of 2 pixels per frame. the code above would deal with the ball bouncing off the top edge, so now let's think about th...
...ting it equal to itself, reversed. if the ball was moving upwards with a speed of 2 pixels per frame, now it will be moving "up" with a speed of -2 pixels, which actually equals to moving down at a speed of 2 pixels per frame. the code above would deal with the ball bouncing off the top edge, so now let's think about the bottom edge: if(y + dy > canvas.height) { dy = -dy; } if the ball's y position is greater than the height of the canvas (remember that we count the y values from the top left, so the top edge starts at 0 and the bottom edge is at 320 pixels, the canvas' height), then bounce it off the bottom edge by reversing the y axis movement as before. we could merge those two statements into one to save on code verbosity: if(y + dy > canvas.height || y + dy < 0) { dy = -dy; } if...
Collision detection - Game development
e ball is colliding with any of the given bricks. this won't give a perfect result every time, and there are much more sophisticated ways to do collision detection, but this will work fine for teaching you the basic concepts. a collision detection function to kick this all off we want to create a collision detection function that will loop through all the bricks and compare every single brick's position with the ball's coordinates as each frame is drawn. for better readability of the code we will define the b variable for storing the brick object in every loop of the collision detection: function collisiondetection() { for(var c=0; c<brickcolumncount; c++) { for(var r=0; r<brickrowcount; r++) { var b = bricks[c][r]; // calculations } } } if the c...
...{ for(var c=0; c<brickcolumncount; c++) { for(var r=0; r<brickrowcount; r++) { var b = bricks[c][r]; // calculations } } } if the center of the ball is inside the coordinates of one of our bricks, we'll change the direction of the ball. for the center of the ball to be inside the brick, all four of the following statements need to be true: the x position of the ball is greater than the x position of the brick. the x position of the ball is less than the x position of the brick plus its width. the y position of the ball is greater than the y position of the brick. the y position of the ball is less than the y position of the brick plus its height. let's write that down in code: function collisiondetection() { for(var c=0; c<brickcolumnco...
Finishing up - Game development
rawing the score counter — add the following function to your code, below the drawscore() function: function drawlives() { ctx.font = "16px arial"; ctx.fillstyle = "#0095dd"; ctx.filltext("lives: "+lives, canvas.width-65, 20); } instead of ending the game immediately, we will decrease the number of lives until they are no longer available. we can also reset the ball and the paddle positions when the player begins with their next life. so, in the draw() function replace the following three lines: alert("game over"); document.location.reload(); clearinterval(interval); // needed for chrome to end game with this, we can add slightly more complex logic to it as given below: lives--; if(!lives) { alert("game over"); document.location.reload(); clearinterval(interval)...
...eload(); clearinterval(interval); // needed for chrome to end game } else { x = canvas.width/2; y = canvas.height-30; dx = 2; dy = -2; paddlex = (canvas.width-paddlewidth)/2; } now, when the ball hits the bottom edge of the screen, we're subtracting one life from the lives variable. 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. rendering the lives display now you need to add a call to drawlives() inside the draw() function and add it below the drawscore() call. drawlives(); improving rendering with requestanimationframe() now let's work on something that is not connected to the game mechanics, but to the way it is being rendered. requestani...
Build the brick field - Game development
m 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. the problem currently is that we're painting all the bricks in one place, at coordinates (0,0). what we need to do is draw each brick at its own x and y position. ...
...e brick to the group. the problem currently is that we're painting all the bricks in one place, at coordinates (0,0). what we need to do is draw each brick at its own x and y position. update the brickx and bricky lines as follows: var brickx = (c*(brickinfo.width+brickinfo.padding))+brickinfo.offset.left; var bricky = (r*(brickinfo.height+brickinfo.padding))+brickinfo.offset.top; each brickx position is worked out as brickinfo.width plus brickinfo.padding, multiplied by the column number, c, plus the brickinfo.offset.left; the logic for the bricky is identical except that it uses the values for row number, r, brickinfo.height, and brickinfo.offset.top. now every single brick can be placed in its correct place, with padding between each brick, and drawn at an offset from the left and top canva...
Extra lives - Game development
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. making our text styling dry as you probably noticed we're using the same styling for all three...
... }, this); } else { alert('you lost, game over!'); location.reload(); } } instead of instantly printing out the alert when you lose a life, we first subtract one life from the current number and check if it's a non-zero value. if yes, then the player still has some lives left and can continue to play — they will see the life lost message, the ball and paddle positions will be reset on screen and on the next input (click or touch) the message will be hidden and the ball will start to move again. when the number of available lives reaches zero, the game is over and the game over alert message will be shown. events you have probably noticed the add() and addonce() method calls in the above two code blocks and wondered how they differ. the difference is that t...
Visual typescript game engine - Game development
s. */ private addson: addson = [ { name: "cache", enabled: true, scriptpath: "externals/cacheinit.ts", }, { name: "hackertimer", enabled: true, scriptpath: "externals/hack-timer.js", }, { name: "dragging", enabled: true, scriptpath: "externals/drag.ts", }, ]; /** * @description this is main coordinary types of positions * can be "diametric-fullscreen" or "frame". * @property drawreference * @type string */ private drawreference: string = "frame"; /** * aspectratio default value, can be changed in run time. */ private aspectratio: number = 1.333; /** * domain is simple url address, * recommendent to use for local propose lan ip * like : 192.168.0.xxx if you wanna run ant tes...
...| | | ├── broadcaster-media.ts | | | | ├── broadcaster.ts | | | | ├── connector.ts | | | | ├── network.ts | | | ├── visual-methods/ | | | | ├── sprite-animation.ts | | | | ├── text.ts | | | | ├── texture.ts | | | ├── browser.ts | | | ├── math.ts | | | ├── position.ts | | | ├── resources.ts | | | ├── sound.ts | | | ├── system.ts | | | ├── view-port.ts | | | ├── visual-render.ts | | ├── interface/ | | | ├── drawi.ts | | | ├── global.ts | | | ├── visual-components.ts | | ├── multiplatform/ | | | ├── mobile/ | | | | ├── ...
Index - MDN Web Docs Glossary: Definitions of Web-related terms
defined by the grid-template-rows property or in the shorthand grid or grid-template properties. 186 grid tracks css grids a grid track is the space between two grid lines. they are defined in the explicit grid by using the grid-template-columns and grid-template-rows properties or the shorthand grid or grid-template properties. tracks are also created in the implicit grid by positioning a grid item outside of the tracks created in the explicit grid. 187 grid container css, glossary, grid using the value grid or inline-grid on an element turns it into a grid container using css grid layout, and any direct children of this element become grid items. 188 guard api, codingscripting, glossary, guard guard is a feature of headers objects (a...
...g is the unique identifying part of a web address, typically at the end of the url. in the context of mdn, it is the portion of the url following "<locale>/docs/". 426 smoke test composing, glossary, intro, qa, testing a smoke test consists of functional or unit tests of critical software functionality. smoke testing comes before further, in-depth testing. 427 snap positions glossary, snap positions a scroll container may set snap positions — points that the scrollport will stop moving at after a scrolling operation is completed. this allows a scrolling experience that gives the effect of paging through content rather than needing to drag content into view. 428 specification glossary, openpractices, standardization a specification is...
Advanced styling effects - Learn web development
<div>s, but each one is now sat on top of a simple <div> with a purple background, to show how the elements will blend together: <article> no mix blend mode <div> </div> <div> </div> </article> <article> multiply mix <div class="multiply-mix"> </div> <div> </div> </article> here's the css we'll style this with: article { width: 280px; height: 180px; margin: 10px; position: relative; display: inline-block; } div { width: 250px; height: 130px; padding: 10px; margin: 10px; } article div:first-child { position: absolute; top: 10px; left: 0; background: url(https://mdn.mozillademos.org/files/13090/colorful-heart.png) no-repeat center 20px; background-color: green; } article div:last-child { background-color: purple; position: absolute; bott...
...we will cover these in detail in our css layout module. css shapes while it is true that everything in css is a rectangular box, and images are a physical rectangular box, we can make it look as if our content flows around non-rectangular things by using css shapes. the css shapes specification enables the wrapping of text around a non-rectangular shape. ...
Flexbox - Learn web development
xplains all the fundamentals. prerequisites: html basics (study introduction to html), and an idea of how css works (study introduction to css.) objective: to learn how to use the flexbox layout system to create web layouts. why flexbox? for a long time, the only reliable cross browser-compatible tools available for creating css layouts were things like floats and positioning. these are fine and they work, but in some ways they are also rather limiting and frustrating. the following simple layout requirements are either difficult or impossible to achieve with such tools, in any kind of convenient, flexible way: vertically centering a block of content inside its parent. making all the children of a container take up an equal amount of the available width/height...
...test your skills: flexbox. summary that concludes our tour of the basics of flexbox. we hope you had fun, and will have a good play around with it as you travel forward with your learning. ...
Test Your Skills: Fundamental layout comprehension - Learn web development
ound it. the <article> and <aside> elements should display as a two column layout. the columns should be a flexible size so that if the browser window shrinks smaller the columns become narrower. the photographs should display as a two column grid with a 1 pixel gap between the images. you will not need to edit the html in order to achieve this layout and the techniques you should use are: positioning float flexbox css grid layout there are a few ways in which you could achieve some of these tasks, and there often isn’t a single right or wrong way to do things. try a few different approaches and see which works best. make notes as you experiment. assessment or further help you can practice these examples in the interactive editors mentioned above. if you would like your work asses...
...t assessed or need help with, in an online shareable editor (as mentioned in step 1 above). ...
Grids - Learn web development
ces. phasellus turpis est, posuere sit amet dapibus ut, facilisis sed est.</p> </aside> <footer>contact me@mysite.com</footer> </div> note: you can also use the value -1 to target the end column or row line, and count inwards from the end using negative values. however this only works for the explicit grid. the value -1 will not target the end line of the implicit grid. positioning with grid-template-areas an alternative way to place items on your grid is to use the grid-template-areas property and giving the various elements of your design a name. remove the line-based positioning from the last example (or re-download the file to have a fresh starting point), and add the following css. .container { display: grid; grid-template-areas: "header header" "...
...have toured the main features of css grid layout. you should be able to start using it in your designs. to dig further into the specification, read our guides to grid layout, which can be found below. ...
Legacy layout methods - Learn web development
an 960 pixels. you can take a look in the skeleton.css file to see the css that is used when we apply this class. the <div> is centered using auto left and right margins, and a padding of 20 pixels is applied left and right. skeleton also sets the box-sizing property to border-box like we did earlier, so the padding and borders of this element will be included in the total width. .container { position: relative; width: 100%; max-width: 960px; margin: 0 auto; padding: 0 20px; box-sizing: border-box; } elements can only be part of the grid if they are inside a row, so as with our earlier example we need an additional <div> or other element with a class of row nested between the content <div> and our actual content container <div>s. we've done this already as well. now let's lay out t...
...ks to use the inbuilt native grid that css provides. ...
Normal Flow - Learn web development
(study introduction to css.) objective: to explain how browsers layout web pages by default, before we begin to make changes. as detailed in the last lesson introducing layout, elements on a webpage lay out in the normal flow, if you have not applied any css to change the way they behave. and, as we began to discover, you can change how elements behave either by adjusting their position in that normal flow, or removing them from it altogether. starting with a solid, well-structured document that is readable in normal flow is the best way to begin any webpage. it ensures that your content is readable, even if the user is using a very limited browser or a device such as a screen reader that reads out the content of the page. in addition, as normal flow is designed to make a readab...
...margin: 10px; } span { background: white; border: 1px solid black; } summary now that you understand normal flow, and how the browser lays things out by default, move on to understand how to change this default display to create the layout needed by your design. previous overview: css layout next in this module introduction to css layout normal flow flexbox grid floats positioning multiple-column layout responsive design beginner's guide to media queries legacy layout methods supporting older browsers fundamental layout comprehension assessment ...
Responsive design - Learn web development
bly-sized column, rather than overflow it, but not grow larger and become pixellated if the column becomes wider than the image. the third key component was the media query. media queries enable the type of layout switch that cameron adams had previously explored using javascript, using only css. rather than having one layout for all screen sizes, the layout could be changed. sidebars could be repositioned for the smaller screen, or alternate navigation could be displayed. 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. in marcotte's original exploration this meant flexible grids (using...
...esign. it is therefore worth checking the age of any materials you are referencing. ...
CSS layout - Learn web development
at css fundamentals, how to style text, and how to style and manipulate the boxes that your content sits inside. now it's time to look at how to place your boxes in the right place in relation to the viewport, and one another. 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. looking to become a front-end web developer? we have put together a course that includes all the essential information you need to work towards your goal. get started prerequisites before starting this module, you should already: have basic familiarity with html, as discussed in the introduction to html module. b...
...cle will give you all you need to know to get started with page layout, then test your grid skills before moving on. floats originally for floating images inside blocks of text, the float property became one of the most commonly used tools for creating multiple column layouts on webpages. with the advent of flexbox and grid it has now returned to its original purpose, as this article explains. positioning positioning allows you to take elements out of the normal document layout flow, and make them behave differently, for example sitting on top of one another, or always remaining in the same place inside the browser viewport. this article explains the different position values, and how to use them. multiple-column layout the multiple-column layout specification gives you a method of laying co...
CSS FAQ - Learn web development
Learn › CSS › Howto › CSS FAQ
-ms-transform: rotate(90deg); -webkit-transform: rotate(90deg); transform: rotate(90deg); note: for more information on dealing with prefixed properties, see handling common html and css problems — handling css prefixes from our cross-browser testing module. note: see the mozilla css extensions page for more information on the mozilla-prefixed css properties. ...
... note: see the mozilla css extensions page for more information on the mozilla-prefixed css properties. how does z-index relate to positioning? the z-index property specifies the stack order of elements. an element with a higher z-index/stack order is always rendered in front of an element with a lower z-index/stack order on the screen. z-index will only work on elements that have a specified position (position:absolute, position:relative, or position:fixed). note: for more information, see our positioning learning article, and in particular the introducing z-index section. ...
Learn to style HTML using CSS - Learn web development
at css fundamentals, how to style text, and how to style and manipulate the boxes that your content sits inside. now it's time to look at how to place your boxes in the right place in relation to the viewport, and one another. ...
...but there's not much you can't do once you have a solid understanding of even the basics of css. ...
Example 3 - Learn web development
pple</option> </select> <div class="select" tabindex="0"> <span class="value">cherry</span> <ul class="optlist hidden"> <li class="option">cherry</li> <li class="option">lemon</li> <li class="option">banana</li> <li class="option">strawberry</li> <li class="option">apple</li> </ul> </div> </form> css content .widget select, .no-widget .select { position : absolute; left : -5000em; height : 0; overflow : hidden; } /* --------------- */ /* required styles */ /* --------------- */ .select { position: relative; display : inline-block; } .select.active, .select:focus { box-shadow: 0 0 3px 1px #227755; outline: none; } .select .optlist { position: absolute; top : 100%; left : 0; } .select .optlist.hidden { max-h...
...,.45); /* 0 1px 2px */ background : #f0f0f0; background : -webkit-linear-gradient(90deg, #e3e3e3, #fcfcfc 50%, #f0f0f0); background : linear-gradient(0deg, #e3e3e3, #fcfcfc 50%, #f0f0f0); } .select .value { display : inline-block; width : 100%; overflow : hidden; white-space : nowrap; text-overflow : ellipsis; vertical-align: top; } .select:after { content : "▼"; position: absolute; z-index : 1; height : 100%; width : 2em; /* 20px */ top : 0; right : 0; padding-top : .1em; -moz-box-sizing : border-box; box-sizing : border-box; text-align : center; border-left : .2em solid #000; border-radius: 0 .1em .1em 0; background-color : #000; color : #fff; } .select .optlist { z-index : 2; list-style: none; margin : 0; paddi...
Example 4 - Learn web development
<option>apple</option> </select> <div class="select"> <span class="value">cherry</span> <ul class="optlist hidden"> <li class="option">cherry</li> <li class="option">lemon</li> <li class="option">banana</li> <li class="option">strawberry</li> <li class="option">apple</li> </ul> </div> </form> css content .widget select, .no-widget .select { position : absolute; left : -5000em; height : 0; overflow : hidden; } /* --------------- */ /* required styles */ /* --------------- */ .select { position: relative; display : inline-block; } .select.active, .select:focus { box-shadow: 0 0 3px 1px #227755; outline: none; } .select .optlist { position: absolute; top : 100%; left : 0; } .select .optlist.hidden { max-h...
...,.45); /* 0 1px 2px */ background : #f0f0f0; background : -webkit-linear-gradient(90deg, #e3e3e3, #fcfcfc 50%, #f0f0f0); background : linear-gradient(0deg, #e3e3e3, #fcfcfc 50%, #f0f0f0); } .select .value { display : inline-block; width : 100%; overflow : hidden; white-space : nowrap; text-overflow : ellipsis; vertical-align: top; } .select:after { content : "▼"; position: absolute; z-index : 1; height : 100%; width : 2em; /* 20px */ top : 0; right : 0; padding-top : .1em; -moz-box-sizing : border-box; box-sizing : border-box; text-align : center; border-left : .2em solid #000; border-radius: 0 .1em .1em 0; background-color : #000; color : #fff; } .select .optlist { z-index : 2; list-style: none; margin : 0; paddi...
Example 5 - Learn web development
ass="optlist hidden" role="presentation"> <li class="option" role="option" aria-selected="true">cherry</li> <li class="option" role="option">lemon</li> <li class="option" role="option">banana</li> <li class="option" role="option">strawberry</li> <li class="option" role="option">apple</li> </ul> </div> </form> css content .widget select, .no-widget .select { position : absolute; left : -5000em; height : 0; overflow : hidden; } /* --------------- */ /* required styles */ /* --------------- */ .select { position: relative; display : inline-block; } .select.active, .select:focus { box-shadow: 0 0 3px 1px #227755; outline: none; } .select .optlist { position: absolute; top : 100%; left : 0; } .select .optlist.hidden { max-h...
...,.45); /* 0 1px 2px */ background : #f0f0f0; background : -webkit-linear-gradient(90deg, #e3e3e3, #fcfcfc 50%, #f0f0f0); background : linear-gradient(0deg, #e3e3e3, #fcfcfc 50%, #f0f0f0); } .select .value { display : inline-block; width : 100%; overflow : hidden; white-space : nowrap; text-overflow : ellipsis; vertical-align: top; } .select:after { content : "▼"; position: absolute; z-index : 1; height : 100%; width : 2em; /* 20px */ top : 0; right : 0; padding-top : .1em; -moz-box-sizing : border-box; box-sizing : border-box; text-align : center; border-left : .2em solid #000; border-radius: 0 .1em .1em 0; background-color : #000; color : #fff; } .select .optlist { z-index : 2; list-style: none; margin : 0; paddi...
Sending forms through JavaScript - Learn web development
ew xmlhttprequest(); // we need a separator to define each part of the request const boundary = "blob"; // store our body request in a string. ...
...: ' + file.dom.files[0].type + '\r\n'; // there's a blank line between the metadata and the data data += '\r\n'; // append the binary data to our body's request data += file.binary + '\r\n'; } // text data is simpler // start a new part in our body's request data += "--" + boundary + "\r\n"; // say it's form data, and name it data += 'content-disposition: form-data; name="' + text.name + '"\r\n'; // there's a blank line between the metadata and the data data += '\r\n'; // append the text data to our body's request data += text.value + "\r\n"; // once we are done, "close" the body's request data += "--" + boundary + "--"; // define what happens on successful data submission xhr.addeventlistener( 'load', function(...
CSS basics - Learn web development
and letter spacing to make body content more readable. h1 { font-size: 60px; text-align: center; } p, li { font-size: 16px; line-height: 2; letter-spacing: 1px; } adjust the px values as you like. your work-in-progress should look similar to this: css: all about boxes something you'll notice about writing css: a lot of it is about boxes. this includes setting size, color, and position. most html elements on your page can be thought of as boxes sitting on top of other boxes. css layout is mostly based on the box model. each box taking up space on your page has properties like: padding, the space around the content. in the example below, it is the space around the paragraph text. border, the solid line that is just outside the padding. margin, the space around the outsid...
...ing on the top of the body, and 20 pixels on the right, bottom and left. the values set top, right, bottom, left, in that order. as with margin, you can use one, two, three, or four values, as documented in padding syntax. border: 5px solid black; this sets values for the width, style and color of the border. in this case, it's a five-pixel–wide, solid black border, on all sides of the body. positioning and styling the main page title h1 { margin: 0; padding: 20px 0; color: #00539f; text-shadow: 3px 3px 1px black; } you may have noticed there's a horrible gap at the top of the body. that happens because browsers apply default styling to the <h1> element (among others). that might seem like a bad idea, but the intent is to provide basic readability for unstyled pages. to eliminate th...
Cooperative asynchronous JavaScript: Timeouts and intervals - Learn web development
rame() is that you can't choose your frame rate. this isn't a problem most of the time, as generally you want your animation to run as smoothly as possible. but what about when you want to create an old school, 8-bit-style animation? this was a problem, for example, in the monkey island-inspired walking animation from our drawing graphics article: in this example, you have to animate both the position of the character on the screen, and the sprite being shown. there are only 6 frames in the sprite's animation. if you showed a different sprite frame for every frame displayed on the screen by requestanimationframe(), guybrush would move his limbs too fast and the animation would look ridiculous. this example therefore throttles the rate at which the sprite cycles its frames using the following c...
...is limbs too fast and the animation would look ridiculous. this example therefore throttles the rate at which the sprite cycles its frames using the following code: if (posx % 13 === 0) { if (sprite === 5) { sprite = 0; } else { sprite++; } } so the code only cycles the sprite once every 13 animation frames. ...actually, it's about every 6.5 frames, as we update posx (character's position on the screen) by two each frame: if (posx > width/2) { newstartpos = -( (width/2) + 102 ); posx = math.ceil(newstartpos / 13) * 13; console.log(posx); } else { posx += 2; } this is the code that calculates how to update the position in each animation frame. the method you use to throttle your animation will depend on your particular code. for instance, in the earlier spinner example, ...
Making decisions in your code — conditionals - Learn web development
ce;\n for(let i = 1; i <= days; i++) {\n const listitem = document.createelement(\'li\');\n listitem.textcontent = i;\n list.appendchild(listitem);\n }\n }\n\ncreatecalendar(31,\'january\');'; let solutionentry = jssolution; textarea.addeventlistener('input', updatecode); window.addeventlistener('load', updatecode); // stop tab key tabbing out of textarea and // make it write a tab at the caret position instead textarea.onkeydown = function(e){ if (e.keycode === 9) { e.preventdefault(); insertatcaret('\t'); } if (e.keycode === 27) { textarea.blur(); } }; function insertatcaret(text) { const scrollpos = textarea.scrolltop; const caretpos = textarea.selectionstart; const front = (textarea.value).substring(0, caretpos); const back = (textarea.value).substring(textarea...
...ak;\n case \'psychedelic\':\n update(\'lime\',\'purple\');\n break;\n }\n}\n\nfunction update(bgcolor, textcolor) {\n html.style.backgroundcolor = bgcolor;\n html.style.color = textcolor;\n}'; let solutionentry = jssolution; textarea.addeventlistener('input', updatecode); window.addeventlistener('load', updatecode); // stop tab key tabbing out of textarea and // make it write a tab at the caret position instead textarea.onkeydown = function(e){ if (e.keycode === 9) { e.preventdefault(); insertatcaret('\t'); } if (e.keycode === 27) { textarea.blur(); } }; function insertatcaret(text) { const scrollpos = textarea.scrolltop; const caretpos = textarea.selectionstart; const front = (textarea.value).substring(0, caretpos); const back = (textarea.value).substring(textarea...
Arrays - Learn web development
+ price;\n\n let listitem = document.createelement(\'li\');\n listitem.textcontent = itemtext;\n list.appendchild(listitem);\n}\n\ntotalbox.textcontent = \'total: $\' + total.tofixed(2);'; let solutionentry = jssolution; textarea.addeventlistener('input', updatecode); window.addeventlistener('load', updatecode); // stop tab key tabbing out of textarea and // make it write a tab at the caret position instead textarea.onkeydown = function(e){ if (e.keycode === 9) { e.preventdefault(); insertatcaret('\t'); } if (e.keycode === 27) { textarea.blur(); } }; function insertatcaret(text) { const scrollpos = textarea.scrolltop; const caretpos = textarea.selectionstart; const front = (textarea.value).substring(0, caretpos); const back = (textarea.value).substring(textare...
...li\');\n listitem.textcontent = itemtext;\n list.appendchild(listitem);\n }\n\n if(myhistory.length >= 5) {\n myhistory.pop();\n }\n\n searchinput.value = \'\';\n searchinput.focus();\n }\n}'; let solutionentry = jssolution; textarea.addeventlistener('input', updatecode); window.addeventlistener('load', updatecode); // stop tab key tabbing out of textarea and // make it write a tab at the caret position instead textarea.onkeydown = function(e){ if (e.keycode === 9) { e.preventdefault(); insertatcaret('\t'); } if (e.keycode === 27) { textarea.blur(); } }; function insertatcaret(text) { const scrollpos = textarea.scrolltop; const caretpos = textarea.selectionstart; const front = (textarea.value).substring(0, caretpos); const back = (textarea.value).substring(textarea...
Solve common problems in your JavaScript code - Learn web development
you've spelt all your variable names, function names, etc. correctly. some common built-in browser functions that cause problems are: correct wrong getelementsbytagname() getelementbytagname() getelementsbyname() getelementbyname() getelementsbyclassname() getelementbyclassname() getelementbyid() getelementsbyid() semi-colon position you need to make sure you don't place any semi-colons incorrectly. for example: correct wrong elem.style.color = 'red'; elem.style.color = 'red;' functions there are a number of things that can go wrong with functions. one of the most common errors is to declare the function, but not call it anywhere. for example: function myfunction() { alert('this is my fun...
...pt? (e.g. to see which one is bigger, or to see if one value is equal to another). ...
Mozilla accessibility architecture
ects they want to expose, make any necessary changes, and then expose the information using microsoft com on windows, or through gtk2's atk api's on linux and unix. the assistive technology can then use this information in a number of ways. it can read in an entire document at once, look only pieces of a document related to recent events, or traverse the accessibility object model based on screen position. 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. mozilla keeps around its own tree of accessibility objects, which parallels the dom tree, but is not a full representation. above: a diagram showing that the msaa tree is a subset of the dom tr...
...t event_reorder domnoderemoved w3c dom mutation event event_destroy (atk) event_reorder (msaa) checkboxstatechange, radiostatechange mozilla dom event_state_change popupshowing mozilla dom event_menustart popuphiding mozilla dom event_menuend nsdocaccessible::scrollpositiondidchange(), then nsdocaccessible::scrolltimercallback() nsiscrollpositonlistener and nsitimer callbacks event_scrollingend (quick timer is used to determine when scrolling pauses or stops, to avoid extra events being fired) nsdocaccessible::onstatechange(), :nsdocaccessible:onlocationchange() nsiwebprogresslistener callback event_state_change (msaa) event_r...
Mozilla’s UAAG evaluation report
4.3 configure text colors. (p1) vg can be changed through preferences or by editing the prefs.js file the prefs are at preferences, appearances, colors to use any color offered in windows, the prefs.js file must be edited by hand 4.4 slow multimedia. (p1) ni cannot slow animations 4.5 start, stop, pause, and navigate multimedia. (p1) na 4.6 position captions. (p1) na 4.7 slow other multimedia. (p2) na this is similar to checkpoint 4.4, except that includes animation through style cannot control animation rate of animated images 4.8 control other multimedia. (p2) na 4.9 global volume control. (p1) na 4.10 independent volume control. (p1) na 4.11 control oth...
...(p2) vg html 4.01: vg css 1: vg css 2: vg dom 1.0: vg guideline 9. provide navigation mechanisms. checkpoint title status notes/plans ...
Accessible Toolkit Checklist
ols as part of their prompts. msaa support, including checkbox state and statechange event tab panels ctrl+[shift]+tab or ctrl+pgup/pgdn to switch tabs tabs can be focused, and then left/right arrow to switch first click on a tab switches to it, second click focuses it msaa support. note, you can use the accessible description to expose the current tab position, such as "3 of 5" in order to provide ease of access for the user. the "of" will be parsed out by the assistive technology, so don't localize it. lists and combo boxes when a list is tabbed to, select the first item if nothing else is already selected f4, alt+down or alt+up toggle a combo box open and closed escape closes combo box if it was open (be careful not t...
...ping letter or several letters to navigate (similar to list support for this) shift+f10 or context menu key to bring up context menu for current item (on os x ctrl+space is used to bring up context menu). space bar toggles checkboxes the enter key should activate an item if double clicking would do so msaa support, including accessible selection, exposing current level and position in list, alternative text for informative or interactive images, selectable, multiselectable and extselectable states, statechange events for expanding/collapsing and toggling of checkbox children. note, you can use the accessible description to expose the current tree view level and position, such as "l3, 6 of 9" in order to provide ease of access for the user. the "l" and "of" will be parsed ou...
mozbrowsercaretstatechanged
ly object a custom object. details the details property returns an anonymous javascript object with the following properties: rect an object that defines information about the bounding rectangle of the current selection. its properties are width: the width of the bounding rectangle, in css pixels. height: the height of the bounding rectangle, in css pixels. top: the top position of the bounding rectangle, in css pixels. bottom: the bottom position of the bounding rectangle, in css pixels. left: the left position of the bounding rectangle, in css pixels. right: the right position of the bounding rectangle, in css pixels. commands an object that defines what commands can currently be executed in the browser <iframe>. its properties are canselectall: a boole...
... cancut: a boolean indicating whether the cut command is available (true) or not (false.) cancopy: a boolean indicating whether the copy command is available (true) or not (false.) canpaste: a boolean indicating whether the paste command is available (true) or not (false.) reason a domstring that defines the reason for the state being changed. possible values are visibilitychange, updateposition, longpressonemptycontent, taponcaret, presscaret, and releasecaret. zoomfactor a number defining the current zoom factor in the browser <iframe>. collapsed a boolean indicating whether the current selection is collapsed (true) or not (false.) caretvisible a boolean indicating whether the caret is currently visible (true) or not (false.) selectionvisible a boolean indicating whether the cu...
Implementing Download Resuming
described here since gecko 1.8a4 (firefox 1.5, seamonkey 1.0, xulrunner 1.8.0.1). introduction various protocols support getting partial files. this means that if a download was interrupted, it can be resumed from that point on, rather than regetting the whole file. the necko implementations of http 1.1 (rfc 2616) as well as ftp support this feature. not only is the ability to specify a start position important, but it's also important to have some assurance that the file did not change since the initial download attempt. that would lead to a situation where the first part of the file corresponds to the initial version, while the latter part belongs to a different version, leading to an unusable result. the interface resuming is done using the nsiresumablechannel interface. the expected way ...
...hat webbrowserpersist/exthandler do). the front-end code can then notify the user of this, and offer to resume the download. resuming a download in order to resume a download, you should create a channel as usual (using nsiioservice). then, you can check if it implements nsiresumablechannel. if it does not, the protocol does not support resuming. otherwise, call resumeat with the desired start position, and the previously stored entity id. (it is possible to pass an empty string as the id; however, this means that you have no assurance that the file remained unchanged) now, you can open the channel as usual (using nsichannel.asyncopen() in the common case) and write to the file in the ondataavailable notifications. you may want to use nsisimplestreamlistener to simplify this task; to get progr...
Sqlite.jsm
tements that will be executed many times. execute() is recommended for statements that will be executed seldomly or once. please note that callers don't need to prepare statements manually before execution. just call executecached() and the statement will be prepared for you automatically. parameters can be bound to the statement by defining the params argument. this argument can be an array of positional parameters or an object of named parameters. if the statement does not contain any bound parameters, this argument can be omitted or specified as null. note: callers are strongly encouraged to use bound parameters instead of dynamically creating sql statements for security reasons. bound parameters aren't prone to sql injection like manual sql statement construction (e.g., concatenating a raw ...
...allers are strongly encouraged to use bound parameters instead of dynamically creating sql statements for security reasons. bound parameters aren't prone to sql injection like manual sql statement construction (e.g., concatenating a raw value into the executed sql statement). note: callers are encouraged to pass objects rather than arrays for bound parameters because they prevent foot guns. with positional arguments, it is simple to modify the parameter count or positions without fixing all users of the statement. objects/named parameters are a little safer because changes in the order of parameters in the statement won't change how values are bound to those parameters. when onrow is not defined, the full results of the operation are buffered before the caller is notified of statement complet...
MathML Demo: <mmultiscripts> - attach prescripts and tensor indices to a base
a mathml mmultiscripts object allows you to build tensor-like objects. for example m c d a b . the scripts come in pairs, with <mprescripts/> used to indicate prescripts and <none/> used to hold an empty position as in f b a . there are some variations possible: <mmultiscripts> a a b c d , nested <msubsup>s a a b c d , or &invisiblecomma; a a ⁣ c b ⁣ d . displays a mathml mmultiscripts objects allows you to build tensor-like objects. ...
... b a . there are some variations possible: <mmultiscripts> a a b c d , nested <msubsup>s a a b c d , or &invisiblecomma; a a ⁣ c b ⁣ d . ...
Mozilla Quirks Mode Behavior
s when the parent element doesn't have a fixed height. see bug 33443#c9. see also bug 41656 and its duplicates. some of these quirks may cause other effects (see bug 54119). in quirks mode, the font element changes the color of text decorations specified on ancestor elements. proposed to apply in all modes: bug 747517. in quirks mode, text-decoration is propagated into floating and absolutely positioned elements. (firefox 4 / thunderbird 3.3 / seamonkey 2.1) in quirks mode, text-decoration is not propagated into tables (bug 572713). maybe (firefox 3) when computing the minimum intrinsic width of an inline flow directly in a table cell (no blocks in between), it is assumed that it is not possible to break before and after an image (when otherwise it would be). obsolete since gecko 8.0 pri...
...ables (bug 572713). maybe (firefox 3) when computing the minimum intrinsic width of an inline flow directly in a table cell (no blocks in between), it is assumed that it is not possible to break before and after an image (when otherwise it would be). obsolete since gecko 8.0 prior to gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) text-decoration in quirks mode had line thickness and position adjusted on descendant text to match the descendant. tables td, th, tr, thead, tbody, and tfoot elements have the document background (and color?) applied to them (when the document background is specified in certain ways?) (see also bug 70831). [this may have been an accurate description when written in june 2001, but no longer appears accurate. should look into tablequirkcolorrule, re-desc...
ui.alertNotificationOrigin
ui.alertnotificationorigin controls the position and direction from which popup notifications invoked by nsialertsservice are sliding in. ...
... ui.alertnotificationorigin controls the position and direction from which popup notifications invoked by nsialertsservice are sliding in. ...
Localization Use Cases
the existing code, explain the problem from the localizers' or developers' perspective, and suggest a solution. declensions in gaia's browser app, there's an about-browser string defined as follows in apps/browser/locales/browser: about-browser=about {{browserbrandshortname}} problem definition in many inflected languages (e.g. german, finnish, hungarian, all slavic languages), the about preposition governs the grammatical case of the complement. it might be the accusative (german), ablative (latin) or locative (slavic languages). let's take slovenian as an example. in slovenian, the ideal string would inflect the noun, like so: o firefoxu however, since we want the name of the browser to be stored in the browserbrandshortname entity, we can't modify it. the work-around is to inflect an a...
...refox", genitive: "firefoxa", dative: "firefoxu", accusative: "firefox", locative: "firefoxu", instrumental:"firefoxom" }> and in shared/branding/unofficial/branding, we can define browserbrandshortname as follows, to mean web browser: now, coming back to apps/browser/locales/browser, we can take advantage of the grammatical cases. slovenian uses the locative case with its about preposition: <aboutbrowser "o {{ browserbrandshortname.locative }}"> for the official branding, we get: o firefoxu and for the unofficial branding, we end up with: o brskalniku genders in the system app's apps/system/locales/system, there's a string called crash-banner-os2. crash-banner-os2={{brandshortname}} just crashed. problem definition in some languages, past participles (crashed) must b...
Leak And Bloat Tests
rce code has changed. provide reasonable coverage for the normal activities that a user performs. method current method: measure leaks and bloats, in a similar way to firefox (using xpcom_mem_leak_log and --trace-malloc). the method of testing memory bloat and leaks will be the same sequence of events, using the same set of test data. startup main mail window open address book and message composition windows close address book and message composition windows quit the application future improvements will be discussed on the discussion page of the mozilla wiki. results printed on tinderbox output, these consist of: mail rlk reference count leaks mail lk total bytes malloc'ed and not free'd mail mh maximum heap size mail a allocations - number of calls to malloc and friends. th...
...user_pref("mail.smtpserver.smtp1.hostname", "tinderbox"); user_pref("mail.smtpserver.smtp1.username", "tinderbox"); user_pref("mail.smtpservers", "smtp1"); user_pref("mail.startup.enabledmailcheckonce", true); user_pref("mailnews.start_page_override.mstone", "1.9pre"); user_pref("mail.shell.checkdefaultclient", false); // ensure os x and outlook/oe books are disabled user_pref("ldap_2.servers.osx.position", 0); user_pref("ldap_2.servers.oe.position", 0); preferences in generated profile, but not set: user_pref("mail.root.none", "/home/moztest/.thunderbird/t7i1txfw.minimum/mail"); user_pref("mail.root.pop3", "/home/moztest/.thunderbird/t7i1txfw.minimum/mail"); user_pref("mail.server.server1.directory", "/home/moztest/.thunderbird/t7i1txfw.minimum/mail/local folders"); user_pref("mail.server.server...
Index
d c pointer variable. when dealing with memory, nss makes use of arenas, which are an attempt to simplify management with the limited offerings of c (because there are no destructors). the idea is to group multiple memory allocations in order to simplify cleanup. performing an operation often involves allocating many individual data items, and the code might be required to abort a task at many positions in the logic. an arena is requested once processing of a task starts, and all memory allocations that are logically associated to that task are requested from the associated arena. the implementation of arenas makes sure that all individual memory blocks are tracked. once a task is done, regardless whether it completed or was aborted, the programmer simply needs to release the arena, and all ind...
... follows rfc #1485. -t trustargs specify the trust attributes to modify in an existing certificate or to apply to a certificate when creating it or adding it to a database. there are three available trust categories for each certificate, expressed in the order ssl, email, object signing for each trust setting. ...
Installing Pork
t parse. to make pork easy to use, you will want to install mcpp that integrates into gcc. you will probably want a separate gcc for this so you don't have to modify your standard system gcc. you can install gcc in the normal way in a special directory. build and install mcpp mcpp generates macro expansion comments that allow pork's elsa to undo macros, which is necessary in order to get exact position information. to tell mcpp which gcc installation to integrate itself with, place the selected gcc bin dir as the first element of your path: path=/bindir/of/my/gcc:$path if you want to use a gcc that has binaries named something other than "gcc" and "g++", or you use "ccache" for you main gcc installation and want mcpp to override a separate installation, you need to pass the options "cc=gccxx...
...isable_literal_template $srcdir/configure --enable-debug --disable-optimize --disable-accessibility --enable-application=browser --disable-crashreporter building will probably require disabling warnings_as_errors: make warnings_as_errors= "-wp,-w0,-k" are options that get passed to mcpp. see the mcpp manual. in particular, -k tells mcpp to add the macro annotations we use to get exact source positions. c++ files from other projects can be preprocessed with gcc -e -wp,-w0,-k. building a 32-bit mcpp on a 64-bit system this is dark magic, and i hope i've got it right. first i built gcc in a separate --prefix=/builds/gcc-3.4.6-installed. note: once you do this, you can only use this version of gcc in -m32 mode. apply this patch: note: this doesn't seem necessary in the latest version; cppflag...
JIT Optimization Strategies
ctor() { this.x = 10; // x is a definite slot property this.y = 10; // y is a definite slot property somecomplicatedfunctioncall(); this.z = 20; // z is not a definite slot property. } in the above example, the properties x and y can always be determined to exist on any instance of someconstructor at definite locations, allowing the engine to infer deterministically the position of x without a shape guard. this optimization can fail for a number of reasons. if the types observed at the property access are polymorphic (more than one type), this optimization cannot succeed. furthermore, even if the object type is monomorphic, the optimization will fail if the property being accessed is not a definite slot as described above. getprop_unboxed similar to getprop_definitesl...
...ctor() { this.x = 10; // x is a definite slot property this.y = 10; // y is a definite slot property somecomplicatedfunctioncall(); this.z = 20; // z is not a definite slot property. } in the above example, the properties x and y can always be determined to exist on any instance of someconstructor at definite locations, allowing the engine to infer deterministically the position of x without a shape guard. this optimization can fail for a number of reasons. if the types observed at the property access are polymorphic (more than one type), this optimization cannot succeed. furthermore, even if the object type is monomorphic, the optimization will fail if the property being written is not a definite slot as described above. setprop_unboxed similar to setprop_definiteslo...
Animated PNG graphics
Mozilla › Tech › APNG
nonzero, the animation should come to rest on the final frame at the end of the last play. 'fctl': the frame control chunk the 'fctl' chunk is an ancillary chunk as defined in the png specification. it must appear before the 'idat' or 'fdat' chunks of the frame to which it applies, specifically: for the default image, if a 'fctl' chunk is present it must appear before the first 'idat' chunk. position relative to the 'actl' chunk is not specified. for the first frame excluding the default image (which may be either the first or second frame), the 'fctl' chunk must appear after all 'idat' chunks and before the 'fdat' chunks for the frame. for all subsequent frames, the 'fctl' chunk for frame n must appear after the 'fdat' chunks from frame n-1 and before the 'fdat' chunks for frame n. other ...
...ne 'fctl' chunk is required for each frame. byte offset field name field type description 0 sequence_number unsigned int sequence number of the animation chunk, starting with 0. 4 width unsigned int width of the following frame. 8 height unsigned int height of the following frame. 12 x_offset unsigned int x position at which to render the following frame. 16 y_offset unsigned int y position at which to render the following frame. 20 delay_num unsigned short frame delay fraction numerator. 22 delay_den unsigned short frame delay fraction denominator. 24 dispose_op byte type of frame area disposal to be done after rendering this frame. ...
Gecko Roles
his page offers a list of accessible roles used in gecko. role constants are defined in the nsiaccessiblerole interface. role_nothing used when the accessible item doesn't have a strongly defined role. role_titlebar represents a title or caption bar for a window. used by msaa only, this is supported automatically by microsoft windows. role_menubar represents the menu bar (positioned beneath the title bar of a window on most platforms or at the top of the screen on mac os x) from which menus are selected by the user. role_scrollbar represents a vertical or horizontal scroll bar, which is part of the client area or used in a control. role_grip represents a special mouse pointer, which allows a user to manipulate user interface elements such as windows. for ex...
...nt. role_menupopup represents a menu, which presents a list of options from which the user can make a selection to perform an action. role_menuitem represents a menu item, which is an entry in a menu that a user can choose to carry out a command, select an option. role_tooltip represents a tooltip that provides helpful hints; this is generally displayed at the mouse cursor position. role_application represents a main window for an application. role_document represents a document window. a document window is always contained within an application window. role_pane represents a pane within a frame or document window. users can navigate between panes and within the contents of the current pane, but cannot navigate between items in different panes. thus,...
Building the WebLock UI
ter/gatekeeper/there.is.only.xul" title="web lock manager" persist="screenx screeny" screenx="24" screeny="24"> </dialog> note that this part of the xul file also contains a stylesheet declaration, which imports css rules and applies them to particular parts of the interface. in gecko, css is used to do virtually all of the presentation of the xul interface - its color, position, style, and to some extent its behavior as well. the web lock manager dialog does not deviate from the look of a standard dialog, so it can use a single declaration to import the "global" skin from the browser and make it available to the widgets you define in weblock.xul. you can save this first, outermost part of the web lock dialog in a file called weblock.xul, which you'll be adding to an in...
... element called <radiogroup/>. grouping radio elements together creates the toggling ui by requiring that one or another of the elements be selected, but not both. 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. site adding ui the next step is to create that part of the user interface that lets you add a new site to the white list. there are other, more sophisticated ways to do this; you may also want to include some ui that lets you view the white list or edit it as a list...
Insert
« xpcom api reference summary the insert family of functions inserts a value into a string's internal buffer. void insert( const self_type& astring, index_type aposition ); parameters astring [in] a nsacstring to append to this string. aposition [in] an offset into the string's internal buffer specifying where to place the given characters. void insert( const char_type* adata, index_type aposition, size_type adatalength = pr_uint32_max ); parameters adata [in] a raw character array to append to this string. aposition [in] an offset into the string's internal buffer specifying where to place the given characters. adatalength [in] the length of adata, measured in storage units. if equal to pr_uint32_max, then adata is assumed to be null-terminated. otherwise, a...
...ata [in] a raw character array to append to this string. aposition [in] an offset into the string's internal buffer specifying where to place the given characters. adatalength [in] the length of adata, measured in storage units. if equal to pr_uint32_max, then adata is assumed to be null-terminated. otherwise, adata need not be null terminated. void insert( char_type achar, index_type aposition ); parameters achar [in] a character to append to this string. aposition [in] an offset into the string's internal buffer specifying where to place the given characters. remarks if insufficient memory is available to perform the assignment, then the string's internal buffer will point to a static empty (zero-length) buffer. ...
Insert
« xpcom api reference summary the insert family of functions inserts a value into a string's internal buffer. void insert( const self_type& astring, index_type aposition ); parameters astring [in] a nsastring to append to this string. aposition [in] an offset into the string's internal buffer specifying where to place the given characters. void insert( const char_type* adata, index_type aposition, size_type adatalength = pr_uint32_max ); parameters adata [in] a raw character array to append to this string. aposition [in] an offset into the string's internal buffer specifying where to place the given characters. adatalength [in] the length of adata, measured in storage units. if equal to pr_uint32_max, then adata is assumed to be null-terminated. otherwise, ad...
...ata [in] a raw character array to append to this string. aposition [in] an offset into the string's internal buffer specifying where to place the given characters. adatalength [in] the length of adata, measured in storage units. if equal to pr_uint32_max, then adata is assumed to be null-terminated. otherwise, adata need not be null terminated. void insert( char_type achar, index_type aposition ); parameters achar [in] a character to append to this string. aposition [in] an offset into the string's internal buffer specifying where to place the given characters. remarks if insufficient memory is available to perform the assignment, then the string's internal buffer will point to a static empty (zero-length) buffer. ...
IAccessibleImage
ain situations. some examples are: the accessible name and description() are not enough to fully describe the image, for example when the accessible description() is used to define the behavior of an actionable image and the image itself conveys semantically significant information. the user can edit the content that includes an image and therefore the user needs to be able to review the image's position. method overview [propget] hresult description([out] bstr description ); [propget] hresult imageposition([in] enum ia2coordinatetype coordinatetype, [out] long x, [out] long y ); [propget] hresult imagesize([out] long height, [out] long width ); methods description() returns the localized description of the image. [propget] hresult description( [out] bstr description ); parameters ...
...pe coordinatetype, [out] long x, [out] long y ); [propget] hresult imagesize([out] long height, [out] long width ); methods description() returns the localized description of the image. [propget] hresult description( [out] bstr description ); parameters description the localized description of the image. return value s_false if there is nothing to return, [out] value is null. s_ok. imageposition() returns the coordinates of the image. [propget] hresult imageposition( [in] enum ia2coordinatetype coordinatetype, [out] long x, [out] long y ); parameters coordinatetype specifies whether the returned coordinates should be relative to the screen or the parent object. x the x coordinate. y the y coordinate. return value s_ok. imagesize() returns the size of the image in units specified...
nsICollection
nt(); parameters none. return value number of items in the list. enumerate() returns an nsienumerator that lets you iterate over the items in the collection. nsienumerator enumerate(); parameters none. return value an nsienumerator. getelementat() returns the element at the specified index into the collection. nsisupports getelementat( in pruint32 index ); parameters index the index position of the item to be returned. return value nsisupports item at the index position. queryelementat() performs a queryinterface on the item at the specified index into the collection. void queryelementat( in pruint32 index, in nsiidref uuid, [iid_is(uuid),retval] out nsqiresult result ); parameters index position of the item to be queried. uuid nsiidref of the item. resul...
...son result of the previous two parameters. removeelement() removes an item from the collection. void removeelement( in nsisupports item ); parameters item nsisupports item to be removed from the list. setelementat() replaces an item at a specified index in the collection with a new one. void setelementat( in pruint32 index, in nsisupports item ); parameters index index position where the new item will be set. item the nsisupports item to be set in that position. remarks nsienumerator is a broken interface, and nsisimpleenumerator should be used in its place. see also nsisupports nsienumerator nsisimpleenumerator ...
nsICommandLine
constants state constants constant value description state_initial_launch 0 the first launch of the application instance. state_remote_auto 1 a remote command line automatically redirected to this instance. state_remote_explicit 2 a remote command line explicitly redirected to this instance using xremote/windde/appleevents. ...
...on windows, flags of the form /flag are normalized to -flag. ...
nsIControllers
ype description commanddispatcher nsidomxulcommanddispatcher obsolete since gecko 1.9 methods appendcontroller() adds a controller to the end of the list. void appendcontroller( in nsicontroller controller ); parameters controller a controller to be added to the list of controllers. exceptions thrown ns_error_out_of_memory getcontrollerat() returns the controller instance at the given position. nsicontroller getcontrollerat( in unsigned long index ); parameters index the position of the wanted controller. return value the controller at the given position. exceptions thrown ns_error_failure the given index is out of range. getcontrollerbyid() returns a controller given by its order, rather than position, of insertion. nsicontroller getcontrollerbyid( in unsigned long controller...
...ns the order of insertion of a controller. unsigned long getcontrollerid( in nsicontroller controller ); parameters controller the controller for which you want to retrieve the insertion index. return value the id in which the controller was inserted. exceptions thrown ns_error_failure the controller is not in the list of controllers. insertcontrollerat() inserts a controller at a specific position in the list of controllers. if the position is out of range, nothing happens. void insertcontrollerat( in unsigned long index, in nsicontroller controller ); parameters index the position within the list where you want the controller to be inserted. controller the controller to be inserted into the list. exceptions thrown ns_error_out_of_memory removecontroller() removes a controller fro...
nsIFrameLoader
this can be used to decide what operations may or may not be allowed on the loader's docshell. read only. docshell nsid...
...he type of mouse event to send. ax the x coordinate of the mouse. ay the y coordinate of the mouse. abutton which button was clicked, if any. aclickcount the number of clicks comprising the mouse button event, if any. amodifiers the modifier keys in effect at the time of the event. aignorerootscrollframe optional whether or not to ignore the root scroll frame. native code only!updatepositionandsize updates the position and size of the subdocument loaded by this frameloader. void updatepositionandsize( in nsiframe aiframe ); parameters aiframe the nsiframe for the content node that owns this frameloader. see also content process event handling nsiframeloaderowner nsiframemessagelistener nsichromeframemessagemanager nsidomwindowutils ...
nsIGeolocationProvider
geolocationprovider.js for an example of how to write a geolocation provider. method overview boolean isready(); obsolete since gecko 1.9.2 void shutdown(); void startup(); void watch(in nsigeolocationupdate callback); methods isready() obsolete since gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) reports whether or not the device is ready and has a position. boolean isready(); parameters none. return value true if the device is ready and has a position available to return; otherwise false. shutdown() shuts down the location device. void shutdown(); parameters none. startup() start up the provider. this is called before any other method and may be called multiple times. void startup(); parameters none. watch() attaches a callback listener to be no...
...the location device. void shutdown(); parameters none. startup() start up the provider. this is called before any other method and may be called multiple times. void startup(); parameters none. watch() attaches a callback listener to be notified when a location change is observed. void watch( in nsigeolocationupdate callback ); parameters callback an nsigeolocationupdate to be notified when position changes. your location provider should call this routine whenever new position data is available. see also using geolocation w3c geolocation specification ...
nsIUpdateCheckListener
void oncheckcomplete( in nsixmlhttprequest request, [array, size_is(updatecount)] in nsiupdate updates, in unsigned long updatecount ); parameters request the nsixmlhttprequest object handling the update check. updates an array of nsiupdate objects describing the available updates. update...
...onerror( in nsixmlhttprequest request, in nsiupdate update ); parameters request the nsixmlhttprequest object handling the update check. update an nsiupdate object containing details about the error in its statustext attribute. onprogress() called every time there is a progress notification loading the update service file. void onprogress( in nsixmlhttprequest request, in unsigned long position, in unsigned long totalsize ); parameters request the nsixmlhttprequest object handling the update check. position the number of bytes downloaded so far. totalsize the total number of bytes that need to be downloaded. see also nsiupdatepatch nsiupdate nsiupdatechecker nsiapplicationupdateservice nsiupdatemanager nsiupdateprompt nsiupdatetimermanager ...
nsIWebBrowserChrome
or showing its chrome appropriately. webbrowser nsiwebbrowser the currently loaded webbrowser. 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. this includes positioning setting up listeners etc. constants constant value description status_script 1 flag for setstatus() status_script_default 2 flag for setstatus() status_link 3 flag for setstatus() chrome_default 1 value for the chromeflags attribute. chrome_window_borders 2 value for the chromeflags attribute. ...
... chrome_personal_toolbar 256 value for the chromeflags attribute. chrome_scrollbars 512 value for the chromeflags attribute. chrome_titlebar 1024 value for the chromeflags attribute. chrome_extra 2048 value for the chromeflags attribute. chrome_with_size 4096 specifically for use with nsiwindowcreator. chrome_with_position 8192 specifically for use with nsiwindowcreator. chrome_window_min 16384 represent special cases. chrome_window_popup 32768 represent special cases. chrome_window_raised 33554432 represent special cases. chrome_window_lowered 67108864 represent special cases. chrome_center_screen 134217728 represent special cases. ...
nsIXULWindow
alling this when this xul window does not yet have a document in its docshell could cause problems. void applychromeflags(); parameters none. assumechromeflagsarefrozen() begin assuming chromeflags do not change hereafter, and assert if they do change. the state change is one-way and idempotent. void assumechromeflagsarefrozen(); parameters none. center() move the window to a centered position. void center( in nsixulwindow arelative, in boolean ascreen, in boolean aalert ); parameters arelative if not null, the window relative to which the window is moved. see ascreen parameter for details. ascreen true to center the window relative to the screen containing arelative if arelative is not null. if arelative is null then relative to the screen of the opener window if it was...
...center the window relative to the screen containing arelative if arelative is not null. if arelative is null then relative to the screen of the opener window if it was initialized by passing it to nswebshellwindow::initialize. failing that relative to the main screen. 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. createnewwindow() create a new window. nsixulwindow createnewwindow( in print32 achromeflags, in nsiappshell aappshell ); parameters achromeflags see nsiwebbrowserchrome. aappshell the app shell passed to nsiappshellservice's createtoplevelwindow method. return value the newly minted window. in the case of a content wi...
XPCOM Interface Reference
ncelablensicategorymanagernsichannelnsichanneleventsinknsichannelpolicynsicharsetresolvernsichromeframemessagemanagernsichromeregistrynsiclassinfonsiclipboardnsiclipboardcommandsnsiclipboarddragdrophooklistnsiclipboarddragdrophooksnsiclipboardhelpernsiclipboardownernsicollectionnsicommandcontrollernsicommandlinensicommandlinehandlernsicommandlinerunnernsicomponentmanagernsicomponentregistrarnsicompositionstringsynthesizernsiconsolelistenernsiconsolemessagensiconsoleservicensicontainerboxobjectnsicontentframemessagemanagernsicontentprefnsicontentprefcallback2nsicontentprefobservernsicontentprefservicensicontentprefservice2nsicontentsecuritypolicynsicontentsniffernsicontentviewnsicontentviewmanagernsicontentviewernsicontrollernsicontrollersnsiconverterinputstreamnsiconverteroutputstreamnsicookiensic...
...ernsidbfolderinfonsidnslistenernsidnsrecordnsidnsrequestnsidnsservicensidomcanvasrenderingcontext2dnsidomchromewindownsidomclientrectnsidomdesktopnotificationnsidomdesktopnotificationcenternsidomelementnsidomeventnsidomeventgroupnsidomeventlistenernsidomeventtargetnsidomfilensidomfileerrornsidomfileexceptionnsidomfilelistnsidomfilereadernsidomfontfacensidomfontfacelistnsidomgeogeolocationnsidomgeopositionnsidomgeopositionaddressnsidomgeopositioncallbacknsidomgeopositioncoordsnsidomgeopositionerrornsidomgeopositionerrorcallbacknsidomgeopositionoptionsnsidomglobalpropertyinitializernsidomhtmlaudioelementnsidomhtmlformelementnsidomhtmlmediaelementnsidomhtmlsourceelementnsidomhtmltimerangesnsidomjswindownsidommousescrolleventnsidommoznetworkstatsnsidommoznetworkstatsdatansidommoznetworkstatsmanagernsi...
Reference Manual
dont_addref(t*), getter_addrefs(t*) n/a e.g., one of the possibilities for assigning into an nscomptr, but you don't want to addref the pointer you are assigning (because it has already been addrefed for some reason) is dont_addref(t*) found at the intersection of "don't addref" and "don't qi". here is a sample demonstrating the various positions these `annotations' can appear in, using dont_addref // controlling assignment into an |nscomptr|... // in constructors... nscomptr<nsifoo> foo1( dont_addref(rawfoo1ptr) ); nscomptr<nsifoo> foo2 = dont_addref(rawfoo2ptr); // note that the function form (called `direct initialization') and the // assignment form (called `copy initialization') of a constructor have...
...(called `copy initialization') of a constructor have // subtly different meanings; prefer direct initialization. nscomptr<nsifoo> foo3; // in a normal assignment... foo3 = dont_addref(rawfoo3ptr); // the annotations described in the table apply to both forms of constructor, // and to plain-old assignment any of the annotations shown in the table can appear in all the positions demonstrated with dont_addref. the sections that follow describe each possibility. nscomptr<t> = t*, nscomptr<t> = dont_queryinterface( t* ) the default behavior, shown in the table as t*, is to addref the new value, but not to call queryinterface against it. this is what happens when no `annotation' is present, e.g., nscomptr<nsifoo> foo( afooptr ); // or foo = afoopt...
XUL Overlays
Mozilla › Tech › XUL › Overlays
the same id attribute specifies a different image, and that image is superimposed on top of the original netscape image as part of the merge process: <html:img id="foo" src="mozillaimage.gif"/> when the base file references an overlay file which contains the html image element above, the new src attribute is superimposed over the original, and the mozilla icon replaces the netscape icon. overlay positioning xul overlays also support positioning of nodes. you can specify a position attribute on a node in the overlay to provide a hint for insertion into the master document. in the following example, the last menu item, example four, will be placed just after the "new" menu item instead of being appended to the end of the menu like the other kids. <overlay id="main-overlay" xmlns:html="http://www.w3...
...the menu like the other kids. <overlay id="main-overlay" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <menu id="file_menu"> <menuitem name="example one"/> <menuitem name="example two"/> <menuitem name="example three"/> <menuitem name="example four" position="1"/> </menu> </overlay> the node with the position attribute orders itself to the top of the menu. the position can also be given for nodes in overlay files that will be ordered in a group of similar items in the base file. for example, if only the last menuitem above had been in an overlay and the other items were defined in the base file, the overlayed menuitem would still appear at the top o...
Thunderbird API documentation
for older versions of thunderbird. much of it may no longer be relevant. see developer.thunderbird.net for newer information. these pages have been moved from mozilla.org, and may or may not be relevant. ...
... of thunderbird. much of it may no longer be relevant. see developer.thunderbird.net for newer information. these pages have been moved from mozilla.org, and may or may not be relevant. ...
CData
way, so this is an alternative to readstringreplacemalformed, it is an attempt at readingmalformed function readaschar8thenaschar16(stringptr, known_len, jschar) { // when reading as jschar it assumes max length of 500 // stringptr is either char or jschar, if you know its jschar for sure, pass 2nd arg as true // if known_len is passed, then assumption is not made, at the known_len position in array we will see a null char // i tried getting known_len from stringptr but its not possible, it has be known, i tried this: //"stringptr.contents.tostring()" "95" //"stringptr.tostring()" "ctypes.unsigned_char.ptr(ctypes.uint64("0x7f73d5c87650"))" // so as we see neither of these is 77, this is for the example of "_scratchpad/entehandle.js at master · noitidart/...
..._len).ptr).contents; // must cast to unsigned char (not ctypes.jschar, or ctypes.char) as otherwise i dont get foreign characters, as they are got as negative values, and i should read till i find a 0 which is null terminator which will have unsigned_char code of 0 // can test this by reading a string like this: "_scratchpad/entehandle.js at master · noitidart/_scratchpad mdnfirefox" at js array position 36 (so 37 if count from 1), we see 183, and at 77 we see char code of 0 if casted to unsigned_char, if casted to char we see -73 at pos 36 but pos 77 still 0, if casted to jschar we see chineese characters in all spots expect spaces even null terminator is a chineese character console.info('ptrasarr.length:', ptrasarr.length); //console.log('debug-msg :: datacasted:', datacasted, ...
DevTools API - Firefox Developer Tools
definition object or the theme identifier. showtoolbox(target [, toolid [, hosttype [, hostoptions]]]) opens a toolbox for given target either by creating a new one or activating an existing one. parameters: target {target} - the target the toolbox will debug. toolid {string} - the tool that should be activated. if unspecified the previously active tool is shown. hosttype {string} - the position the toolbox will be placed. one of bottom, side, window, custom. see hosttype for details. hostoptions {object} - an options object passed to the selected host. see hosttype for details. return value: a promise that is fulfilled with the toolbox instance once it has been initialized and the selected tool is loaded. gettoolbox(target) fetch the toolbox object for the given target. para...
...an unique identifier for the tool. it must be a valid id for an html element. url string, required. an url of the panel document. label string, optional. the tool's name. if undefined the icon should be specified. tooltip string, optional. the tooltip for the tool's tab. panellabel string, optional. an accessibility label for the panel. ordinal integer, optional. the position of the tool's tab within the toolbox. default: 99 visibilityswitch string, optional. a preference name that controls the visiblity of the tool. default: devtools.{id}.enabled icon string, optional. an url for the icon to show in the toolbox tab. if undefined the label should be defined. highlightedicon string, optional. an url for an icon that is to be used when the tool is high...
Index - Firefox Developer Tools
68 select an element guide, inspector, tools the selected element is the element in the page that the inspector is currently focused on. the selected element is shown in the html pane and its css is displayed in the css pane. 69 selec...
...5 inspect and select colors guide, inspector, tools in the css pane's rules view, if a rule contains a color value, you'll see a sample of the color next to the value: 66 open the inspector guide, inspector, tools there are two main ways to open the inspector: 67 reposition elements in the page starting in firefox 48 you can move absolutely positioned elements by dragging them around the page. 68 select an element guide, inspector, tools the selected element is the element in the page that the inspector is currently focused on. the selected element is shown in the html pane and its css is displayed in the css pane. 69 select and highlight elements the selected element is the element in the page that...
AbstractRange.collapsed - Web APIs
specifications specification status comment domthe definition of 'collapsed' in that specification. ...
... specifications specification status comment domthe definition of 'collapsed' in that specification. ...
AnalyserNode - Web APIs
node works even if the output is not connected. ...
... channel count mode "max" channel count 2 channel interpretation "speakers" inheritance this interface inherits from the following parent interfaces: <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarg...
AnimationEvent - Web APIs
the animationevent interface represents events providing information related to animations. ...
... the animationevent interface represents events providing information related to animations. ...
Attr - Web APIs
Web › API › Attr
the attr interface represents one of a dom element's attributes as an object. in most dom methods, you will directly retrieve the attribute as a string (e.g., element.getattribute()), but certain functions (e.g., element.getattributenode()) or means of iterating return attr types. ...
...thods, you will directly retrieve the attribute as a string (e.g., element.getattribute()), but certain functions (e.g., element.getattributenode()) or means of iterating return attr types. ...
AudioBufferSourceNode - Web APIs
particularly stringent timing accuracy requirements, such as for sounds that must match a specific rhythm and can be kept in memory rather than being played from disk or the network. to play sounds which require accurate timing but must be streamed from the network or played from disk, use a audioworkletnode to implement its playback. ...
...ng played from disk or the network. to play sounds which require accurate timing but must be streamed from the network or played from disk, use a audioworkletnode to implement its playback. ...
AudioContext - Web APIs
dio processing, or decoding. you need to create an audiocontext before you do anything else, as everything happens inside a context. it's recommended to create one audiocontext and reuse it instead of initializing a new one each time, and it's ok to use a single audiocontext for several different audio source and pipeline concurrently. ...
...d to create one audiocontext and reuse it instead of initializing a new one each time, and it's ok to use a single audiocontext for several different audio source and pipeline concurrently. ...
AudioNode - Web APIs
Web › API › AudioNode
onode interface is a generic interface for representing an audio processing module. examples include: an audio source (e.g. an html <audio> or <video> element, an oscillatornode, etc.), the audio destination, intermediate processing module (e.g. ...
...video> element, an oscillatornode, etc.), the audio destination, intermediate processing module (e.g. ...
BaseAudioContext - Web APIs
finition for online and offline audio-processing graphs, as represented by audiocontext and offlineaudiocontext respectively. you wouldn't use baseaudiocontext directly — you'd use its features via one of these two inheriting interfaces. a baseaudiocontext can be a target of events, therefore it implements the eventtarget interface. ...
...udiocontext directly — you'd use its features via one of these two inheriting interfaces. a baseaudiocontext can be a target of events, therefore it implements the eventtarget interface. ...
BeforeInstallPromptEvent - Web APIs
the beforeinstallpromptevent is fired at the window.onbeforeinstallprompt handler before a user is prompted to "install" a web site to a home screen on mobile. this interface inherits from the event interface. ...
...mptevent is fired at the window.onbeforeinstallprompt handler before a user is prompted to "install" a web site to a home screen on mobile. this interface inherits from the event interface. ...
BeforeUnloadEvent - Web APIs
roperty, a dialog box appears, asking the users for confirmation to leave the page (see example below). when no value is provided, the event is processed silently. some implementations only show the dialog box if the frame or any embedded frame receives a user gesture or user interaction. see browser compatibility for more information. ...
...he event is processed silently. some implementations only show the dialog box if the frame or any embedded frame receives a user gesture or user interaction. see browser compatibility for more information. ...
BluetoothDevice - Web APIs
the bluetoothdevice interface of the web bluetooth api represents a bluetooth device inside a particular script execution environment. ...
... the bluetoothdevice interface of the web bluetooth api represents a bluetooth device inside a particular script execution environment. ...
BroadcastChannel - Web APIs
at any browsing context of a given origin can subscribe to. it allows communication between different documents (in different windows, tabs, frames or iframes) of the same origin. messages are broadcasted via a message event fired at all broadcastchannel objects listening to the channel. note: this feature is available in web workers. ...
...or iframes) of the same origin. messages are broadcasted via a message event fired at all broadcastchannel objects listening to the channel. note: this feature is available in web workers. ...
CDATASection - Web APIs
mple: <foo>here is a cdata section: <![cdata[ < > & ]]> with all kinds of unescaped text.</foo> the only sequence which is not allowed within a cdata section is the closing sequence of a cdata section itself, ]]>: <![cdata[ ]]> will cause an error ]]> note that cdata sections should not be used within html; they only work in xml. ...
...lowed within a cdata section is the closing sequence of a cdata section itself, ]]>: <![cdata[ ]]> will cause an error ]]> note that cdata sections should not be used within html; they only work in xml. ...
CSSCounterStyleRule - Web APIs
the csscounterstylerule interface represents an @counter-style at-rule. ...
... the csscounterstylerule interface represents an @counter-style at-rule. ...
CSSPrimitiveValue - Web APIs
to a centimeter value.) percentage values can't be converted since they are relative to the parent value (or another property value). there is one exception for color percentage values: since a color percentage value is relative to the range 0-255, a color percentage value can be converted to a number (see also the rgbcolor interface). ...
...xception for color percentage values: since a color percentage value is relative to the range 0-255, a color percentage value can be converted to a number (see also the rgbcolor interface). ...
CSSValueList - Web APIs
interface and provides the abstraction of an ordered collection of css values. some properties allow an empty list in their syntax. in that case, these properties take the none identifier. so, an empty list means that the property has the value none. the items in the cssvaluelist are accessible via an integral index, starting from 0. ...
...hese properties take the none identifier. so, an empty list means that the property has the value none. the items in the cssvaluelist are accessible via an integral index, starting from 0. ...
CSS Object Model (CSSOM) - Web APIs
the css object model is a set of apis allowing the manipulation of css from javascript. it is much like the dom, but for the css rather than the html. it allows users to read and modify css style dynamically. ...
... extended by the cssom-related specifications: document, window, element, htmlelement, htmlimageelement, range, mouseevent, and svgelement. ...
Using the CSS Typed Object Model - Web APIs
h> or <percent>, the cssunitvalue unit would have been px or percent respectively. there are other types available: an <image> will return a cssimagevalue. a <color> would return a cssstylevalue. a transform returns a csstransformvalue. a custom property returns a cssunparsedvalue. you can use a cssunitvalue or csskeywordvalue to create other objects. ...
...there are other types available: an <image> will return a cssimagevalue. a <color> would return a cssstylevalue. a transform returns a csstransformvalue. a custom property returns a cssunparsedvalue. you can use a cssunitvalue or csskeywordvalue to create other objects. for example, the parameters for a csspositionvalue is one to two cssunitvalues or csskeywordvalues, or one of each: let position = new csspositionvalue( new csskeywordvalue("center"), new cssunitvalue(10, "px")); cssstylevalue the cssstylevalue interface of the the css typed object model api is the base class of all css values accessible through the typed om api, including cssimagevalue, csskeywordvalue, cssnumericvalue, csspositionvalue, csstransformvalue, and cssunparsedvalue. it has two methods: cssstyleva...
CanvasRenderingContext2D.putImageData() - Web APIs
timagedata() method. you can find more information about putimagedata() and general manipulation of canvas contents in the article pixel manipulation with canvas. syntax void ctx.putimagedata(imagedata, dx, dy); void ctx.putimagedata(imagedata, dx, dy, dirtyx, dirtyy, dirtywidth, dirtyheight); parameters imagedata an imagedata object containing the array of pixel values. ...
... of canvas contents in the article pixel manipulation with canvas. syntax void ctx.putimagedata(imagedata, dx, dy); void ctx.putimagedata(imagedata, dx, dy, dirtyx, dirtyy, dirtywidth, dirtyheight); parameters imagedata an imagedata object containing the array of pixel values. dx horizontal position (x coordinate) at which to place the image data in the destination canvas. dy vertical position (y coordinate) at which to place the image data in the destination canvas. dirtyx optional horizontal position (x coordinate) of the top-left corner from which the image data will be extracted. defaults to 0. dirtyy optional vertical position (y coordinate) of the top-left corner from which the image data will be extracted. defaults to 0. dirtywidth optional width of the rectangle to be pai...
Advanced animations - Web APIs
} }; ball.draw(); nothing special here, the ball is actually a simple circle and gets drawn with the help of the arc() method. adding velocity now that we have a ball, we are ready to add a basic animation like we have learned in the last chapter of this tutorial. again, window.requestanimationframe() helps us to control the animation. the ball gets moving by adding a velocity vector to the position. for each frame, we also clear the canvas to remove old circles from prior frames. var canvas = document.getelementbyid('canvas'); var ctx = canvas.getcontext('2d'); var raf; var ball = { x: 100, y: 100, vx: 5, vy: 2, radius: 25, color: 'blue', draw: function() { ctx.beginpath(); ctx.arc(this.x, this.y, this.radius, 0, math.pi * 2, true); ctx.closepath(); ctx.fills...
...; ball.y += ball.vy; raf = window.requestanimationframe(draw); } canvas.addeventlistener('mouseover', function(e) { raf = window.requestanimationframe(draw); }); canvas.addeventlistener('mouseout', function(e) { window.cancelanimationframe(raf); }); ball.draw(); boundaries without any boundary collision testing our ball runs out of the canvas quickly. we need to check if the x and y position of the ball is out of the canvas dimensions and invert the direction of the velocity vectors. to do so, we add the following checks to the draw method: if (ball.y + ball.vy > canvas.height || ball.y + ball.vy < 0) { ball.vy = -ball.vy; } if (ball.x + ball.vx > canvas.width || ball.x + ball.vx < 0) { ball.vx = -ball.vx; } first demo let's see how it looks in action so far. move your mouse i...
Pixel manipulation with canvas - Web APIs
he coordinates are specified in canvas coordinate space units. note: any pixels outside the canvas are returned as transparent black in the resulting imagedata object. this method is also demonstrated in the article manipulating video using canvas. a color picker in this example we are using the getimagedata() method to display the color under the mouse cursor. for this, we need the current position of the mouse with layerx and layery, then we look up the pixel data on that position in the pixel array that getimagedata() provides us. finally, we use the array data to set a background color and a text in the <div> to display the color. <canvas id="canvas" width="300" height="227" style="float:left"></canvas> <div id="color" style="width:200px;height:50px;float:left"></div> var img = new ...
...document.getelementbyid('invertbtn'); invertbtn.addeventlistener('click', invert); var grayscalebtn = document.getelementbyid('grayscalebtn'); grayscalebtn.addeventlistener('click', grayscale); } zooming and anti-aliasing with the help of the drawimage() method, a second canvas and the imagesmoothingenabled property, we are able to zoom into our picture and see the details. we get the position of the mouse and crop an image of 5 pixels left and above to 5 pixels right and below. then we copy that one over to another canvas and resize the image to the size we want it to. in the zoom canvas we resize a 10×10 pixel crop of the original canvas to 200×200. zoomctx.drawimage(canvas, math.min(math.max(0, x - 5), img.width - 10), math.min(math.max(0, y - ...
Using images - Web APIs
lace scaled images on the canvas. drawimage(image, x, y, width, height) this adds the width and height parameters, which indicate the size to which to scale the image when drawing it onto the canvas. example: tiling an image in this example, we'll use an image as a wallpaper and repeat it several times on the canvas. this is done simply by looping and placing the scaled images at different positions. in the code below, the first for loop iterates over the rows. the second for loop iterates over the columns. the image is scaled to one third of its original size, which is 50x38 pixels. note: images can become blurry when scaling up or grainy if they're scaled down too much. scaling is probably best not done if you've got some text in it which needs to remain legible. <html> <body onload...
...dx, dy) and scaling it to the size specified by dwidth and dheight. to really understand what this does, it may help to look at the image to the right. the first four parameters define the location and size of the slice on the source image. the last four parameters define the rectangle into which to draw the image on the destination canvas. slicing can be a useful tool when you want to make compositions. you could have all elements in a single image file and use this method to composite a complete drawing. for instance, if you want to make a chart you could have a png image containing all the necessary text in a single file and depending on your data could change the scale of your chart fairly easily. another advantage is that you don't need to load every image individually, which can improve l...
CharacterData - Web APIs
the characterdata abstract interface represents a node object that contains characters. this is an abstract interface, meaning there aren't any object of type characterdata: it is implemented by other interfaces, like text, comment, or processinginstruction which aren't abstract. ...
...s is an abstract interface, meaning there aren't any object of type characterdata: it is implemented by other interfaces, like text, comment, or processinginstruction which aren't abstract. ...
Comment - Web APIs
Web › API › Comment
the comment interface represents textual notations within markup; although it is generally not visually shown, such comments are available to be read in the source view. comments are represented in html and xml as content between '<!--' and '-->'. in xml, the character sequence '--' cannot be used within a comment. ...
...e available to be read in the source view. comments are represented in html and xml as content between '<!--' and '-->'. in xml, the character sequence '--' cannot be used within a comment. ...
CustomElementRegistry.define() - Web APIs
imgurl; if(this.hasattribute('img')) { imgurl = this.getattribute('img'); } else { imgurl = 'img/default.png'; } var img = document.createelement('img'); img.src = imgurl; icon.appendchild(img); // create some css to apply to the shadow dom var style = document.createelement('style'); style.textcontent = '.wrapper {' + 'position: relative;' + '}' + '.info {' + 'font-size: 0.8rem;' + 'width: 200px;' + 'display: inline-block;' + 'border: 1px solid black;' + 'padding: 10px;' + 'background: white;' + ...
...200px;' + 'display: inline-block;' + 'border: 1px solid black;' + 'padding: 10px;' + 'background: white;' + 'border-radius: 10px;' + 'opacity: 0;' + 'transition: 0.6s all;' + 'position: absolute;' + 'bottom: 20px;' + 'left: 10px;' + 'z-index: 3;' + '}' + 'img {' + 'width: 1.2rem' + '}' + '.icon:hover + .info, .icon:focus + .info {' + 'o...
DOMMatrixReadOnly.scale() - Web APIs
4 3d matrix. note: at time of writing, firefox still supports an older version of the specification that accepts either one or three values. dommatrix.scale(scale[, originx][, originy]) we'll show an example of how you can deal with the cross-browser support implications of this in the examples section, below. examples this svg contains three squares, one red, one blue, and one green, each positioned at the document origin: <svg width="250" height="250" viewbox="0 0 25 25"> <rect width="25" height="25" fill="red" /> <rect id="transformed" width="25" height="25" fill="blue" /> <rect id="transformedorigin" width="25" height="25" fill="green" /> </svg> this javascript first creates an identity matrix, then uses the scale() method to create a new matrix with a single parameter. we tes...
...d observing it's is2d property — if this is false then the third parameter has been accepted by the browser as a scalez parameter, making this a 3d matrix. we then create a new matrix scaled about a given origin, using either three or six parameters depending on the browser support. these new matrices are then applied to the blue and green squares as a transform, changing their dimensions and position. the red square is left in place. const matrix = new dommatrixreadonly(); const scaledmatrix = 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) { scaledmatrixwithor...
DOMRect - Web APIs
Web › API › DOMRect
rectangle. the type of box represented by the domrect is specified by the method or property that returned it. for example, vreyeparameters.renderrect from the defunct webvr api specified the viewport of a canvas into which visuals for one eye of a head mounted display should be rendered. it inherits from its parent, domrectreadonly. ...
...ect from the defunct webvr api specified the viewport of a canvas into which visuals for one eye of a head mounted display should be rendered. it inherits from its parent, domrectreadonly. ...
Document: scroll event - Web APIs
ottle the event using requestanimationframe(), settimeout(), or a customevent, as follows. note, however, that input events and animation frames are fired at about the same rate, and therefore the optimization below is often unnecessary. this example optimizes thescroll event for requestanimationframe. ...
..., that input events and animation frames are fired at about the same rate, and therefore the optimization below is often unnecessary. this example optimizes thescroll event for requestanimationframe. // reference: http://www.html5rocks.com/en/tutorials/speed/animations/ let last_known_scroll_position = 0; let ticking = false; function dosomething(scroll_pos) { // do something with the scroll position } window.addeventlistener('scroll', function(e) { last_known_scroll_position = window.scrolly; if (!ticking) { window.requestanimationframe(function() { dosomething(last_known_scroll_position); ticking = false; }); ticking = true; } }); see more, similar examples on the resize event page. specifications specification status css object model...
DocumentFragment - Web APIs
t that stores a segment of a document structure comprised of nodes just like a standard document. the key difference is due to the fact that the document fragment isn't part of the active document tree structure. changes made to the fragment don't affect the document (even on reflow) or incur any performance impact when changes are made. ...
...ument fragment isn't part of the active document tree structure. changes made to the fragment don't affect the document (even on reflow) or incur any performance impact when changes are made. ...
DocumentOrShadowRoot - Web APIs
read only returns the element set as the target for mouse events while the pointer is locked. it returns null if lock is pending, the pointer is unlocked, or if the target is in another document. documentorshadowroot.stylesheetsread only returns a stylesheetlist of cssstylesheet objects for stylesheets explicitly linked into, or embedded in a document. methods documentorshadowroot.caretpositionfrompoint() returns a caretposition object containing the dom node containing the caret, and caret's character offset within that node. documentorshadowroot.elementfrompoint() returns the topmost element at the specified coordinates. documentorshadowroot.elementsfrompoint() returns an array of all elements at the specified coordinates. documentorshadowroot.getselection() returns a selection...
...ng the caret, and caret's character offset within that node. documentorshadowroot.elementfrompoint() returns the topmost element at the specified coordinates. documentorshadowroot.elementsfrompoint() returns an array of all elements at the specified coordinates. documentorshadowroot.getselection() returns a selection object representing the range of text selected by the user, or the current position of the caret. documentorshadowroot.nodefrompoint() returns the topmost node at the specified coordinates. documentorshadowroot.nodesfrompoint() returns an array of all nodes at the specified coordinates. specifications specification status comment shadow domthe definition of 'documentorshadowroot' in that specification. obsolete implementation in shado...
DocumentType - Web APIs
the documenttype interface represents a node containing a doctype. ...
... the documenttype interface represents a node containing a doctype. ...
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. syntax domrect = element.getboundingclientrect(); value the returned value is a domrect object which is the union of the rectangles returned by getclientrects() for the element, i.e., the css border-boxes associated with the element. ...
... and where the top and left are the top-left of the border-box for the first css box (in content order) for the element. the amount of scrolling that has been done of the viewport area (or any other scrollable element) is taken into account when computing the bounding rectangle. this means that the rectangle's boundary edges (top, right, bottom, left) change their values every time the scrolling position changes (because their values are relative to the viewport and not absolute). if you need the bounding rectangle relative to the top-left corner of the document, just add the current scrolling position to the top and left properties (these can be obtained using window.scrollx and window.scrolly) to get a bounding rectangle which is independent from the current scrolling position. cross-browser ...
Element.getClientRects() - Web APIs
td> elements for the third example. strong { text-align: center; } div { display: inline-block; width: 150px; } div p, ol, table { border: 1px solid blue; } span, li, th, td { border: 1px solid green; } javascript the javascript code draws the client rects for all html elements that have css class withclientrectsoverlay assigned. ...
...ectsoverlay(elt) { /* absolutely position a div over each client rect so that its border width is the same as the rectangle's width. note: the overlays will be out of place if the user resizes or zooms. ...
Element.insertAdjacentHTML() - Web APIs
the insertadjacenthtml() method of the element interface parses the specified text as html or xml and inserts the resulting nodes into the dom tree at a specified position. it does not reparse the element it is being used on, and thus it does not corrupt the existing elements inside that element. this avoids the extra step of serialization, making it much faster than direct innerhtml manipulation. syntax element.insertadjacenthtml(position, text); parameters position a domstring representing the position relative to the element; must be one of the following strings: 'beforebegin': before the element itself. 'afterbegin': just inside the element, before its first child. 'beforeend': just inside the element, after its last child. 'afterend': after the element itself. text the...
... representing the position relative to the element; must be one of the following strings: 'beforebegin': before the element itself. 'afterbegin': just inside the element, before its first child. 'beforeend': just inside the element, after its last child. 'afterend': after the element itself. text the string to be parsed as html or xml and inserted into the tree. visualization of position names <!-- beforebegin --> <p> <!-- afterbegin --> foo <!-- beforeend --> </p> <!-- afterend --> note: the beforebegin and afterend positions work only if the node is in the dom tree and has a parent element. example // <div id="one">one</div> var d1 = document.getelementbyid('one'); d1.insertadjacenthtml('afterend', '<div id="two">two</div>'); // at this point, the new structure is: ...
Element.insertAdjacentText() - Web APIs
the insertadjacenttext() method of the element interface inserts a given text node at a given position relative to the element it is invoked upon. syntax element.insertadjacenttext(position, element); parameters position a domstring representing the position relative to the element; must be one of the following strings: 'beforebegin': before the element itself. 'afterbegin': just inside the element, before its first child. 'beforeend': just inside the element, after its last child. 'afterend': after the element itself. element a domstring representing the text to be inserted into the tree. return value void. ...
...trings: 'beforebegin': before the element itself. 'afterbegin': just inside the element, before its first child. 'beforeend': just inside the element, after its last child. 'afterend': after the element itself. element a domstring representing the text to be inserted into the tree. return value void. exceptions exception explanation syntaxerror the position specified is not a recognised value. visualization of position names <!-- beforebegin --> <p> <!-- afterbegin --> foo <!-- beforeend --> </p> <!-- afterend --> note: the beforebegin and afterend positions work only if the node is in a tree and has an element parent. example beforebtn.addeventlistener('click', function() { para.insertadjacenttext('afterbegin',textinput.value); }...
Element: scroll event - Web APIs
ottle the event using requestanimationframe(), settimeout(), or a customevent, as follows. note, however, that input events and animation frames are fired at about the same rate, and therefore the optimization below is often unnecessary. this example optimizes thescroll event for requestanimationframe. ...
..., that input events and animation frames are fired at about the same rate, and therefore the optimization below is often unnecessary. this example optimizes thescroll event for requestanimationframe. // reference: http://www.html5rocks.com/en/tutorials/speed/animations/ let last_known_scroll_position = 0; let ticking = false; function dosomething(scroll_pos) { // do something with the scroll position } window.addeventlistener('scroll', function(e) { last_known_scroll_position = window.scrolly; if (!ticking) { window.requestanimationframe(function() { dosomething(last_known_scroll_position); ticking = false; }); ticking = true; } }); note: you can find more examples on the resize event page. specifications specification status css obje...
ErrorEvent - Web APIs
the errorevent interface represents events providing information related to errors in scripts or in files. ...
... the errorevent interface represents events providing information related to errors in scripts or in files. ...
EventTarget - Web APIs
e listeners for them. element, document, and window are the most common event targets, but other objects can be event targets, too. for example xmlhttprequest, audionode, audiocontext, and others. many event targets (including elements, documents, and windows) also support setting event handlers via onevent properties and attributes. ...
...httprequest, audionode, audiocontext, and others. many event targets (including elements, documents, and windows) also support setting event handlers via onevent properties and attributes. ...
ExtendableEvent - Web APIs
vent handler, the browser should throw an invalidstateerror; note also that multiple calls will stack up, and the resulting promises will be added to the list of extend lifetime promises. note: the behaviour described in the above paragraph was fixed in firefox 43 (see bug 1180274.) this interface inherits from the event interface. ...
...to the list of extend lifetime promises. note: the behaviour described in the above paragraph was fixed in firefox 43 (see bug 1180274.) this interface inherits from the event interface. ...
File - Web APIs
Web › API › File
mozgetasfile() api on an htmlcanvaselement. a file object is a specific kind of a blob, and can be used in any context that a blob can. in particular, filereader, url.createobjecturl(), createimagebitmap(), and xmlhttprequest.send() accept both blobs and files. see using files from web applications for more information and examples. ...
...lar, filereader, url.createobjecturl(), createimagebitmap(), and xmlhttprequest.send() accept both blobs and files. see using files from web applications for more information and examples. ...
FocusEvent - Web APIs
the focusevent interface represents focus-related events, including focus, blur, focusin, and focusout. ...
... the focusevent interface represents focus-related events, including focus, blur, focusin, and focusout. ...
Gamepad - Web APIs
Web › API › Gamepad
properties gamepad.axes read only an array representing the controls with axes present on the device (e.g. analog thumb sticks). gamepad.buttons read only an array of gamepadbutton objects representing the buttons present on the device. ...
... properties gamepad.axes read only an array representing the controls with axes present on the device (e.g. analog thumb sticks). gamepad.buttons read only an array of gamepadbutton objects representing the buttons present on the device. ...
Using the Gamepad API - Web APIs
as the triggers on many modern gamepads. the values are normalized to the range 0.0..1.0, with 0.0 representing a button that is not pressed, and 1.0 representing a button that is fully pressed. axes: an array representing the controls with axes present on the device (e.g. analog thumb sticks). each entry in the array is a floating point value in the range -1.0 - 1.0, representing the axis position from the lowest value (-1.0) to the highest value (1.0). timestamp: this returns a domhighrestimestamp representing the last time the data for this gamepad was updated, allowing developers to determine if the axes and button data have been updated from the hardware. the value must be relative to the navigationstart attribute of the performancetiming interface. values are monotonically increasing...
...ball around the screen using the four gamepad buttons on the right hand side of the gamepad. you can view the demo live, and find the source code on github. to start with, we declare some variables: the gamepadinfo paragraph that the connection info is written into, the ball that we want to move, the start variable that acts as the id for requestanimation frame, the a and b variables that act as position modifiers for moving the ball, and the shorthand variables that will be used for the requestanimationframe() and cancelanimationframe() cross browser forks. var gamepadinfo = document.getelementbyid("gamepad-info"); var ball = document.getelementbyid("ball"); var start; var a = 0; var b = 0; next we use the gamepadconnected event to check for a gamepad being connected. when one is connected, w...
Geolocation.clearWatch() - Web APIs
the geolocation.clearwatch() method is used to unregister location/error monitoring handlers previously installed using geolocation.watchposition(). syntax navigator.geolocation.clearwatch(id); parameters id the id number returned by the geolocation.watchposition() method when installing the handler you wish to remove. example var id, target, option; function success(pos) { var crd = pos.coords; if (target.latitude === crd.latitude && target.longitude === crd.longitude) { console.log('congratulation, you reach the target'); navigator.geolocation.clearwatch(id); } }; function error(err) { console.warn('error(' + err.code + '): ' + err.message); }; target = { latitude : 0, longitude: 0, } options = { enablehighaccuracy: false, timeout: 5000, maximumage: 0 ...
... ...
Geolocation - Web APIs
the geolocation interface represents an object able to programmatically obtain the position of the device. it gives web content access to the location of the device. this allows a web site or app to offer customized results based on the user's location. an object with this interface is obtained using the navigator.geolocation property implemented by the navigator object. note: for security reasons, when a web page tries to access location information, the user is notified and asked to grant permission. be aware that each browser has its own policies and methods for requesting this permission. properties the geolocation interface neither implements, nor inherits any property. ...
...te: for security reasons, when a web page tries to access location information, the user is notified and asked to grant permission. be aware that each browser has its own policies and methods for requesting this permission. properties the geolocation interface neither implements, nor inherits any property. methods the geolocation interface doesn't inherit any method. geolocation.getcurrentposition() secure context determines the device's current location and gives back a geolocationposition object with the data. geolocation.watchposition() secure context returns a long value representing the newly established callback function to be invoked whenever the device location changes. geolocation.clearwatch() secure context removes the particular handler previously installed using watchposit...
GlobalEventHandlers.onanimationcancel - Web APIs
first is the box itself, with all its properties, including animation, defined. we go ahead and describe the animation i...
...tyles for the box that we're animating. first is the box itself, with all its properties, including animation, defined. we go ahead and describe the animation in-place here because the animation is intended to begin as soon as the page loads, rather than based on an event. #box { width: var(--boxwidth); height: var(--boxwidth); left: 0; top: 0; border: 1px solid #7788ff; margin: 0; position: relative; background-color: #2233ff; display: flex; justify-content: center; animation: 5s ease-in-out 0s infinite alternate both slidebox; } the animation's keyframes are described next, plotting a course from the top-left corner of the content box to the bottom-right corner. @keyframes slidebox { from { left:0; top:0; } to { left:calc(100% - var(--boxwidth)); t...
GlobalEventHandlers.ondblclick - Web APIs
ctionref is a function name or a function expression. the function receives a mouseevent object as its sole argument. within the function, this will be the element upon which the event was triggered. only one ondblclick handler can be assigned to an object at a time. you may prefer to use the eventtarget.addeventlistener() method instead, since it's more flexible. ...
...ed to an object at a time. you may prefer to use the eventtarget.addeventlistener() method instead, since it's more flexible. example this example logs the position of double clicks. html <p>double click anywhere in this example.</p> <p id="log"></p> javascript let log = document.getelementbyid('log'); document.ondblclick = logdoubleclick; function logdoubleclick(e) { log.textcontent = `position: (${e.clientx}, ${e.clienty})`; } result specifications specification status comment html living standardthe definition of 'ondblclick' in that specification. living standard ...
GlobalEventHandlers.onmouseup - Web APIs
n name or a function expression. the function receives a mouseevent object as its sole argument. example in this example, a piece of "toast" hides when you click down with the mouse, and reappears when you release. it uses the onmousedown and onmouseup event handlers. ...
...ppears when you release. it uses the onmousedown and onmouseup event handlers. ...
GlobalEventHandlers.onscroll - Web APIs
value functionref a function name, or a function expression. the function receives a uievent object as its sole argument. only one onscroll handler can be assigned to an object at a time. for greater flexibility, you can pass a scroll event to the eventtarget.addeventlistener() method instead. ...
...<textarea>, and logs the element's vertical scroll position accordingly. html <textarea>1 2 3 4 5 6 7 8 9</textarea> <p id="log"></p> css textarea { width: 4rem; height: 8rem; font-size: 3rem; } javascript const textarea = document.queryselector('textarea'); const log = document.getelementbyid('log'); textarea.onscroll = logscroll; function logscroll(e) { log.textcontent = `scroll position: ${e.target.scrolltop}`; } result specifications specification status comment html living standardthe definition of 'onscroll' in that specification. living standard document object model (dom) level 3 events specificationthe definition of 'onscroll' in that specification. obsolete initial definition ...
HTMLAudioElement - Web APIs
the htmlaudioelement interface provides access to the properties of <audio> elements, as well as methods to manipulate them. it's based on, and inherits properties and methods from, the htmlmediaelement interface. ...
...audioelement interface provides access to the properties of <audio> elements, as well as methods to manipulate them. it's based on, and inherits properties and methods from, the htmlmediaelement interface. ...
HTMLBRElement - Web APIs
the htmlbrelement interface represents a html line break element (<br>). it inherits from htmlelement. ...
... the htmlbrelement interface represents a html line break element (<br>). it inherits from htmlelement. ...
HTMLBaseElement - Web APIs
the htmlbaseelement interface contains the base uri for a document. this object inherits all of the properties and methods as described in the htmlelement interface. ...
... the htmlbaseelement interface contains the base uri for a document. this object inherits all of the properties and methods as described in the htmlelement interface. ...
HTMLBodyElement - Web APIs
the htmlbodyelement interface provides special properties (beyond those inherited from the regular htmlelement interface) for manipulating <body> elements. ...
... the htmlbodyelement interface provides special properties (beyond those inherited from the regular htmlelement interface) for manipulating <body> elements. ...
HTMLCanvasElement - Web APIs
the htmlcanvaselement interface provides properties and methods for manipulating the layout and presentation of <canvas> elements. the htmlcanvaselement interface also inherits the properties and methods of the htmlelement interface. ...
...ace provides properties and methods for manipulating the layout and presentation of <canvas> elements. the htmlcanvaselement interface also inherits the properties and methods of the htmlelement interface. ...
HTMLCollection.item - Web APIs
elements appear in an htmlcollection in the same order in which they appear in the document's source. ...
...elements appear in an htmlcollection in the same order in which they appear in the document's source. ...
HTMLDListElement - Web APIs
the htmldlistelement interface provides special properties (beyond those of the regular htmlelement interface it also has available to it by inheritance) for manipulating definition list (<dl>) elements. ...
... the htmldlistelement interface provides special properties (beyond those of the regular htmlelement interface it also has available to it by inheritance) for manipulating definition list (<dl>) elements. ...
HTMLDataElement - Web APIs
the htmldataelement interface provides special properties (beyond the regular htmlelement interface it also has available to it by inheritance) for manipulating <data> elements. ...
... the htmldataelement interface provides special properties (beyond the regular htmlelement interface it also has available to it by inheritance) for manipulating <data> elements. ...
HTMLDataListElement - Web APIs
the htmldatalistelement interface provides special properties (beyond the htmlelement object interface it also has available to it by inheritance) to manipulate <datalist> elements and their content. ...
... the htmldatalistelement interface provides special properties (beyond the htmlelement object interface it also has available to it by inheritance) to manipulate <datalist> elements and their content. ...
HTMLDetailsElement - Web APIs
the htmldetailselement interface provides special properties (beyond the regular htmlelement interface it also has available to it by inheritance) for manipulating <details> elements. ...
... the htmldetailselement interface provides special properties (beyond the regular htmlelement interface it also has available to it by inheritance) for manipulating <details> elements. ...
HTMLDialogElement - Web APIs
the htmldialogelement interface provides methods to manipulate <dialog> elements. it inherits properties and methods from the htmlelement interface. ...
... the htmldialogelement interface provides methods to manipulate <dialog> elements. it inherits properties and methods from the htmlelement interface. ...
HTMLDivElement - Web APIs
the htmldivelement interface provides special properties (beyond the regular htmlelement interface it also has available to it by inheritance) for manipulating <div> elements. ...
... the htmldivelement interface provides special properties (beyond the regular htmlelement interface it also has available to it by inheritance) for manipulating <div> elements. ...
HTMLDocument - Web APIs
the htmldocument interface, which may be accessed through the window.htmldocument property, extends the window.htmldocument property to include methods and properties that are specific to html documents. ...
...nt interface, which may be accessed through the window.htmldocument property, extends the window.htmldocument property to include methods and properties that are specific to html documents. ...
HTMLEmbedElement - Web APIs
the htmlembedelement interface provides special properties (beyond the regular htmlelement interface it also has available to it by inheritance) for manipulating <embed> elements. this topic describes the htmlembedelement interface as defined in the standard. it does not address earlier, non-standardized version of the interface. ...
...by inheritance) for manipulating <embed> elements. this topic describes the htmlembedelement interface as defined in the standard. it does not address earlier, non-standardized version of the interface. ...
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. ...
... 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. ...
HTMLFormControlsCollection - Web APIs
the htmlformcontrolscollection interface represents a collection of html form control elements. it represents the lists returned by the htmlformelement interface's elements property and the htmlfieldsetelement interface's elements property. this interface replaces one method from htmlcollection, on which it is based. ...
...y the htmlformelement interface's elements property and the htmlfieldsetelement interface's elements property. this interface replaces one method from htmlcollection, on which it is based. ...
HTMLFormElement - Web APIs
the htmlformelement interface represents a <form> element in the dom. it allows access to—and, in some cases, modification of—aspects of the form, as well as access to its component elements. ...
... the htmlformelement interface represents a <form> element in the dom. it allows access to—and, in some cases, modification of—aspects of the form, as well as access to its component elements. ...
HTMLHRElement - Web APIs
the htmlhrelement interface provides special properties (beyond those of the htmlelement interface it also has available to it by inheritance) for manipulating <hr> elements. ...
... the htmlhrelement interface provides special properties (beyond those of the htmlelement interface it also has available to it by inheritance) for manipulating <hr> elements. ...
HTMLHeadElement - Web APIs
the htmlheadelement interface contains the descriptive information, or metadata, for a document. this object inherits all of the properties and methods described in the htmlelement interface. ...
... the htmlheadelement interface contains the descriptive information, or metadata, for a document. this object inherits all of the properties and methods described in the htmlelement interface. ...
HTMLHeadingElement - Web APIs
the htmlheadingelement interface represents the different heading elements, <h1> through <h6>. it inherits methods and properties from the htmlelement interface. ...
... the htmlheadingelement interface represents the different heading elements, <h1> through <h6>. it inherits methods and properties from the htmlelement interface. ...
HTMLHtmlElement - Web APIs
the htmlhtmlelement interface serves as the root node for a given html document. this object inherits the properties and methods described in the htmlelement interface. you can retrieve the htmlhtmlelement object for a given document by reading the value of the document.documentelement property. ...
... inherits the properties and methods described in the htmlelement interface. you can retrieve the htmlhtmlelement object for a given document by reading the value of the document.documentelement property. ...
HTMLIFrameElement - Web APIs
the htmliframeelement interface provides special properties and methods (beyond those of the htmlelement interface it also has available to it by inheritance) for manipulating the layout and presentation of inline frame elements. ...
...terface provides special properties and methods (beyond those of the htmlelement interface it also has available to it by inheritance) for manipulating the layout and presentation of inline frame elements. ...
HTMLImageElement - Web APIs
the htmlimageelement interface represents an html <img> element, providing the properties and methods used to manipulate image elements. ...
... the htmlimageelement interface represents an html <img> element, providing the properties and methods used to manipulate image elements. ...
HTMLLabelElement - Web APIs
the htmllabelelement interface gives access to properties specific to <label> elements. it inherits methods and properties from the base htmlelement interface. ...
... the htmllabelelement interface gives access to properties specific to <label> elements. it inherits methods and properties from the base htmlelement interface. ...
HTMLLegendElement - Web APIs
the htmllegendelement is an interface allowing to access properties of the <legend> elements. it inherits properties and methods from the htmlelement interface. ...
... the htmllegendelement is an interface allowing to access properties of the <legend> elements. it inherits properties and methods from the htmlelement interface. ...
HTMLLinkElement - Web APIs
llinkelement interface represents reference information for external resources and the relationship of those resources to a document and vice-versa (corresponds to <link> element; not to be confused with <a>, which is represented by htmlanchorelement). this object inherits all of the properties and methods of the htmlelement interface. ...
... and vice-versa (corresponds to <link> element; not to be confused with <a>, which is represented by htmlanchorelement). this object inherits all of the properties and methods of the htmlelement interface. ...
HTMLMapElement - Web APIs
the htmlmapelement interface provides special properties and methods (beyond those of the regular object htmlelement interface it also has available to it by inheritance) for manipulating the layout and presentation of map elements. ...
...e provides special properties and methods (beyond those of the regular object htmlelement interface it also has available to it by inheritance) for manipulating the layout and presentation of map elements. ...
HTMLMediaElement.onencrypted - Web APIs
the onencrypted property of the htmlmediaelement is an event handler, fired whenever an encrypted event occurs, denoting the media is encrypted. this interface inherits from the extendableevent interface. ...
... property of the htmlmediaelement is an event handler, fired whenever an encrypted event occurs, denoting the media is encrypted. this interface inherits from the extendableevent interface. ...
HTMLMediaElement.onwaitingforkey - Web APIs
the onwaitingforkey property of the htmlmediaelement is an event handler, fired when a waitingforkey event occurs, when playback is blocked while waiting for an encryption key. this interface inherits from the extendableevent interface. ...
...ment is an event handler, fired when a waitingforkey event occurs, when playback is blocked while waiting for an encryption key. this interface inherits from the extendableevent interface. ...
HTMLMediaElement.readyState - Web APIs
. possible values are: constant value description have_nothing 0 no information is available about the media resource. have_metadata 1 enough of the media resource has been retrieved that the metadata attributes are initialized. seeking will no longer raise an exception. have_current_data 2 data is available for the current playback position, but not enough to actually play more than one frame. have_future_data 3 data for the current playback position as well as for at least a little bit of time into the future is available (in other words, at least two frames of video, for example). have_enough_data 4 enough data is available—and the download rate is high enough—that the media can be played through ...
...future is available (in other words, at least two frames of video, for example). have_enough_data 4 enough data is available—and the download rate is high enough—that the media can be played through to the end without interruption. examples this example will listen for audio data to be loaded for the element `example`. it will then check if at least the current playback position has been loaded. if it has, the audio will play. <audio id="example" preload="auto"> <source src="sound.ogg" type="audio/ogg" /> </audio> var obj = document.getelementbyid('example'); obj.addeventlistener('loadeddata', function() { if(obj.readystate >= 2) { obj.play(); } }); specifications specification status comment html living standardthe definition...
HTMLMediaElement: seeked event - Web APIs
the seeked event is fired when a seek operation completed, the current playback position has changed, and the boolean seeking attribute is changed to false. bubbles no cancelable no interface event target element default action none event handler property globaleventhandlers.onseeked specification html5 media examples these examples add an event listener for the htmlmediaelement's seeked event, then post a message when that event handler has reacted to the event firing. ...
...lobaleventhandlers.onseeked specification html5 media examples these examples add an event listener for the htmlmediaelement's seeked event, then post a message when that event handler has reacted to the event firing. using addeventlistener(): const video = document.queryselector('video'); video.addeventlistener('seeked', (event) => { console.log('video found the playback position it was looking for.'); }); using the onseeked event handler property: const video = document.queryselector('video'); video.onseeked = (event) => { console.log('video found the playback position it was looking for.'); }; specifications specification status html living standardthe definition of 'seeked media event' in that specification. living standard html5...
HTMLMediaElement: seeking event - Web APIs
the seeking event is fired when a seek operation starts, meaning the boolean seeking attribute has changed to true and the media is seeking a new position. bubbles no cancelable no interface event target element default action none event handler property globaleventhandlers.onseeking specification html5 media examples these examples add an event listener for the htmlmediaelement's seeking event, then post a message when that event handler has reacted to the event firing. ...
...obaleventhandlers.onseeking specification html5 media examples these examples add an event listener for the htmlmediaelement's seeking event, then post a message when that event handler has reacted to the event firing. using addeventlistener(): const video = document.queryselector('video'); video.addeventlistener('seeking', (event) => { console.log('video is seeking a new position.'); }); using the onseeking event handler property: const video = document.queryselector('video'); video.onseeking = (event) => { console.log('video is seeking a new position.'); }; specifications specification status html living standardthe definition of 'seeking media event' in that specification. living standard html5the definition of 'seeking media even...
HTMLMenuElement - Web APIs
the htmlmenuelement interface provides special properties (beyond those defined on the regular htmlelement interface it also has available to it by inheritance) for manipulating <menu> elements. ...
... the htmlmenuelement interface provides special properties (beyond those defined on the regular htmlelement interface it also has available to it by inheritance) for manipulating <menu> elements. ...
HTMLMenuItemElement - Web APIs
the htmlmenuitemelement interface provides special properties (beyond those defined on the regular htmlelement interface it also has available to it by inheritance) for manipulating <menuitem> elements. ...
... the htmlmenuitemelement interface provides special properties (beyond those defined on the regular htmlelement interface it also has available to it by inheritance) for manipulating <menuitem> elements. ...
HTMLMetaElement - Web APIs
the htmlmetaelement interface contains descriptive metadata about a document. it inherits all of the properties and methods described in the htmlelement interface. ...
... the htmlmetaelement interface contains descriptive metadata about a document. it inherits all of the properties and methods described in the htmlelement interface. ...
HTMLMeterElement - Web APIs
the html <meter> elements expose the htmlmeterelement interface, which provides special properties and methods (beyond the htmlelement object interface they also have available to them by inheritance) for manipulating the layout and presentation of <meter> elements. ...
...ce, which provides special properties and methods (beyond the htmlelement object interface they also have available to them by inheritance) for manipulating the layout and presentation of <meter> elements. ...
HTMLModElement - Web APIs
the htmlmodelement interface provides special properties (beyond the regular methods and properties available through the htmlelement interface they also have available to them by inheritance) for manipulating modification elements, that is <del> and <ins>. ...
...ties (beyond the regular methods and properties available through the htmlelement interface they also have available to them by inheritance) for manipulating modification elements, that is <del> and <ins>. ...
HTMLOListElement - Web APIs
the htmlolistelement interface provides special properties (beyond those defined on the regular htmlelement interface it also has available to it by inheritance) for manipulating ordered list elements. ...
... the htmlolistelement interface provides special properties (beyond those defined on the regular htmlelement interface it also has available to it by inheritance) for manipulating ordered list elements. ...
HTMLOptGroupElement - Web APIs
the htmloptgroupelement interface provides special properties and methods (beyond the regular htmlelement object interface they also have available to them by inheritance) for manipulating the layout and presentation of <optgroup> elements. ...
...rovides special properties and methods (beyond the regular htmlelement object interface they also have available to them by inheritance) for manipulating the layout and presentation of <optgroup> elements. ...
HTMLOptionsCollection - Web APIs
the htmloptionscollection interface represents a collection of <option> html elements (in document order) and offers methods and properties for selecting from the list as well as optionally altering its items. this object is returned only by the options property of select. ...
... (in document order) and offers methods and properties for selecting from the list as well as optionally altering its items. this object is returned only by the options property of select. ...
HTMLParagraphElement - Web APIs
the htmlparagraphelement interface provides special properties (beyond those of the regular htmlelement object interface it inherits) for manipulating <p> elements. ...
... the htmlparagraphelement interface provides special properties (beyond those of the regular htmlelement object interface it inherits) for manipulating <p> elements. ...
HTMLParamElement - Web APIs
the htmlparamelement interface provides special properties (beyond those of the regular htmlelement object interface it inherits) for manipulating <param> elements, representing a pair of a key and a value that acts as a parameter for an <object> element. ...
...operties (beyond those of the regular htmlelement object interface it inherits) for manipulating <param> elements, representing a pair of a key and a value that acts as a parameter for an <object> element. ...
HTMLPictureElement - Web APIs
the htmlpictureelement interface represents a <picture> html element. it doesn't implement specific properties or methods. ...
... the htmlpictureelement interface represents a <picture> html element. it doesn't implement specific properties or methods. ...
HTMLPreElement - Web APIs
the htmlpreelement interface exposes specific properties and methods (beyond those of the htmlelement interface it also has available to it by inheritance) for manipulating a block of preformatted text (<pre>). ...
...tmlpreelement interface exposes specific properties and methods (beyond those of the htmlelement interface it also has available to it by inheritance) for manipulating a block of preformatted text (<pre>). ...
HTMLQuoteElement - Web APIs
the htmlquoteelement interface provides special properties and methods (beyond the regular htmlelement interface it also has available to it by inheritance) for manipulating quoting elements, like <blockquote> and <q>, but not the <cite> element. ...
...pecial properties and methods (beyond the regular htmlelement interface it also has available to it by inheritance) for manipulating quoting elements, like <blockquote> and <q>, but not the <cite> element. ...
HTMLScriptElement - Web APIs
e). javascript files should be served with the application/javascript mime type, but browsers are lenient and block them only if the script is served with an image type (image/*), video type (video/*), audio type (audio/*), or text/csv. if the script is blocked, its element receives an error event; otherwise, it receives a load event. ...
...e script is served with an image type (image/*), video type (video/*), audio type (audio/*), or text/csv. if the script is blocked, its element receives an error event; otherwise, it receives a load event. ...
HTMLSelectElement - Web APIs
the htmlselectelement interface represents a <select> html element. these elements also share all of the properties and methods of other html elements via the htmlelement interface. ...
... the htmlselectelement interface represents a <select> html element. these elements also share all of the properties and methods of other html elements via the htmlelement interface. ...
HTMLShadowElement - Web APIs
the htmlshadowelement interface represents a <shadow> html element, which is used in shadow dom. ...
... the htmlshadowelement interface represents a <shadow> html element, which is used in shadow dom. ...
HTMLSourceElement - Web APIs
the htmlsourceelement interface provides special properties (beyond the regular htmlelement object interface it also has available to it by inheritance) for manipulating <source> elements. ...
... the htmlsourceelement interface provides special properties (beyond the regular htmlelement object interface it also has available to it by inheritance) for manipulating <source> elements. ...
HTMLSpanElement - Web APIs
the htmlspanelement interface represents a <span> element and derives from the htmlelement interface, but without implementing any additional properties or methods. ...
... the htmlspanelement interface represents a <span> element and derives from the htmlelement interface, but without implementing any additional properties or methods. ...
HTMLStyleElement - Web APIs
esents a <style> element. it inherits properties and methods from its parent, htmlelement, and from linkstyle. this interface doesn't allow to manipulate the css it contains (in most case). to manipulate css, see using dynamic styling information for an overview of the objects used to manipulate specified css properties using the dom. ...
...'t allow to manipulate the css it contains (in most case). to manipulate css, see using dynamic styling information for an overview of the objects used to manipulate specified css properties using the dom. ...
HTMLTableCaptionElement - Web APIs
the htmltablecaptionelement interface special properties (beyond the regular htmlelement interface it also has available to it by inheritance) for manipulating table caption elements. ...
... the htmltablecaptionelement interface special properties (beyond the regular htmlelement interface it also has available to it by inheritance) for manipulating table caption elements. ...
HTMLTableColElement - Web APIs
the htmltablecolelement interface provides special properties (beyond the htmlelement interface it also has available to it inheritance) for manipulating single or grouped table column elements. ...
... the htmltablecolelement interface provides special properties (beyond the htmlelement interface it also has available to it inheritance) for manipulating single or grouped table column elements. ...
HTMLTemplateElement - Web APIs
the htmltemplateelement interface enables access to the contents of an html <template> element. ...
... the htmltemplateelement interface enables access to the contents of an html <template> element. ...
HTMLTimeElement - Web APIs
the htmltimeelement interface provides special properties (beyond the regular htmlelement interface it also has available to it by inheritance) for manipulating <time> elements. ...
... the htmltimeelement interface provides special properties (beyond the regular htmlelement interface it also has available to it by inheritance) for manipulating <time> elements. ...
HTMLTitleElement - Web APIs
the htmltitleelement interface contains the title for a document. this element inherits all of the properties and methods of the htmlelement interface. ...
... the htmltitleelement interface contains the title for a document. this element inherits all of the properties and methods of the htmlelement interface. ...
HTMLTrackElement - Web APIs
the htmltrackelement interface represents an html <track> element within the dom. this element can be used as a child of either <audio> or <video> to specify a text track containing information such as closed captions or subtitles. ...
...face represents an html <track> element within the dom. this element can be used as a child of either <audio> or <video> to specify a text track containing information such as closed captions or subtitles. ...
HTMLUListElement - Web APIs
the htmlulistelement interface provides special properties (beyond those defined on the regular htmlelement interface it also has available to it by inheritance) for manipulating unordered list elements. ...
... the htmlulistelement interface provides special properties (beyond those defined on the regular htmlelement interface it also has available to it by inheritance) for manipulating unordered list elements. ...
HTMLUnknownElement - Web APIs
the htmlunknownelement interface represents an invalid html element and derives from the htmlelement interface, but without implementing any additional properties or methods. ...
... the htmlunknownelement interface represents an invalid html element and derives from the htmlelement interface, but without implementing any additional properties or methods. ...
HTMLVideoElement - Web APIs
and methods of htmlmediaelement and htmlelement. the list of supported media formats varies from one browser to the other. you should either provide your video in a single format that all the relevant browsers supports, or provide multiple video sources in enough different formats that all the browsers you need to support are covered. ...
...e your video in a single format that all the relevant browsers supports, or provide multiple video sources in enough different formats that all the browsers you need to support are covered. ...
HashChangeEvent - Web APIs
the hashchangeevent interface represents events that fire when the fragment identifier of the url has changed. the fragment identifier is the part of the url that follows (and includes) the # symbol. ...
...ngeevent interface represents events that fire when the fragment identifier of the url has changed. the fragment identifier is the part of the url that follows (and includes) the # symbol. ...
IDBCursor.continue() - Web APIs
the continue() method of the idbcursor interface advances the cursor to the next position along its direction, to the item whose key matches the optional key parameter. if no key is specified, the cursor advances to the immediate next position, based on its direction. note: this feature is available in web workers. syntax cursor.continue(key); parameters key optional the key to position the cursor at. exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbcursor's transaction is inactive. ...
...sition the cursor at. exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbcursor's transaction is inactive. dataerror the key parameter may have any of the following conditions: the key is not a valid key. the key is less than or equal to this cursor's position and the cursor's direction is next or nextunique. the key is greater than or equal to this cursor's position and this cursor's direction is prev or prevunique. invalidstateerror the cursor is currently being iterated or has iterated past its end. example in this simple fragment we create a transaction, retrieve an object store, then use a cursor to iterate throug...
IDBCursor.continuePrimaryKey() - Web APIs
success handler - results in an invalidstateerror being thrown on the second call because the cursor’s got value flag has been unset. this method is only valid for cursors coming from an index. using it for cursors coming from an object store will throw an error. note: this feature is available in web workers. syntax cursor.continueprimarykey(key, primarykey); parameters key the key to position the cursor at. primarykey the primary key to position the cursor at. exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbcursor's transaction is inactive. dataerror the key parameter may have any of the following conditions: the key is not a valid key. ...
...sition the cursor at. exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbcursor's transaction is inactive. dataerror the key parameter may have any of the following conditions: the key is not a valid key. the key is less than or equal to this cursor's position and the cursor's direction is next or nextunique. the key is greater than or equal to this cursor's position and this cursor's direction is prev or prevunique. invalidstateerror the cursor is currently being iterated or has iterated past its end. invalidaccesserror the cursor's direction is not prev or next. example here’s how you can resume an iter...
IDBCursor.update() - Web APIs
Web › API › IDBCursor › update
the update() method of the idbcursor interface returns an idbrequest object, and, in a separate thread, updates the value at the current position of the cursor in the object store. if the cursor points to a record that has just been deleted, a new record is created. be aware that you can't call update() (or idbcursor.delete()) on cursors obtained from idbindex.openkeycursor(). for such needs, you have to use idbindex.opencursor() instead. note: this feature is available in web workers. syntax var anidbrequest = myidbcursor.update(value); parameters value the new value to be stored at the current position. return value an idbrequest object on which subsequent events related to this operation are fired. exceptions this method may raise a domexception of one of the following types: ...
...ansaction is inactive. readonlyerror the transaction mode is read only. invalidstateerror the cursor was created using idbindex.openkeycursor, is currently being iterated, or has iterated past its end. dataerror the underlying object store uses in-line keys and the property in the value at the object store's key path does not match the key in this cursor's position. datacloneerror the data being stored could not be cloned by the internal structured cloning algorithm. example in this simple fragment we create a transaction, retrieve an object store, then use a cursor to iterate through all the records in the object store. if the albumtitle of the current cursor is "a farewell to kings", we update year the album was released using var ...
IDBDatabase - Web APIs
rything you do in indexeddb always happens in the context of a transaction, representing interactions with data in the database. all objects in indexeddb — including object stores, indexes, and cursors — are tied to a particular transaction. thus, you cannot execute commands, access data, or open anything outside of a transaction. ...
...xeddb — including object stores, indexes, and cursors — are tied to a particular transaction. thus, you cannot execute commands, access data, or open anything outside of a transaction. ...
IDBOpenDBRequest - Web APIs
the idbopendbrequest interface of the indexeddb api provides access to the results of requests to open or delete databases (performed using idbfactory.open and idbfactory.deletedatabase), using specific event handler attributes. note: this feature is available in web workers. ...
...uests to open or delete databases (performed using idbfactory.open and idbfactory.deletedatabase), using specific event handler attributes. note: this feature is available in web workers. ...
IDBRequest - Web APIs
indicating success is fired at the request (idbrequest.onsuccess). if an error occurs while performing the operation, the exception is made available through the result property and an error event is fired (idbrequest.onerror). the interface idbopendbrequest is derived from idbrequest. note: this feature is available in web workers. ...
...le through the result property and an error event is fired (idbrequest.onerror). the interface idbopendbrequest is derived from idbrequest. note: this feature is available in web workers. ...
IDBTransaction - Web APIs
iting of data is done within transactions. you use idbdatabase to start transactions, idbtransaction to set the mode of the transaction (e.g. is it readonly or readwrite), and you access an idbobjectstore to make a request. you can also use an idbtransaction object to abort transactions. note: this feature is available in web workers. ...
...readonly or readwrite), and you access an idbobjectstore to make a request. you can also use an idbtransaction object to abort transactions. note: this feature is available in web workers. ...
InstallEvent - Web APIs
o the oninstall handler, the installevent interface represents an install action that is dispatched on the serviceworkerglobalscope of a serviceworker. as a child of extendableevent, it ensures that functional events such as fetchevent are not dispatched during installation. this interface inherits from the extendableevent interface. ...
...ker. as a child of extendableevent, it ensures that functional events such as fetchevent are not dispatched during installation. this interface inherits from the extendableevent interface. ...
Timing element visibility with the Intersection Observer API - Web APIs
de to their margins to get the spacing just right). the grid-row is set to 2, to place it alongside the site body. the content body speaking of the site's body: the main content of the site is kept in a <main> element. the following style is applied to that: main { grid-column: 2; grid-row: 2; margin: 0; margin-left: 16px; font-size: 16px; } the primary feature here is that the grid position is set to place the body content in column 2, row 2. articles each article is contained in an <article> element, styled like this: article { background-color: white; padding: 6px; } article:not(:last-child) { margin-bottom: 8px; } article h2 { margin-top: 0; } this creates article boxes with a white background which float atop the blue background, with a small margin around the arti...
...last item in the container has an 8px bottom margin to space things apart. ads finally, the ads have the following initial styling. individual ads may customize the style somewhat, as we'll see later. .ad { height: 96px; padding: 6px; border-color: #555; border-style: solid; border-width: 1px; } .ad:not(:last-child) { margin-bottom: 8px; } .ad h2 { margin-top: 0; } .ad div { position: relative; float: right; padding: 0 4px; height: 20px; width: 120px; font-size: 14px; bottom: 30px; border: 1px solid black; background-color: rgba(255, 255, 255, 0.5); } there's nothing magic in here. it's fairly basic css. tying it together with javascript that brings us to the javascript code which makes everything work. let's start with the global variables: let contentbox...
Location - Web APIs
Web › API › Location
t" title="port">8888</span></span><span id="pathname" title="pathname">/foo/bar</span><span id="search" title="search">?q=baz</span><span id="hash" title="hash">#bang</span></span> css html, body {height:100%;} html {display:table; width:100%;} body {display:table-cell; text-align:center; vertical-align:middle; font-family:georgia; font-size:230%; line-height:1em; white-space:nowrap;} [title] {position:relative; display:inline-block; box-sizing:border-box; /*border-bottom:.5em solid;*/ line-height:2em; cursor:pointer;} [title]:before {content:attr(title); font-family:monospace; position:absolute; top:100%; width:100%; left:50%; margin-left:-50%; font-size:40%; line-height:1.5; background:black;} [title]:hover:before, :target:before {background:black; color:yellow;} [title] [title]:before {mar...
...-height:2em; cursor:pointer;} [title]:before {content:attr(title); font-family:monospace; position:absolute; top:100%; width:100%; left:50%; margin-left:-50%; font-size:40%; line-height:1.5; background:black;} [title]:hover:before, :target:before {background:black; color:yellow;} [title] [title]:before {margin-top:1.5em;} [title] [title] [title]:before {margin-top:3em;} [title]:hover, :target {position:relative; z-index:1; outline:50em solid rgba(255,255,255,.8);} javascript [].foreach.call(document.queryselectorall('[title][id]'), function (node) { node.addeventlistener("click", function(e) { e.preventdefault(); e.stoppropagation(); window.location.hash = '#' + $(this).attr('id'); }); }); [].foreach.call(document.queryselectorall('[title]'), function (node) { node.addeventl...
MediaKeyMessageEvent - Web APIs
the mediakeymessageevent interface of the encryptedmediaextensions api contains the content and related data when the content decryption module generates a message for the session. ...
... the mediakeymessageevent interface of the encryptedmediaextensions api contains the content and related data when the content decryption module generates a message for the session. ...
MediaKeySession.onkeystatuseschange - Web APIs
the onkeystatuseschange property of the mediakeysession is an event handler, fired whenever a keystatuschange event ocurrs, denoting there has been a change in the keys or their statuses within a session. this interface inherits from the extendableevent interface. ...
..., fired whenever a keystatuschange event ocurrs, denoting there has been a change in the keys or their statuses within a session. this interface inherits from the extendableevent interface. ...
MediaKeySession.onmessage - Web APIs
the onmessage property of the mediakeysession is an event handler, fired whenever a mediakeymessageevent occurs, denoting a message is generated by the content decryption module. this interface inherits from the extendableevent interface. ...
...an event handler, fired whenever a mediakeymessageevent occurs, denoting a message is generated by the content decryption module. this interface inherits from the extendableevent interface. ...
MediaSource - Web APIs
the mediasource interface of the media source extensions api represents a source of media data for an htmlmediaelement object. a mediasource object can be attached to a htmlmediaelement to be played in the user agent. ...
... the media source extensions api represents a source of media data for an htmlmediaelement object. a mediasource object can be attached to a htmlmediaelement to be played in the user agent. ...
MediaStreamTrackEvent - Web APIs
the mediastreamtrackevent interface represents events which indicate that a mediastream has had tracks added to or removed from the stream through calls to media stream api methods. these events are sent to the stream when these changes occur. ...
...which indicate that a mediastream has had tracks added to or removed from the stream through calls to media stream api methods. these events are sent to the stream when these changes occur. ...
Using the MediaStream Recording API - Web APIs
it checked/unchecked. in web dictaphone this powers the information screen, which is shown/hidden by clicking the question mark icon in the top right hand corner. ...
... how we want it, making sure that it has enough z-index to always sit above the other elements and therefore be focusable/clickable: label { font-family: 'notocoloremoji'; font-size: 3rem; position: absolute; top: 2px; right: 3px; z-index: 5; cursor: pointer; } then we hide the actual checkbox, because we don't want it cluttering up our ui: input[type=checkbox] { position: absolute; top: -100px; } next, we style the information screen (wrapped in an <aside> element) how we want it, give it fixed position so that it doesn't appear in the layout flow and affect the main ui, transform it to the position we want it to sit in by default, and give it a transition for smooth showing/hiding: aside { position: fixed; top: 0; left: 0; text-shadow: 1px 1px 1...
MediaTrackConstraints.cursor - Web APIs
efine 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. later code can detect this flag's val...
...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. later code can detect this flag's value and if it's true, can manually look at some metadata that might be provided and insert a fake representation of the cursor at the correct position. examples here are some example constraints objects for getdisplaymedia() that make use of the cursor property. in addition, see example: constraint exerciser in capabilities, constraints, and settings for a complete example showing how constraints are used. example: cursor always visible this example sets up the constraints to request that the cursor always be visible. let displaymediaoptio...
MessageEvent - Web APIs
broadcastchannel.postmessage()) and broadcastchannel.onmessage). webrtc data channels (see rtcdatachannel.onmessage). the action triggered by this event is defined in a function set as the event handler for the relevant message event (e.g. using an onmessage handler as listed above). note: this feature is available in web workers. ...
...is event is defined in a function set as the event handler for the relevant message event (e.g. using an onmessage handler as listed above). note: this feature is available in web workers. ...
MouseEvent.pageX - Web APIs
Web › API › MouseEvent › pageX
e cssom view module redefined it as a double float. see the browser compatibility section for details. see page in coordinate systems for some additional information about coordinates specified in this fashion. syntax var pagex = mouseevent.pagex; value a floating-point number of pixels from the left edge of the document at which the mouse was clicked, regardless of any scrolling or viewport positioning that may be in effect. this property was originally specified in the touch events specification as a long integer, but was redefined in the cssom view module to be a double-precision floating-point number to allow for subpixel precision. even though numeric types both are represented by number in javascript, they may be handled differently internally in the browser's code, resulting in potent...
...for subpixel precision. even though numeric types both are represented by number in javascript, they may be handled differently internally in the browser's code, resulting in potential behavior differences. see browser compatibility to learn which browsers have been updated to use the revised data type. example more examples you can also see an example that demonstrates how to access the mouse position information in every available coordinate system. let's take a look at a simple example that shows you the mouse's position relative to the page's origin. since this example is presented in an <iframe>, that top-left corner is the top-left corner of the frame, not the browser window. javascript var box = document.queryselector(".box"); var pagex = document.getelementbyid("x"); var pagey = docu...
Node.isConnected - Web APIs
Web › API › Node › isConnected
st.isconnected); // returns false document.body.appendchild(test); console.log(test.isconnected); // returns true shadow dom a shadow dom example: // create a shadow root var shadow = this.attachshadow({mode: 'open'}); // create some css to apply to the shadow dom var style = document.createelement('style'); console.log(style.isconnected); // returns false style.textcontent = ` .wrapper { position: relative; } .info { font-size: 0.8rem; width: 200px; display: inline-block; border: 1px solid black; padding: 10px; background: white; border-radius: 10px; opacity: 0; transition: 0.6s all; positions: absolute; bottom: 20px; left: 10px; z-index: 3 } `; // attach the created style element to the shadow dom shadow.appendchild(style); console.log(style.isconnected); // ...
... /* * node.isconnected polyfill for ie and edgehtml * 2020-02-04 * * by eli grey, https://eligrey.com * public domain. * no warranty expressed or implied. use at your own risk. */ if (!('isconnected' in node.prototype)) { object.defineproperty(node.prototype, 'isconnected', { get() { return ( !this.ownerdocument || !( this.ownerdocument.comparedocumentposition(this) & this.document_position_disconnected ) ); }, }); } specifications specification status comment domthe definition of 'isconnected' in that specification. living standard initial definition. ...
OfflineAudioContext - Web APIs
offlineaudiocontext interface is an audiocontext interface representing an audio-processing graph built from linked together audionodes. in contrast with a standard audiocontext, an offlineaudiocontext doesn't render the audio to the device hardware; instead, it generates it, as fast as it can, and outputs the result to an audiobuffer. ...
... with a standard audiocontext, an offlineaudiocontext doesn't render the audio to the device hardware; instead, it generates it, as fast as it can, and outputs the result to an audiobuffer. ...
PageTransitionEvent - Web APIs
the pagetransitionevent event object is available inside handler functions for the pageshow and pagehide events, fired when a document is being loaded or unloaded. ...
... the pagetransitionevent event object is available inside handler functions for the pageshow and pagehide events, fired when a document is being loaded or unloaded. ...
PannerNode.orientationX - Web APIs
the orientationx property of the pannernode interface indicates the x (horizontal) component of the direction in which the audio source is facing, in a 3d cartesian coordinate space. the complete vector is defined by the position of the audio source, given as (positionx, positiony, positionz), and the orientation of the audio source (that is, the direction in which it's facing), given as (orientationx, orientationy, orientationz). depending on the directionality of the sound (as specified using the attributes coneinnerangle, coneouterangle, and coneoutergain), the orientation of the sound may alter the perceived volume of the sound as it's being played. if the sound is pointing toward the listener, it will be louder than if the sound is pointed away from the listener. the audioparam contained...
...n the sound is rotated // by between 15 (30/2) and 22.5 (45/2) degrees either direction, // the volume will decrease gradually panner.coneouterangle = 45; // this value determines the volume of the sound outside of both inner and outer cone // setting it to 0 means there is no sound, so we can clearly hear when we leave the cone // 0 is also the default panner.coneoutergain = 0; // increase the z position to ensure the cone has an effect // (otherwise the sound is located at the same position as the listener) panner.positionz.setvalueattime(1, context.currenttime); having set up the pannernode, we can now schedule some updates to its y-axis rotation: // calculate the vector for no rotation // this means the sound will play at full volume const [x1, y1, z1] = yrotationtovector(0); // schedule the...
PannerNode.orientationY - Web APIs
the orientationy property of the pannernode interface indicates the y (vertical) component of the direction the audio source is facing, in 3d cartesian coordinate space. the complete vector is defined by the position of the audio source, given as (positionx, positiony, positionz), and the orientation of the audio source (that is, the direction in which it's facing), given as (orientationx, orientationy, orientationz). depending on the directionality of the sound (as specified using the attributes coneinnerangle, coneouterangle, and codeoutergain), the orientation of the sound may alter the perceived volume of the sound as it's being played. if the sound is pointing toward the listener, it will be louder than if the sound is pointed away from the listener. the audioparam contained by this prop...
...n the sound is rotated // by between 15 (30/2) and 22.5 (45/2) degrees either direction, // the volume will decrease gradually panner.coneouterangle = 45; // this value determines the volume of the sound outside of both inner and outer cone // setting it to 0 means there is no sound, so we can clearly hear when we leave the cone // 0 is also the default panner.coneoutergain = 0; // increase the z position to ensure the cone has an effect // (otherwise the sound is located at the same position as the listener) panner.positionz.setvalueattime(1, context.currenttime); having set up the pannernode, we can now schedule some updates to its y-axis rotation: // calculate the vector for no rotation // this means the sound will play at full volume const [x1, y1, z1] = yrotationtovector(0); // schedule the...
PannerNode.orientationZ - Web APIs
the orientationz property of the pannernode interface indicates the z (depth) component of the direction the audio source is facing, in 3d cartesian coordinate space. the complete vector is defined by the position of the audio source, given as (positionx, positiony, positionz), and the orientation of the audio source (that is, the direction in which it's facing), given as (orientationx, orientationy, orientationz). depending on the directionality of the sound (as specified using the attributes coneinnerangle, coneouterangle, and codeoutergain), the orientation of the sound may alter the perceived volume of the sound as it's being played. if the sound is pointing toward the listener, it will be louder than if the sound is pointed away from the listener. the audioparam contained by this propert...
...n the sound is rotated // by between 15 (30/2) and 22.5 (45/2) degrees either direction, // the volume will decrease gradually panner.coneouterangle = 45; // this value determines the volume of the sound outside of both inner and outer cone // setting it to 0 means there is no sound, so we can clearly hear when we leave the cone // 0 is also the default panner.coneoutergain = 0; // increase the z position to ensure the cone has an effect // (otherwise the sound is located at the same position as the listener) panner.positionz.setvalueattime(1, context.currenttime); having set up the pannernode, we can now schedule some updates to its y-axis rotation: // calculate the vector for no rotation // this means the sound will play at full volume const [x1, y1, z1] = yrotationtovector(0); // schedule the...
Path2D - Web APIs
Web › API › Path2D
er curve to the path. it requires three points. the first two points are control points and the third one is the end point. the starting point is the last point in the current path, which can be changed using moveto() before creating the bézier curve. path2d.quadraticcurveto() adds a quadratic bézier curve to the current path. ...
...path which is centered at (x, y) position with radius r starting at startangle and ending at endangle going in the given direction by anticlockwise (defaulting to clockwise). path2d.arcto() adds a circular arc to the path with the given control points and radius, connected to the previous point by a straight line. path2d.ellipse() adds an elliptical arc to the path which is centered at (x, y) position with the radii radiusx and radiusy starting at startangle and ending at endangle going in the given direction by anticlockwise (defaulting to clockwise). path2d.rect() creates a path for a rectangle at position (x, y) with a size that is determined by width and height. specifications specification status comment html living standardthe definition of 'path2d' in th...
PerformanceFrameTiming - Web APIs
nce. this means the browser should process a frame in about 16.7ms. an application can register a performanceobserver for "frame" performance entry types and the observer can retrieve data about the duration of each frame event. this information can be used to help identify areas that take too long to provide a good user experience. ...
...ry types and the observer can retrieve data about the duration of each frame event. this information can be used to help identify areas that take too long to provide a good user experience. ...
PerformanceLongTaskTiming - Web APIs
the performancelongtasktiming interface of the the long tasks api reports instances of long tasks. ...
... the performancelongtasktiming interface of the the long tasks api reports instances of long tasks. ...
PerformanceMark - Web APIs
performancemark is an abstract interface for performanceentry objects with an entrytype of "mark". entries of this type are created by calling performance.mark() to add a named domhighrestimestamp (the mark) to the browser's performance timeline. ...
...ntry objects with an entrytype of "mark". entries of this type are created by calling performance.mark() to add a named domhighrestimestamp (the mark) to the browser's performance timeline. ...
PerformanceMeasure - Web APIs
performancemeasure is an abstract interface for performanceentry objects with an entrytype of "measure". entries of this type are created by calling performance.measure() to add a named domhighrestimestamp (the measure) between two marks to the browser's performance timeline. ...
...ype of "measure". entries of this type are created by calling performance.measure() to add a named domhighrestimestamp (the measure) between two marks to the browser's performance timeline. ...
PerformanceNavigationTiming - Web APIs
the performancenavigationtiming interface provides methods and properties to store and retrieve metrics regarding the browser's document navigation events. for example, this interface can be used to determine how much time it takes to load or unload a document. ...
...s to store and retrieve metrics regarding the browser's document navigation events. for example, this interface can be used to determine how much time it takes to load or unload a document. ...
PerformancePaintTiming - Web APIs
page construction. "paint" refers to conversion of the render tree to on-screen pixels. an application can register a performanceobserver for "paint" performance entry types and the observer can retrieve the times that paint events occur. use this information to help identify areas that take too long to provide a good user experience. ...
...t" performance entry types and the observer can retrieve the times that paint events occur. use this information to help identify areas that take too long to provide a good user experience. ...
PerformanceResourceTiming - Web APIs
mestamps for network events such as redirect start and end times, fetch start, dns lookup start and end times, response start and end times, etc.. additionally, the interface extends performanceentry with other properties which provide data about the size of the fetched resource as well as the type of resource that initiated the fetch. ...
...dditionally, the interface extends performanceentry with other properties which provide data about the size of the fetched resource as well as the type of resource that initiated the fetch. ...
Using Pointer Events - Web APIs
ing, the start point is drawn as a small circle. we're using a 4-pixel wide line, so a 4 pixel radius circle will show up neatly. drawing as the pointers move each time one or more pointers moves, a pointermove event is delivered, resulting in our handlemove() function being called. its responsibility in this example is to update the cached touch information and to draw a line from the previous position to the current position of each touch. function handlemove(evt) { var el = document.getelementsbytagname("canvas")[0]; var ctx = el.getcontext("2d"); var color = colorfortouch(evt); var idx = ongoingtouchindexbyid(evt.pointerid); log("continuing touch: idx = " + idx); if (idx >= 0) { ctx.beginpath(); log("ctx.moveto(" + ongoingtouches[idx].pagex + ", " + ongoingtouches[idx]...
... previous information about each touch to determine the starting point for each touch's new line segment to be drawn. this is done by looking at each touch's pointerevent.pointerid property. this property is a unique integer for each pointer event, and remains consistent for each event during the duration of each finger's contact with the surface. this lets us get the coordinates of the previous position of each touch and use the appropriate context methods to draw a line segment joining the two positions together. after drawing the line, we call array.splice() to replace the previous information about the touch point with the current information in the ongoingtouches array. handling the end of a touch when the user lifts a finger off the surface, a pointerup event is sent. we handle this even...
ProcessingInstruction - Web APIs
erent from the xml declaration. user-defined processing instructions cannot begin with "xml", as xml-prefixed processing-instruction target names are reserved by the xml specification for particular, standard uses (see, for example, <?xml-stylesheet ?>). the processinginstruction interface inherits methods and properties from node. ...
...on target names are reserved by the xml specification for particular, standard uses (see, for example, <?xml-stylesheet ?>). the processinginstruction interface inherits methods and properties from node. ...
ProgressEvent - Web APIs
the progressevent interface represents events measuring progress of an underlying process, like an http request (for an xmlhttprequest, or the loading of the underlying resource of an <img>, <audio>, <video>, <style> or <link>). ...
...events measuring progress of an underlying process, like an http request (for an xmlhttprequest, or the loading of the underlying resource of an <img>, <audio>, <video>, <style> or <link>). ...
PromiseRejectionEvent - Web APIs
the promiserejectionevent interface represents events which are sent to the global script context when javascript promises are rejected. these events are particularly useful for telemetry and debugging purposes. for details on promise rejection events, see promise rejection events in using promises. ...
...t when javascript promises are rejected. these events are particularly useful for telemetry and debugging purposes. for details on promise rejection events, see promise rejection events in using promises. ...
RTCDTMFSender - Web APIs
is to allow webrtc-based communication clients to be connected to a public-switched telephone network (pstn) or other legacy telephone service, including extant voice over ip (voip) services. for that reason, dtmf can't be used between two webrtc-based devices, because there is no mechanism provided by webrtc for receiving dtmf codes. ...
...luding extant voice over ip (voip) services. for that reason, dtmf can't be used between two webrtc-based devices, because there is no mechanism provided by webrtc for receiving dtmf codes. ...
RTCDataChannel: bufferedamountlow event - Web APIs
specified by bufferedamountlowthreshold, which we have set to 65536. in other words, we'll try to keep at least 64kb of data in the buffer, reading 64kb at a time from the source. let pc = new rtcpeerconnection(); let dc = pc.createdatachannel("sendfile"); let source = /* source data object */ dc.bufferedamountlowthreshold = 65536; pc.addeventlistener("bufferedamountlow", ev => { if (source.position <= source.length) { dc.send(source.readfile(65536)); } }, false); after creating the rtcpeerconnection, this calls rtcpeerconnection.createdatachannel() to create the data channel. then a listener is created for bufferedamountlow to refill the incoming data buffer any time its contents fall below 65536 bytes. you can also set up a listener for bufferedamountlow using its event handler pr...
...fter creating the rtcpeerconnection, this calls rtcpeerconnection.createdatachannel() to create the data channel. then a listener is created for bufferedamountlow to refill the incoming data buffer any time its contents fall below 65536 bytes. 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. candidate recommendation ...
RTCDtlsTransport - Web APIs
o provide information about sctp packets transmitted and received by an connection's data channels. features of the dtls transport include the addition of security to the underlying transport; the rtcdtlstransport interface can be used to obtain information about the underlying transport and the security added to it by the dtls layer. ...
...tion of security to the underlying transport; the rtcdtlstransport interface can be used to obtain information about the underlying transport and the security added to it by the dtls layer. ...
RTCPeerConnection - Web APIs
the rtcpeerconnection interface represents a webrtc connection between the local computer and a remote peer. it provides methods to connect to a remote peer, maintain and monitor the connection, and close the connection once it's no longer needed. ...
...tion between the local computer and a remote peer. it provides methods to connect to a remote peer, maintain and monitor the connection, and close the connection once it's no longer needed. ...
RadioNodeList - Web APIs
the radionodelist interface represents a collection of radio elements in a <form> or a <fieldset> element. ...
... the radionodelist interface represents a collection of radio elements in a <form> or a <fieldset> element. ...
Range.getBoundingClientRect() - Web APIs
e; this is a rectangle enclosing the union of the bounding rectangles for all the elements in the range. this method is useful for determining the viewport coordinates of the cursor or selection inside a text box. see element.getboundingclientrect() for details on the returned value. ...
... returned value. syntax boundingrect = range.getboundingclientrect() example html <div id="highlight"></div> <p>this example positions a "highlight" rectangle behind the contents of a range. the range's content <b>starts here</b> and continues on until it <b>ends here</b>. ...
Range.setEnd() - Web APIs
Web › API › Range › setEnd
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. return value undefined. ...
... 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. return value undefined. ...
Range.setStart() - Web APIs
Web › API › Range › setStart
syntax range.setstart(startnode, startoffset); parameters startnode the node where the range should start. startoffset an integer greater than or equal to zero representing the offset for the start of the range from the start of startnode. ...
...he 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. setting the start point below (lower in the document) the end point will result in a collapsed range with the start and end points both set to the specified start position. syntax range.setstart(startnode, startoffset); parameters startnode the node where the range should start. startoffset an integer greater than or equal to zero representing the offset for the start of the range from the start of startnode. examples highlight part of an element this example uses the range.setstart() and range.setend() methods to add part of an address to a range. th...
Range - Web APIs
Web › API › Range
document.createrange() method. range objects can also be retrieved by using the getrangeat() method of the selection object or the caretrangefrompoint() method of the document object. there also is the range() constructor available. properties there are no inherited properties. range.collapsed read only returns a boolean indicating whether the range's start and end points are at the same position. range.commonancestorcontainer read only returns the deepest node that contains the startcontainer and endcontainer nodes. range.endcontainer read only returns the node within which the range ends. range.endoffset read only returns a number representing where in the endcontainer the range ends. range.startcontainer read only returns the node within which the range starts. range.start...
... the endcontainer the range ends. range.startcontainer read only returns the node within which the range starts. range.startoffset read only returns a number representing where in the startcontainer the range starts. constructor range() returns a range object with the global document as its start and end. methods there are no inherited methods. range.setstart() sets the start position of a range. range.setend() sets the end position of a range. range.setstartbefore() sets the start position of a range relative to another node. range.setstartafter() sets the start position of a range relative to another node. range.setendbefore() sets the end position of a range relative to another node. range.setendafter() sets the end position of a range relative to another node. r...
SVGAltGlyphDefElement - Web APIs
the svgaltglyphdefelement interface corresponds to the <altglyphdef> element. ...
... the svgaltglyphdefelement interface corresponds to the <altglyphdef> element. ...
SVGAltGlyphItemElement - Web APIs
the svgaltglyphitemelement interface corresponds to the <altglyphitem> element. ...
... the svgaltglyphitemelement interface corresponds to the <altglyphitem> element. ...
SVGAnimateColorElement - Web APIs
the svganimatecolorelement interface corresponds to the <animatecolor> element. ...
... the svganimatecolorelement interface corresponds to the <animatecolor> element. ...
SVGAnimateElement - Web APIs
the svganimateelement interface corresponds to the <animate> element. ...
... the svganimateelement interface corresponds to the <animate> element. ...
SVGAnimateMotionElement - Web APIs
the svganimatemotionelement interface corresponds to the <animatemotion> element. ...
... the svganimatemotionelement interface corresponds to the <animatemotion> element. ...
SVGAnimateTransformElement - Web APIs
the svganimatetransformelement interface corresponds to the <animatetransform> element. ...
... the svganimatetransformelement interface corresponds to the <animatetransform> element. ...
SVGAnimationElement - Web APIs
the svganimationelement interface is the base interface for all of the animation element interfaces: svganimateelement, svgsetelement, svganimatecolorelement, svganimatemotionelement and svganimatetransformelement. ...
...nterface is the base interface for all of the animation element interfaces: svganimateelement, svgsetelement, svganimatecolorelement, svganimatemotionelement and svganimatetransformelement. ...
SVGCircleElement - Web APIs
the svgcircleelement interface is an interface for the <circle> element. ...
... the svgcircleelement interface is an interface for the <circle> element. ...
SVGClipPathElement - Web APIs
the svgclippathelement interface provides access to the properties of <clippath> elements, as well as methods to manipulate them. ...
... the svgclippathelement interface provides access to the properties of <clippath> elements, as well as methods to manipulate them. ...
SVGComponentTransferFunctionElement - Web APIs
the svgcomponenttransferfunctionelement interface defines a base interface used by the component transfer function interfaces. ...
... the svgcomponenttransferfunctionelement interface defines a base interface used by the component transfer function interfaces. ...
SVGCursorElement - Web APIs
the svgcursorelement interface provides access to the properties of <cursor> elements, as well as methods to manipulate them. ...
... the svgcursorelement interface provides access to the properties of <cursor> elements, as well as methods to manipulate them. ...
SVGDefsElement - Web APIs
the svgdefselement interface corresponds to the <defs> element. ...
... the svgdefselement interface corresponds to the <defs> element. ...
SVGDescElement - Web APIs
the svgdescelement interface corresponds to the <desc> element. ...
... the svgdescelement interface corresponds to the <desc> element. ...
SVGElement - Web APIs
all of the svg dom interfaces that correspond directly to elements in the svg language derive from the svgelement interface. ...
... all of the svg dom interfaces that correspond directly to elements in the svg language derive from the svgelement interface. ...
SVGEllipseElement - Web APIs
the svgellipseelement interface provides access to the properties of <ellipse> elements. ...
... the svgellipseelement interface provides access to the properties of <ellipse> elements. ...
SVGExternalResourcesRequired - Web APIs
the svgexternalresourcesrequired interface defines an interface which applies to all elements where this element or one of its descendants can reference an external resource. ...
... the svgexternalresourcesrequired interface defines an interface which applies to all elements where this element or one of its descendants can reference an external resource. ...
SVGFEBlendElement - Web APIs
the svgfeblendelement interface corresponds to the <feblend> element. ...
... the svgfeblendelement interface corresponds to the <feblend> element. ...
SVGFEColorMatrixElement - Web APIs
the svgfecolormatrixelement interface corresponds to the <fecolormatrix> element. ...
... the svgfecolormatrixelement interface corresponds to the <fecolormatrix> element. ...
SVGFEComponentTransferElement - Web APIs
the svgfecomponenttransferelement interface corresponds to the <fecomponenttransfer> element. ...
... the svgfecomponenttransferelement interface corresponds to the <fecomponenttransfer> element. ...
SVGFECompositeElement - Web APIs
the svgfecompositeelement interface corresponds to the <fecomposite> element. ...
... the svgfecompositeelement interface corresponds to the <fecomposite> element. ...
SVGFEConvolveMatrixElement - Web APIs
the svgfeconvolvematrixelement interface corresponds to the <feconvolvematrix> element. ...
... the svgfeconvolvematrixelement interface corresponds to the <feconvolvematrix> element. ...
SVGFEDiffuseLightingElement - Web APIs
the svgfediffuselightingelement interface corresponds to the <fediffuselighting> element. ...
... the svgfediffuselightingelement interface corresponds to the <fediffuselighting> element. ...
SVGFEDisplacementMapElement - Web APIs
the svgfedisplacementmapelement interface corresponds to the <fedisplacementmap> element. ...
... the svgfedisplacementmapelement interface corresponds to the <fedisplacementmap> element. ...
SVGFEDistantLightElement - Web APIs
the svgfedistantlightelement interface corresponds to the <fedistantlight> element. ...
... the svgfedistantlightelement interface corresponds to the <fedistantlight> element. ...
SVGFEDropShadowElement - Web APIs
the svgfedropshadowelement interface corresponds to the <fedropshadow> element. ...
... the svgfedropshadowelement interface corresponds to the <fedropshadow> element. ...
SVGFEFloodElement - Web APIs
the svgfefloodelement interface corresponds to the <feflood> element. ...
... the svgfefloodelement interface corresponds to the <feflood> element. ...
SVGFEFuncAElement - Web APIs
the svgfefuncaelement interface corresponds to the <fefunca> element. ...
... the svgfefuncaelement interface corresponds to the <fefunca> element. ...
SVGFEFuncBElement - Web APIs
the svgfefuncbelement interface corresponds to the <fefuncb> element. ...
... the svgfefuncbelement interface corresponds to the <fefuncb> element. ...
SVGFEFuncGElement - Web APIs
the svgfefuncgelement interface corresponds to the <fefuncg> element. ...
... the svgfefuncgelement interface corresponds to the <fefuncg> element. ...
SVGFEFuncRElement - Web APIs
the svgfefuncrelement interface corresponds to the <fefuncr> element. ...
... the svgfefuncrelement interface corresponds to the <fefuncr> element. ...
SVGFEGaussianBlurElement - Web APIs
the svgfegaussianblurelement interface corresponds to the <fegaussianblur> element. ...
... the svgfegaussianblurelement interface corresponds to the <fegaussianblur> element. ...
SVGFEImageElement - Web APIs
the svgfeimageelement interface corresponds to the <feimage> element. ...
... the svgfeimageelement interface corresponds to the <feimage> element. ...
SVGFEMergeElement - Web APIs
the svgfemergeelement interface corresponds to the <femerge> element. ...
... the svgfemergeelement interface corresponds to the <femerge> element. ...
SVGFEMergeNodeElement - Web APIs
the svgfemergenodeelement interface corresponds to the <femergenode> element. ...
... the svgfemergenodeelement interface corresponds to the <femergenode> element. ...
SVGFEMorphologyElement - Web APIs
the svgfemorphologyelement interface corresponds to the <femorphology> element. ...
... the svgfemorphologyelement interface corresponds to the <femorphology> element. ...
SVGFEOffsetElement - Web APIs
the svgfeoffsetelement interface corresponds to the <feoffset> element. ...
... the svgfeoffsetelement interface corresponds to the <feoffset> element. ...
SVGFEPointLightElement - Web APIs
the svgfepointlightelement interface corresponds to the <fepointlight> element. ...
... the svgfepointlightelement interface corresponds to the <fepointlight> element. ...
SVGFESpecularLightingElement - Web APIs
the svgfespecularlightingelement interface corresponds to the <fespecularlighting> element. ...
... the svgfespecularlightingelement interface corresponds to the <fespecularlighting> element. ...
SVGFESpotLightElement - Web APIs
the svgfespotlightelement interface corresponds to the <fespotlight> element. ...
... the svgfespotlightelement interface corresponds to the <fespotlight> element. ...
SVGFETileElement - Web APIs
the svgfetileelement interface corresponds to the <fetile> element. ...
... the svgfetileelement interface corresponds to the <fetile> element. ...
SVGFETurbulenceElement - Web APIs
the svgfeturbulenceelement interface corresponds to the <feturbulence> element. ...
... the svgfeturbulenceelement interface corresponds to the <feturbulence> element. ...
SVGFilterElement - Web APIs
the svgfilterelement interface provides access to the properties of <filter> elements, as well as methods to manipulate them. ...
... the svgfilterelement interface provides access to the properties of <filter> elements, as well as methods to manipulate them. ...
SVGFilterPrimitiveStandardAttributes - Web APIs
the svgfilterprimitivestandardattributes interface defines the set of dom attributes that are common across the filter primitive interfaces. ...
... the svgfilterprimitivestandardattributes interface defines the set of dom attributes that are common across the filter primitive interfaces. ...
SVGFontElement - Web APIs
the svgfontelement interface corresponds to the <font> elements. object-oriented access to the attributes of the <font> element via the svg dom is not possible. ...
... the svgfontelement interface corresponds to the <font> elements. object-oriented access to the attributes of the <font> element via the svg dom is not possible. ...
SVGFontFaceElement - Web APIs
the svgfontfaceelement interface corresponds to the <font-face> elements. object-oriented access to the attributes of the <font-face> element via the svg dom is not possible. ...
... the svgfontfaceelement interface corresponds to the <font-face> elements. object-oriented access to the attributes of the <font-face> element via the svg dom is not possible. ...
SVGFontFaceFormatElement - Web APIs
the svgfontfaceformatelement interface corresponds to the <font-face-format> elements. object-oriented access to the attributes of the <font-face-format> element via the svg dom is not possible. ...
...gfontfaceformatelement interface corresponds to the <font-face-format> elements. object-oriented access to the attributes of the <font-face-format> element via the svg dom is not possible. ...
SVGFontFaceNameElement - Web APIs
the svgfontfacenameelement interface corresponds to the <font-face-name> elements. object-oriented access to the attributes of the <font-face-name> element via the svg dom is not possible. ...
...the svgfontfacenameelement interface corresponds to the <font-face-name> elements. object-oriented access to the attributes of the <font-face-name> element via the svg dom is not possible. ...
SVGFontFaceSrcElement - Web APIs
the svgfontfacesrcelement interface corresponds to the <font-face-src> elements. object-oriented access to the attributes of the <font-face-src> element via the svg dom is not possible. ...
... the svgfontfacesrcelement interface corresponds to the <font-face-src> elements. object-oriented access to the attributes of the <font-face-src> element via the svg dom is not possible. ...
SVGFontFaceUriElement - Web APIs
the svgfontfaceurielement interface corresponds to the <font-face-uri> elements. object-oriented access to the attributes of the <font-face-uri> element via the svg dom is not possible. ...
... the svgfontfaceurielement interface corresponds to the <font-face-uri> elements. object-oriented access to the attributes of the <font-face-uri> element via the svg dom is not possible. ...
SVGForeignObjectElement - Web APIs
the svgforeignobjectelement interface provides access to the properties of <foreignobject> elements, as well as methods to manipulate them. ...
... the svgforeignobjectelement interface provides access to the properties of <foreignobject> elements, as well as methods to manipulate them. ...
SVGGElement - Web APIs
the svggelement interface corresponds to the <g> element. ...
... the svggelement interface corresponds to the <g> element. ...
SVGGeometryElement - Web APIs
the svggeometryelement interface represents svg elements whose rendering is defined by geometry with an equivalent path, and which can be filled and stroked. this includes paths and the basic shapes. ...
...metryelement interface represents svg elements whose rendering is defined by geometry with an equivalent path, and which can be filled and stroked. this includes paths and the basic shapes. ...
SVGGlyphElement - Web APIs
the svgglyphelement interface corresponds to the <glyph> element. object-oriented access to the attributes of the <glyph> element via the svg dom is not possible. ...
... the svgglyphelement interface corresponds to the <glyph> element. object-oriented access to the attributes of the <glyph> element via the svg dom is not possible. ...
SVGGlyphRefElement - Web APIs
the svgglyphrefelement interface corresponds to the <glyphref> elements. ...
... the svgglyphrefelement interface corresponds to the <glyphref> elements. ...
SVGGradientElement - Web APIs
the svggradient interface is a base interface used by svglineargradientelement and svgradialgradientelement. ...
... the svggradient interface is a base interface used by svglineargradientelement and svgradialgradientelement. ...
SVGGraphicsElement - Web APIs
the svggraphicselement interface represents svg elements whose primary purpose is to directly render graphics into a group. ...
... the svggraphicselement interface represents svg elements whose primary purpose is to directly render graphics into a group. ...
SVGHKernElement - Web APIs
the svghkernelement interface corresponds to the <hkern> elements. object-oriented access to the attributes of the <hkern> element via the svg dom is not possible. ...
... the svghkernelement interface corresponds to the <hkern> elements. object-oriented access to the attributes of the <hkern> element via the svg dom is not possible. ...
SVGImageElement - Web APIs
the svgimageelement interface corresponds to the <image> element. ...
... the svgimageelement interface corresponds to the <image> element. ...
SVGLineElement - Web APIs
the svglineelement interface provides access to the properties of <line> elements, as well as methods to manipulate them. ...
... the svglineelement interface provides access to the properties of <line> elements, as well as methods to manipulate them. ...
SVGLinearGradientElement - Web APIs
the svglineargradientelement interface corresponds to the <lineargradient> element. ...
... the svglineargradientelement interface corresponds to the <lineargradient> element. ...
SVGMPathElement - Web APIs
the svgmpathelement interface corresponds to the <mpath> element. ...
... the svgmpathelement interface corresponds to the <mpath> element. ...
SVGMaskElement - Web APIs
the svgmaskelement interface provides access to the properties of <mask> elements, as well as methods to manipulate them. ...
... the svgmaskelement interface provides access to the properties of <mask> elements, as well as methods to manipulate them. ...
SVGMeshElement - Web APIs
the svgmeshelement interface provides access to the properties of <mesh> elements. ...
... the svgmeshelement interface provides access to the properties of <mesh> elements. ...
SVGMetadataElement - Web APIs
the svgmetadataelement interface corresponds to the <metadata> element. ...
... the svgmetadataelement interface corresponds to the <metadata> element. ...
SVGMissingGlyphElement - Web APIs
the svgmissingglyphelement interface corresponds to the <missing-glyph> elements. object-oriented access to the attributes of the <missing-glyph> element via the svg dom is not possible. ...
... the svgmissingglyphelement interface corresponds to the <missing-glyph> elements. object-oriented access to the attributes of the <missing-glyph> element via the svg dom is not possible. ...
SVGPathElement - Web APIs
the svgpathelement interface corresponds to the <path> element. ...
... the svgpathelement interface corresponds to the <path> element. ...
SVGPatternElement - Web APIs
the svgpatternelement interface corresponds to the <pattern> element. ...
... the svgpatternelement interface corresponds to the <pattern> element. ...
SVGPolygonElement - Web APIs
the svgpolygonelement interface provides access to the properties of <polygon> elements, as well as methods to manipulate them. ...
... the svgpolygonelement interface provides access to the properties of <polygon> elements, as well as methods to manipulate them. ...
SVGPolylineElement - Web APIs
the svgpolylineelement interface provides access to the properties of <polyline> elements, as well as methods to manipulate them. ...
... the svgpolylineelement interface provides access to the properties of <polyline> elements, as well as methods to manipulate them. ...
SVGRadialGradientElement - Web APIs
the svgradialgradientelement interface corresponds to the <radialgradient> element. ...
... the svgradialgradientelement interface corresponds to the <radialgradient> element. ...
SVGRect - Web APIs
Web › API › SVGRect
svgrect represents a rectangle. rectangles consist of an x and y coordinate pair identifying a minimum x value, a minimum y value, and a width and height, which are constrained to be non-negative. an svgrect object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown. ...
...height, which are constrained to be non-negative. an svgrect object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown. ...
SVGRectElement - Web APIs
the svgrectelement interface provides access to the properties of <rect> elements, as well as methods to manipulate them. ...
... the svgrectelement interface provides access to the properties of <rect> elements, as well as methods to manipulate them. ...
SVGRenderingIntent - Web APIs
the svgrenderingintent interface defines the enumerated list of possible values for rendering-intent attributes or descriptors. ...
... the svgrenderingintent interface defines the enumerated list of possible values for rendering-intent attributes or descriptors. ...
SVGScriptElement - Web APIs
the svgscriptelement interface corresponds to the svg <script> element. ...
... the svgscriptelement interface corresponds to the svg <script> element. ...
SVGSetElement - Web APIs
the svgsetelement interface corresponds to the <set> element. ...
... the svgsetelement interface corresponds to the <set> element. ...
SVGSolidcolorElement - Web APIs
the svgsolidcolorelement interface corresponds to the <solidcolor> element. ...
... the svgsolidcolorelement interface corresponds to the <solidcolor> element. ...
SVGStopElement - Web APIs
the svgstopelement interface corresponds to the <stop> element. ...
... the svgstopelement interface corresponds to the <stop> element. ...
SVGStyleElement - Web APIs
svg style interface the svgstyleelement interface corresponds to the svg <style> element. ...
... svg style interface the svgstyleelement interface corresponds to the svg <style> element. ...
SVGSwitchElement - Web APIs
the svgswitchelement interface corresponds to the <switch> element. ...
... the svgswitchelement interface corresponds to the <switch> element. ...
SVGSymbolElement - Web APIs
the svgsymbolelement interface corresponds to the <symbol> element. ...
... the svgsymbolelement interface corresponds to the <symbol> element. ...
SVGTextPathElement - Web APIs
the svgtextpathelement interface corresponds to the <textpath> element. ...
... the svgtextpathelement interface corresponds to the <textpath> element. ...
SVGTitleElement - Web APIs
the svgtitleelement interface corresponds to the <title> element. ...
... the svgtitleelement interface corresponds to the <title> element. ...
SVGURIReference - Web APIs
the svgurireference interface is used to reflect the href attribute and the deprecated xlink:href attribute. ...
... the svgurireference interface is used to reflect the href attribute and the deprecated xlink:href attribute. ...
SVGUnitTypes - Web APIs
the svgunittypes interface defines a commonly used set of constants used for reflecting gradientunits, patterncontentunits and other similar attributes. ...
... the svgunittypes interface defines a commonly used set of constants used for reflecting gradientunits, patterncontentunits and other similar attributes. ...
SVGUseElement - Web APIs
svg use dom interface the svguseelement interface corresponds to the <use> element. ...
... svg use dom interface the svguseelement interface corresponds to the <use> element. ...
SVGVKernElement - Web APIs
the svgvkernelement interface corresponds to the <vkern> elements. object-oriented access to the attributes of the <vkern> element via the svg dom is not possible. ...
... the svgvkernelement interface corresponds to the <vkern> elements. object-oriented access to the attributes of the <vkern> element via the svg dom is not possible. ...
SVGZoomAndPan - Web APIs
the svgzoomandpan interface is used to reflect the zoomandpan attribute, and is mixed in to other interfaces for elements that support this attribute. ...
... the svgzoomandpan interface is used to reflect the zoomandpan attribute, and is mixed in to other interfaces for elements that support this attribute. ...
Selection API - Web APIs
ng the selection to be the entire contents of a dom node using selection.selectallchildren(). you can run code in response to the selection being changed, or a new selection being started, using the globaleventhandlers.onselectionchange and globaleventhandlers.onselectstart event handlers. selection api interfaces selection represents the range of text selected by the user or the current position of the caret. extensions to other interfaces window.getselection(), document.getselection() returns a selection object representing the range of text selected by the user or the current position of the caret. document.getselection() is basically an alias of window.getselection(). globaleventhandlers.onselectstart represents the event handler that is called when a selectstart event is fire...
... opera full support yessafari full support ...
ServiceWorkerGlobalScope - Web APIs
chronous requests are not allowed from within a service worker — only asynchronous requests, like those initiated via the fetch() method, can be used. this interface inherits from the workerglobalscope interface, and its parent eventtarget, and therefore implements properties from windowtimers, windowbase64, and windoweventhandlers. ...
...sed. this interface inherits from the workerglobalscope interface, and its parent eventtarget, and therefore implements properties from windowtimers, windowbase64, and windoweventhandlers. ...
SourceBuffer.abort() - Web APIs
fter the call to appendbuffer but before the updateend event fires (i.e. a buffer is being appended but the operation has not yet completed) a user "scrubs" the video seeking to a new point in time. in this case you would want to manually call abort() on the source buffer to stop the decoding of the current buffer, then fetch and append the newly requested segment that relates to the current new position of the video. you can see something similar in action in nick desaulnier's bufferwhenneeded demo — in line 48, an event listener is added to the playing video so a function called seek() is run when the seeking event fires. 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...
... 48, an event listener is added to the playing video so a function called seek() is run when the seeking event fires. 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. recommendation initial definition. ...
SourceBuffer - Web APIs
the sourcebuffer interface represents a chunk of media to be passed into an htmlmediaelement and played, via a mediasource object. this can be made up of one or several media segments. ...
... the sourcebuffer interface represents a chunk of media to be passed into an htmlmediaelement and played, via a mediasource object. this can be made up of one or several media segments. ...
SourceBufferList - Web APIs
ents a simple container list for multiple sourcebuffer objects. the source buffer list containing the sourcebuffers appended to a particular mediasource can be retrieved using the mediasource.sourcebuffers property. the individual source buffers can be accessed using array operator (i.e. []) or functions such as foreach() for example. ...
...ource can be retrieved using the mediasource.sourcebuffers property. the individual source buffers can be accessed using array operator (i.e. []) or functions such as foreach() for example. ...
StaticRange.collapsed - Web APIs
specifications specification status comment domthe definition of 'collapsed' in that specification. ...
... specifications specification status comment domthe definition of 'collapsed' in that specification. ...
StorageEvent - Web APIs
a storageevent is sent to a window when a storage area it has access to is changed within the context of another document. ...
... a storageevent is sent to a window when a storage area it has access to is changed within the context of another document. ...
StylePropertyMap - Web APIs
the stylepropertymap interface of the the css typed object model api provides a representation of a css declaration block that is an alternative to cssstyledeclaration. ...
... the stylepropertymap interface of the the css typed object model api provides a representation of a css declaration block that is an alternative to cssstyledeclaration. ...
SyncEvent - Web APIs
Web › API › SyncEvent
the syncevent interface represents a sync action that is dispatched on the serviceworkerglobalscope of a serviceworker. this interface inherits from the extendableevent interface. ...
... the syncevent interface represents a sync action that is dispatched on the serviceworkerglobalscope of a serviceworker. this interface inherits from the extendableevent interface. ...
TaskAttributionTiming - Web APIs
the taskattributiontiming interface of the long tasks api returns information about the work involved in a long task and its associate frame context. the frame context, also called the container, is the iframe, embed or object that is being implicated, on the whole, for a long task. ...
...nvolved in a long task and its associate frame context. the frame context, also called the container, is the iframe, embed or object that is being implicated, on the whole, for a long task. ...
Text - Web APIs
Web › API › Text
contains markup, it is parsed into information items and text nodes that form its children. new documents have a single text node for each block of text. over time, more text nodes may be created as the document's content changes. the node.normalize() method merges adjacent text objects back into a single node for each block of text. ...
...f text. over time, more text nodes may be created as the document's content changes. the node.normalize() method merges adjacent text objects back into a single node for each block of text. ...
TimeEvent - Web APIs
Web › API › TimeEvent
the timeevent interface, a part of svg smil animation, provides specific contextual information associated with time events. ...
... the timeevent interface, a part of svg smil animation, provides specific contextual information associated with time events. ...
Touch() - Web APIs
Web › API › Touch › Touch
chinit); arguments touchinit is a touchinit dictionary, having the following fields: "identifier", required, of type long, that is the identification number for the touch point. "target", required, of type eventtarget, the item at which the touch point started when it was first placed on the surface. "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. "screenx", optional and defaulting to 0, of type double, that is the horizontal position of the touch on the user's screen. "screeny", optio...
... 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. "screenx", optional and defaulting to 0, of type double, that is the horizontal position of the touch on the user's screen. "screeny", optional and defaulting to 0, of type double, that is the vertical position of the touch on the user's screen. "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. "radiusx", optional ...
WebGLContextEvent - Web APIs
the webcontextevent interface is part of the webgl api and is an interface for an event that is generated in response to a status change to the webgl rendering context. inheritance this interface inherits properties and methods from its parent interface, event. ...
...for an event that is generated in response to a status change to the webgl rendering context. inheritance this interface inherits properties and methods from its parent interface, event. ...
Hello vertex attributes - Web APIs
« previousnext » this webgl example demonstrates how to combine shader programming and user interaction by sending user input to the shader using vertex attributes. hello world program in glsl how to send input to a shader program by saving data in gpu memory. <p>first encounter with attributes and sending data to gpu. ...
...t seem to support html5 canvas.</canvas> body { text-align : center; } canvas { width : 280px; height : 210px; margin : auto; padding : 0; border : none; background-color : black; } button { display : block; font-size : inherit; margin : auto; padding : 0.6em; } <script type="x-shader/x-vertex" id="vertex-shader"> #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) { ...
Controlling multiple parameters with ConstantSourceNode - Web APIs
n" class="button"> ▶️ </div> </div> <div class="right"> <span>volume: </span> <input type="range" min="0.0" max="1.0" step="0.01" value="0.8" name="volume" id="volumecontrol"> </div> </div> <p>use the button above to start and stop the tones, and the volume control to change the volume of the notes e and g in the chord.</p> css .controls { width: 400px; position: relative; vertical-align: middle; height: 44px; } .button { font-size: 32px; cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -o-user-select: none; } .right { width: 50%; font: 14px "open sans", "lucida grande", "arial", sans-serif; position: absolute; right: 0; display: table-cell; vertical-align: middl...
... setting up let's start by looking at the global variable initialization. let context = null; let playbutton = null; let volumecontrol = null; let oscnode1 = null; let oscnode2 = null; let...
Visualizations with Web Audio API - Web APIs
idth, 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. var slicewidth = width * 1.0 / bufferlength; var x = 0; now we run through a loop, defining the position of a small segment of the wave for each point in the buffer at a certain height based on the data point value form the array, then moving the line across to the place where the next wave segment should be drawn: for(var i = 0; i < buffe...
...ch value in the dataarray. for each one, we make the barheight equal to the array value, set a fill colour based on the barheight (taller bars are brighter), and draw a bar at x pixels across the canvas, which is barwidth wide and barheight/2 tall (we eventually decided to cut each bar in half so they would all fit on the canvas better.) the one value that needs explaining is the vertical offset position we are drawing each bar at: height-barheight/2. i am doing this because i want each bar to stick up from the bottom of the canvas, not down from the top, as it would if we set the vertical position to 0. therefore, we instead set the vertical position each time to the height of the canvas minus barheight/2, so therefore each bar will be drawn from partway down the canvas, down to the bottom. ...
Using the Web Speech API - Web APIs
color; console.log('confidence: ' + event.results[0][0].confidence); } the second line here is a bit complex-looking, so let's explain it step by step. the speechrecognitionevent.results property returns a speechrecognitionresultlist object containing speechrecognitionresult objects. it has a getter so it can be accessed like an array — so the first [0] returns the speechrecognitionresult at position 0. each speechrecognitionresult object contains speechrecognitionalternative objects that contain individual recognised words. these also have getters so they can be accessed like arrays — the second [0] therefore returns the speechrecognitionalternative at position 0. we then return its transcript property to get a string containing the individual recognised result as a string, set the backgro...
...ole.log('speech paused at character ' + event.charindex + ' of "' + event.utterance.text + '", which is "' + char + '".'); } finally, we call blur() on the text input. this is mainly to hide the keyboard on firefox os. inputtxt.blur(); } updating the displayed pitch and rate values the last part of the code simply updates the pitch/rate values displayed in the ui, each time the slider positions are moved. pitch.onchange = function() { pitchvalue.textcontent = pitch.value; } rate.onchange = function() { ratevalue.textcontent = rate.value; } ...
WheelEvent - Web APIs
ispatch a scroll event. even when it does, that doesn't mean that the delta* values in the wheel event necessarily reflect the content's scrolling direction. therefore, do not rely on delta* properties to get the content's scrolling direction. instead, detect value changes to scrollleft and scrolltop of the target in the scroll event. ...
...irection. therefore, do not rely on delta* properties to get the content's scrolling direction. instead, detect value changes to scrollleft and scrolltop of the target in the scroll event. ...
Window.getDefaultComputedStyle() - Web APIs
regular elements. return value the returned style is a cssstyledeclaration object. the object is of the same type as the object returned by window.getcomputedstyle(), but only takes into account user-agent and user rules. ...
...ment.getelementbyid("elemid"); var style = window.getdefaultcomputedstyle(elem1); longer example <style> #elem-container { position: absolute; left: 100px; top: 200px; height: 100px; } </style> <div id="elem-container">dummy</div> <div id="output"></div> <script> var elem = document.getelementbyid("elem-container"); var thecssprop = window.getdefaultcomputedstyle(elem).position; document.getelementbyid("output").innerhtml = thecssprop; // will output "static" </script> use with pseudo-elements the getdefaultcomputedstyle() method can pull style info from pseudo-elements (e.g., ::before or ::after). <style> h3:after { content: ' rocks!'; } </style> <h3>generated content</h3> <script> var h3 = document.queryselector('h3'), result = getdefaultco...
XMLDocument - Web APIs
the xmldocument interface represents an xml document. it inherits from the generic document and does not add any specific methods or properties to it: nevertheless, several algorithms behave differently with the two types of documents. ...
...cument. it inherits from the generic document and does not add any specific methods or properties to it: nevertheless, several algorithms behave differently with the two types of documents. ...
XMLHttpRequest - Web APIs
xmlhttprequest (xhr) objects are used to interact with servers. you can retrieve data from a url without having to do a full page refresh. this enables a web page to update just part of a page without disrupting what the user is doing. xmlhttprequest is used heavily in ajax programming. ...
...ithout having to do a full page refresh. this enables a web page to update just part of a page without disrupting what the user is doing. xmlhttprequest is used heavily in ajax programming. ...
XMLHttpRequestEventTarget - Web APIs
xmlhttprequesteventtarget is the interface that describes the event handlers you can implement in an object that will handle events for an xmlhttprequest. ...
... xmlhttprequesteventtarget is the interface that describes the event handlers you can implement in an object that will handle events for an xmlhttprequest. ...
XRBoundedReferenceSpace - Web APIs
the webxr device api's xrboundedreferencespace interface describes a virtual world reference space which has preset boundaries. this extends xrreferencespace, which describes an essentially unrestricted space around the viewer's position. these bounds are defined using an array of points, each of which defines a vertex in a polygon inside which the user is allowed to move. this is typically used when the xr system is capable of tracking the user's physical movement within a limited distance of their starting position. the specified bounds may, in fact, describe the shape and size of the room the user is located in, in order to let the webxr site or application prevent the user from colliding with the walls or other obstacles in the real world. at a minimum, the boundaries indicate the area in...
...why they're useful. properties in addition to the properties of xrreferencespace, xrboundedreferencespace includes the following: boundsgeometry read only an array of dompointreadonly objects, each of which defines a vertex in the polygon defining the boundaries within which the user will be required to remain. these vertices must be sorted such that they move clockwise around the viewer's position. methods xrboundedreferencespace inherits the methods of its parent interface, xrreferencespace. it has no further methods. specifications specification status comment webxr device apithe definition of 'xrboundedreferencespace' in that specification. working draft initial definition. ...
XRFrame.getPose() - Web APIs
Web › API › XRFrame › getPose
the xrframe method getpose() returns the relative position and orientation—the pose—of one xrspace to that of another space. with this, you can observe the motion of objects relative to each other and to fixed locations throughout the scene. for example, to get the position of a controller relative to the viewer's head, you would compare the controller's gripspace to the xrreferencespace of type viewer. syntax var xrpose = xrframe.getpose(space, basespace); parameters space an xrspace specifying the space for which to obtain an xrpose describing the item's position and orientation. basespace an xrspace to use as the base or origin for the purposes of computing the relative position and orientation. ...
...e to the xrreferencespace of type viewer. syntax var xrpose = xrframe.getpose(space, basespace); parameters space an xrspace specifying the space for which to obtain an xrpose describing the item's position and orientation. basespace an xrspace to use as the base or origin for the purposes of computing the relative position and orientation. return value an xrpose object specifying the position and orientation, relative to the xrspace indicated by basespace. specifications specification status comment webxr device apithe definition of 'xrframe.getpose()' in that specification. working draft initial definition. ...
XRFrame - Web APIs
Web › API › XRFrame
ded in order to render a single frame of animation for an xrsession describing a vr or ar sccene. events which communicate the tracking state of objects also provide an xrframe reference as part of their structure. in addition to providing a reference to the xrsession for which this frame is to be rendered, the getviewerpose() method is provided to obtain the xrviewerpose describing the viewer's position and orientation in space, and getpose() can be used to create an xrpose describing the relative position of one xrspace relative to another. properties session read only the xrsession that for which this xrframe describes the tracking details for all objects. the information about a specific object can be obtained by calling one of the methods on the object. methods getpose() returns ...
... read only the xrsession that for which this xrframe describes the tracking details for all objects. the information about a specific object can be obtained by calling one of the methods on the object. methods getpose() returns an xrpose object representing the spatial relationship between the two specified xrspace objects. getviewerpose() returns an xrviewerpose describing the viewer's position and orientation in a given xrreferencespace. specifications specification status comment webxr device apithe definition of 'xrframe' in that specification. working draft initial definition. ...
XRInputSource.targetRayMode - Web APIs
the user points in the direction of the target. the target ray extends from the hand (or the object in the hand) in the targeted direction. the direction is determined using platform-specific rules, though if no such rules exist, the direction is chosen by assuming the user is pointing their index finger straight out from their hand. usage notes the input source's targetrayspace indicates the position and orientation of the target ray, and can be used to determine where to render the ray. example this fragment of code shows part of a function to be called once every frame. it looks for inputs which have a non-null targetrayspace. inputs which have a value for this property represent inputs that project a target ray outward from the user. for each such input, this example looks for inputs wh...
...s that project a target ray outward from the user. for each such input, this example looks for inputs whose targetraymode is tracked-pointer, indicating that the input is in fact intended to represent a targeting device rather than a gazing device, screen tap, or mouse click. for tracked pointers, a function myrendertargetrayasbeam() is called to render a beam from the input controller's virtual position outward in the direction it's pointing. the code should continue to perform tasks such as drawing controllers or any objects representative of the user's hands' positions in the virtual space, as well as any other input-related tasks. function updateinputsources(session, frame, refspace) { for (let source of session.getinputsources()) { let targetraypose = frame.getpose(inputsource.target...
XRPose.transform - Web APIs
Web › API › XRPose › transform
this is the same pose that's returned by the frame's getpose() method. example this handler for the xrsession event select handles events for tracked pointers. ...
...this is the same pose that's returned by the frame's getpose() method. example this handler for the xrsession event select handles events for tracked pointers. ...
XRReferenceSpaceEvent.transform - Web APIs
the read-only xrreferencespaceevent property transform indicates the position and orientation of the affected referencespace's native origin after the changes the event represents are applied. the transform is defined using the old coordinate system, which allows it to be used to convert coordinates from the pre-event coordinate system to the post-event coordiante system. syntax let refspace = xrreferencespaceevent.transform; value an xrrigidtransform object providing a transform that can be used to convert coordinates from the pre-event coordinate system to the post-event coordinate system. 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. alternatively, you can just discar...
...nt.transform; value an xrrigidtransform object providing a transform that can be used to convert coordinates from the pre-event coordinate system to the post-event coordinate system. 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. alternatively, you can just discard any cached positional information and recompute from scratch. the approach you take will depend on your needs. 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. the scene is represented by a ...
XRReferenceSpaceEvent - Web APIs
sing the values in the given xrreferencespaceeventinit dictionary. properties in addition to inheriting the properties available on the parent interface, event, xrreferencespaceevent objects include the following properties: referencespace read only an xrreferencespace indicating the reference space that generated the event. transform read only an xrrigidtransform object indicating the position and orientation of the specified referencespace's native origin after the event, defined relative to the coordinate system before the event. methods while xrreferencespaceevent does not define any methods, it inherits the methods of its parent interface, event. event types reset the reset event is sent to a reference space when its native origin is changed due to a discontinuity, recalibr...
...ative to the coordinate system before the event. methods while xrreferencespaceevent does not define any methods, it inherits the methods of its parent interface, 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. this is an opportunity for your app to update any stored transforms, position/orientation information, or the like—or to dump any cached values based on the reference's space's origin so you can recompute them as needed. specifications specification status comment webxr device apithe definition of 'xrreferencespaceevent' in that specification. working draft initial definition. ...
XRRigidTransform.inverse - Web APIs
explicitly generate it. syntax let transforminverse = xrrigidtransform.inverse; value an xrrigidtransform which contains the inverse of the xrrigidtransform on which it's accessed. applying the inverse of a transform to any object previously transformed by the parent xrrigidtransform always undoes the transformation, resulting in the object returning to its previous pose. in other words, its position and orientation both return to their prior configurations. examples in this example, the model view matrix for an object is computed by taking the view matrix and multiplying it by the object's pose matrix. let modelviewmatrix = mat4.create(); for (let view of pose.view) { let viewport = gllayer.getviewport(view); gl.viewport(viewport.x, viewport.y, viewport.width, viewport.height); /*...
...ltiply(modelviewmatrix, view.transform.inverse.matrix, objectmatrix); gl.uniformmatrix4fv(programinfo.uniformlocations.modelviewmatrix, false, modelviewmatrix); /* ... */ } this outline of a renderer's core code shows how the pose's view gets represented by taking its transform's inverse's matrix as the model view matrix used to transform objects based on the viewer's position and orientation. 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. specifications specification status comment webxr device apithe definition of 'xrrigidtransform.inverse' in that specification. working draft initial definition. ...
XRWebGLLayer - Web APIs
only returns the width of the xrwebgllayer's framebuffer. framebufferheight read only returns the height of the layer's framebuffer. ignoredepthvalues read only a boolean which indicates whether or not the webxr compositor should make use of the contents of the layer's depth buffer while compositing the scene. 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. in this way, for example, the rendering of the left eye's point of view and of the right eye's point of view are each placed into the correct parts of the framebuffer. static methods getnativeframebufferscalefactor() returns the...
...y view in a frame each time the gpu is ready to render the scene to the xr device, the xr runtime calls the function you specified when you called the xrsession method requestanimationframe() to ask to render the frame. that function receives as input an xrframe which encapsulates the data needed to render the frame. this information includes the pose (an xrviewerpose object) that describes the position and facing direction of the viewer within the scene as well as a list of xrview objects, each representing one perspective on the scene. in current webxr implementations, there will never be more than two entries in this list: one describing the position and viewing angle of the left eye and another doing the same for the right. let pose = xrframe.getviewerpose(xrreferencespace); if (pose) { ...
Using the aria-valuenow attribute - Accessibility
ibutes. when the rendered value cannot be accurately represented as a number, authors should use the aria-valuetext attribute in conjunction with aria-valuenow to provide a user-friendly representation of the range's current value. for example, a slider may have rendered values of small, medium, and large. in this case, the values of aria-valuenow could range from 1 through 3, which indicate the position of each value in the value space, but the aria-valuetext would be one of the strings: small, medium, or large. aria-valuenow is a required attribute of role slider, scrollbar and spinbutton. value string representation of a number possible effects on user agents and assistive technology for elements with role progressbar and scrollbar, assistive technologies should render the actual value a...
...e, but the aria-valuetext would be one of the strings: small, medium, or large. aria-valuenow is a required attribute of role slider, scrollbar and spinbutton. value string representation of a number possible effects on user agents and assistive technology for elements with role progressbar and scrollbar, assistive technologies should render the actual value as a percentage, calculated as a position on the range from aria-valuemin to aria-valuemax if both are defined, otherwise the actual value with a percent indicator. for elements with role slider and spinbutton, assistive technologies should render the actual value to users. note: opinions may differ on how assistive technology should handle this technique. the information provided above is one of those opinions and therefore not normat...
ARIA: article role - Accessibility
es. they may also support indication of nesting relationships within articles. articles can be nested, indicating that a nested article directly relates to the one it is nested in, but not necessarily to the ones outside the nesting hierarchy. see the examples for specific use cases. 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. inside an application or other widget that causes screen readers and other assistive technologies to be in pass-through mode, an article can be used to indicate that these should switch back to treating the enclosed content as regular web content. instead of including the article role on a non-semantic element, the <article> element should be ...
...helps search engines better discover the structure of a page. examples of appropriate uses of the role="article", or preferably <article>, include blog posts, forum posts, a comment to a forum or blog post, a comment to a comment to a forum or blog post, any an item in a social media feed. associated wai-aria roles, states, and properties aria-posinset in the context of a feed, indicates the position of this particular article within that feed, based on a count starting at 1. aria-setsize in the context of a feed, indicates how many article items there are within that feed. keyboard interactions this role does not support any specific keyboard interaction. required javascript features event handlers this role does not require any event handlers to be present. changing attribute val...
ARIA: row role - Accessibility
only needed if columns are hidden from the dom. it is generally placed on row children, rather than on the row itself. if the columns displayed are contiguous, then it can be placed on the row. the attribute takes as its value an integer between 1 and the total number of columns within the table, grid or treegrid. when placed on the row, the aria-colindex defines an element's column index or position with respect to the total number of columns within a row. 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 it...
...umns are in the dom, this attribute is not necessary. aria-rowindex attribute the aria-rowindex attribute is only needed if rows are hidden from the dom, to indicate which row, in the list of total rows, is being read. the attribute, placed with a unique value on each row, takes as its value an integer between 1 and the total number of rows within the table, grid or treegrid, indicating the position, or index, of each row. 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. if all the rows are present in the dom, this attribute is not necessary. keyboard interactions none required javascript fea...
-webkit-box-reflect - CSS: Cascading Style Sheets
olution><id-selector> = <hash-token><cf-mixing-image> = <percentage>? && <image><cf-final-image> = <image> | <color><linear-gradient()> = linear-gradient( [ <angle> | to <side-or-corner> ]? , <color-stop-list> )<repeating-linear-gradient()> = repeating-linear-gradient( [ <angle> | to <side-or-corner> ]? , <color-stop-list> )<radial-gradient()> = radial-gradient( [ <ending-shape> | <size> ]? [ at <position> ]? , <color-stop-list> )<repeating-radial-gradient()> = repeating-radial-gradient( [ <ending-shape> | <size> ]? [ at <position> ]? , <color-stop-list> )<conic-gradient()> = conic-gradient( [ from <angle> ]? [ at <position> ]?, <angular-color-stop-list> )where <rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]? ) | rgb( <number>{3} [ / <alpha-value> ]? ) | rgb( <percentage>#{3} , <alpha-value>? )...
...hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsla( <hue>, <percentage>, <percentage>, <alpha-value>? )<side-or-corner> = [ left | right ] | [ top | bottom ]<color-stop-list> = [ <linear-color-stop> [, <linear-color-hint>]? ]# , <linear-color-stop><ending-shape> = circle | ellipse<size> = closest-side | farthest-side | closest-corner | farthest-corner | <length> | <length-percentage>{2}<position> = [ [ left | center | right ] | [ top | center | bottom ] | [ left | center | right | <length-percentage> ] [ top | center | bottom | <length-percentage> ]? | [ [ left | right ] <length-percentage> ] && [ [ top | bottom ] <length-percentage> ] ]<angular-color-stop-list> = [ <angular-color-stop> [, <angular-color-hint>]? ]# , <angular-color-stop>where <alpha-value> = <number> | <percentage><hue> ...
::after (:after) - CSS: Cascading Style Sheets
Web › CSS › ::after
accessible experience a semantic disclosure widget created in some other way (such as with details and summary elements) is likely to be more appropriate. html <p>here we have some <span tabindex="0" data-descr="collection of words and punctuation">text</span> with a few <span tabindex="0" data-descr="small popups that appear when hovering">tooltips</span>. ...
... some <span tabindex="0" data-descr="collection of words and punctuation">text</span> with a few <span tabindex="0" data-descr="small popups that appear when hovering">tooltips</span>. </p> css span[data-descr] { position: relative; text-decoration: underline; color: #00f; cursor: help; } span[data-descr]:hover::after, span[data-descr]:focus::after { content: attr(data-descr); position: absolute; left: 0; top: 24px; min-width: 200px; border: 1px #aaaaaa solid; border-radius: 10px; background-color: #ffffcc; padding: 12px; color: #000000; font-size: 14px; z-index: 1; } result specifications specification status comment css pseudo-elements level 4the definition of '::after' in that specification. working draft no signific...
::before (:before) - CSS: Cascading Style Sheets
Web › CSS › ::before
er-style: dotted; } result to-do list in this example we will create a simple to-do list using pseudo-elements. this method can often be used to add small touches to the ui and improve user experience. ...
...experience. ...
::cue-region - CSS: Cascading Style Sheets
operties apply to each cue individually, to avoid creating boxes and obscuring unexpectedly large areas of the media. ...
... candidate recommendation initial d...
::cue - CSS: Cascading Style Sheets
Web › CSS › ::cue
ts longhand properties apply to each cue individually, to avoid creating boxes and obscuring unexpectedly large areas of the media. ...
... ::cue { color: #fff; background-color: rgba(0, 0, 0, 0.6); }...
::first-letter (:first-letter) - CSS: Cascading Style Sheets
in css2. ...
...font-language-override, font-stretch, font-synthesis, font-variant, font-variant-alternates, font-variant-caps, font-variant-east-asian, font-variant-ligatures, font-variant-numeric, font-variant-position, font-weight, font-size, font-size-adjust, line-height and font-family all background properties : background, background-color, background-image, background-clip, background-origin, background-position, background-repeat, background-size, background-attachment, and background-blend-mode all margin properties: margin, margin-top, margin-right, margin-bottom, margin-left all padding properties: padding, padding-top, padding-right, padding-bottom, padding-left all border properties: the shorthands border, border-style, border-color, border-width, border-radius, border-image, and the longhands p...
::first-line (:first-line) - CSS: Cascading Style Sheets
red; } css3 introduced the ::first-line notation (with two colons) to distinguish pseudo-classes from pseudo-elements. browsers also accept :first-line, introduced in css2. ...
...ariant, font-variant-numeric, font-variant-position, font-variant-east-asian, font-variant-caps, font-variant-alternates, font-variant-ligatures, font-synthesis, font-feature-settings, font-language-override, font-weight, font-size, font-size-adjust, font-stretch, and font-family all background-related properties: background-color, background-clip, background-image, background-origin, background-position, background-repeat, background-size, background-attachment, and background-blend-mode the color property word-spacing, letter-spacing, text-decoration, text-transform, and line-height text-shadow, text-decoration, text-decoration-color, text-decoration-line, text-decoration-style, and vertical-align. syntax /* css3 syntax */ ::first-line /* css2 syntax */ :first-line examples html <p>s...
:nth-last-child() - CSS: Cascading Style Sheets
the :nth-last-child() css pseudo-class matches elements based on their position among a group of siblings, counting from the end. /* selects every fourth element among any group of siblings, counting backwards from the last one */ :nth-last-child(4n) { color: lime; } note: this pseudo-class is essentially the same as :nth-child, except it counts items backwards from the end, not forwards from the beginning. syntax the nth-last-child pseudo-class is specified with a single argument, which represents the pattern for matching elements, counting from the end. keyword values odd represents elements whose numeric position in a series of siblings is odd: 1, 3, 5, etc., counting from the end. ...
...unts items backwards from the end, not forwards from the beginning. syntax the nth-last-child pseudo-class is specified with a single argument, which represents the pattern for matching elements, counting from the end. keyword values odd represents elements whose numeric position in a series of siblings is odd: 1, 3, 5, etc., counting from the end. even represents elements whose numeric position in a series of siblings is even: 2, 4, 6, etc., counting from the end. functional notation <an+b> represents elements whose numeric position in a series of siblings matches the pattern an+b, for every positive integer or zero value of n. the index of the first element, counting from the end, is 1. the values a and b must both be <integer>s. formal syntax :nth-last-child( <nth> [ of <comp...
additive-symbols - CSS: Cascading Style Sheets
olution><id-selector> = <hash-token><cf-mixing-image> = <percentage>? && <image><cf-final-image> = <image> | <color><linear-gradient()> = linear-gradient( [ <angle> | to <side-or-corner> ]? , <color-stop-list> )<repeating-linear-gradient()> = repeating-linear-gradient( [ <angle> | to <side-or-corner> ]? , <color-stop-list> )<radial-gradient()> = radial-gradient( [ <ending-shape> | <size> ]? [ at <position> ]? , <color-stop-list> )<repeating-radial-gradient()> = repeating-radial-gradient( [ <ending-shape> | <size> ]? [ at <position> ]? , <color-stop-list> )<conic-gradient()> = conic-gradient( [ from <angle> ]? [ at <position> ]?, <angular-color-stop-list> )where <rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]? ) | rgb( <number>{3} [ / <alpha-value> ]? ) | rgb( <percentage>#{3} , <alpha-value>? )...
...hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsla( <hue>, <percentage>, <percentage>, <alpha-value>? )<side-or-corner> = [ left | right ] | [ top | bottom ]<color-stop-list> = [ <linear-color-stop> [, <linear-color-hint>]? ]# , <linear-color-stop><ending-shape> = circle | ellipse<size> = closest-side | farthest-side | closest-corner | farthest-corner | <length> | <length-percentage>{2}<position> = [ [ left | center | right ] | [ top | center | bottom ] | [ left | center | right | <length-percentage> ] [ top | center | bottom | <length-percentage> ]? | [ [ left | right ] <length-percentage> ] && [ [ top | bottom ] <length-percentage> ] ]<angular-color-stop-list> = [ <angular-color-stop> [, <angular-color-hint>]? ]# , <angular-color-stop>where <alpha-value> = <number> | <percentage><hue> ...
negative - CSS: Cascading Style Sheets
olution><id-selector> = <hash-token><cf-mixing-image> = <percentage>? && <image><cf-final-image> = <image> | <color><linear-gradient()> = linear-gradient( [ <angle> | to <side-or-corner> ]? , <color-stop-list> )<repeating-linear-gradient()> = repeating-linear-gradient( [ <angle> | to <side-or-corner> ]? , <color-stop-list> )<radial-gradient()> = radial-gradient( [ <ending-shape> | <size> ]? [ at <position> ]? , <color-stop-list> )<repeating-radial-gradient()> = repeating-radial-gradient( [ <ending-shape> | <size> ]? [ at <position> ]? , <color-stop-list> )<conic-gradient()> = conic-gradient( [ from <angle> ]? [ at <position> ]?, <angular-color-stop-list> )where <rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]? ) | rgb( <number>{3} [ / <alpha-value> ]? ) | rgb( <percentage>#{3} , <alpha-value>? )...
...hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsla( <hue>, <percentage>, <percentage>, <alpha-value>? )<side-or-corner> = [ left | right ] | [ top | bottom ]<color-stop-list> = [ <linear-color-stop> [, <linear-color-hint>]? ]# , <linear-color-stop><ending-shape> = circle | ellipse<size> = closest-side | farthest-side | closest-corner | farthest-corner | <length> | <length-percentage>{2}<position> = [ [ left | center | right ] | [ top | center | bottom ] | [ left | center | right | <length-percentage> ] [ top | center | bottom | <length-percentage> ]? | [ [ left | right ] <length-percentage> ] && [ [ top | bottom ] <length-percentage> ] ]<angular-color-stop-list> = [ <angular-color-stop> [, <angular-color-hint>]? ]# , <angular-color-stop>where <alpha-value> = <number> | <percentage><hue> ...
pad - CSS: Cascading Style Sheets
olution><id-selector> = <hash-token><cf-mixing-image> = <percentage>? && <image><cf-final-image> = <image> | <color><linear-gradient()> = linear-gradient( [ <angle> | to <side-or-corner> ]? , <color-stop-list> )<repeating-linear-gradient()> = repeating-linear-gradient( [ <angle> | to <side-or-corner> ]? , <color-stop-list> )<radial-gradient()> = radial-gradient( [ <ending-shape> | <size> ]? [ at <position> ]? , <color-stop-list> )<repeating-radial-gradient()> = repeating-radial-gradient( [ <ending-shape> | <size> ]? [ at <position> ]? , <color-stop-list> )<conic-gradient()> = conic-gradient( [ from <angle> ]? [ at <position> ]?, <angular-color-stop-list> )where <rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]? ) | rgb( <number>{3} [ / <alpha-value> ]? ) | rgb( <percentage>#{3} , <alpha-value>? )...
...hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsla( <hue>, <percentage>, <percentage>, <alpha-value>? )<side-or-corner> = [ left | right ] | [ top | bottom ]<color-stop-list> = [ <linear-color-stop> [, <linear-color-hint>]? ]# , <linear-color-stop><ending-shape> = circle | ellipse<size> = closest-side | farthest-side | closest-corner | farthest-corner | <length> | <length-percentage>{2}<position> = [ [ left | center | right ] | [ top | center | bottom ] | [ left | center | right | <length-percentage> ] [ top | center | bottom | <length-percentage> ]? | [ [ left | right ] <length-percentage> ] && [ [ top | bottom ] <length-percentage> ] ]<angular-color-stop-list> = [ <angular-color-stop> [, <angular-color-hint>]? ]# , <angular-color-stop>where <alpha-value> = <number> | <percentage><hue> ...
prefix - CSS: Cascading Style Sheets
olution><id-selector> = <hash-token><cf-mixing-image> = <percentage>? && <image><cf-final-image> = <image> | <color><linear-gradient()> = linear-gradient( [ <angle> | to <side-or-corner> ]? , <color-stop-list> )<repeating-linear-gradient()> = repeating-linear-gradient( [ <angle> | to <side-or-corner> ]? , <color-stop-list> )<radial-gradient()> = radial-gradient( [ <ending-shape> | <size> ]? [ at <position> ]? , <color-stop-list> )<repeating-radial-gradient()> = repeating-radial-gradient( [ <ending-shape> | <size> ]? [ at <position> ]? , <color-stop-list> )<conic-gradient()> = conic-gradient( [ from <angle> ]? [ at <position> ]?, <angular-color-stop-list> )where <rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]? ) | rgb( <number>{3} [ / <alpha-value> ]? ) | rgb( <percentage>#{3} , <alpha-value>? )...
...hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsla( <hue>, <percentage>, <percentage>, <alpha-value>? )<side-or-corner> = [ left | right ] | [ top | bottom ]<color-stop-list> = [ <linear-color-stop> [, <linear-color-hint>]? ]# , <linear-color-stop><ending-shape> = circle | ellipse<size> = closest-side | farthest-side | closest-corner | farthest-corner | <length> | <length-percentage>{2}<position> = [ [ left | center | right ] | [ top | center | bottom ] | [ left | center | right | <length-percentage> ] [ top | center | bottom | <length-percentage> ]? | [ [ left | right ] <length-percentage> ] && [ [ top | bottom ] <length-percentage> ] ]<angular-color-stop-list> = [ <angular-color-stop> [, <angular-color-hint>]? ]# , <angular-color-stop>where <alpha-value> = <number> | <percentage><hue> ...
suffix - CSS: Cascading Style Sheets
olution><id-selector> = <hash-token><cf-mixing-image> = <percentage>? && <image><cf-final-image> = <image> | <color><linear-gradient()> = linear-gradient( [ <angle> | to <side-or-corner> ]? , <color-stop-list> )<repeating-linear-gradient()> = repeating-linear-gradient( [ <angle> | to <side-or-corner> ]? , <color-stop-list> )<radial-gradient()> = radial-gradient( [ <ending-shape> | <size> ]? [ at <position> ]? , <color-stop-list> )<repeating-radial-gradient()> = repeating-radial-gradient( [ <ending-shape> | <size> ]? [ at <position> ]? , <color-stop-list> )<conic-gradient()> = conic-gradient( [ from <angle> ]? [ at <position> ]?, <angular-color-stop-list> )where <rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]? ) | rgb( <number>{3} [ / <alpha-value> ]? ) | rgb( <percentage>#{3} , <alpha-value>? )...
...hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsla( <hue>, <percentage>, <percentage>, <alpha-value>? )<side-or-corner> = [ left | right ] | [ top | bottom ]<color-stop-list> = [ <linear-color-stop> [, <linear-color-hint>]? ]# , <linear-color-stop><ending-shape> = circle | ellipse<size> = closest-side | farthest-side | closest-corner | farthest-corner | <length> | <length-percentage>{2}<position> = [ [ left | center | right ] | [ top | center | bottom ] | [ left | center | right | <length-percentage> ] [ top | center | bottom | <length-percentage> ]? | [ [ left | right ] <length-percentage> ] && [ [ top | bottom ] <length-percentage> ] ]<angular-color-stop-list> = [ <angular-color-stop> [, <angular-color-hint>]? ]# , <angular-color-stop>where <alpha-value> = <number> | <percentage><hue> ...
symbols - CSS: Cascading Style Sheets
olution><id-selector> = <hash-token><cf-mixing-image> = <percentage>? && <image><cf-final-image> = <image> | <color><linear-gradient()> = linear-gradient( [ <angle> | to <side-or-corner> ]? , <color-stop-list> )<repeating-linear-gradient()> = repeating-linear-gradient( [ <angle> | to <side-or-corner> ]? , <color-stop-list> )<radial-gradient()> = radial-gradient( [ <ending-shape> | <size> ]? [ at <position> ]? , <color-stop-list> )<repeating-radial-gradient()> = repeating-radial-gradient( [ <ending-shape> | <size> ]? [ at <position> ]? , <color-stop-list> )<conic-gradient()> = conic-gradient( [ from <angle> ]? [ at <position> ]?, <angular-color-stop-list> )where <rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]? ) | rgb( <number>{3} [ / <alpha-value> ]? ) | rgb( <percentage>#{3} , <alpha-value>? )...
...hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsla( <hue>, <percentage>, <percentage>, <alpha-value>? )<side-or-corner> = [ left | right ] | [ top | bottom ]<color-stop-list> = [ <linear-color-stop> [, <linear-color-hint>]? ]# , <linear-color-stop><ending-shape> = circle | ellipse<size> = closest-side | farthest-side | closest-corner | farthest-corner | <length> | <length-percentage>{2}<position> = [ [ left | center | right ] | [ top | center | bottom ] | [ left | center | right | <length-percentage> ] [ top | center | bottom | <length-percentage> ]? | [ [ left | right ] <length-percentage> ] && [ [ top | bottom ] <length-percentage> ] ]<angular-color-stop-list> = [ <angular-color-stop> [, <angular-color-hint>]? ]# , <angular-color-stop>where <alpha-value> = <number> | <percentage><hue> ...
height - CSS: Cascading Style Sheets
Web › CSS › @viewport › height
e@viewportinitial valueas each of the properties of the shorthand:min-height: automax-height: nonepercentagesas each of the properties of the shorthand:min-height: the percentage is calculated with respect to the height of the generated box's containing block. ...
...k is not specified explicitly (i.e., it depends on content height), and this element is not absolutely positioned, the percentage value is treated as 0.max-height: the percentage is calculated with respect to the height of the generated box's containing block. ...
Realizing common layouts using CSS Grid Layout - CSS: Cascading Style Sheets
span changes depending on the size of the screen. we start mobile first, and all we want for the narrowest screens is for the items to remain in source order, and all span right across the grid. .wrapper > * { grid-column: col-start / span 12; } at the next breakpoint we want to move to a two-column layout. our header and navigation still span the full grid, so we do not need to specify any positioning for them. the sidebar is starting on the first column line named col-start, spanning 3 lines. it goes after row line 3, as the header and navigation are in the first two row tracks. the ad panel is below the sidebar, so starts at grid row line 4. then we have the content and footer starting at col-start 4 and spanning 9 tracks taking them to the end of the grid. @media (min-width: 500px) { ...
...n: col-start 11 / span 2; grid-row: 2; } .ad { grid-column: col-start 11 / span 2; grid-row: 3; } .main-footer { grid-column: col-start / span 12; } nav ul { flex-direction: column; } } once again the grid inspector is useful to help us see how our layout has taken shape. something to note as we create this layout is that we haven’t needed to explicitly position every element on the grid at each breakpoint. we have been able to inherit the placement set up for earlier breakpoints – an advantage of working “mobile first”. we are also able to take advantage of grid auto-placement. by keeping elements in a logical order, auto-placement does quite a lot of work for us in placing items onto the grid. in the final example in this guide we will create a l...
CSS Images - CSS: Cascading Style Sheets
css images is a module of css that defines what types of images can be used (the <image> type, containing urls, gradients and other types of images), how to resize them and how they, and other replaced content, interact with the different layout models. reference properties image-orientation image-rendering image-resolution object-fit object-position functions linear-gradient() radial-gradient() repeating-linear-gradient() repeating-radial-gradient() conic-gradient() repeating-conic-gradient() url() element() image() cross-fade() data types <gradient> <image> guides using css gradients presents a specific type of css images, gradients, and how to create and use these. implementing image sprites in css describes the common technique grouping several image...
...ages in one single document to save download requests and speed up the availability of a page. specifications specification status comment css images module level 4 working draft added image-resolution, conic-gradient(), and image() css images module level 3 candidate recommendation added image-orientation, image-rendering, object-fit and object-position compatibility standardthe definition of 'css gradients' in that specification. living standard standardizes the -webkit prefixed gradient value functions css values and units module level 3the definition of '<url>' in that specification. candidate recommendation css level 2 (revision 1)the definition of '<uri>' in that specification. recommendation ...
CSS Logical Properties and Values - CSS: Cascading Style Sheets
border-end-end-radius border-style (logical keyword) border-width (logical keyword) margin (logical 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 key...
... ...
CSS Motion Path - CSS: Cascading Style Sheets
at your disposal, which wasn't ideal and only allowed for simple movements. 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. ...
... ...
Understanding CSS z-index - CSS: Cascading Style Sheets
in the most basic cases, html pages can be considered two-dimensional, because text, images, and other elements are arranged on the page without overlapping. in this case, there is a single rendering flow, and all elements are aware of the space taken by others. the z-index attribute lets you adjust the order of the layering of objects when rendering content. in css 2.1, each box has a position in three dimensions. in addition to their horizontal and vertical positions, boxes lie along a "z-axis" and are formatted one on top of the other. z-axis positions are particularly relevant when boxes overlap visually. (from css 2.1 section 9.9.1 - layered presentation) this means that css style rules allow you to position boxes on layers in addition to the normal rendering layer (layer 0). the z posi...
... using z-index appears extremely easy: a single property, assigned a single integer number, with an easy-to-understand behaviour. however, when z-index is applied to complex hierarchies of html elements, its behaviour can be hard to understand or predict. this is due to complex stacking rules. ...
Basic concepts of CSS Scroll Snap - CSS: Cascading Style Sheets
ore app-like experience on mobile or even on the desktop for some types of applications. basics of scroll snap the key properties of the scroll snap specification are scroll-snap-type and scroll-snap-align. the scroll-snap-type property is used on the scroll container to state the type and direction of scrolling. the scroll-snap-align property must be used on child elements in order to set the position that scrolling will snap to. the below example demonstrates scroll snapping along the y axis, with scroll-snap-align used on the section element to dictate the point the scrolling should stop. using scroll-snap-type the scroll-snap-type property needs to know the direction in which scroll snapping happens. this could be x or y, or the logical mappings block or inline. you can also use the key...
... the point, but does not have to. using mandatory gives a very consistent experience — you know that the browser will always snap to each defined point. this means you can be confident that something you expect to be at the top of the screen will be when scrolling finishes. however, it can cause problems if the content is larger than you expect — users may find themselves in the frustrating position of never being able to scroll and view a certain point in the content. therefore, use of mandatory should be carefully considered and only used in situations where you know how much content is on the screen at any one time. the proximity value will only snap to a position when it is close by, the exact distance being left to the browser to decide. in the example below you can change the value be...
CSS values and units - CSS: Cascading Style Sheets
roperties accept a dimension that could be either one of two types, for example a <length> or a <percentage>. in this case the allowed value is detailed in the specification as a combination unit, e.g. <length-percentage>. ...
... <time-percentage> special data types (defined in other specs) <color> <image> <position> color the <color> value specifies the color of an element feature (e.g. it's background color), and is defined in the css color module. image the <image> value specifies all the different types of image that can be used in css, and is defined in the css image values and replaced content module. position the <position> type defines 2d positioning of an object inside a positioning area, for example a background image inside a container. this type is interpreted as a background-position and therefore specified in the css backgrounds and borders specification. functional notation calc() min() max() clamp() toggle() attr() functional notation is a type of value that can represent more co...
Animatable CSS properties - CSS: Cascading Style Sheets
ime. ...
... 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 ...
Replaced elements - CSS: Cascading Style Sheets
in css, a replaced element is an element whose representation is outside the scope of css; they're external objects whose representation is independent of the css formatting model. put in simpler terms, they're elements whose contents are not affected by the current document's styles. the position of the replaced element can be affected using css, but not the contents of the replaced element itself. some replaced elements, such as <iframe> elements, may have stylesheets of their own, but they don't inherit the styles of the parent document. the only other impact css can have on a replaced element is that there are properties which support controlling the positioning of the element's content within its box. see controlling object position within the content box for further information. replaced...
...the html markup. using css with replaced elements css handles replaced elements specifically in some cases, like when calculating margins and some auto values. note that some replaced elements, but not all, have intrinsic dimensions or a defined baseline, which is used by some css properties, such as vertical-align. only replaced elements can ever have intrinsic dimensions. controlling object position within the content box certain css properties can be used to specify how the object contained within the replaced element should be positioned within the element's box area. these are defined by the css images module level 3 and css images module level 4 specifications: object-fit specifies how the replaced element's content object should be fitted to the containing element's box. object-po...
CSS Tutorials - CSS: Cascading Style Sheets
Web › CSS › Tutorials
s you to resize images used as an element's background. this tutorial describes how to achieve this in a simple way. media queries the size of the screens, or the kind of devices like touchscreens or printed sheets vary greatly nowadays. media queries are the fundamental building blocks in achieving web sites that render everywhere in their best quality. understanding z-index controlling superposition of boxes is a basic feature that is very quickly needed by web developers. though not that difficult, it requires a basic knowledge of css. intermediate-level css tutorials after the release of css 2 (level 1), new features have been added to css. some of them are fancy and are pretty self contained. they are easy to use for anybody with a fair knowledge of basic concepts. css counters cou...
...e counter-reset, counter-increment, counters(), and counter(). css animations css3 animations allow you to define configurations of style, as keyframes, and to transition between them defining an animation. css transitions css3 transitions allow you to define an animation between several styles and to control the way this transition happens. css transforms transforms allow you to change the position of elements by modifying their coordinate space: it allows for translating, rotating, and deforming them in the 2d or 3d spaces. css gradients gradients are images that transition smoothly from one color to another. there are several types of gradients allowed in css: linear or radial, repeating or not. this tutorial describes how to use them. advanced-level css tutorials css also got new fe...
animation-timing-function - CSS: Cascading Style Sheets
on, as determined by animation-name. the non-step keyword values (ease, linear, ease-in-out, etc.) each represent cubic bézier curve with fixed four point values, with the cubic-bezier() function value allowing for a non-predefined value. the step timing functions divides the input time into a specified number of intervals that are equal in length. it is defined by a number of steps and a step position. ease equal to cubic-bezier(0.25, 0.1, 0.25, 1.0), the default value, increases in velocity towards the middle of the animation, slowing back down at the end. linear equal to cubic-bezier(0.0, 0.0, 1.0, 1.0), animates at an even speed. ease-in equal to cubic-bezier(0.42, 0, 1.0, 1.0), starts off slowly, with the speed of the transition of the animating properting increasing until complete...
...ets" title="brackets: enclose several entities, combinators, and multipliers to transform them as a single component">[0,1]>, <number>, <number <a href="/docs/css/value_definition_syntax#brackets" title="brackets: enclose several entities, combinators, and multipliers to transform them as a single component">[0,1]>, <number>)<step-timing-function> = step-start | step-end | steps(<integer>[, <step-position>]?)where <step-position> = jump-start | jump-end | jump-none | jump-both | start | end examples cubic-bezier examples <div class="parent"> <div class="ease">ease</div> <div class="easein">ease-in</div> <div class="easeout">ease-out</div> <div class="easeinout">ease-in-out</div> <div class="linear">linear</div> <div class="cb">cubic-bezier(0.2,-2,0.8,2)</div> </div> .parent > div...
animation - CSS: Cascading Style Sheets
Web › CSS › animation
="pause"></button> </div> <div class="cell flx"> <div class="overlay">animation: 3s slidein;</div> <div class="animation a3"></div> </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...
...ets" title="brackets: enclose several entities, combinators, and multipliers to transform them as a single component">[0,1]>, <number>, <number <a href="/docs/css/value_definition_syntax#brackets" title="brackets: enclose several entities, combinators, and multipliers to transform them as a single component">[0,1]>, <number>)<step-timing-function> = step-start | step-end | steps(<integer>[, <step-position>]?)where <step-position> = jump-start | jump-end | jump-none | jump-both | start | end examples cylon eye <div class="view_port"> <div class="polling_message"> listening for dispatches </div> <div class="cylon_eye"></div> </div> .polling_message { color: white; float: left; margin-right: 2%; } .view_port { background-color: black; height: 25px; width: 100%; overflow:...
background-attachment - CSS: Cascading Style Sheets
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. 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. ...
...ackground is fixed relative to the viewport. even if an element has a scrolling mechanism, the background doesn't move with the element. (this is not compatible with background-clip: text.) local the background is fixed relative to the element's contents. if the element has a scrolling mechanism, the background scrolls with the element's contents, and the background painting area and background positioning area are relative to the scrollable area of the element rather than to the border framing them. scroll the background is fixed relative to the element itself and does not scroll with its contents. (it is effectively attached to the element's border.) formal definition initial valuescrollapplies toall elements. it also applies to ::first-letter and ::first-line.inheritednocomputed valueas ...
background-image - CSS: Cascading Style Sheets
olution><id-selector> = <hash-token><cf-mixing-image> = <percentage>? && <image><cf-final-image> = <image> | <color><linear-gradient()> = linear-gradient( [ <angle> | to <side-or-corner> ]? , <color-stop-list> )<repeating-linear-gradient()> = repeating-linear-gradient( [ <angle> | to <side-or-corner> ]? , <color-stop-list> )<radial-gradient()> = radial-gradient( [ <ending-shape> | <size> ]? [ at <position> ]? , <color-stop-list> )<repeating-radial-gradient()> = repeating-radial-gradient( [ <ending-shape> | <size> ]? [ at <position> ]? , <color-stop-list> )<conic-gradient()> = conic-gradient( [ from <angle> ]? [ at <position> ]?, <angular-color-stop-list> )where <rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]? ) | rgb( <number>{3} [ / <alpha-value> ]? ) | rgb( <percentage>#{3} , <alpha-value>? )...
...hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsla( <hue>, <percentage>, <percentage>, <alpha-value>? )<side-or-corner> = [ left | right ] | [ top | bottom ]<color-stop-list> = [ <linear-color-stop> [, <linear-color-hint>]? ]# , <linear-color-stop><ending-shape> = circle | ellipse<size> = closest-side | farthest-side | closest-corner | farthest-corner | <length> | <length-percentage>{2}<position> = [ [ left | center | right ] | [ top | center | bottom ] | [ left | center | right | <length-percentage> ] [ top | center | bottom | <length-percentage> ]? | [ [ left | right ] <length-percentage> ] && [ [ top | bottom ] <length-percentage> ] ]<angular-color-stop-list> = [ <angular-color-stop> [, <angular-color-hint>]? ]# , <angular-color-stop>where <alpha-value> = <number> | <percentage><hue> ...
background-repeat - CSS: Cascading Style Sheets
direction: repeat the image is repeated as much as needed to cover the whole background image painting area. the last image will be clipped if it doesn't fit. space the image is repeated as much as possible without clipping. the first and last images are pinned to either side of the element, and whitespace is distributed evenly between the images. the background-position property is ignored unless only one image can be displayed without clipping. the only case where clipping happens using space is when there isn't enough room to display one image. round as the allowed space increases in size, the repeated images will stretch (leaving no gaps) until there is room (space left >= half of the image width) for another one to be added. when the next ima...
... is added, all of the current ones compress to allow room. example: an image with an original width of 260px, repeated three times, might stretch until each repetition is 300px wide, and then another image will be added. they will then compress to 225px. no-repeat the image is not repeated (and hence the background image painting area will not necessarily be entirely covered). the position of the non-repeated background image is defined by the background-position css property. formal definition initial valuerepeatapplies toall elements. 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...
border-image-source - CSS: Cascading Style Sheets
olution><id-selector> = <hash-token><cf-mixing-image> = <percentage>? && <image><cf-final-image> = <image> | <color><linear-gradient()> = linear-gradient( [ <angle> | to <side-or-corner> ]? , <color-stop-list> )<repeating-linear-gradient()> = repeating-linear-gradient( [ <angle> | to <side-or-corner> ]? , <color-stop-list> )<radial-gradient()> = radial-gradient( [ <ending-shape> | <size> ]? [ at <position> ]? , <color-stop-list> )<repeating-radial-gradient()> = repeating-radial-gradient( [ <ending-shape> | <size> ]? [ at <position> ]? , <color-stop-list> )<conic-gradient()> = conic-gradient( [ from <angle> ]? [ at <position> ]?, <angular-color-stop-list> )where <rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]? ) | rgb( <number>{3} [ / <alpha-value> ]? ) | rgb( <percentage>#{3} , <alpha-value>? )...
...hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsla( <hue>, <percentage>, <percentage>, <alpha-value>? )<side-or-corner> = [ left | right ] | [ top | bottom ]<color-stop-list> = [ <linear-color-stop> [, <linear-color-hint>]? ]# , <linear-color-stop><ending-shape> = circle | ellipse<size> = closest-side | farthest-side | closest-corner | farthest-corner | <length> | <length-percentage>{2}<position> = [ [ left | center | right ] | [ top | center | bottom ] | [ left | center | right | <length-percentage> ] [ top | center | bottom | <length-percentage> ]? | [ [ left | right ] <length-percentage> ] && [ [ top | bottom ] <length-percentage> ] ]<angular-color-stop-list> = [ <angular-color-stop> [, <angular-color-hint>]? ]# , <angular-color-stop>where <alpha-value> = <number> | <percentage><hue> ...
<display-listitem> - CSS: Cascading Style Sheets
the list-item keyword causes the element to generate a ::marker pseudo-element with the content specified by its list-style properties (for example a bullet point) together with a principal box of the specified type for its own contents. syntax a single value of list-item will cause the element to behave like a list item. this can be used together with list-style-type and list-style-position. list-item can also be combined with any <display-outside> keyword and the flow or flow-root <display-inside> keywords. note: in browsers that support the two-value syntax, if no inner value is specified it will default to flow. if no outer value is specified, the principal box will have an outer display type of block. examples html <div class="fake-list">i will display as a list item</div> css .f...
...de> keyword and the flow or flow-root <display-inside> keywords. note: in browsers that support the two-value syntax, if no inner value is specified it will default to flow. if no outer value is specified, the principal box will have an outer display type of block. examples html <div class="fake-list">i will display as a list item</div> css .fake-list { display: list-item; list-style-position: inside; } result specifications specification status css display module level 3the definition of 'display-listitem' in that specification. candidate recommendation ...
float - CSS: Cascading Style Sheets
Web › CSS › float
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...must float on the end side of its containing block. that is the right side with ltr scripts, and the left side with rtl scripts. formal definition initial valuenoneapplies toall elements, but has no effect if the value of display is none.inheritednocomputed valueas specifiedanimation typediscrete formal syntax left | right | none | inline-start | inline-end examples how floated elements are positioned as mentioned above, when an element is floated, it is taken out of the normal flow of the document (though still remaining part of it). it is shifted to the left, or right, until it touches the edge of its containing box, or another floated element. in this example, there are three colored squares. two are floated left, and one is floated right. note that the second "left" square is placed to...
grid-area - CSS: Cascading Style Sheets
Web › CSS › grid-area
& <custom-ident>? contributes the nth grid line to the grid item’s placement. if a negative integer is given, it instead counts in reverse, starting from the end edge of the explicit grid. if a name is given as a <custom-ident>, only lines with that name are counted. if not enough lines with that name exist, all implicit grid lines are assumed to have that name for the purpose of finding this position. an <integer> value of 0 is invalid. span && [ <integer> || <custom-ident> ] contributes a grid span to the grid item’s placement such that the corresponding edge of the grid item’s grid area is n lines from the opposite edge. if a name is given as a <custom-ident>, only lines with that name are counted. if not enough lines with that name exist, all implicit grid lines on the side of t...
...licit grid corresponding to the search direction are assumed to have that name for the purpose of counting this span. if the <integer> is omitted, it defaults to 1. negative integers or 0 are invalid. ...
grid-column - CSS: Cascading Style Sheets
& <custom-ident>? contributes the nth grid line to the grid item’s placement. if a negative integer is given, it instead counts in reverse, starting from the end edge of the explicit grid. if a name is given as a <custom-ident>, only lines with that name are counted. if not enough lines with that name exist, all implicit grid lines are assumed to have that name for the purpose of finding this position. an <integer> value of 0 is invalid. span && [ <integer> || <custom-ident> ] contributes a grid span to the grid item’s placement such that the corresponding edge of the grid item’s grid area is n lines from the opposite edge. if a name is given as a <custom-ident>, only lines with that name are counted. if not enough lines with that name exist, all implicit grid lines on the side of t...
... support automatic placement of grid items. all items end up in the first row/col of the grid unless explicitly annotated with -ms-grid-column and -ms-grid-row. one can use a little javascript to enable automatic annotation: source repository. ...
grid-row - CSS: Cascading Style Sheets
Web › CSS › grid-row
& <custom-ident>? contributes the nth grid line to the grid item’s placement. if a negative integer is given, it instead counts in reverse, starting from the end edge of the explicit grid. if a name is given as a <custom-ident>, only lines with that name are counted. if not enough lines with that name exist, all implicit grid lines are assumed to have that name for the purpose of finding this position. an <integer> value of 0 is invalid. span && [ <integer> || <custom-ident> ] contributes a grid span to the grid item’s placement such that the corresponding edge of the grid item’s grid area is n lines from the opposite edge. if a name is given as a <custom-ident>, only lines with that name are counted. if not enough lines with that name exist, all implicit grid lines on the side of t...
...es not support automatic placement of grid items. all items end up in the first row/col of the grid unless explicitly annotated with -ms-grid-column and -ms-grid-row. one can use a little javascript to enable automatic annotation: source repository. ...
inset-block-end - CSS: Cascading Style Sheets
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. ...
... editor's draft initial definition ...
inset-block-start - CSS: Cascading Style Sheets
ock-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. ...
... editor's draft initial definition ...
inset-block - CSS: Cascading Style Sheets
lock: 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. ...
... editor's draft initial definition ...
inset-inline-end - CSS: Cascading Style Sheets
aining 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. ...
... editor's draft initial definition ...
inset-inline-start - CSS: Cascading Style Sheets
*/ 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. ...
... editor's draft initial definition ...
inset-inline - CSS: Cascading Style Sheets
0% 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. ...
... editor's draft initial definition ...
<length> - CSS: Cascading Style Sheets
Web › CSS › length
the effect of different length units. ...
... 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; } .results { margin-top: 10px; } .input-container { position: absolute; display: flex; justify-content: flex-start; align-items: center; height: 50px; } label { margin: 0 10px 0 20px; } javascript const inputdiv = document.queryselector('.inner'); const inputelem = document.queryselector('input'); const resultsdiv = document.queryselector('.resul...
margin-left - CSS: Cascading Style Sheets
as a percentage, relative to the width of the containing block. auto the left margin receives a share of the unused horizontal space, as determined mainly by the layout mode that is used. if the values of margin-left and margin-right are both auto, the calculated space is evenly distributed. this table summarizes the different cases: 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. in this case, it is set to the value centering the ele...
...ny table-*, except table-caption any any 0 internal table-* elements don't have margins, use border-spacing instead any, except flex, inline-flex, or table-* any fixed or absolute 0, except if both margin-left and margin-right are set to auto. in this case, it is set to the value centering the border area inside the available width, if fixed. absolutely positioned layout mode flex, inline-flex any any 0, except if there is any positive horizontal free space. in this case, it is evenly distributed to all horizontal auto margins. flexbox layout mode formal definition initial value0applies toall elements, except elements with table display types other than table-caption, table and inline-table. it also applies to ::...
margin-right - CSS: Cascading Style Sheets
s a percentage, relative to the width of the containing block. auto the right margin receives a share of the unused horizontal space, as determined mainly by the layout mode that is used. if the values of margin-left and margin-right are both auto, the calculated space is evenly distributed. this table summarizes the different cases: 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. in this case, it is set to the value centering the ele...
...ny table-*, except table-caption any any 0 internal table-* elements don't have margins, use border-spacing instead any, except flex, inline-flex, or table-* any fixed or absolute 0, except if both margin-left and margin-right are set to auto. in this case, it is set to the value centering the border area inside the available width, if fixed. absolutely positioned layout mode flex, inline-flex any any 0, except if there is any positive horizontal free space. in this case, it is evenly distributed to all horizontal auto margins. flexbox layout mode formal definition initial value0applies toall elements, except elements with table display types other than table-caption, table and inline-table. it also applies to ::...
mask-border-source - CSS: Cascading Style Sheets
olution><id-selector> = <hash-token><cf-mixing-image> = <percentage>? && <image><cf-final-image> = <image> | <color><linear-gradient()> = linear-gradient( [ <angle> | to <side-or-corner> ]? , <color-stop-list> )<repeating-linear-gradient()> = repeating-linear-gradient( [ <angle> | to <side-or-corner> ]? , <color-stop-list> )<radial-gradient()> = radial-gradient( [ <ending-shape> | <size> ]? [ at <position> ]? , <color-stop-list> )<repeating-radial-gradient()> = repeating-radial-gradient( [ <ending-shape> | <size> ]? [ at <position> ]? , <color-stop-list> )<conic-gradient()> = conic-gradient( [ from <angle> ]? [ at <position> ]?, <angular-color-stop-list> )where <rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]? ) | rgb( <number>{3} [ / <alpha-value> ]? ) | rgb( <percentage>#{3} , <alpha-value>? )...
...hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsla( <hue>, <percentage>, <percentage>, <alpha-value>? )<side-or-corner> = [ left | right ] | [ top | bottom ]<color-stop-list> = [ <linear-color-stop> [, <linear-color-hint>]? ]# , <linear-color-stop><ending-shape> = circle | ellipse<size> = closest-side | farthest-side | closest-corner | farthest-corner | <length> | <length-percentage>{2}<position> = [ [ left | center | right ] | [ top | center | bottom ] | [ left | center | right | <length-percentage> ] [ top | center | bottom | <length-percentage> ]? | [ [ left | right ] <length-percentage> ] && [ [ top | bottom ] <length-percentage> ] ]<angular-color-stop-list> = [ <angular-color-stop> [, <angular-color-hint>]? ]# , <angular-color-stop>where <alpha-value> = <number> | <percentage><hue> ...
mask-image - CSS: Cascading Style Sheets
olution><id-selector> = <hash-token><cf-mixing-image> = <percentage>? && <image><cf-final-image> = <image> | <color><linear-gradient()> = linear-gradient( [ <angle> | to <side-or-corner> ]? , <color-stop-list> )<repeating-linear-gradient()> = repeating-linear-gradient( [ <angle> | to <side-or-corner> ]? , <color-stop-list> )<radial-gradient()> = radial-gradient( [ <ending-shape> | <size> ]? [ at <position> ]? , <color-stop-list> )<repeating-radial-gradient()> = repeating-radial-gradient( [ <ending-shape> | <size> ]? [ at <position> ]? , <color-stop-list> )<conic-gradient()> = conic-gradient( [ from <angle> ]? [ at <position> ]?, <angular-color-stop-list> )where <rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]? ) | rgb( <number>{3} [ / <alpha-value> ]? ) | rgb( <percentage>#{3} , <alpha-value>? )...
...hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsla( <hue>, <percentage>, <percentage>, <alpha-value>? )<side-or-corner> = [ left | right ] | [ top | bottom ]<color-stop-list> = [ <linear-color-stop> [, <linear-color-hint>]? ]# , <linear-color-stop><ending-shape> = circle | ellipse<size> = closest-side | farthest-side | closest-corner | farthest-corner | <length> | <length-percentage>{2}<position> = [ [ left | center | right ] | [ top | center | bottom ] | [ left | center | right | <length-percentage> ] [ top | center | bottom | <length-percentage> ]? | [ [ left | right ] <length-percentage> ] && [ [ top | bottom ] <length-percentage> ] ]<angular-color-stop-list> = [ <angular-color-stop> [, <angular-color-hint>]? ]# , <angular-color-stop>where <alpha-value> = <number> | <percentage><hue> ...
mask-repeat - CSS: Cascading Style Sheets
works for either direction: repeat the image is repeated as much as needed to cover the whole mask painting area. the last image will be clipped if it doesn't fit. space the image is repeated as much as possible without clipping. the first and last images are pinned to either side of the element, and whitespace is distributed evenly between the images. the mask-position property is ignored unless only one image can be displayed without clipping. the only case where clipping happens using space is when there isn't enough room to display one image. round as the allowed space increases in size, the repeated images will stretch (leaving no gaps) until there is room for another one to be added. when the next image is added, all of the current ones com...
...e next image is added, all of the current ones compress to allow room. example: an image with an original width of 260px, repeated three times, might stretch until each repetition is 300px wide, and then another image will be added. they will then compress to 225px. no-repeat the image is not repeated (and hence the mask painting area will not necessarily be entirely covered). the position of the non-repeated mask image is defined by the mask-position css property. 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...
mix-blend-mode - CSS: Cascading Style Sheets
o; } .col { display: flex; flex: 1 auto; flex-direction: column; height: auto; } .cell { margin: .5em; padding: .5em; background-color: #fff; overflow: hidden; text-align: center; } .note { background: #fff3d4; padding: 1em; margin: .5em .5em 0; font: .8em sans-serif; text-align: left; white-space: nowrap; } .note + .row .cell { margin-top: 0; } .container { position: relative; background: linear-gradient(to right, #000 0%, transparent 50%, #fff 100%), linear-gradient(to bottom, #ff0 0%, #f0f 50%, #0ff 100%); width: 150px; height: 150px; margin: 0 auto; } .r { transform-origin: center; transform: rotate(-30deg); fill: url(#red); } .g { transform-origin: center; transform: rotate(90deg); fill: url(#green); } .b { transfor...
...-mode: saturation; } .color .item { mix-blend-mode: color; } .luminosity .item { mix-blend-mode: luminosity; } using mix-blend-mode with html html <div class="isolate"> <div class="circle circle-1"></div> <div class="circle circle-2"></div> <div class="circle circle-3"></div> </div> css .circle { width: 80px; height: 80px; border-radius: 50%; mix-blend-mode: screen; position: absolute; } .circle-1 { background: red; } .circle-2 { background: lightgreen; left: 40px; } .circle-3 { background: blue; left: 20px; top: 40px; } .isolate { isolation: isolate; /* without isolation, the background color will be taken into account */ position: relative; } result using mix-blend-mode with svg svg <svg> <g class="isolate"> <circle cx="40" cy="40" r...
object-fit - CSS: Cascading Style Sheets
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... background-size ...
offset-distance - CSS: Cascading Style Sheets
100% represents the total length of the path (when the offset-path is defined as a basic shape or path()). ...
... 100% represents the total length of the path (when the offset-path is defined as a basic shape or path()). ...
offset-rotate - CSS: Cascading Style Sheets
this is the default value. ...
...this is the default value. <angle> the element has a constant clockwise rotation transformation applied to it by the specified rotation angle. ...
order - CSS: Cascading Style Sheets
Web › CSS › order
the visual (css) order is important, then screen reader users will not have access to the correct reading order. flexbox & the keyboard navigation disconnect — tink source order matters | adrian roselli mdn understanding wcag, guideline 1.3 explanations understanding success criterion 1.3.2 | w3c understanding wcag 2.0 formal definition initial value0applies toflex items and absolutely-positioned flex container childreninheritednocomputed valueas specifiedanimation typean integer formal syntax <integer> examples ordering items in a flex container this example uses css to create a classic two-sidebar layout surrounding a content block. the flexible box layout module automatically creates blocks of equal vertical size and uses as much horizontal space as available. html <header>...
...in > article { flex:1; order: 2; } main > nav { width: 200px; order: 1; } main > aside { width: 200px; order: 3; } result specifications specification status comment css flexible box layout modulethe definition of 'order' in that specification. candidate recommendation initial definition initial value0applies toflex items and absolutely-positioned flex container childreninheritednocomputed valueas specifiedanimation typean integer ...
Guide to scroll anchoring - CSS: Cascading Style Sheets
f the page you are looking at suddenly jumps. this has happened because large images or some other elements have just loaded further up in the content. scroll anchoring is a browser feature that aims to solve this problem of content jumping, which happens if content loads in after the user has already scrolled to a new part of the document. how does it work? scroll anchoring adjusts the scroll position to compensate for the changes outside of the viewport. this means that the point in the document the user is looking at remains in the viewport, which may mean their scroll position actually changes in terms of how far they have moved through the document. how do i turn on scroll anchoring? you don't! the feature is enabled by default in supporting browsers. in most cases anchored scrolling is ...
... triggers, which will disable scroll anchoring in places where it might be problematic. if any of the triggers happen on the anchor node, or an ancestor of it, anchoring is suppressed. these suppression triggers are changes to the computed value of any of the following properties: top, left, right, or bottom margin or padding any width or height-related properties transform additionally, position changes anywhere inside the scrolling box also disable scroll anchoring. in bug 1584285 the layout.css.scroll-anchoring.suppressions.enabled flag was added to firefox nightly in order to allow the disabling of these triggers further reading explainer document on the wicg site scroll anchoring for web developers on the chromium blog implement a pin-to-bottom scrolling element using scroll...
scroll-snap-align - CSS: Cascading Style Sheets
the scroll-snap-align property specifies the box’s snap position as an alignment of its snap area (as the alignment subject) within its snap container’s snapport (as the alignment container). the two values specify the snapping alignment in the block axis and inline axis, respectively. if only one value is specified, the second value defaults to the same value. 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. start the start alignment of this box's scroll snap area, within the scroll container's snappo...
...e; 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. start the start alignment of this box's scroll snap area, within the scroll container's snapport is a snap position in this axis. end the end alignment of this box's scroll snap area, within the scroll container's snapport is a snap position in this axis. center the center alignment of this box's scroll snap area, within the scroll container's snapport is a snap position in this axis. safari currently has the two value syntax in the wrong order, the first value being inline the second block. see bug #191...
scroll-snap-type - CSS: Cascading Style Sheets
/* 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. ...
...p-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. x the scroll container snaps to snap positions in its horizontal axis only. y the scroll container snaps to snap positions in its vertical axis only. block the scroll container snaps to snap positions in its block axis only. inline the scroll container snaps to snap positions in its inline axis only. both the scroll container snaps to snap positions in both of its axes independently (potentially snapping to different elements in each axis). mandatory the visual viewport of this scroll container will rest on ...
transform-box - CSS: Cascading Style Sheets
erence box. the reference box of a <table> is the border box of its table wrapper box, not its table box. fill-box the object bounding box is used as the reference box. stroke-box the stroke bounding box is used as the reference box. view-box the nearest svg viewport is used as the reference box. 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. formal definition initial valueview-boxapplies totransformable elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax content-box | border-box | fill-box | stroke-box | view-box exampl...
...none" /> </g> </svg> in the css we have an animation that uses a transform to rotate the rectangle infinitely. transform-box: fill-box is used to make the the transform-origin the center of the bounding box, so the rectangle spins in place. without it, the transform origin is the center of the svg canvas, and so you get a very different effect. ...
transition-timing-function - CSS: Cascading Style Sheets
n, as defined in transition-property. the non-step keyword values (ease, linear, ease-in-out, etc.) each represent cubic bézier curve with fixed four point values, with the cubic-bezier() function value allowing for a non-predefined value. the step timing functions divides the input time into a specified number of intervals that are equal in length. it is defined by a number of steps and a step position. ease equal to cubic-bezier(0.25, 0.1, 0.25, 1.0), the default value, increases in velocity towards the middle of the transition, slowing back down at the end. linear equal to cubic-bezier(0.0, 0.0, 1.0, 1.0), transitions at an even speed. ease-in equal to cubic-bezier(0.42, 0, 1.0, 1.0), starts off slowly, with the transition speed increasing until complete. ease-out equal to ...
...ets" title="brackets: enclose several entities, combinators, and multipliers to transform them as a single component">[0,1]>, <number>, <number <a href="/docs/css/value_definition_syntax#brackets" title="brackets: enclose several entities, combinators, and multipliers to transform them as a single component">[0,1]>, <number>)<step-timing-function> = step-start | step-end | steps(<integer>[, <step-position>]?)where <step-position> = jump-start | jump-end | jump-none | jump-both | start | end examples cubic-bezier examples <div class="parent"> <div class="ease">ease</div> <div class="easein">ease-in</div> <div class="easeout">ease-out</div> <div class="easeinout">ease-in-out</div> <div class="linear">linear</div> <div class="cb">cubic-bezier(0.2,-2,0.8,2)</div> </div> .parent {} .pa...
transition - CSS: Cascading Style Sheets
specifications specification status comment css transitionsthe definition of 'transition' in that specification. working draft initial definition ...
... specifications specification status comment css transitionsthe definition of 'transition' in that specification. working draft initial definition ...
Used value - CSS: Cascading Style Sheets
lue after all calculations have been performed on the computed value. after the user agent has finished its calculations, every css property has a used value. the used values of dimensions (e.g., width, line-height) are in pixels. the used values of shorthand properties (e.g., background) are consistent with those of their component properties (e.g., background-color or background-size) and with position and float. note: the getcomputedstyle() dom api returns the resolved value, which may either be the computed value or the used value, depending on the property. example this example computes and displays the used width value of three elements (updates on resize): html <div id="no-width"> <p>no explicit width.</p> <p class="show-used-width">..</p> <div id="width-50"> <p>explicit ...
... of a parent, whose computed value is a percentage. for css properties that don't depend on layout (e.g., display, font-size, or line-height), the computed values and used values are the same. the following are the css 2.1 properties that do depend on layout, so they have a different computed value and used value: (taken from css 2.1 changes: specified, computed, and actual values): background-position bottom, left, right, top height, width margin-bottom, margin-left, margin-right, margin-top min-height, min-width padding-bottom, padding-left, padding-right, padding-top text-indent specification specification status comment css level 2 (revision 2)the definition of 'used value' in that specification. working draft no change. css level...
Media buffering, seeking, and time ranges - Developer guides
eem to display. so let's build this. ...
...id="buffered-amount"></span> </div> <div class="progress"> <span id="progress-amount"></span> </div> we'll use the following css to style the buffering display: .buffered { height: 20px; position: relative; background: #555; width: 300px; } #buffered-amount { display: block; height: 100%; background-color: #777; width: 0; } .progress { margin-top: -20px; height: 20px; position: relative; width: 300px; } #progress-amount { display: block; height: 100%; background-color: #595; width: 0; } and the following javascript provides our functionality: window.onload = function(){ var myaudio = document.getelementbyid('my-audio'); myaudio.addeventlistener('progress', function() { var duration = myaudio.duration; if (duration > 0) { for (var i = 0...
Creating a cross-browser video player - Developer guides
tes); if so, it uses the play() method to playback the video. otherwise the video must be playing, so it is paused using the pause() method. stop stop.addeventlistener('click', function(e) { video.pause(); video.currenttime = 0; progress.value = 0; }); the media api doesn't have a stop method, so to mimic this the video is paused, and its currenttime (i.e. the video's current playing position) and the <progress> element's position is set to 0 (more on the <progress> element later). mute mute.addeventlistener('click', function(e) { video.muted = !video.muted; }); the mute button is a simple toggle button that uses the media api's muted attribute to mute the video: this is a boolean indicating whether the video is muted or not. to get it to toggle, we set it to the inverse of its...
...is the ability to click on the video's progress bar to "skip ahead" to a different point in the video. this can also be achieved by adding a simple click event listener to the progress element: progress.addeventlistener('click', function(e) { var pos = (e.pagex - this.offsetleft) / this.offsetwidth; video.currenttime = pos * video.duration; }); this piece of code simply uses the clicked position to (roughly) work out where in the progress element the user has clicked, and to move the video to that position by setting its currenttime attribute. fullscreen the fullscreen api should be straight forward to use: the user clicks a button, if the video is in fullscreen mode: cancel it, otherwise enter fullscreen mode. alas it has been implemented in browsers in a number of weird and wonderfu...
Block formatting context - Developer guides
a block formatting context is a part of a visual css rendering of a web page. it's the region in which the layout of block boxes occurs and in which floats interact with other elements. a block formatting context is created by at least one of the following: the root element of the document (<html>). floats (elements where float isn't none). absolutely positioned elements (elements where position is absolute or fixed). inline-blocks (elements with display: inline-block). table cells (elements with display: table-cell, which is the default for html table cells). table captions (elements with display: table-caption, which is the default for html table captions). anonymous table cells implicitly created by the elements with display: table, table-row, table-row-group, table-header-group, tab...
...selves. multicol containers (elements where column-count or column-width isn't auto, including elements with column-count: 1). column-span: all should always create a new formatting context, even when the column-span: all element isn't contained by a multicol container (spec change, chrome bug). formatting contexts affect layout, but typically, we create a new block formatting context for the positioning and clearing floats rather than changing the layout, because an element that establishes a new block formatting context will: contain internal floats. exclude external floats. suppress margin collapsing. note: a flex/grid container(display: flex/grid/inline-flex/inline-grid) establishes a new flex/grid formatting context, which is similar to block formatting context except layout. ther...
Using HTML sections and outlines - Developer guides
html tags. html header element (<header>) defines a page area that typically contains a logo, title, and navigation. the header can also be used inside other semantic elements such as <article> or <section>. a section header might contain the section's heading, author name, etc. <article>, <section>, <aside>, and <nav> can have their own <header>. despite its name, the header is not necessarily positioned at the beginning of a page or section. html footer element (<footer>) defines a page footer, which typically contains copyright or legal notices and sometimes some links. in the context of a section, a footer might contain the sectioned content's publication date, license information, etc. <article>, <section>, <aside>, and <nav> can have their own <footer>. despite its name, the footer is not...
...inning of a page or section. html footer element (<footer>) defines a page footer, which typically contains copyright or legal notices and sometimes some links. in the context of a section, a footer might contain the sectioned content's publication date, license information, etc. <article>, <section>, <aside>, and <nav> can have their own <footer>. despite its name, the footer is not necessarily positioned at the end of a page or section. how do sectional elements work? <body> <header> <nav> <ul> <li><a href="#">link</a></li> <li><a href="#">link</a></li> <li><a href="#">link</a></li> </ul> </nav> <h1> page title </h1> </header> <section> <h2> my blog posts </h2> <article> ...
<col> - HTML: Hypertext Markup Language
Web › HTML › Element › col
t value is assumed. 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. because <td> elements are not descendant of the <col> element, they won't inherit it. if the table doesn't use a colspan attribute, use the td:nth-child(an+b) css selector. set a to zero and b to the position of the column in the table, e.g. td:nth-child(2) { text-align: right; } to right-align the second column. if the table does use a colspan attribute, the effect can be achieved by combining adequate css attribute selectors like [colspan=n], though this is not trivial. bgcolor the background color of the table. it is a 6-digit hexadecimal rgb code, prefixed by a '#'. one of t...
...s close to the top of the cell as it is possible. note: do not try to set the vertical-align property on a selector giving a <col> element. because <td> elements are not descendant of the <col> element, they won't inherit it. if the table doesn't use a colspan attribute, use the td:nth-child(an+b) css selector where a is the total number of the columns in the table and b is the ordinal position of the column in the table. only after this selector the vertical-align property can be used. if the table does use a colspan attribute, the effect can be achieved by combining adequate css attribute selectors like [colspan=n], though this is not trivial. width this attribute specifies a default width for each column in the current column group. in addition to the standard pixel and p...
<colgroup> - HTML: Hypertext Markup Language
Web › HTML › Element › colgroup
using their own align attribute. note: do not try to set the text-align property on a selector giving a <colgroup> element. because <td> elements are not descendant of the <colgroup> element, they won't inherit it. if the table doesn't use a colspan attribute, use one td:nth-child(an+b) css selector per column, where a is the total number of the columns in the table and b is the ordinal position of this column in the table. only after this selector the text-align property can be used. if the table does use a colspan attribute, the effect can be achieved by combining adequate css attribute selectors like [colspan=n], though this is not trivial. bgcolor the background color of the table. it is a 6-digit hexadecimal rgb code, prefixed by a '#'. one of the predefined color kewo...
...he cell as it is possible. note: do not try to set the vertical-align property on a selector giving a <colgroup> element. because <td> elements are not descendant of the <colgroup> element, they won't inherit it. if the table doesn't use a colspan attribute, use the td:nth-child(an+b) css selector per column, where a is the total number of the columns in the table and b is the ordinal position of the column in the table. only after this selector the vertical-align property can be used. if the table does use a colspan attribute, the effect can be achieved by combining adequate css attribute selectors like [colspan=n], though this is not trivial. examples please see the <table> page for examples on <colgroup>. specifications specification status comment ...
<img>: The Image Embed element - HTML: Hypertext Markup Language
Web › HTML › Element › img
o handle the image until it's reasonably certain that it will be needed. this generally improves the performance of the content in most typical use cases. note: loading is only deferred when javascript is enabled. this is an anti-tracking measure, because if a user agent supported lazy loading when scripting is disabled, it would still be possible for a site to track a user's approximate scroll position throughout a session, by strategically placing images in a page's markup such that a server can track how many images are requested and when. referrerpolicy a string indicating which referrer to use when fetching the resource: no-referrer: the referer header will not be sent. no-referrer-when-downgrade: no referer header is sent when navigating to an origin without https. this is...
... its default dimensions are defined by the embedded image's intrinsic values, like it were inline-block. you can set properties like border/border-radius, padding/margin, width, height, etc. on an image. <img> has no baseline, so when images are used in an inline formatting context with vertical-align: baseline, the bottom of the image will be placed on the text baseline. you can use the object-position property to position the image within the element's box, and the object-fit property to adjust the sizing of the image within the box (for example, whether the image should fit the box or fill it even if clipping is required). depending on its type, an image may have an intrinsic width and height. for some image types, however, intrinsic dimensions are unnecessary. svg images, for instance, have...
<input>: The Input (Form Input) element - HTML: Hypertext Markup Language
Web › HTML › Element › input
t not functionality. ...
...input caret: html <label for="textinput">note the red caret:</label> <input id="textinput" class="custom" size="32"> css input.custom { caret-color: red; font: 16px "helvetica", "arial", "sans-serif" } result object-position and object-fit in certain cases (typically involving non-textual inputs and specialized interfaces), the <input> element is a replaced element. when it is, the position and size of the element's size and positioning within its frame can be adjusted using the css object-position and object-fit properties styling for more information about adding color to elements in html, see: applying color to html elements using css. also see: styling html forms, advanced styling for html forms, and the compatibility table of css properties. additional features la...
<sub>: The Subscript element - HTML: Hypertext Markup Language
Web › HTML › Element › sub
ending tag are mandatory. permitted parents any element that accepts phrasing content. implicit aria role no corresponding role permitted aria roles any dom interface htmlelement attributes this element only includes the global attributes. usage notes the <sub> element should be used only for typographical reasons—that is, to change the position of the text to comply with typographical conventions or standards, rather than solely for presentation or appearance purposes. for example, using <sub> to style the name of a company which uses altered baselines in their wordmark would not be appropriate; instead, css should be used (likely the vertical-align property, such as vertical-align: sub or, to more precisely control the baseline shift,...
...by nakamura, johnson, and mason<sub>1</sub> this will result in the complete annihilation of both particles.</p> the resulting output looks like this: variable subscripts in mathematics, families of variables related to the same concept (such as distances along the same axis) are represented using the same variable name with a subscript following. for example: <p>the horizontal coordinates' positions along the x-axis are represented as <var>x<sub>1</sub></var> ... <var>x<sub>n</sub></var>.</p> the resulting output: chemical formulas when writing a chemical formula, such as h20, the number of atoms of a given element within the described molecule is represented using a subscripted number; in the case of water, the subscripted "2" indicates that there are two atoms of hydrogen in the mole...
<tr>: The Table Row element - HTML: Hypertext Markup Language
Web › HTML › Element › tr
each be two rows tall. having the first row's "membership dates" heading cell span two columns using the colspan attribute, which causes this heading to actually be two columns wide. having a second row of <th> elements that contains only the "joined" and "canceled" headings. because the other columns are already occupied by first-row cells that span into the second row, these wind up correctly positioned under the "membership dates" heading. html the html is similar to the previous example's, except for the addition of the new column in each data row, and the changes to the header. those changes make the html look like this: <table> <tr> <th rowspan="2">name</th> <th rowspan="2">id</th> <th colspan="2">membership dates</th> <th rowspan="2">balance</th> </tr> <tr> <...
...is is a way to quickly apply a background color to all of the cells in the heading area at once. this does not affect the style of the <th> elements in the first column, though, where we treat the member names as a row heading. advanced styling now we'll go all-out, with styles on rows in the header and body areas both, including alternating row colors, cells with different colors depending on position within a row, and so forth. result here's what the final table will look like: there is no change to the html again. see what proper preparation of your html can do for you? <table> <thead> <tr> <th rowspan="2">name</th> <th rowspan="2">id</th> <th colspan="2">membership dates</th> <th rowspan="2">balance</th> </tr> <tr> <th>joined</th> <th...
HTML elements reference - HTML: Hypertext Markup Language
Web › HTML › Element
or your page content, including header and footer navigation, and heading elements to identify sections of content. element description <address> the html <address> element indicates that the enclosed html provides contact information for a person or people, or for an organization. <article> the html <article> element represents a self-contained composition in a document, page, application, or site, which is intended to be independently distributable or reusable (e.g., in syndication). <aside> the html <aside> element represents a portion of a document whose content is only indirectly related to the document's main content. <footer> the html <footer> element represents a footer for its nearest sectioning content or sectio...
...u> the html unarticulated annotation element (<u>) represents a span of inline text which should be rendered in a way that indicates that it has a non-textual annotation. <var> the html variable element (<var>) represents the name of a variable in a mathematical expression or a programming context. <wbr> the html <wbr> element represents a word break opportunity—a position within text where the browser may optionally break a line, though its line-breaking rules would not otherwise create a break at that location. image and multimedia html supports various multimedia resources such as images, audio, and video. element description <area> the html <area> element defines a hot-spot region on an image, and optionally associates i...
Global attributes - HTML: Hypertext Markup Language
to the element. note that it is recommended for styles to be defined in a separate file or files. this attribute and the <style> element have mainly the purpose of allowing for quick styling, for example for testing purposes. tabindex an integer attribute indicating if the element can take input focus (is focusable), if it should participate to sequential keyboard navigation, and if so, at what position. it can take several values: a negative value means that the element should be focusable, but should not be reachable via sequential keyboard navigation; 0 means that the element should be focusable and reachable via sequential keyboard navigation, but its relative order is defined by the platform convention; a positive value means that the element should be focusable and reachable via se...
...e and reachable via sequential keyboard navigation, but its relative order is defined by the platform convention; a positive value means that the element should be focusable and reachable via sequential keyboard navigation; the order in which the elements are focused is the increasing value of the tabindex. if several elements share the same tabindex, their relative order follows their relative positions in the document. title contains a text representing advisory information related to the element it belongs to. such information can typically, but not necessarily, be presented to the user as a tooltip. translate an enumerated attribute that is used to specify whether an element's attribute values and the values of its text node children are to be translated when the page is localized,...
HTML documentation index - HTML: Hypertext Markup Language
Web › HTML › Index
ow content, html:phrasing content, multimedia, reference, web the html <area> element defines a hot-spot region on an image, and optionally associates it with a hypertext link. this element is used only within a <map> element. 61 <article>: the article contents element element, html, html sections, reference, web the html <article> element represents a self-contained composition in a document, page, application, or site, which is intended to be independently distributable or reusable (e.g., in syndication). 62 <aside>: the aside element element, html, html sections, html5, html:flow content, html:palpable content, html:sectioning content, reference, web the html <aside> element represents a portion of a document whose content is only indirectly relat...
...g video, video, web the html video element (<video>) embeds a media player which supports video playback into the document. you can use <video> for audio content as well, but the <audio> element may provide a more appropriate user experience. 219 <wbr> element, html, html text-level semantics, reference, web the html <wbr> element represents a word break opportunity—a position within text where the browser may optionally break a line, though its line-breaking rules would not otherwise create a break at that location. 220 <xmp> element, html, obsolete, reference, web the html example element (<xmp>) renders text between the start and end tags without interpreting the html in between and using a monospaced font. the html2 specification recommended th...
Content-Security-Policy-Report-Only - HTTP
licy: default-src https:; report-uri /csp-violation-report-endpoint/ violation report syntax the report json object contains the following data: blocked-uri the uri of the resource that was blocked from loading by the content security policy. if the blocked uri is from a different origin than the document-uri, then the blocked uri is truncated to contain just the scheme, host, and port. disposition either "enforce" or "report" depending on whether the content-security-policy header or the content-security-policy-report-only header is used. document-uri the uri of the document in which the violation occurred. effective-directive the directive whose enforcement caused the violation. original-policy the original policy as specified by the content-security-policy-report-only http header.
...this is not always the case. for example, when the signup.html would attempt to load css from http://anothercdn.example.com/stylesheet.css, the browser would not include the full path but only the origin (http://anothercdn.example.com). this is done to prevent leaking sensitive informatio...
Feature-Policy: geolocation - HTTP
by default, the geolocation api can be used within top-level documents and their same-origin child frames. this directive allows or prevents cross-origin frames from accessing geolocation. this includes same-origin frames. ...
... by default, the geolocation api can be used within top-level documents and their same-origin child frames. this directive allows or prevents cross-origin frames from accessing geolocation. this includes same-origin frames. ...
Index - HTTP
Web › HTTP › Headers › Index
locally by a browser for their origins. 21 connection http, headers, reference, web the connection general header controls whether or not the network connection stays open after the current transaction finishes. if the value sent is keep-alive, the connection is persistent and not closed, allowing for subsequent requests to the same server to be done. 22 content-disposition http, reference, header in a multipart/form-data body, the http content-disposition general header is a header that can be used on the subpart of a multipart body to give information about the field it applies to. the subpart is delimited by the boundary defined in the content-type header. used on the body itself, content-disposition has no effect. 23 content-encoding htt...
... element.requestfullscreen(). when this policy is enabled, the returned promise rejects with a typeerror. 68 feature-policy: geolocation feature policy, feature-policy, geolocation, http, header the http feature-policy header geolocation directive controls whether the current document is allowed to use the geolocation interface. when this policy is enabled, calls to getcurrentposition() and watchposition() will cause those functions' callbacks to be invoked with a positionerror code of permission_denied. 69 feature-policy: microphone feature policy, feature-policy, http, header, microphone the http feature-policy header microphone directive controls whether the current document is allowed to use audio input devices. when this policy is enabled, the promise...
HTTP Index - HTTP
Web › HTTP › Index
locally by a browser for their origins. 69 connection http, headers, reference, web the connection general header controls whether or not the network connection stays open after the current transaction finishes. if the value sent is keep-alive, the connection is persistent and not closed, allowing for subsequent requests to the same server to be done. 70 content-disposition http, reference, header in a multipart/form-data body, the http content-disposition general header is a header that can be used on the subpart of a multipart body to give information about the field it applies to. the subpart is delimited by the boundary defined in the content-type header. used on the body itself, content-disposition has no effect. 71 content-encoding htt...
...element.requestfullscreen(). when this policy is enabled, the returned promise rejects with a typeerror. 132 feature-policy: geolocation feature policy, feature-policy, geolocation, http, header the http feature-policy header geolocation directive controls whether the current document is allowed to use the geolocation interface. when this policy is enabled, calls to getcurrentposition() and watchposition() will cause those functions' callbacks to be invoked with a positionerror code of permission_denied. 133 feature-policy: gyroscope the http feature-policy header gyroscope directive controls whether the current document is allowed to gather information about the orientation of the device through the gyroscope interface. 134 feature-policy: lay...
POST - HTTP
Web › HTTP › Methods › POST
a '=' between the key and the value. non-alphanumeric characters in both keys and values are percent encoded: this is the reason why this type is not suitable to use with binary data (use multipart/form-data instead) multipart/form-data: each value is sent as a block of data ("body part"), with a user agent-defined delimiter ("boundary") separating each part. the keys are given in the content-disposition header of each part. text/plain when the post request is sent via a method other than an html form — like via an xmlhttprequest — the body can take any type. as described in the http 1.1 specification, post is designed to allow a uniform method to cover the following functions: annotation of existing resources posting a message to a bulletin board, newsgroup, mailing list, or similar g...
.../test example a simple form using the default application/x-www-form-urlencoded content type: post /test http/1.1 host: foo.example content-type: application/x-www-form-urlencoded content-length: 27 field1=value1&field2=value2 a form using the multipart/form-data content type: post /test http/1.1 host: foo.example content-type: multipart/form-data;boundary="boundary" --boundary content-disposition: form-data; name="field1" value1 --boundary content-disposition: form-data; name="field2"; filename="example.txt" value2 --boundary-- specifications specification title rfc 7231, section 4.3.3: post hypertext transfer protocol (http/1.1): semantics and content rfc 2046, section 5.1.1: common syntax multipurpose internet mail extensions (mime) part two:...
HTTP resources and specifications - HTTP
proposed standard rfc 7239 forwarded http extension proposed standard ...
...r informational (expired) 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. proposed standard rfc 7239 forwarded http extension proposed standard rfc 6455 the websocket protocol proposed standard rfc 5246 the transport layer security (tls) protocol version 1.2 this specification has been modified by subse...
JavaScript modules - JavaScript
rns an object containing the canvas's 2d context and the wrapper's id. createreportlist() — creates an unordered list appended inside a specified wrapper element, which can be used to output report data into. returns the list's id. square.js — contains: name — a constant containing the string 'square'. draw() — draws a square on a specified canvas, with a specified size, position, and color. returns an object containing the square's size, position, and color. reportarea() — writes a square's area to a specific report list, given its length. reportperimeter() — writes a square's perimeter to a specific report list, given its length. aside — .mjs versus .js throughout this article, we've used .js extensions for our module files, but in other resources yo...
... provided by a module, and also helps javascript modules to interoperate with existing commonjs and amd module systems (as explained nicely in es6 in depth: modules by jason orendorff; search for "default exports"). let's look at an example as we explain how it works. in our basic-modules square.js you can find a function called randomsquare() that creates a square with a random color, size, and position. we want to export this as our default, so at the bottom of the file we write this: export default randomsquare; note the lack of curly braces. we could instead prepend export default onto the function and define it as an anonymous function, like this: export default function(ctx) { ... } over in our main.js file, we import the default function using this line: import randomsquare from '.
Assertions - JavaScript
irst "a" in "an a". this character has a different meaning when it appears at the start of a group. $ matches the end of input. if the multiline flag is set to true, also matches immediately before a line break character. for example, /t$/ does not match the "t" in "eater", but does match it in "eat". \b matches a word boundary. this is the position where a word character is not followed or preceded by another word-character, such as between a letter and a space. note that a matched word boundary is not included in the match. in other words, the length of a matched word boundary is zero. examples: /\bm/ matches the "m" in "moon". /oo\b/ does not match the "oo" in "moon", because "oo" is followed by "n" which is a word ch...
...ord character. /oon\b/ matches the "oon" in "moon", because "oon" is the end of the string, thus not followed by a word character. /\w\b\w/ will never match anything, because a word character can never be followed by both a non-word and a word character. to match a backspace character ([\b]), see character classes. \b matches a non-word boundary. this is a position where the previous and next character are of the same type: either both must be words, or both must be non-words, for example between two letters or between two spaces. the beginning and end of a string are considered non-words. same as the matched word boundary, the matched non-word boundary is also not included in the match. for example, /\bon/ matches "on" in "at noon", and /ye\b/ matches "ye"...
Regular expression syntax cheatsheet - JavaScript
irst "a" in "an a". this character has a different meaning when it appears at the start of a group. $ matches the end of input. if the multiline flag is set to true, also matches immediately before a line break character. for example, /t$/ does not match the "t" in "eater", but does match it in "eat". \b matches a word boundary. this is the position where a word character is not followed or preceded by another word-character, such as between a letter and a space. note that a matched word boundary is not included in the match. in other words, the length of a matched word boundary is zero. examples: /\bm/ matches the "m" in "moon". /oo\b/ does not match the "oo" in "moon", because "oo" is followed by "n" which is a word ch...
...ord character. /oon\b/ matches the "oon" in "moon", because "oon" is the end of the string, thus not followed by a word character. /\w\b\w/ will never match anything, because a word character can never be followed by both a non-word and a word character. to match a backspace character ([\b]), see character classes. \b matches a non-word boundary. this is a position where the previous and next character are of the same type: either both must be words, or both must be non-words, for example between two letters or between two spaces. the beginning and end of a string are considered non-words. same as the matched word boundary, the matched non-word boundary is also not included in the match. for example, /\bon/ matches "on" in "at noon", and /ye\b/ matches "ye"...
Text formatting - JavaScript
the first element is at index 0, the next at index 1, and so on. the length of a string is the number of elements in it. you can create strings using string literals or string objects. ...
... or string.prototype.codepointat(). a string object has a variety of methods: for example those that return a variation on the string itself, such as substring and touppercase. the following table summarizes the methods of string objects. methods of string method description charat, charcodeat, codepointat return the character or character code at the specified position in string. indexof, lastindexof return the position of specified substring in the string or last position of specified substring, respectively. startswith, endswith, includes returns whether or not the string starts, ends or contains a specified string. concat combines the text of two strings and returns a new string. fromcharcode, fromcodepoint con...
SyntaxError: illegal character - JavaScript
use an editor that supports syntax highlighting and carefully check your code against mismatches like a minus sign ( - ) versus a dash ( – ) or simple quotes ( " ) vs non-standard quotation marks ( “ ). ...
...use an editor that supports syntax highlighting and carefully check your code against mismatches like a minus sign ( - ) versus a dash ( – ) or simple quotes ( " ) vs non-standard quotation marks ( “ ). ...
Array.prototype.reduce() - JavaScript
to the first value in the array, and currentvalue will be equal to the second. note: if initialvalue is not provided, reduce() will execute the callback function starting at index 1, skipping the first index. if initialvalue is provided, it will start at index 0. if the array is empty and no initialvalue is provided, typeerror will be thrown. if the array only has one element (regardless of position) and no initialvalue is provided, or if initialvalue is provided but the array is empty, the solo value will be returned without calling callback. it is almost always safer to provide an initialvalue, because there can be up to four possible output types without initialvalue, as shown in the following example: let maxcallback = ( acc, cur ) => math.max( acc.x, cur.x ); let maxcallback2 = ( max,...
... return new promise((resolve, reject) => { resolve(a * 2) }) } // function 3 - will be wrapped in a resolved promise by .then() function f3(a) { return a * 3 } // promise function 4 function p4(a) { return new promise((resolve, reject) => { resolve(a * 4) }) } const promisearr = [p1, p2, f3, p4] runpromiseinsequence(promisearr, 10) .then(console.log) // 1200 function composition enabling piping // building-blocks to use for composition const double = x => x + x const triple = x => 3 * x const quadruple = x => 4 * x // function composition enabling pipe functionality const pipe = (...functions) => input => functions.reduce( (acc, fn) => fn(acc), input ) // composed functions for multiplication of specific values const multiply6 = pipe(double, triple) const mult...
Array.prototype.forEach() - JavaScript
the console, you can use console.table(), which prints a formatted version of the array. the following example illustrates an alternative approach, using foreach(). the following code logs a line for each element in an array: function logarrayelements(element, index, array) { console.log('a[' + index + '] = ' + element) } // notice that index 2 is skipped, since there is no item at // that position in the array... [2, 5, , 9].foreach(logarrayelements) // logs: // a[0] = 2 // a[1] = 5 // a[3] = 9 using thisarg the following (contrived) example updates an object's properties from each entry in the array: function counter() { this.sum = 0 this.count = 0 } counter.prototype.add = function(array) { array.foreach((entry) => { this.sum += entry ++this.count }, this) // ^---- ...
......
Array.prototype.includes() - JavaScript
ple is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax arr.includes(valuetofind[, fromindex]) parameters valuetofind the value to search for. note: when comparing strings and characters, includes() is case-sensitive. fromindex optional the position in this array at which to begin searching for valuetofind. the first element to be searched is found at fromindex for positive values of fromindex, or at arr.length + fromindex for negative values of fromindex (using the absolute value of fromindex as the number of elements from the end of the array at which to start the search). defaults to 0. return value a boolean which is true if the val...
...includes(nan) // true fromindex is greater than or equal to the array length if fromindex is greater than or equal to the length of the array, false is returned. the array will not be searched. let arr = ['a', 'b', 'c'] arr.includes('c', 3) // false arr.includes('c', 100) // false computed index is less than 0 if fromindex is negative, the computed index is calculated to be used as a position in the array at which to begin searching for valuetofind. if the computed index is less or equal than -1 * arr.length, the entire array will be searched. // array length is 3 // fromindex is -100 // computed index is 3 + (-100) = -97 let arr = ['a', 'b', 'c'] arr.includes('a', -100) // true arr.includes('b', -100) // true arr.includes('c', -100) // true arr.includes('a', -2) // false inclu...
Atomics.add() - JavaScript
the static atomics.add() method adds a given value at a given position in the array and returns the old value at that position. this atomic operation guarantees that no other write happens until the modified value is written back. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax atomics.add(typedarray, index, value) parameters typedarray an integer typed array. one of int8array, uint8array, int16array, uint16array, int32array, uint32array, bigint64array, or biguint64array. index the position in the typedarray to add a value to. ...
... exceptions throws a typeerror, if typedarray is not one of the allowed integer types. ...
Atomics.and() - JavaScript
the static atomics.and() method computes a bitwise and with a given value at a given position in the array, and returns the old value at that position. this atomic operation guarantees that no other write happens until the modified value is written back. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax atomics.and(typedarray, index, value) parameters typedarray an integer typed array. one of int8array, uint8array, int16array, uint16array, int32array, uint32array, bigint64array, or biguint64array. index the position in the typedarray to compute the bitwise and. value the number to compute the bitwise and...
... exceptions throws a typeerror, if typedarray is not one of the allowed integer types. ...
Atomics.compareExchange() - JavaScript
this atomic operation guarantees that no other write happens until the modified value is written back. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax atomics.compareexchange(typedarray, index, expectedvalue, replacementvalue) parameters typedarray an integer typed array. one of int8array, uint8array, int16array, uint16array, int32array, uint32array, bigint64array, or biguint64array. index the position in the typedarray to exchange a value. expectedvalue the value to check for equality. replacementvalue the number to exchange. return value the old value at the given position (typedarray[index]). exceptions throws a typeerror, if typedarray is not one of the allowed integer types. throws a rangeerror, if index is out of bounds in the typedarray. examples using compareexchange() c...
Atomics.exchange() - JavaScript
the static atomics.exchange() method stores a given value at a given position in the array and returns the old value at that position. this atomic operation guarantees that no other write happens between the read of the old value and the write of the new value. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax atomics.exchange(typedarray, index, value) parameters typedarray an integer typed array. one of int8array, uint8array, int16array, uint16array, int32array, uint32array, bigint64array, or biguint64array. index the position in the typedarray to exchange a value. value the number to exchange. return...
... exceptions throws a typeerror, if typedarray is not one of the allowed integer types. ...
Atomics.load() - JavaScript
exceptions throws a typeerror, if typedarray is not one of the allowed integer types. ...
...stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax atomics.load(typedarray, index) parameters typedarray an integer typed array. one of int8array, uint8array, int16array, uint16array, int32array, uint32array, bigint64array, or biguint64array. index the position in the typedarray to load from. return value the value at the given position (typedarray[index]). exceptions throws a typeerror, if typedarray is not one of the allowed integer types. throws a rangeerror, if index is out of bounds in the typedarray. examples using load const sab = new sharedarraybuffer(1024); const ta = new uint8array(sab); atomics.add(ta, 0, 12); atomics.load(ta, 0)...
Atomics.or() - JavaScript
the static atomics.or() method computes a bitwise or with a given value at a given position in the array, and returns the old value at that position. this atomic operation guarantees that no other write happens until the modified value is written back. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax atomics.or(typedarray, index, value) parameters typedarray an integer typed array. one of int8array, uint8array, int16array, uint16array, int32array, uint32array, bigint64array, or biguint64array. index the position in the typedarray to compute the bitwise or. value the number to compute the bitwise or with...
... exceptions throws a typeerror, if typedarray is not one of the allowed integer types. ...
Atomics.store() - JavaScript
value the number to store. return value the value that has been stored. ...
...n a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax atomics.store(typedarray, index, value) parameters typedarray an integer typed array. one of int8array, uint8array, int16array, uint16array, int32array, uint32array, bigint64array, or biguint64array. index the position in the typedarray to store a value in. value the number to store. return value the value that has been stored. exceptions throws a typeerror, if typedarray is not one of the allowed integer types. throws a rangeerror, if index is out of bounds in the typedarray. examples using store() var sab = new sharedarraybuffer(1024); var ta = new uint8array(sab); atomics.store(ta, 0, 12); // ...
Atomics.sub() - JavaScript
the static atomics.sub() method substracts a given value at a given position in the array and returns the old value at that position. this atomic operation guarantees that no other write happens until the modified value is written back. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax atomics.sub(typedarray, index, value) parameters typedarray an integer typed array. one of int8array, uint8array, int16array, uint16array, int32array, uint32array, bigint64array, or biguint64array. index the position in the typedarray to subtract a value from. value the number to subtract. return value the old value at ...
... exceptions throws a typeerror, if typedarray is not one of the allowed integer types. ...
Atomics.wait() - JavaScript
value the expected value to test. timeout optional time to wait in milliseconds. infinity, if no time is provided. return value a string which is either "ok", "not-equal", or "timed-out". ...
... value the expected value to test. timeout optional time to wait in milliseconds. infinity, if no time is provided. return value a string which is either "ok", "not-equal", or "timed-out". exceptions throws a typeerror, if typedarray is not a shared int32array. throws a rangeerror, if index is out of bounds in the typedarray. ...
Atomics.xor() - JavaScript
the static atomics.xor() method computes a bitwise xor with a given value at a given position in the array, and returns the old value at that position. this atomic operation guarantees that no other write happens until the modified value is written back. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax atomics.xor(typedarray, index, value) parameters typedarray an integer typed array. one of int8array, uint8array, int16array, uint16array, int32array, uint32array, bigint64array, or biguint64array. index the position in the typedarray to compute the bitwise xor. value the number to compute the bitwise xor...
... exceptions throws a typeerror, if typedarray is not one of the allowed integer types. ...
RegExp - JavaScript
gexp.prototype.lastindex. ...
...and no more match. with the global flag g, all 6 digi...
String.prototype.charAt() - JavaScript
r; i < str.length; i++) { if ((chr = getwholechar(str, i)) === false) { continue; } // adapt this line at the top of each loop, passing in the whole string and // the current iteration and returning a variable to represent the // individual character console.log(chr); } function getwholechar(str, i) { var code = str.charcodeat(i); if (number.isnan(code)) { return ''; // position not found } if (code < 0xd800 || code > 0xdfff) { return str.charat(i); } // high surrogate (could change last hex to 0xdb7f to treat high private // surrogates as single characters) if (0xd800 <= code && code <= 0xdbff) { if (str.length <= (i + 1)) { throw 'high surrogate without following low surrogate'; } var next = str.charcodeat(i + 1); if (0xdc00 > n...
...gth; i++) { [chr, i] = getwholecharandi(str, i) // adapt this line at the top of each loop, passing in the whole string and // the current iteration and returning an array with the individual character // and 'i' value (only changed if a surrogate pair) console.log(chr) } function getwholecharandi(str, i) { let code = str.charcodeat(i) if (number.isnan(code)) { return '' // position not found } if (code < 0xd800 || code > 0xdfff) { return [str.charat(i), i] // normal character, keeping 'i' the same } // high surrogate (could change last hex to 0xdb7f to treat high private // surrogates as single characters) if (0xd800 <= code && code <= 0xdbff) { if (str.length <= (i + 1)) { throw 'high surrogate without following low surrogate' } let next...
String.prototype.codePointAt() - JavaScript
the codepointat() method returns a non-negative integer that is the unicode code point value. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax str.codepointat(pos) parameters pos position of an element in str to return the code point value from. return value a number representing the code point value of the character at the given pos. if there is no element at pos, returns undefined. description if there is no element at the specified position, undefined is returned. if no utf-16 surrogate pair begins at pos, the code unit at pos is returned. polyfill the following extends strings to include the code...
...ply`/`call` with `undefined`/`null` var defineproperty = (function() { // ie 8 only supports `object.defineproperty` on dom elements try { var object = {}; var $defineproperty = object.defineproperty; var result = $defineproperty(object, object, object) && $defineproperty; } catch(error) {} return result; }()); var codepointat = function(position) { if (this == null) { throw typeerror(); } var string = string(this); var size = string.length; // `tointeger` var index = position ? number(position) : 0; if (index != index) { // better `isnan` index = 0; } // account for out-of-bounds indices: if (index < 0 || index >= size) { return undefined; } /...
TypedArray.prototype.copyWithin() - JavaScript
the copywithin() method copies the sequence of array elements within the array to the position starting at target. the copy is taken from the index positions of the second and third arguments start and end. the end argument is optional and defaults to the length of the array. this method has the same algorithm as array.prototype.copywithin. typedarray is one of the typed array types here. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...pe.copywithin. typedarray is one of the typed array types here. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax typedarray.copywithin(target, start[, end = this.length]) parameters target target start index position where to copy the elements to. start source start index position where to start copying elements from. end optional optional. source end index position where to end copying elements from. return value the modified array. description see array.prototype.copywithin for more details. examples using copywithin var buffer = new arraybuffer(8); var uint8 = new uint8array(buffer); uint8.set(...
encodeURIComponent() - JavaScript
"%20" with "+". ...
...ese characters have no formalized uri delimiting uses, the following can be safely used: function fixedencodeuricomponent(str) { return encodeuricomponent(str).replace(/[!'()*]/g, function(c) { return '%' + c.charcodeat(0).tostring(16); }); } examples encoding for content-disposition and link headers the following example provides the special encoding required within utf-8 content-disposition and link server response header parameters (e.g., utf-8 filenames): var filename = 'my file(2).txt'; var header = "content-disposition: attachment; filename*=utf-8''" + encoderfc5987valuechars(filename); console.log(header); // logs "content-disposition: attachment; filename*=utf-8''my%20file%282%29.txt" function encoderfc5987valuechars(str) { return encodeuricomponent(str). ...
for - JavaScript
; if (i > 3) break; // more statements } you can also omit all three blocks. again, make sure to use a break statement to end the loop and also modify (increase) a variable, so that the condition for the break statement is true at some point. 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 /...
...ot 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. indeed, without the semicolon the line that follows the cycle declaration will be considered a statem...
<mpadded> - MathML
possible values: any length or an increment/decrement (a length prefixed with "+" or "-") . mathbackground the background color. ...
..., style provided for use with stylesheets. depth sets or increments the depth. possible values: any length or an increment/decrement (a length prefixed with "+" or "-") . height sets or increments the height. possible values: any length or an increment/decrement (a length prefixed with "+" or "-") . href used to set a hyperlink to a specified uri. lspace sets or increments the horizontal position. possible values: any length or an increment/decrement (a length prefixed with "+" or "-") . mathbackground the background color. you can use #rgb, #rrggbb and html color names. mathcolor the text color. you can use #rgb, #rrggbb and html color names. voffset sets or increments the vertical position. possible values: any length or an increment/decrement (a length prefixed with "+" or "-") .
Populating the page: how browsers work - Web Performance
visible node in the dom tree, and determining, based on the css cascade, what the computed styles are for each node. layout the fourth step in the critical rending path is running layout on the render tree to compute the geometry of each node. layout is the process by which the width, height, and location of all the nodes in the render tree are determined, plus the determination of the size and position of each object on the page. reflow is any subsequent size and position determination of any part of the page or the entire document. once the render tree is built, layout commences. the render tree identified which nodes are displayed (even if invisible) along with their computed styles, but not the dimensions or location of each node. to determine the exact size and location of each object, the...
...s what the dimensions of all the different boxes are going to be on the screen. taking the size of the viewport as its base, layout generally starts with the body, laying out the dimensions of all the body’s descendants, with each element's box model properties, providing placeholder space for replaced elements it doesn’t know the dimensions of, such as our image. the first time the size and position of nodes are determined is called layout. subsequent recalculations of node size and locations are called reflows. in our example, suppose the initial layout occurs before the image is returned. since we didn't declare the size of our image, there will be a reflow once the image size is known. paint the last step in the critical rendering path is painting the individual nodes to the screen, th...
Media - Progressive web apps (PWAs)
ight also have a hover effect when the pointer is over it. more details for more information about user interfaces in css, see user interface in the css specification. in part ii of this tutorial, there is an example of mozilla's markup language for user interfaces. action: printing a document note: this snippet only works on firefox since it erroneously increments the css counter for fix-position elemnts. it shouldn not work in other browsers. see issue on css3-page. make a new html document, doc4.html. copy and paste the content from here: <!doctype html> <html> <head> <title>print sample</title> <link rel="stylesheet" href="style4.css"> </head> <body> <h1>section a</h1> <p>this is the first section...</p> <h1>section b</h1> <p>this is the second sect...
.../div> </body> </html> make a new stylesheet, style4.css. copy and paste the content from here: /*** print sample ***/ /* defaults for screen */ #print-head, #print-foot { display: none; } /* print only */ @media print { h1 { page-break-before: always; padding-top: 2em; } h1:first-child { page-break-before: avoid; counter-reset: page; } #print-head { display: block; position: fixed; top: 0pt; left:0pt; right: 0pt; font-size: 200%; text-align: center; } #print-foot { display: block; position: fixed; bottom: 0pt; right: 0pt; font-size: 200%; } #print-foot:after { content: counter(page); counter-increment: page; } } /* end print only */ view this document in your browser. it uses your browser's default style. print (or print previ...
dy - SVG: Scalable Vector Graphics
Web › SVG › Attribute › dy
the dy attribute indicates a shift along the y-axis on the position of an element or its content. ...
... the dy attribute indicates a shift along the y-axis on the position of an element or its content. ...
edgeMode - SVG: Scalable Vector Graphics
the edgemode attribute determines how to extend the input image as necessary with color values so that the matrix operations can be applied when the kernel is positioned at or near the edge of the input image. two elements are using this attribute: <feconvolvematrix> and <fegaussianblur> feconvolvematrix for <feconvolvematrix>, edgemode determines how to extend the input image as necessary with color values so that the matrix operations can be applied when the kernel is positioned at or near the edge of the input image. value duplicate | wrap | none default value duplicate animatable yes duplicate this value indicates that the input image is extended along each of its borders as necessary by duplicating the color values at the given edge of the in...
...e indicates that the input image is extended by taking the color values from the opposite edge of the image. none this value indicates that the input image is extended with pixel values of zero for r, g, b and a. fegaussianblur for <fegaussianblur>, edgemode determines how to extend the input image as necessary with color values so that the matrix operations can be applied when the kernel is positioned at or near the edge of the input image. value duplicate | wrap | none default value none animatable yes duplicate this value indicates that the input image is extended along each of its borders as necessary by duplicating the color values at the given edge of the input image. wrap this value indicates that the input image is extended by taking th...
kernelUnitLength - SVG: Scalable Vector Graphics
, in the surface normal calculation formulas. the first number is the x value. the second number is the y value. if the y value is not specified, it defaults to the same value as x. by specifying value(s) for kernelunitlength, the kernel becomes defined in a scalable, abstract coordinate system. if the attribute is not specified, the x and y values represent very small deltas relative to a given position, which might be implemented in some cases as one pixel in the intermediate image offscreen bitmap, which is a pixel-based coordinate system, and thus potentially not scalable. if a negative or zero value is specified the default value will be used instead. value <number-optional-number> default value pixel in offscreen bitmap animatable yes fespecularl...
..., in the surface normal calculation formulas. the first number is the x value. the second number is the y value. if the y value is not specified, it defaults to the same value as x. by specifying value(s) for kernelunitlength, the kernel becomes defined in a scalable, abstract coordinate system. if the attribute is not specified, the x and y values represent very small deltas relative to a given position, which might be implemented in some cases as one pixel in the intermediate image offscreen bitmap, which is a pixel-based coordinate system, and thus potentially not scalable. if a negative or zero value is specified the default value will be used instead. value <number-optional-number> default value pixel in offscreen bitmap animatable yes specifica...
orient - SVG: Scalable Vector Graphics
Web › SVG › Attribute › orient
the orient attribute indicates how a marker is rotated when it is placed at its position on the shape. only one element is using this attribute: <marker> html, body, svg { height: 100%; } <svg viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <defs> <marker id="arrow" viewbox="0 0 10 10" refx="5" refy="5" markerwidth="6" markerheight="6" orient="auto-start-reverse"> <path d="m 0 0 l 10 5 l 0 10 z" /> </marker> <marker id="dataarrow" viewbox="0 0 10 10" refx="5" refy="5" markerwidth="6" markerheight="6" orient="-65deg"> <path d="m 0 0 l 10 5 l 0 10 z" fill="red" /> </marker> </defs> <polyline points="10,10 10,90 90,90" fill="none" stroke="black" marker-start="url(#arrow)" marker-end="url(#arrow)" /> <polyl...
... auto-start-reverse if placed by marker-start, the marker is oriented 180° different from the orientation that would be used if auto where specified. for all other markers, auto-start-reverse means the same as auto. note: this allows a single arrowhead marker to be defined that can be used for both the start and end of a path, i.e. which points outwards from both ends.
refX - SVG: Scalable Vector Graphics
Web › SVG › Attribute › refX
the refx attribute defines the x coordinate of an element’s reference point. two elements are using this attribute: <marker> and <symbol> marker for <marker>, refx defines the x coordinate of the marker’s reference point, which is to be placed exactly at the marker’s position on the shape. value <length-percentage> | <number> | left | center | right default value 0 animatable yes <length-percentage> lengths are interpreted as being in the coordinate system of the marker contents, after application of the viewbox and preserveaspectratio attributes. percentage values are interpreted as being a percentage of the viewbox width. <number> numbers are interpreted as being in the coordinate system of the marker contents, after application of th...
... the shape. center the reference point of the marker is placed at the horizontal center of the shape. right the reference point of the marker is placed at the right edge of the shape. symbol for <symbol>, refx defines the x coordinate of the symbol, which is defined by the cumulative effect of the x attribute and any transformations on the <symbol> and its host <use> element. unlike other positioning attributes, refx is interpreted as being in the coordinate system of the symbol contents, after application of the viewbox and preserveaspectratio attributes. if the attribute is not specified, no horizontal adjustment is made, and the left side of the symbol’s rectangular viewport region (regardless of the viewbox coordinate) is positioned at the x coordinate. for backwards compatibility, ...
refY - SVG: Scalable Vector Graphics
Web › SVG › Attribute › refY
the refy attribute defines the y coordinate of an element’s reference point. two elements are using this attribute: <marker> and <symbol> marker for <marker>, refy defines the y coordinate of the marker’s reference point, which is to be placed exactly at the marker’s position on the shape. value <length-percentage> | <number> | top | center | bottom default value 0 animatable yes <length-percentage> lengths are interpreted as being in the coordinate system of the marker contents, after application of the viewbox and preserveaspectratio attributes. percentage values are interpreted as being a percentage of the viewbox height. <number> numbers are interpreted as being in the coordinate system of the marker contents, after application of t...
... the shape. center the reference point of the marker is placed at the vertical center of the shape. bottom the reference point of the marker is placed at the bottom edge of the shape. symbol for <symbol>, refy defines the y coordinate of the symbol, which is defined by the cumulative effect of the y attribute and any transformations on the <symbol> and its host <use> element. unlike other positioning attributes, refy is interpreted as being in the coordinate system of the symbol contents, after application of the viewbox and preserveaspectratio attributes. if the attribute is not specified, no vertical adjustment is made, and the top side of the symbol’s rectangular viewport region (regardless of the viewbox coordinate) is positioned at the y coordinate. for backwards compatibility, the...
targetX - SVG: Scalable Vector Graphics
Web › SVG › Attribute › targetX
specifications specification status comment filter effects module level 1the definition of 'targetx' in that specification. ...
...onvolution matrix relative to a given target pixel in the input image. the leftmost column of the matrix is column number zero. the value must be such that: 0 <= targetx < orderx. only one element is using this attribute: <feconvolvematrix> usage notes value <integer> default value floor(orderx / 2) animatable yes <integer> this value indicates the positioning in horizontal direction of the convolution matrix relative to a given target pixel in the input image. specifications specification status comment filter effects module level 1the definition of 'targetx' in that specification. working draft no change scalable vector graphics (svg) 1.1 (second edition)the definition of 'targetx' in that specificatio...
targetY - SVG: Scalable Vector Graphics
Web › SVG › Attribute › targetY
specifications specification status comment filter effects module level 1the definition of 'targety' in that specification. ...
...f the convolution matrix relative to a given target pixel in the input image. the topmost row of the matrix is row number zero. the value must be such that: 0 <= targety < ordery. only one element is using this attribute: <feconvolvematrix> usage notes value <integer> default value floor(ordery / 2) animatable yes <integer> this value indicates the positioning in vertical direction of the convolution matrix relative to a given target pixel in the input image. specifications specification status comment filter effects module level 1the definition of 'targety' in that specification. working draft no change scalable vector graphics (svg) 1.1 (second edition)the definition of 'targety' in that specification.
vector-effect - SVG: Scalable Vector Graphics
bute, vector-effect can be used as a css property. as a presentation attribute, it can be applied to any element but it has effect only on the following ten elements: <circle>, <ellipse>, <foreignobject>, <image>, <line>, <path>, <polygon>, <polyline>, <rect>, <text>, <textpath> <tspan>, and <use> usage notes value none | non-scaling-stroke | non-scaling-size | non-rotation | fixed-position default value none animatable yes none this value specifies that no vector effect shall be applied, i.e. the default rendering behaviour is used which is to first fill the geometry of a shape with a specified paint, then stroke the outline with a specified paint. non-scaling-stroke this value modifies the way an object is stroked. normally stroking involves cal...
...cs of non-scaling-stroke. non-rotation this value specifies a special user coordinate system used by the element and its descendants. the rotation and skew of that user coordinate system is suppressed in spite of any transformation changes from a host coordinate space. however, it does not specify the suppression of scaling. also, it does not specify the origin of user coordinate system. fixed-position this value specifies a special user coordinate system used by the element and its descendants. the position of user coordinate system is fixed in spite of any transformation changes from a host coordinate space. however, it does not specify the suppression of rotation, skew and scaling. when this vector effect and the transform property are defined at the same time, that property is consumed for...
SVG Attribute reference - SVG: Scalable Vector Graphics
Web › SVG › Attribute
rning 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 ...
...serveaspectratio 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-thick...
<image> - SVG: Scalable Vector Graphics
Web › SVG › Element › image
width: the width the image renders at. unlike html's <img>, this attribute is required. height: the height the image renders at. unlike html's <img>, this attribute is required. href and xlink:href: points at a url for the image file. preserveaspectratio: controls how the image is scaled. dom interf...
...entpermitted contentany number of the following elements, in any order:animation elementsdescriptive elements attributes global attributes conditional processing attributes core attributes graphical event attributes presentation attributes xlink attributes class style externalresourcesrequired transform specific attributes x: positions the image horizontally from the origin. y: positions the image vertically from the origin. width: the width the image renders at. unlike html's <img>, this attribute is required. height: the height the image renders at. unlike html's <img>, this attribute is required. href and xlink:href: points at a url for the image file. preserveaspectratio: controls how the image is scaled. dom interface <image> implements the svgimageelement interface.
<tspan> - SVG: Scalable Vector Graphics
Web › SVG › Element › tspan
html,body,svg { height:100% } <svg viewbox="0 0 240 40" xmlns="http://www.w3.org/2000/svg"> <style> text { font: italic 12px serif; } tspan { font: bold 10px sans-serif; fill: red; } </style> <text x="10" y="30" class="small"> you are <tspan>not</tspan> a banana! </text> </svg> attributes x the x coordinate of the starting point of the text baseline. ...
...0" class="small"> you are <tspan>not</tspan> a banana! </text> </svg> attributes x the x coordinate of the starting point of the text baseline. value type: <length>|<percentage> ; default value: none; animatable: yes y the y coordinate of the starting point of the text baseline. value type: <length>|<percentage> ; default value: none; animatable: yes dx shifts the text position horizontally from a previous text element. value type: <length>|<percentage> ; default value: none; animatable: yes dy shifts the text position vertically from a previous text element. value type: <length>|<percentage> ; default value: none; animatable: yes rotate rotates orientation of each individual glyph. can rotate glyphs individually. value type: <list-of-number> ; default value: non...
SVG 2 support in Mozilla - SVG: Scalable Vector Graphics
utes removed from <pattern> and <filter> implementation status unknown auto value of width and height computes to 0 but 100% on <svg> not implemented coordinate systems, transformations and units change notes exception for bad values on svgmatrix.skewx() and svgmatrix.skewy() implementation status unknown bounding box for element with no position at (0, 0) implementation status unknown defer keyword removed from preserveaspectratio attribute removed (bug 1280425) added non-scaling-size, non-rotation and fixed-position keywords for vector-effect property not implemented yet (bug 1318208) vector-effect has no effect within 3d rendering context implementation status unknown consider clip and ov...
...), <glyphref> never really implemented (bug 1302693) svgtextcontentelement.selectsubstring() deprecated implementation status unknown getcomputedtextlength() not including dx and dy values implementation status unknown text in non-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 ...
SVG animation with SMIL - SVG: Scalable Vector Graphics
dur="5s" repeatcount="indefinite" /> </circle> </svg> animating the transform attributes the <animatetransform> element let you animate transform attributes. this new element is necessary because we are not animating a simple attribute like x which is just a number. rotation attributes look like this: rotation(theta, x, y), where theta is the angle in degrees, and x and y are absolute positions. in the example below, we animate the center of the rotation and the angle. <svg width="300" height="100"> <title>svg smil animate with transform</title> <rect x="0" y="0" width="300" height="100" stroke="black" stroke-width="1" /> <rect x="0" y="50" width="15" height="34" fill="blue" stroke="black" stroke-width="1"> <animatetransform attributename="transform" begin="0s"...
...the path is defined the same way as in <path>. you can set the attribute to define whether the object rotates following the tangent of the path. example 1: linear motion in this example, a blue circle bounces between the left and right edges of a black box, over and over again, indefinitely. the animation here is handled by the <animatemotion> element. in this...
SVG In HTML Introduction - SVG: Scalable Vector Graphics
ample: <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="signalerror();"></p> </fieldset> </form> <svg viewbox="0 0 100 100" preserveaspectratio="xm...
...t...
Texts - SVG: Scalable Vector Graphics
Web › SVG › Tutorial › Texts
w3.org/2000/svg"> <text> this is <tspan font-weight="bold" fill="red">bold and red</tspan> </text> <style><![cdata[ text{ dominant-baseline: hanging; font: 28px verdana, helvetica, arial, sans-serif; } ]]></style> </svg> the tspan element has the following custom attributes: x set a new absolute x coordinate for the containing text. this overwrites the default current text position. the attribute may also contain a list of numbers, that are one by one applied to the single characters of the tspan element. dx start drawing the text with a horizontal offset dx from the default current position. here, too, you may provide a list of values that are applied to consecutive characters, hence piling up the offset over time. likewise, there are y and dy for vertical displacement.
...ver time. likewise, there are y and dy for vertical displacement. rotate rotate all characters by this degree. a list of numbers makes each character rotate to its respective value, with remaining characters rotating according to the last value. textlength this is a more obscure attribute giving the calculated length of the string. it is meant to allow the rendering engine to fine-tune the positions of the glyphs when its own measured text length doesn't meet the one provided here. textpath this element fetches via its xlink:href attribute an arbitrary path and aligns the characters, that it encircles, along this path: <path id="my_path" d="m 20,20 c 80,60 100,40 120,20" fill="transparent" /> <text> <textpath xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#my_path"> a curv...
An Overview - XSLT: Extensible Stylesheet Language Transformations
structure of the document in memory. this representation, called the tree, is what is actually manipulated by the processor. the tree is an abstract datatype, a conceptual model which can be implemented in various ways depending on the parser and the processor. :netscape's uses a structure similar to the w3c dom as its tree structure, but others are possible. the only requirements concern the disposition of objects in the tree, their properties, and their relationships. the tree consists of a hierarchical framework of nodes. it can be made up of seven different types of nodes: the single root node, element nodes, text nodes, attribute nodes, comment nodes, processing instruction nodes, and namespace nodes. at the top of the tree is the root node. the root node does not correspond to any indiv...
...des can have no children. the result of the processor's action is also a tree. netscape uses this tree to render the contents in the browser window. xslt is a high-level declarative language. 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. the particulars of how this is to be accomplished are left up to the processor. because the order of execution of the stylesheet cannot be guaranteed, xslt does not support any functionality that produces side-effects. in this it is like lisp or scheme. locations on the tree are specified using xpath, another w3c recommendation. transformations depend on the processor's bein...
Transforming XML with XSLT - XSLT: Extensible Stylesheet Language Transformations
of xml technologies, firefox incorporates within itself all of the mechanisms needed to process both original xml documents and the specialized stylesheets used to style and lay them out for html display, reducing server load with client-side processing. at present, gecko (the layout engine behind firefox) supports two forms of xml stylesheets. for basic control of appearance — fonts, colors, position, and so forth — gecko uses css. css1 and css2 are well supported and support for the emerging css3 standard is under development. for further information about css, see eric meyer's css pages. our focus here is on the second type of stylesheet that gecko supports: the xslt stylesheet. xslt stands for extensible stylesheet language/transform and the name is apt. xslt allows a stylesheet author ...
... element-available() (supported) false() (supported) floor() (supported) format-number() (supported) function-available() (supported) generate-id() (supported) id() (partially supported) key() (supported) lang() (supported) last() (supported) local-name() (supported) name() (supported) namespace-uri() (supported) normalize-space() (supported) not() (supported) number() (supported) position() (supported) round() (supported) starts-with() (supported) string() (supported) string-length() (supported) substring() (supported) substring-after() (supported) substring-before() (supported) sum() (supported) system-property() (supported) translate() (supported) true() (supported) unparsed-entity-url() (not supported) for further reading books online the world wide web ...
Working with Events - Archive of obsolete content
adding listeners in constructors event emitters may be modules, as is the case for the ready event above, or they may be objects returned by constructors. in the latter case the options object passed to the constructor typically defines properties whose names are the names of supported event types prefixe...
tabs - Archive of obsolete content
e type that the document currently loaded in the tab is being rendered as. this may come from http headers or other sources of mime information, and might be affected by automatic type conversions performed by either the browser or extensions. this property is read-only. index the index of the tab relative to other tabs in the application window. this property can be set to change its relative position. ispinned whether or not this tab is pinned as an app tab. this property is read-only. window the window object for this tab. readystate new in firefox 33. a string telling you the load state of the document hosted by this tab. this corresponds directly to document.readystate. it has one of four possible values: "uninitialized": the tab's document is not yet loading "loading": the ta...
core/heritage - Archive of obsolete content
=> 0.2039 pink.cyan() // => 0.0000 pink instanceof color // => true be aware though that it's not multiple inheritance and ancestors prototypes of the classes passed under implements option are ignored. as mentioned before you could pass constructors that were not created using class function as long as they have proper prototype setup. ...
lang/functional - Archive of obsolete content
{ partial } = require("sdk/lang/functional"); let add = function add (x, y) { return x + y; } let addone = partial(add, 1); addone(5); // 6 addone(10); // 11 partial(add, addone(20))(2); // 23 parameters fn : function function on which partial application is to be performed. arguments... : mixed additional arguments returns function : the partial function. compose(fn...) returns the composition of a list of functions, where each function consumes the return value of the function that follows. in math terms, composing the functions f(), g(), and h() produces f(g(h())). let { compose } = require("sdk/lang/functional"); let welcome = compose(exclaim, greet); welcome('moe'); // "hi: moe!"; function greet (name) { return "hi: " + name; } function exclaim (statement) { return statement + ...
ui/frame - Archive of obsolete content
it occupies the whole width of the browser window and is 18 pixels high on a normal-resolution display or 36 pixels high on a high-resolution (hidpi) display. this toolbar might look something like: scripting frames to add scripts to frames, include them directly from the frame's html content, as with a normal web page: <script type="text/jav...
util/list - Archive of obsolete content
m) function adds a item to a list. removelistitem(list, item) function removes an item from a list list an ordered collection (also known as a sequence) disallowing duplicate elements. list is composed out of iterable, therefore it provides custom enumeration behavior that is similar to array (enumerates only on the elements of the list). list is a base trait and is meant to be part of a composition, since all of its api is private except for the length property. examples: var { list } = require("sdk/util/list"); var mylist = list.compose({ add: function add(item1, item2, /*item3...*/) { array.slice(arguments).foreach(this._add.bind(this)); }, remove: function remove(item1, item2, /*item3...*/) { array.slice(arguments).foreach(this._remove.bind(this)); } }); mylist('foo', '...
Adding a Button to the Toolbar - Archive of obsolete content
con-64.png" }, onclick: handleclick }); function handleclick(state) { tabs.open("https://www.mozilla.org/"); } now run the add-on with jpm run. 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. the id attribute is mandatory, and is used to remember the position of the button, so you should not change it in subsequent versions of the add-on. clicking the button loads https://www.mozilla.org/ into a new tab. specifying the icon the icon property may specify a single icon or a collection of icons in different sizes, as in the example above. if you specify a collection of icons in different sizes the browser will automatically choose the best fit for the...
Canvas code snippets - Archive of obsolete content
this can be used to determine if the mouse cursor is inside a certain shape or not. function getpixelcolour(canvas, x, y) { var cx = canvas.getcontext('2d'); var pixel = cx.getimagedata(x, y, 1, 1); return { r: pixel.data[0], g: pixel.data[1], b: pixel.data[2], a: pixel.data[3] }; } chaining methods this class provides jquery-style chained access...
Dialogs and Prompts - Archive of obsolete content
thing but false, the dialog will be closed. buttons in <dialog> predefined there are six button types you can use in the buttons attribute of dialog. they are: accept — ok button. cancel — cancel button. disclosure — more info button. help — help button (doesn't work in thunderbird 1.0 bug 256915) extra1, extra2 — two buttons without any predefined labels or meaning. extra2 is positioned at the left side of the dialog (by default). 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. for example, to add an apply button to your dialog, use the following code: <dialog xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.
Chapter 6: Firefox extensions and XUL applications - Archive of obsolete content
emented? let’s examine these questions one at a time. what does this do? what arguments does it take? first we’ll search for the component’s definition. type interface nsilocalfile (with a trailing space) in the search field and go. nearly all components inherit from nsisupports (fixme: why 'nearly' ?), so adding a trailing space when you search serves as a delimiter on the inheritance position, and makes it easier to specify what you’re looking for (see figures 6, 7).4 this results in the file nsilocalfile.idl. let’s display it. every method includes explanatory comments. in initwithpath, the nsilocalfile object gets initialized, and any information already in it gets reset. also be aware of a potential problem when using paths not representing entities.5 this requires a full pa...
Chapter 3: Introduction to XUL—How to build a more intuitive UI - Archive of obsolete content
the markup for the button with that id in the base document, and inserted into the box. figure 20: output from listing 23 and 25 furthermore, following the declaration insertbefore="label1", the "button2" button now has been inserted before the element with the id "label1". conversely, if we wanted to insert it directly after, we could have used the attribute insertafter. we can also use the position attribute as a way to locate an element numerically at any position; for example, using position="4" would insert it as the fourth element. external entities being a form of xml, xul can also use entity references based on dtds (document type definitions) as shown in listing 26. note that external dtd files are limited to what is given in the chrome url, which will be discussed in chapter 5. pl...
Chapter 5: Let's build a Firefox extension - Archive of obsolete content
crash, are all implemented through this api. we used two methods in the nslsessionstore interface in this project. let’s look at how they work. getbrowserstate() returns a json-formatted5 text string representing the state of every currently open browser window. this string includes extensive information regarding every open window and tab, the forward/back history for each tab, page scroll position, text zoom, contents of form elements, etc. setwindowstate(awindow, astate, aoverwrite) restores the browser window indicated by the parameter awindow to the state indicated by astate. if aoverwrite is true, the currently open tab is overwritten; otherwise, a new tab is created for the restored content. javascript debugging methods alert the easiest way to debug javascvript is using the wi...
Adding windows and dialogs - Archive of obsolete content
he dialog element as the document root instead of the more generic window element. you may be asking yourself what's the big deal about defining a simple xul window with an ok and maybe a cancel button. the dialogs we have covered in this section are very simple and shouldn't be too hard to implement manually using xul. well, it's more complicated than that. different operating systems order and position their buttons differently in their dialogs. there are also subtle aspects about window size, margins and paddings that are not the same for all systems, so you should avoid making dialogs from scratch or overriding the default dialog css styles. the dialog element handles all of this transparently. all you need to do is define which buttons you'll need and the actions associated with them. <d...
The Box Model - Archive of obsolete content
ld only use it when you need flexible space. if you need fix-sized space it's best to use margins and paddings and avoid adding unnecessary nodes to your xul document. alignment xul, unlike html, provides an easy way to align elements both horizontally and vertically. you can either use the align and pack attributes, or the -moz-box-align and -moz-box-pack css properties. packing determines the positioning of the child elements in the direction of the container's orientation. alignment determines the positioning in the other direction. so, in a flexed hbox, having center alignment and end packing results in this: one important thing to notice is that aligment and flexibility can't be mixed in some cases. if you add flexibility to one of the buttons, the packing will no longer be useful, but t...
Adding preferences to an extension - Archive of obsolete content
shes all the settings we implement as well as their types. in our case, we have a single preference, the stock symbol to monitor. preferences are identified by name; in this case, the name is "extensions.stockwatcher2.symbol". the actual user interface is described in the <prefpane> block. the <hbox> element is used to lay out the user interface by indicating that the widgets inside it should be positioned horizontally, next to each other in the window. our dialog has two widgets in it. the first is a label describing the textbox. the second is the textbox itself, in which the user enters the symbol. the preference property ties the textbox to the "pref_symbol" <preference> element and to the "extensions.stockwatcher2.symbol" preference. this lets the preference value automatically be updated to...
Creating reusable content with CSS and XBL - Archive of obsolete content
s not ideal for complex applications where parts need to be self-contained and reusable. you can place stylesheets in separate files, and you can place scripts in separate files. but you must link those files from the document as a whole. another structural limitation concerns content. you can use css to provide content for selected elements, but the content is limited to text and images, and its positioning is limited to before or after the selected element. mozilla provides a mechanism that overcomes these limitations: xbl (xml bindings language). you can use xbl to link selected elements to their own: stylesheets content properties and methods event handlers because you avoid linking everything at the document level, you can make self-contained parts that are easy to maintain and reuse. ...
JXON - Archive of obsolete content
n xml document to json (often called "jxon algorithms") are more or less freely based on the parker convention (especially regarding the transformation of tags names into object properties names, the recognition of the typeof of all the collected text content of each tag and the absorption of solitary text and/or cdatasection nodes into primitive values). it is called “parker convention” in opposition to “badgerfish convention”, after the comic parker & badger by cuadrado. see also: badgerfish convention. the following is a transcription of the parker convention paper (version 0.4), from the page “transformingrules” of the xml2json-xslt project site. this convention was written in order to regulate the conversion to json from xslt, so parts of it are futile for javascript. note: on ...
Images, Tables, and Mysterious Gaps - Archive of obsolete content
in figure 3. the most crucial part of figure 3 is the baseline (represented by the blue line), and its placement within the line box. the baseline's exact placement is dependent on the "default" font for the line box (represented by the red box), which is determined by the value of font-family for the element that contains the line box. it isn't possible for an author to change the baseline's position directly, so wherever it ends up is where it will be. the space below the baseline is referred to as "descender space" since that's where the descenders in lowercase letters like "j", "y", and "q" are drawn. figure 4 shows what happens when we add an image to the mix. note where the image sits by default: its bottom edge is aligned with the baseline of the line box. this placement can be chang...
Notes on HTML Reflow - Archive of obsolete content
owdirty indicates that container frame has decided to coalesce several incremental reflows targeted at its children into a single reflow. the container frame maintains the necessary state to determine which children must be reflowed. userdefined, for "special situations". currently, this is only used by the viewport frame to schedule a reflow to reflow all of the viewport's fixed-position frames. we should probably try to eliminate it. an incremental reflow may damage other parts of the frame hierarchy; for example, changing the size of the font used in a specific paragraph may cause the paragraph to grow or shrink. a container must therefore propagate any damage that the incremental reflow of the child frame caused, possibly reflowing other children as well. dirty reflo...
Making it into a static overlay - Archive of obsolete content
usbar element in the overlay file to be added to the interface's dom and thus show up in the interface as if they were defined on the same element in navigator.xul. note that we've added a new attribute to the statusbarpanel element: insertbefore. this attribute identifies another statusbarpanel element within statusbar before which our element should appear. thus it allows us to define the exact position of our element relative to the other statusbarpanel elements within statusbar. if insertbefore is omitted, the element will be added as the last child of statusbar, usually before the resizer grippy. we could instead have used an insertafter attribute to place the element after another. to use this overlay instead of our changes to navigator.xul we need to remove our changes, then add a reference...
Tinderbox - Archive of obsolete content
. the tool enables mozilla.org to be immediately notified of changes to the code that prevent mozilla from compiling and running (or compromise performance and footprint) so they can get someone to fix the problem or reverse the changes. mozilla engineers regularly check tinderbox before changing the code because changes are prohibited while the codebase is broken. the mozilla sheriff, a rotating position responsible for watching the code and getting engineers to fix breakage, checks tinderbox even more regularly. while it isn't difficult to load the tinderbox web page or sidebar, it would be useful to have an even quicker way to check tinderbox that doesn't require going to a web page, changing sidebars, or even having the sidebar open. although there are multiple tinderbox clients machines doing...
In-Depth - Archive of obsolete content
rimary"); to -moz-binding: url("chrome://communicator/skin/toolbar/toolbarbindings.xml#toolbar-primary"); now every toolbar has a spot for an image on the right hand side and we can start adding images, but first we need to make sure we can see the images that we add. also in the communicator.css add this code: .toolbar-primary-icon { width: 100px; background-repeat: no-repeat; background-position: top; } open up \classic\skin\classic\navigator\navigator.css and scroll down to the bottom. to style that image, we first need to get a handle to the toolbar, then the box inside of it, and then to the image that we added with the xml. by hunting around with the dom inspector and looking at the navigation toolbar you can find this information. the id is "navigation-toolbar". then it contains a ...
Drag and Drop Example - Archive of obsolete content
e, it only accepts text. we don't need to do anything special for the ondragover function, so no code is added in its body. the ondrop handler first uses the createelement function to create a new element of the type stored in the drag session. next, appendchild is called to add the new element to the stack, which is the target of the event. finally, we set some attributes on the new element. the position of elements in a stack is determined by the left and top attributes. the values of the pagex and pagey properties store the mouse pointer coordinates on the window where the drop occured. this allows us to place the new element at the position where the mouse button was released. this isn't quite the correct way to do this as we actually need to calculate the coordinates of the event relative to ...
Editor Embedding Guide - Archive of obsolete content
ate of the command. cmd_delete deletes current selection. getcommandstate "state_enabled" (boolean) docommand no parameter note getcommandstate in these cases will return whether or not it is possible to call docommand. this will not really give you any concrete information on the state of the command. cmd_paste pastes into current selection or if there is no selection at the cursor position. getcommandstate "state_enabled" (boolean) docommand no parameter note getcommandstate in these cases will return whether or not it is possible to call docommand. this will not really give you any concrete information on the state of the command. cmd_cutordelete cuts or deletes current selection. getcommandstate "state_enabled" (boolean) docommand no parameter note getcommandst...
Fast Graphics Performance With HTML - Archive of obsolete content
make content that has scrolling content underneath it opaque e.g. use <div><div style="background:white; position:fixed">simple</div>lots of text...</div> instead of <div><div style="position:fixed">simple</div>lots of text...</div> make the content of scrollable sub frames opaque e.g. use <div style="overflow:scroll><div style="background:white"><p>this is some text</p><p>and some more</p></div></div> instead of <div style="overflow:scroll><p>this is some text</p><p>and some more</p></div> animating 'transform' and 'opacity' properties can be done with the compositor which makes them efficient to animate ...
Document Loading - From Load Start to Finding a Handler - Archive of obsolete content
onstartrequest notification comes back from necko nsdocumentopeninfo::onstartrequest checks the response status code on the channel for http channels and drops the load on the floor if warranted (e.g. 204 or 205 responses). then it calls nsdocumentopeninfo::dispatchcontent nsdocumentopeninfo::dispatchcontent starts doing the real dirty work. first it checks whether the channel has "content-disposition: attachment" set. if so, it skips trying to find an internal viewer and goes right over to looking for a stream converter. otherwise, dispatchcontent goes through a three-step process to try to find the correct listener. the basic idea is that dispatchcontent calls nsdocumentopeninfo::trycontentlistener on various content listeners; if that returns true, we have found the right listener and we ar...
Documentation for BiDi Mozilla - Archive of obsolete content
om right to left. in some circumstances, even on a platform with bidi capability, the layout code has to reverse text fragments or to allow for the fact that they are displayed in reverse. in general, this happens whenever we are dealing with less than a whole frame. examples of this are in nstextframe::painttextslowly; nstextframe::paintunicodetext when a selection is displayed; nstextframe::getposition; nstextframe::getpointfromoffset. text in visual mode must also be reversed before display on a bidi platform. text fields and composer the specification of the bidi changes to composer was posted in the editor and i18n newsgroups, and responses there were taken into account. the implementation is mostly in layout code, especially in nsselection.cpp and nscaret.cpp. other bidi functionality c...
Hidden prefs - Archive of obsolete content
he default (defined in mailnews.js) is: pref("mail.addr_book.quicksearchquery.format","?(or(primaryemail,c,@v)(displayname,c,@v)(firstname,c,@v)(lastname,c,@v))"); "and", "or" and "not" are valid. see http://lxr.mozilla.org/mozilla/sourc...drdatabase.idl for the list of valid attributes "c" == contains. see nsabquerystringtoexpression::createbooleanconditionstring() for other operators. mail composition "other header" pref ("mail.compose.other.header") the format for this a comma delimited list of mail headers, like "approved,x-no-archive" an example for your prefs.js would be: user_pref("mail.compose.other.header", "approved"); this will cause "approved" to show up in the compose window address picker, under to:, cc:, bcc:, newsgroup:, etc. for example: when that mail gets sent, approv...
SXSW 2007 presentations - Archive of obsolete content
...
Static Analysis for Windows Code under Linux - Archive of obsolete content
-enable-debug ac_add_options --disable-optimize ac_add_options --disable-tests ac_add_options --disable-embedding-tests ac_add_options --disable-installer ac_add_options --disable-accessibility ac_add_options --disable-vista-sdk-requirements ac_add_options --disable-updater #change this to where your libidl-config file locate. ...
Table Layout Regression Tests - Archive of obsolete content
> <color data="-16777216"/> <background data="0 2 3 -1 0 0 "/> <spacing data="left: null top: null right: null bottom: null left: null top: null right: null bottom: null left: 1[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="...
Treehydra Manual - Archive of obsolete content
in this example, we show how to access the gimple just after function inlining is performed. (this allows a simple version of interprocedural analysis.) at this point, gcc is using a different internal structure, so treehydra uses a different callback, process_cgraph. require({ after_gcc_pass: "einline" + (isgcc42 ? "" : "_ipa")}); i...
URIs and URLs - Archive of obsolete content
roken down, it consists of: scheme, username, password, host, port, directory, filebasename, fileextension, param, query and ref. together these segments form the url spec with the following syntax: scheme://username:password@host:port/directory/filebasename.fileextension;param?query#ref for performance reasons the complete spec is stored in escaped form in the nsstandardurl object with pointers (position and length) to each basic segment and for the more global segments like path and prehost for example. necko provides pre written urlparsers for schemes based on hierachical naming systems. escaping to be able to parse an url safely it is sometimes necessary to "escape" certain characters, to hide them from the parser. an escaped character is encoded as a character triplet, consisting of the perc...
Venkman Introduction - Archive of obsolete content
new views or modules for the debugger if you choose—though this latter is an advanced topic and a subject for a future article. to remove a view from venkman, simply click the close button at the top right of that view. when the view again becomes necessary—for example, when you open a source file from the loaded scripts view and want to view the source—the view reappears where it was last positioned. to make a view reappear explicitly, select it from the view->show/hide menu of the debugger. you can also make views float in their own separate windows. to make a view float, click the float button in the upper left of that view. you can access any of the basic views from the show/hide submenu of the view menu. the list displayed there includes all of the basic views in venkman. as you chang...
Anonymous Content - Archive of obsolete content
on points? perhaps on elementxbl?] event flow and targeting flow and targeting across scopes dom events can fire on anonymous targets just as they can on explicit targets. as long as the event flows within the same scope, it is no different from the behavior outlined in the dom level 2 events specification. events flow through the final transformed content model after all elements have been repositioned through the usage of children tags. whenever events flow from an anonymous element in a bound element's scope to the bound element itself, one of two actions occurs. either the event is retargeted so that the bound element becomes the target, or the event is stopped and flow proceeds to the next phase. whenever an event is retargeted, the target field of the event is set to the bound element. ...
Event Handlers - Archive of obsolete content
that the event handler will fire during the bubbling phase. the other possible values are target, which means the handler will only fire if event.originaltarget is the same as the target to which the handler is attached, and capturing, which indicates the handler should fire during the capturing phase of event flow. xbl event handlers always fire last, after all other event handlers at the same position in the event flow. since xbl handlers usually constitute the default actions for a widget, this allows authors in the bound document to write events that potentially suppress the default actions taken by the xbl handlers. within an xbl inheritance chain, event handlers always fire first on the derived binding and then on the base binding in the chain. a derived handler then has a way of preventi...
A XUL Bestiary - Archive of obsolete content
ace with the global skin, which is loaded in almost every xul file you see in mozilla (and whose absence from your own xul files can make your work look strange, senseless, or invisible altogether), a xul.css file is loaded which provides some very basic presentational information for the widgets in the toolkit. so css is a lot of what makes xul xul, especially with the advent of css2 and its new positioning capabilities. skinning is most often brought up in the context of dynamic changes to the overall look of an application. though this is not yet in the browser, very soon it will be possible to change the look of a whole application dynamically, but only to the extent that the skin is actually defined in the main global.css, or global skin. when you create styles in <style> tags, as style attr...
movetoclick - Archive of obsolete content
« xul reference home movetoclick type: boolean if true, clicking the slide area of the scale moves the thumb directly to that position. if false, clicking the slide area moves the thumb only one increment in that direction. if not specified, the default value is used, which varies for each platform. ...
align - Archive of obsolete content
bute to create elements that stretch in the opposite direction. left the elements are aligned on their left edges. center the elements are centered horizontally. right the elements are aligned on their right edges. the pack attribute is related to the alignment but is used to specify the position in the opposite direction. you can also specify the value of align using the style property -moz-box-align. ...
bottom - Archive of obsolete content
...
collapse - Archive of obsolete content
parent is collapsed so that its width or height is 0. after when the grippy is clicked, the element immediately after the splitter in the same parent is collapsed so that its width or height is 0. both either the element immediately before the splitter, or the element immediately after the splitter can be collapsed, if the size of that element would fall below the minimum size due to the position of the splitter. ...
curpos - Archive of obsolete content
the default value is 0. ...
image - Archive of obsolete content
« xul reference home image type: uri the uri of the image to appear on the element. if this attribute is empty or left out, no image appears. the position of the image is determined by the dir and orient attributes. example <menuitem label="foo" class="menuitem-iconic" image="something.png"/> see also image element ...
left - Archive of obsolete content
Archive › Mozilla › XUL › Attribute › left
...
maxpos - Archive of obsolete content
the default value is 100. ...
ordinal - Archive of obsolete content
by default, elements appear in the order they appear in the xul code. the ordinal attribute can be used to change the order. note the default ordinal for elements is 1. ...
pack - Archive of obsolete content
Archive › Mozilla › XUL › Attribute › pack
« xul reference home pack type: one of the values below the pack attribute specifies where child elements of the box are placed when the box is larger that the size of the children. for boxes with horizontal orientation, it is used to indicate the position of children horizontally. for boxes with vertical orientation, it is used to indicate the position of children vertically. the align attribute is used to specify the position in the opposite direction. you can also specify the value of pack using the style property -moz-box-pack. start child elements are placed starting from the left or top edge of the box. if the box is larger than the total size of the children, the extra space is placed on the right or bottom side. center extra space is split equally along each side of...
panel.flip - Archive of obsolete content
er, being able to flip horizontally makes sense. this attribute, set to both, permits that behavior. you will not normally have to use this attribute, since it's automatically applied to arrow panels. an arrow panel can also specify a value of slide, which causes the arrow to "slide" instead of flipping when the panel doesn't have room. a sliding panel will have the start (or end) position extended such that the panel can be the requested size, meaning the arrow will no longer be at the start (or end) of the panel - i.e., the arrow will appear to have been slid along the panel to ensure the arrow is still pointing at the anchor. in this image, the panel has flip="slide" and has a width which is greater than the distance from the anchor to the right of the screen (or ...
panel.level - Archive of obsolete content
herwise ime or on-screen keyboard popups will appear incorrectly. for these reasons, you should avoid setting the level if not needed. top the panel is shown in front of all other normal windows, including those of other applications. parent the panel is shown just above the window the panel is in, but behind other windows above it. if anchored, the child window maintains its relative position to its parent window. floating the panel floats above the window the panel is in. on mac, the panel is only visible when the application is active. ...
popup.left - Archive of obsolete content
...
popup.top - Archive of obsolete content
...
popupanchor - Archive of obsolete content
use event coordinates. this point (either directly under the mouse or attached to one of the four corners) is called the originating point.by default the popup content appears with its top left point located directly underneath the point at which the user's mouse goes down (on tooltips the content is displaced by the height of the mouse cursor). popupanchor works in conjunction with popupalign to position the popup content on the element. the default value for both popupanchor and popupalign is "none." ...
resizeafter - Archive of obsolete content
closest the element immediately to the right or below the splitter resizes. farthest the element that is the farthest away from the splitter to the right or below the splitter resizes. ...
resizebefore - Archive of obsolete content
closest the element immediately to the left or above the splitter resizes. ...
right - Archive of obsolete content
positive values are to the left; negative values are to the right of the right edge of the stack. this location is specified with respect to the right edge of the stack prior to the element being evaluated, or added to the stack. placing the element which contains this attribute within the stack may result in the stack changing size. ...
screenX - Archive of obsolete content
...
screenY - Archive of obsolete content
...
state - Archive of obsolete content
atically as the splitter is moved, and is generally used in a stylesheet to apply a different appearance for each state. open the content either before or after the splitter, depending on the value of the collapsed attribute, is currently displayed. collapsed the content either before or after the splitter is collapsed and is not visible. dragging the user is current adjusting the position of the splitter, typically by dragging it with the mouse. more info on splitters in the xul tutorial ...
top - Archive of obsolete content
Archive › Mozilla › XUL › Attribute › top
...
Attribute (XUL) - Archive of obsolete content
ewound 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 sort sortactive sortdirection sortresource sortreso...
Building accessible custom components in XUL - Archive of obsolete content
ts are fully accessible out-of-the-box. however, if you are building custom controls in xul, you may need to use dhtml accessibility techniques to ensure that your custom controls are equally accessible. a super-simple spreadsheet download stage-1.zip install stage-1.xpi to build our xul spreadsheet, we'll use three built-in xul controls: a single grid element to contain the other elements and position them in rows and columns. description elements for each row and column header. label elements for each cell in the spreadsheet. the xul markup is straightforward. we define the grid, then define the headers for each row (numbered 1 through 7), then define the column header and cells for each column. the label for each header and cell is defined in the value attribute. the flex attributes are sim...
Dynamically modifying XUL-based user interface - Archive of obsolete content
= createmenuitem("last item"); popup.insertbefore(first, popup.firstchild); popup.appendchild(last); you can also use appendchild() and insertbefore() to move existing elements. for example you could move the item labeled "first item" to the end of popup by adding this statement as a last line to the snippet above: popup.appendchild(first); this statement would remove the node from its current position in the document and re-insert it at the end of the popup. anonymous content (xbl) xbl is the language used in mozilla to define new widgets. widgets defined in xbl may choose to define some content which is inserted to the bound element, when the binding is attached. this content, called anonymous content, is not accessible through normal dom methods. you need to use the methods of nsidomdocument...
findbar - Archive of obsolete content
, top, width browser type: browser element lets you set and get the browser in which the findbar is located. findmode type: integer read only. the find mode in use. ...
getFormattedString - Archive of obsolete content
if you need to handle substitutions involving plurals, take a look at localization and plurals. ...
getIndexOfItem - Archive of obsolete content
« xul reference home getindexofitem( item ) return type: integer returns the zero-based position of the specified item. items are numbered starting at the first item displayed in the list. ...
insertItemAt - Archive of obsolete content
you may optionally set a value. the new item element is returned. ...
openPopupAtScreen - Archive of obsolete content
« xul reference home openpopupatscreen( x, y, iscontextmenu ) return type: no return value open the popup at a specific screen position specified by x and y. this position may be adjusted if it would cause the popup to be off of the screen. the x and y coordinates are measured in css pixels. ...
setSelectionRange - Archive of obsolete content
...
Extensions - Archive of obsolete content
pup"> <menuitem label="thesaurus"/> </menupopup> note that other extensions may be adding their own items into the same menus. because of this, the new item might not appear at the end of the menu but before a menuitem added by another extension, depending on the order in which the overlays are applied. as you cannot predict this order, you should not rely on any menuitems being in particular positions in the presence of other extensions. modifying the context menu an extension may wish to modify the context menu associated with the browser area. normally, this menu displays menu items specific to what was context clicked or focused. for instance, opening a context menu for a link displays items to open the link in a new window or tab and to save or bookmark the link. an extension may modify...
MoveResize - Archive of obsolete content
moving and resizing a popup menus and popups have methods which may be used to move and resize them. moving a popup once a popup is open, it can be moved using the popup's moveto method. void moveto(in long left, in long top); the left argument is the horizontal screen position and the top argument is the vertical screen position. this method will change the left and top attributes to match the supplied arguments, so if these attributes are persisted the values will be restored when the window is displayed again. for instance, the following example will move a popup to the upper left corner of the screen: popup.moveto(0, 0); the position may be shifted so as not to cover user interface elements provided by the operating system, such as the menu bar or the task bar. resizing a popup th...
scrollBoxObject - Archive of obsolete content
...
selectionEnd - Archive of obsolete content
...
Property - Archive of obsolete content
minresultsforpopup minwidth minute minuteleadingzero mode month monthleadingzero name next nomatch notificationshidden object observes onfirstpage onlastpage open ordinal orient pack pagecount pageid pageincrement pageindex pagestep parentcontainer palette persist persistence placeholder pmindicator popup popupboxobject popupopen position predicate preferenceelements preferencepanes preferences priority radiogroup readonly readonly ref resource resultspopup scrollboxobject scrollincrement scrollheight scrollwidth searchbutton searchcount searchlabel searchparam searchsessions second secondleadingzero securityui selected selectedbrowser selectedcount selectedindex selectedit...
Template and Tree Listeners - Archive of obsolete content
e second tree does not. this is because the listener is only attached to the first tree. the example above makes use of the getresourceatindex and getindexofresource methods. these two methods are available for tree builders and will convert between an index in the tree and the associated member resource for the item at the index. naturally, we can't store the index as the item may have moved its position. or, the resource may no longer be part of the results, which is why we need to check the return value of the getindexofresource method. (as this example uses the rdf resources directly, it requires elevated privileges so you will need a chrome url to test it.) you might also guess that the builder's root property, which is used above, refers to the tree. in a content builder, it will return the ...
The Joy of XUL - Archive of obsolete content
plication logic was migrated from javascript to the xpcom component. separation of presentation from logic makes applications resilient to change.the original ui implementation made extensive use of graphics for rendering the month and week views. later, as the developers learned more about xul and the implementation of the basic components matured, better ways were identified to simplify the composition of the ui. this led to increased screen drawing performance and reduced memory and disk footprint requirements of the application. the ui for the month and week views was practically rewritten while the application logic remained virtually unchanged. porting xul applications to other platforms is trivial.the calendar originated as a linux application with no consideration given to porting it to ...
Creating toolbar buttons (Customize Toolbar Window) - Archive of obsolete content
/addressbo...ddressbook.xul thunderbird - address book addressbooktoolbarpalette chrome://editor/content/editor.xul kompozer - main window nvutoolbarpalette chrome://calendar/content/calendar.xul sunbird - main window calendartoolbarpalette more information xulplanet.com references: <toolbarbutton>, <toolbaritem>. how to adjust toolbar button's label position a forum thread about adding an item to the toolbar (instead of just adding it to palette) right after an extension is installed. note that this is not recommended. there is another page on mdc with information about adding buttons to various windows in seamonkey. includes useful information about overlays for chatzilla. ...
Adding Buttons - Archive of obsolete content
like html, xul has a number of tags that can be used to create user interface elements. ...
Adding Event Handlers - Archive of obsolete content
as a name, for example, 'mousemove' is the name of the event that is triggered when the user moves the mouse over a ui element. xul uses the same event mechanism as defined by dom events. when an action occurs that would trigger an event, such as the user moving the mouse, an event object is created corresponding to that event type. various properties are set on the event object such as the mouse position, the key that was pressed, and so forth. the event is then sent to the xul in phases. in the capturing phase, the event is first sent to the window, then to the document, followed by each ancestor of the xul element where the event occured downwards until it reaches that element. in the target phase, the event is sent to the target xul element. in the bubbling phase, the event is sent to ea...
Adding more elements - Archive of obsolete content
ontal"> <caption label="search criteria"/> <menulist id="searchtype"> . . . <spacer style="width: 10px;"/> <textbox id="find-text" flex="1" style="min-width: 15em;"/> </groupbox> there are other cosmetic problems as well. we could also have the groupbox grow so that it extends vertically to the bottom of the box. also, we could modify some of the margins so that the elements are positioned better. we will see more examples of the box model and some of its features as we continue to add elements throughout the tutorial. find files example so far source view next, we will look at how to create stacks. « previousnext » ...
Creating a Skin - Archive of obsolete content
16px 64px 0); -moz-box-orient: vertical; } #savesearch { list-style-image: url("chrome://editor/skin/icons/btn1.gif"); -moz-image-region: rect(80px 16px 96px 0); -moz-box-orient: vertical; } mozilla provides a custom style property -moz-image-region which can be used to make an element use part of an image. you can think of it as a clip region for the image. you set the property to a position and size within an image and the button will display only that section of the image. this allows you to use the same image for multiple buttons and set a different region for each one. when you have lots of buttons, with states for hover, active and disabled, this saves space that would normally be occupied by mutliple images. in the code above, we use the same image for each button, but set a di...
Features of a Window - Archive of obsolete content
the new elements. the window is really just a box which is flexible and defaults to vertical orientation. you can also specify the width and height directly on the window tag. this, of course, causes the window to be displayed in a specific size. if you leave it out, the size is determined by the elements that are in it. gecko 1.9.2 note starting in gecko 1.9.2 (firefox 3.6), overriding the position of a window using window features will not change the persisted values saved by the session store feature. that means the next time the window is opened, it will still open in the saved location. <window id="findfile-window" title="find files" width="400" height="450" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> in this example, the window will open with a...
Grids - Archive of obsolete content
Archive › Mozilla › XUL › Tutorial › Grids
a grid contains elements that are aligned in rows just like tables. ...
Modifying a XUL Interface - Archive of obsolete content
d); it should be fairly straightforward from the function names what these functions do. the insertbefore() function inserts a new child node before an existing one. this is used to insert into the middle of a list of children of the parent element instead of at the end like appendchild() does. the replacechild() function removes an existing child and adds a new one in its place at the same position in the list of its parent element. finally the removechild() function removes a child from the list of its parent element. note that for all these functions, the object referred to by the variable referencechild or the variables newchild and oldchild must already exist or an error occurs. likewise the object referred to by the variable child which is to be removed must already exist or an erro...
More Tree Features - Archive of obsolete content
next, we'll find out to get and set the selection for trees. « previousnext » ...
Property Files - Archive of obsolete content
var strbundle = document.getelementbyid("strings"); var result = strbundle.getformattedstring("resultmessage", [ dir, count ]); alert(result); this example will display following message in an alert box. 10 files found in the /usr/local/document directory. you will notice the formatting codes %1$s and %2$s is used, and replaced different order in the array. formatting code %n$s is specify the position of corresponding parameter directly. although the word order is not the same in all the languages, by using getformattedstring() the specification of the order can be put out the property files. in case you need to format a string that already contains the percentage character in it (to get something like "50% off" returned), escape the percentage character with another percentage character, like...
Stacks and Decks - Archive of obsolete content
eing the third one. the third page is a box with two elements inside it. both the box and the elements inside it make up the page. the deck will be as large as the largest child, which here should be the third page. you can switch pages by using a script to modify the selectedindex attribute. more on this in the section on events and the dom. the next section describes how stacks can be used to position child elements. « previousnext » ...
Tabboxes - Archive of obsolete content
atically check for mail' will appear. when the second tab is clicked, the page containing the button labeled 'clear news buffer' will appear instead. the currently selected tab element is given an additional selected attribute which is set to true. this alters the appearance of the currently selected tab to make it look selected. only one tab will have a true value for this attribute at a time. position of the tabs finally, you can change the position of the tabs so that they appear on any side of the tab pages. there is no special syntax to do this. you simply set the orient and dir attributes as necessary. remember that the tab elements are much like regular boxes in terms of layout. moreover, the tabbox element is much like a regular container box with a default vertical orientation, whereas...
The Box Model - Archive of obsolete content
s a few very simple rules. a box can lay out its children in one of two orientations, either horizontally or vertically. a horizontal box lines up its elements horizontally and a vertical box orients its elements vertically. you can think of a box as one row or one column from an html table. various attributes placed on the child elements in addition to some css style properties control the exact position and size of the children. box elements the basic syntax of a box is as follows: <hbox> <!-- horizontal elements --> </hbox> <vbox> <!-- vertical elements --> </vbox> the hbox element is used to create a horizontally oriented box. each element placed in the hbox will be placed horizontally in a row. the vbox element is used to create a vertically oriented box. added elements will be placed u...
Tree Box Objects - Archive of obsolete content
the parts of the tree at specific coordinates and vice versa. the getcellat() function may be used to get the cell at specific pixel location the getrowat() function may be used to get a row at a specific location. the getrowat() function takes two arguments, the x and y coordinates to use. tree.boxobject.getrowat( 50, 100 ); this example will return the index of the row with a horizontal position of 50 and a vertical position of 100. naturally, it doesn't really matter what the value of the x coordinate is since rows always take up the entire horizontal space of the tree. one important thing to note is that the coordinates are measured from the upper left corner of the containing document, not the edge of the tree itself. this makes it easy to pass event coordinates directly to these fu...
Tree Selection - Archive of obsolete content
lected item, where the first row is 0. child items are included in the count just after their parents. this means that if there are 3 top-level items and each has two child items, there will be a total of 9 items. the first item (at index 0) will be the first top-level item. the next item at index 1 will be its first child. the second child will be at index 2 and the second parent item will be at position 3 and so on. in the image, there are eight rows displayed, of which two are selected. the first selected row has an index of 4 and the second has an index of 7. the rows that are not displayed are not included in the index count. multiple selection for trees that allow multiple selection, getting the list of selected rows is a bit more complicated. the tree's view has a selection property whi...
XUL Structure - Archive of obsolete content
as many components as you want pre-installed. each extension is something of a standalone component with a separate chrome url. mozilla also has one component for each installed theme and locale. each of these components, or packages, is made up of a set of files that describe the user interface for it. for example, the messenger component has descriptions of the mail messages list window, the composition window and the address book dialogs. the packages that are provided with mozilla are located within the chrome directory, which is in the directory where you built mozilla. the chrome directory is where you find all the files that describe the user interface used by the mozilla browser, mail client, and other applications. typically, you put all the xul files for an application in this directory...
Accessibility/XUL Accessibility Reference - Archive of obsolete content
the widget visually to the right of the column headers) or the column headers themselves (for sorting by column). these functions must be replicated elsewhere (like in the main menu, e.g. the manage bookmarks window in firefox 2 or the places window in firefox 3). jaws 7.10 can not read the column headers. the main tree is accessible like a regular tree control. ...
attribute.align - Archive of obsolete content
s how child elements of the box are aligned, when the size of the box is larger than the total size of the children. for boxes that have horizontal orientation, it specifies how its children will be aligned vertically. for boxes that have vertical orientation, it is used to specify how its children are algined horizontally. the pack attribute is related to the alignment but is used to specify the position in the opposite direction. you can also specify the value of align using the style property -moz-box-align. parameters start child elements are aligned starting from the left or top edge of the box. if the box is larger than the total size of the children, the extra space is placed on the right or bottom side. center extra space is split equally along each side of the child elements, resulting ...
browser - Archive of obsolete content
f, such as goback and goforward. it also contains the load constants used by reloadwithflags and loaduriwithflags. webprogress type: nsiwebprogress this read-only property contains an nsiwebprogress object which is used to monitor the progress of a document loading. ...
checkbox - Archive of obsolete content
value of the disabled attribute. src type: url gets and sets the value of the src attribute. label type: string gets and sets the value of the label attribute. tabindex type: integer gets and sets the value of the tabindex attribute. ...
colorpicker - Archive of obsolete content
boolean returns true if the popup for a button-type colorpicker is open. set this property to true to open the popup or false to close the popup. tabindex type: integer gets and sets the value of the tabindex attribute. ...
command - Archive of obsolete content
, 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
commandset - Archive of obsolete content
, 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
datepicker - Archive of obsolete content
ar type: integer the currently selected year from 1 to 9999. set this property to change the selected year. yearleadingzero type: boolean a read only value indicating whether a leading zero should be displayed before the year when it is less than 1000. ...
description - Archive of obsolete content
gets and sets the value of the tabindex attribute. 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. ...
dialogheader - Archive of obsolete content
, 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
editor - Archive of obsolete content
tml editing interface for the editor which contains methods for manipulating an html document. pass the editor's contentwindow as the argument. makeeditable( editortype, waitforload ) return type: no return value this function enables editing for an editor. specify text or html as the editortype. ...
image - Archive of obsolete content
Archive › Mozilla › XUL › image
, 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
key - Archive of obsolete content
Archive › Mozilla › XUL › key
, 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
label - Archive of obsolete content
Archive › Mozilla › XUL › label
gets and sets the value of the disabled attribute. 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. ...
menubar - Archive of obsolete content
, 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
param - Archive of obsolete content
Archive › Mozilla › XUL › param
, 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
preference - Archive of obsolete content
returns true, if the given element is "editable" (see below). void setelementvalue(in domelement element); initializes the supplied element from the value stored in the preference. this function calls onsyncfrompreference. void updateelements(); update all elements that observe this preference. ...
prefwindow - Archive of obsolete content
of the last selected pane. it will be opened by default the next time the preferences dialog is opened. preferencepanes type: dom nodelist holds a list of all the prefpane elements in the window. type type: string gets and sets the value of the type attribute. ...
richlistitem - Archive of obsolete content
gets and sets the value of the tabindex attribute. 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. ...
rule - Archive of obsolete content
Archive › Mozilla › XUL › rule
, 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
tabbox - Archive of obsolete content
ays be one of the tab elements in the tabs element. assign a value to this property to modify the currently selected tab. tabs type: tabs element the tabs element contained within the tabbox. tabpanels type: tabpanels element the tabpanels element contained within the tabbox. ...
tabbrowser - Archive of obsolete content
lf, such as goback and goforward. it also contains the load constants used by reloadwithflags and loaduriwithflags. webprogress type: nsiwebprogress this read-only property contains an nsiwebprogress object which is used to monitor the progress of a document loading. ...
timepicker - Archive of obsolete content
should be displayed before the second when it is less than 10. tabindex type: integer gets and sets the value of the tabindex attribute. value type: string the currently entered time of the form hh:mm:ss. set this property to change the time. ...
toolbar - Archive of obsolete content
element in the toolbar's toolbarpalette. some special ids may also be used to create special spacing items: separator: a separator, which is drawn as a vertical bar. spacer: a non-flexible space. spring: a flexible space. the method returns the dom element for the created item. ...
treecell - Archive of obsolete content
, 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
treeitem - Archive of obsolete content
, 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
wizard - Archive of obsolete content
title type: string the title that appears at the top of the wizard. this is overridden by the label attribute on the individual pages. wizardpages type: dom nodelist of wizardpage elements this property holds the list of wizardpage elements in the wizard. ...
wizardpage - Archive of obsolete content
s, 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 methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefault...
Dialogs in XULRunner - Archive of obsolete content
og("chrome://basicapp/content/dialog.xul", "newdlg", "modal"); } the resulting dialog looks like this on windows 2000, and will look similar on other operating systems: the first thing that caught my eye about dialog is the button-related attributes on the element. in an effort to make things easier for developers and more consistent for users, xul has a mechanism to automatically create and position the core dialog buttons ("ok," "cancel," and "help" for example). the developer just declares the need for the button, the button's caption, and the access key for the button, as well as the javascript function to call if the button is pressed. xul handles placing and styling the buttons on the dialog. this is also nice for cross-platform applications, as each os has its own convention for where...
Mozilla release FAQ - Archive of obsolete content
sion what's this section about? this section is to prevent rehashing of the same debates over and over again on the newsgroups. it might slightly reflect the opinions of pat gunn, and if you're really angry about this, drop him an email at qc@apk.net i'll try to keep this section with only debates that are frequent that seem to have a right answer. how about a mozilla operating system? mozilla is positioned well as an application software. however, it makes very little sense to try to make mozilla into an operating sense, almost as little sense as it would to make a word processor or a mp3 player into one. beyond technical reasons, the operating system market is currently glutted, and a new entry would be unlikely to attract enough users to ensure the writing of drivers for a new system, a critica...
2006-10-20 - Archive of obsolete content
n why gtk1 builds are still being performed is because: when requests are made to change build boxes to newer versions the people responsible for making the change reply with "that would require an os upgrade". on october 20th j. paul reed responded to boris zbarsky's post: j. paul reed restates his overall goal that are "getting us to not rely on hardware that you have to have in a certain position for it to boot" to use standard known configuration for every nightly build that is produced. he also points out that there is a wiki page where the standard reference platform for linux has been defined (for trunk builds). on october 20th boris zbarsky responded to j. paul reed previous post: in his post, boris zbarsky acknoleges the points that j. paul reed made in his previous post. ...
2006-10-20 - Archive of obsolete content
ile type? joes noticed that mp3 files are no longer allowed to be opened directly from email attachments in trunk builds of thunderbird and seamonkey. they must be first saved to the drive. --------------010306060708080008030904 content-type: audio/mpeg; name="eternals - babalus's wedding dayfinal.mp3" content-transfer-encoding: base64 content-id: <part1.00030607.05030...@gmail.com> content-disposition: inline; filename="eternals - babalus's wedding dayfinal.mp3" he wonders why this is. meetings none during this week. ...
2006-09-29 - Archive of obsolete content
widths of the * frame. * @param apadding the sum of the left and right margins of the * frame, including actual values resulting from * percentages. * @param ashrinkwrap whether the frame is in a context where * non-replaced blocks should shrink-wrap (e.g., * it's floating, absolutely positioned, or * inline-block). */ virtual nssize computesize(nscoord aavailwidth, nscoord amargin, nscoord aborder, nscoord apadding, prbool ashrinkwrap) = 0; details can be located at refactoring some of nshtmlreflowstate. discussion on how to determine whether there is pending layout changes or reflows when using a...
2006-12-24 - Archive of obsolete content
ember 1, 2006 announcements none this week. 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
ember 2, 2006 announcements none this week. 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. ...
NPEvent - Archive of obsolete content
e definition of the event type used by the xwindows platform. for information about the xevent structure and xwindows events, see the xwindows documentation. 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. e.g. key events don't have a position. mouse events have x and y coordinates relative to the top-left corner of the plugin rectangle. see also npp_handleevent() ...
NPP_SetWindow - Archive of obsolete content
and clipping rectangle (see note on unix below). returns if successful, the function returns nperr_no_error. if unsuccessful, the plug-in is not loaded and the function returns an error code. for possible values, see error codes. 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. if the window handle is set to null, the window is destroyed. in this case, the plug-in must not perform any additional graphics operations on the window and should free any associated resources. the data structure passed in npp_setwindow is an npwindow object, which contains the coordinates of the instance's area a...
NPWindow - Archive of obsolete content
indow field holds a platform-specific handle to a drawable or an off-screen pixmap, as follows: windows: hdc mac os: pointer to np_port structure unix/x11: not used. (the drawable is provided in a graphicsexpose event, when the paint is requested.) description the npwindow structure represents the native window or a drawable, and contains information about coordinate position, size, whether the plug-in is windowed or windowless, and some platform-specific information. the plug-in area is a native window element on windows and unix, or a rectangle within a native window on mac os. the x, y, height, and width coordinates of npwindow specify the position and size of this area. the browser calls npp_setvalue whenever the drawable changes. a windowed plug-in is drawn int...
NP_Port - Archive of obsolete content
« gecko plugin api reference « plug-in side plug-in api summary used on mac os only contains information required by the window field of an npwindow structure. syntax typedef struct np_port { cgrafptr port; /* grafport */ int32 portx; /* position inside the topmost window */ int32 porty; } np_port; fields the data structure has the following fields: port standard mac os port into which the plug-in should draw. portx, porty top-left corner of the plug-in rectangle in port coordinates (taking the scroll position into account). description on mac os, the window field of an npwindow structure points to an np_port object, which is allocated by the browser. the np_port is valid for the lifetime of the npwindow, that is, until npp_setwindow is called again with a diff...
Proposal - Archive of obsolete content
feed extension created to make rss feeds work better with newsgator software. lets you specify an image, up to 277x78 pixels. and lets you specifies a specific rendering transform (xslt) to be used when rendering the feed in newsgator for outlook. the transform must already exist on the machine running newsgator; stylesheets will not be downloaded or installed automatically. spec exists rss disposition hinting a proposal to make it so iptv and ipradio/podcasting works better with rss. uses an http "content-type" parameter to hint at an rss feeds disposition type -- to hint at what is being syndicated. in development rsshints a module that adds elements to a feed that help an aggregator process them. draft exists source guid when an rss item is posted in response to a previous item (called t...
Theme changes in Firefox 2 - Archive of obsolete content
.css new file; css used for the window to add a new feed reader. browser/feeds/feedicon.png new file; the rss feed icon. browser/feeds/feedicon16.png new file; the 16x16 pixel version of the rss feed icon. browser/feeds/subscribe.css new file; css used for the window to subscribe to a news feed. browser/go-rtl.png new file; go icon to use if it's positioned at the left end of the url field. browser/preferences/preferences.css file that skins the preferences window. browser/safebrowsing/browser-protection.css new file; css for the window that appears to warn the user that a site may be fraudulent, as well as the url bar icon that indicates a site may be fraudulent. browser/safebrowsing/close16x16.png new file; th...
Using the W3C DOM - Archive of obsolete content
ent elements. therefore, if you wish to read and write these properties from javascript through the dom2, use one of these two approaches: place all of the element's static css declarations (if it has any) in the element's style attribute. use no static css declarations for the element and initialize its css properties from javascript through the dom. w3c dom2 reflection of an element's css positioning properties the values returned by the w3c dom2 style.left and style.top properties are strings that include the css unit suffix (such as "px"), whereas ie5+ elemref.style.pixelleft (and the corresponding properties for top) return an integer. 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(). converse...
-ms-content-zoom-snap-points - Archive of obsolete content
nimation typediscrete syntax values snapinterval( <percentage>, <percentage> ) specifies where the snap-points will be placed. the first percentage specifies where the first snap-point will be placed. the second percentage specifies the distance between subsequent snap-points, both zoomed in and zoomed out from the initial snap-point. snaplist( <percentage># ) specifies the position of individual snap-points as a comma-separated list of percentages, each of which represents a zoom factor. if any value specified is less than that specified by the -ms-content-zoom-limit-min property, the value of -ms-content-zoom-limit-min is used. if any value specified is greater than that specified by the -ms-content-zoom-limit-max property, the value of -ms-content-zoom-limit-max is...
-ms-scroll-snap-points-x - Archive of obsolete content
apinterval( <length-percentage>, <length-percentage> ) specifies a starting snap-point followed by the interval between all snap-points. the first value specifies where the first snap-point will be placed. the second value specifies the distance between subsequent snap-points both to the left and the right of the initial snap-point. snaplist( <length-percentage># ) specifies the position of individual snap-points as a comma-separated list of values, each of which represents a zoom factor. if any value is less than -ms-scroll-limit-x-min , then -ms-scroll-limit-x-min is used. if any value is greater than -ms-scroll-limit-x-max, then -ms-scroll-limit-x-max is used. formal syntax snapinterval( <length-percentage>, <length-percentage> ) | snaplist( <length-percentage>...
-ms-scroll-snap-points-y - Archive of obsolete content
taqe>. snapinterval( <length-percentage>, <length-percentage> ) specifies a starting snap-point followed by the interval between all snap-points. the first value specifies where the first snap-point will be placed. the second value specifies the distance between subsequent snap-points both above and below the initial snap-point. snaplist( <length-percentage># ) specifies the position of individual snap-points as a comma-separated list of values, each of which represents a zoom factor. if any value is less than -ms-scroll-limit-y-min , then -ms-scroll-limit-y-min is used. if any value is greater than -ms-scroll-limit-y-max, then -ms-scroll-limit-y-max is used. formal syntax snapinterval( <length-percentage>, <length-percentage> ) | snaplist( <length-percentage>...
-ms-wrap-flow - Archive of obsolete content
he exclusion and must leave empty the areas to the start and end edges of the exclusion box. formal syntax auto | both | start | end | maximum | clear specifications not part of any specification. remarks the -ms-wrap-flow property makes an element an exclusion element when it has a computed value other than auto. this property specifies that the exclusion element (the exclusion) can be positioned in various ways, and that inline content will wrap around the exclusion in a way similar to how it wraps around floated elements. when the -ms-wrap-flow property's computed value is auto, the element does not become an exclusion element unless its float property's computed value is not none. in that case, the element contributes its border box to its containing block's wrapping context and con...
::-ms-ticks-after - Archive of obsolete content
-style border-left-width border-right-color border-right-style border-right-width border-top-color border-top-left-radius border-top-right-radius border-top-style border-top-width box-shadow box-sizing color cursor display (values block, inline-block, none) @font-face font-size font-style font-weight height margin-bottom margin-left margin-right margin-top -ms-background-position-x -ms-background-position-y -ms-high-contrast-adjust opacity outline-color outline-style outline-width padding-bottom padding-left padding-right padding-top transform transform-origin visibility width syntax ::-ms-ticks-after ...
::-ms-ticks-before - Archive of obsolete content
-style border-left-width border-right-color border-right-style border-right-width border-top-color border-top-left-radius border-top-right-radius border-top-style border-top-width box-shadow box-sizing color cursor display (values block, inline-block, none) @font-face font-size font-style font-weight height margin-bottom margin-left margin-right margin-top -ms-background-position-x -ms-background-position-y -ms-high-contrast-adjust opacity outline-color outline-style outline-width padding-bottom padding-left padding-right padding-top transform transform-origin visibility width syntax ::-ms-ticks-before ...
::-ms-track - Archive of obsolete content
-style border-left-width border-right-color border-right-style border-right-width border-top-color border-top-left-radius border-top-right-radius border-top-style border-top-width box-shadow box-sizing color cursor display (values block, inline-block, none) @font-face font-size font-style font-weight height margin-bottom margin-left margin-right margin-top -ms-background-position-x -ms-background-position-y -ms-high-contrast-adjust opacity outline-color outline-style outline-width padding-bottom padding-left padding-right padding-top transform transform-origin visibility width syntax ::-ms-track see also ::-ms-thumb ::-ms-fill-upper ::-ms-fill-lower ::-webkit-slider-runnable-track ::-moz-range-track css-tricks: styling cross-browser compatible...
::-ms-value - Archive of obsolete content
-style border-left-width border-right-color border-right-style border-right-width border-top-color border-top-left-radius border-top-right-radius border-top-style border-top-width box-shadow box-sizing color cursor display (values block, inline-block, none) @font-face font-size font-style font-weight height margin-bottom margin-left margin-right margin-top -ms-background-position-x -ms-background-position-y -ms-high-contrast-adjust opacity outline-color outline-style outline-width padding-bottom padding-left padding-right padding-top transform transform-origin visibility width syntax ::-ms-value example input::-ms-value { color: lime; font-style: italic; } to disable the default styling: select::-ms-value { background-color: transparent; co...
Back to the Server: Server-Side JavaScript On The Rise - Archive of obsolete content
es the jaxer.db namespace creates a new database table in the default sqlite database if it doesn't already exist. you can see the field names and data types which make sense for the type of data that's been added. the second statement is just a simple insert statement using the data obtained from the form. placeholders in the form of '?' are used to match up the argument values with their proper position in the insert statement. xml processing the final feature we'll explore is xml processing with a particular emphasis first on the capability to create a simple xml service on the server-side, then use the e4x capabilities to processes it. listing 10 demonstrates the configuration of a simple service we're able to advertise through jaxer using the...
Implementation Status - Archive of obsolete content
8.3.3 label partial labels for items inside a choices element has bind problems. we'd like to expand how we render labels bound to different, unique types. 297083; 343443; 8.3.4 help supported 8.3.5 hint partial problems with hints in xul-hosted documents and ephemeral message positioning 349667; 8.3.6 alert supported 9. container form controls section title status notes bugs 9.1.1 group supported 9.2.1 switch partial @selected not working inside repeats 339937; 9.2.2 case ...
Mozilla XForms Specials - Archive of obsolete content
cut. this is documented in nsixformsnsinstanceelement. custom control interface we have added a lot of functionality to our user interface, which allows the form authors to create custom controls. it involves exposing some (script) functionality on all our controls, like output, input, etc. and allowing the ui to be represented in xbl. more information can be found in xforms:custom controls. labelposition for xforms:input elements bound to a boolean node we support an attribute labelposition in the namespace http://www.mozilla.org/projects/xfor...009/extensions, which allows the form author to define on which side of the checkbox the label will be shown. for details, see the input control documentation. misc cross domain submission not exactly either a limitation, or an extension, but it is worth ...
XForms Repeat Element - Archive of obsolete content
y:line> </my:lines> </instance> </model> <repeat id="lineset" nodeset="/my:lines/my:line"> <input ref="my:price"> <label>line item</label> </input> <input ref="@name"> <label>name</label> </input> </repeat> <trigger> <label>insert a new item after the current one</label> <action ev:event="domactivate"> <insert nodeset="/my:lines/my:line" at="index('lineset')" position="after"/> <setvalue ref="/my:lines/my:line[index('lineset')]/@name"/> <setvalue ref="/my:lines/my:line[index('lineset')]/price">0.00</setvalue> </action> </trigger> <trigger> <label>remove current item</label> <delete ev:event="domactivate" nodeset="/my:lines/my:line" at="index('lineset')"/> </trigger> attribute based repeat when using xforms within host languag...
The Business Benefits of Web Standards - Archive of obsolete content
re, 4.x browsers are known to have security issues, so their users should be encouraged to upgrade. mandated accessibility being accessible is mandatory in many countries for government agencies (us, uk, canada), and --in some countries like australia-- for every organization. in the us, section 508 applies to government-funded projects and agencies. coding with standards (particularly css for positioning, and strict html) makes accessibility an easier goal to achieve, as standards have been created with accessibility in mind. taking care of accessibility means being able to serve web content to a larger audience, increasing web site usability, even for non-disabled people. comporting with the relevant legislation in the jurisdiction is an important driver particularly for developers who wish...
Examples - Game development
al fireworks animated firework effects rendered on canvas. autumn falling autumn leaves, with light source shining through. created using three.js. fire walk with me billowing fire cloud effect. rainbow firestorm rainbow-coloured particles, falling like rain, bouncing around on a terrain of orbs. crowd simulation simulation of a bustling crowd of people all trying to reach their opposite positions. svg masking experiment an xray machine, creating using an svg mask. realistic water simulation flowing water, like the waves on the ocean. dungeon demo haxor-based dungeon scene with walkable character. massive assault tech demo rendered archipelago with futuristic military vehicles. flight stream 3d globe with simulated flight paths. webgl filters demo showing webgl filters being u...
Introduction to game development for the Web - Game development
e programming language used on the web, is blazing fast in modern browsers and getting faster all the time. use its power to write the code for your game, or look at using technologies like emscripten or asm.js to easily port your existing games. pointer lock api the pointer lock api lets you lock the mouse or other pointing device within your game's interface so that instead of absolute cursor positioning you receive coordinate deltas that give you more precise measurements of what the user is doing, and prevent the user from accidentally sending their input somewhere else, thereby missing important action. svg (scalable vector graphics) lets you build vector graphics that scale smoothly regardless of the size or resolution of the user's display. typed arrays javascript typed arrays give yo...
2D collision detection - Game development
king the centre points of the two circles and ensuring the distance between the centre points are less than the two radii added together. playable code <div id="cr-stage"></div> <p>move the circle with arrow keys. ...
Unconventional controls - Game development
vement of that object occured. that way we can detect a hand movement by using only a built-in microphone! this can be accomplished using a small library created by daniel rapp — it can be as simple as calculating the difference between two frequencies: doppler.init(function(bandwidth) { var diff = bandwidth.left - bandwidth.right; }); the diff would be the difference between the initial position of the hand and the final one. this approach won't give us the full flexibility of using a gamepad, or even leap motion, but it's definitely an interesting, unconventional alternative. you can use it to scroll a page hands-free, or play theremin, but it should also be enough to move the ship up and down the screen if implemented correctly. proximity api another interesting idea is to use the b...
Implementing controls using the Gamepad API - Game development
ct -1 or 1 values can be a problem. for this reason, it can be good to set a threshold for the value of the axis to take effect. for example, the fridge tank will turn right only when the x value is bigger than 0.5: if(gamepadapi.axesstatus[0].x > 0.5) { this.player.angle += 3; this.turret.angle += 3; } even if we move it a little by mistake or the stick doesn't make it back to its original position, the tank won't turn unexpectedly. specification update after more than a year of stability, in april 2015 the w3c gamepad api spec was updated (see the latest.) it hasn't changed much, but it's good to know whats going on — the updates are as follows. getting the gamepads the navigator.getgamepads() method has been updated with a longer explanation and an example piece of code. now the len...
Efficient animation for web games - Game development
this, the browser can make some assumptions that it can’t easily make when you’re manually tweaking values in javascript. to take a concrete example, if you start a css transition to move something from off-screen so that it is fully visible on-screen, the browser knows that the related content will end up completely visible to the user and can then pre-render that content. when you animate position with javascript, the browser cannot easily make that same assumption, and so you might end up causing it to draw only the newly-exposed region of content, which may introduce slow-down. there are signals at the beginning and end of animations that allow you to attach javascript callbacks and form a rudimentary form of synchronisation (though there are no guarantees on how promptly these callbacks...
Square tilemaps implementation: Static maps - Game development
e can use a plain object or a custom class. for the sake of simplicity, in the example code a plain object has been used. it contains the basic map properties: cols: the width of the map, in columns. rows: the height of the map, in rows. tsize: the tile size, in pixels. tiles: a 1-dimensional array containing the visual grid. gettile(): a helper method that gets the tile index in a certain position. tiles contains the actual visual map data. we are representing the tiles with indices, assigned to the tiles dependant on their position in the atlas (e.g. 0 for the left-most tile.) however, we must account for empty tiles, since they are crucial for implementing layers — empty tiles are usually assigned a negative index value, 0, or a null value. in these examples, empty tiles will be repr...
Paddle and keyboard controls - Game development
nvas if we hold either key for too long. we could improve that and move the paddle only within the boundaries of the canvas by changing the code like this: if(rightpressed) { paddlex += 7; if (paddlex + paddlewidth > canvas.width){ paddlex = canvas.width - paddlewidth; } } else if(leftpressed) { paddlex -= 7; if (paddlex < 0){ paddlex = 0; } } the paddlex position we're using will move between 0 on the left side of the canvas and canvas.width-paddlewidth on the right hand side, which will work exactly as we want it to. add the above code block into the draw() function at the bottom, just above the closing curly brace. the only thing left to do now is call the drawpaddle() function from within the draw() function, to actually print it on the screen. add t...
Animations and tweens - Game development
0,2,0,1,0,2,0], 24); to add an animation to the object we use the animations.add() method, which contains the following parameters the name we chose for the animation an array defining the order in which to display the frames during the animation. if you look again at the wobble.png image, you'll see there are three frames. phaser extracts these and stores references to them in an array — positions 0, 1, and 2. the above array says that we are displaying frame 0, then 1, then 0, etc. the framerate, in fps. since we are running the animation at 24fps and there are 9 frames, the animation will display just under three times per second. applying the animation when the ball hits the paddle in the arcade.collide() method call that handles the collision between the ball and the paddle (the f...
Collision detection - Game development
verything a lot easier — we just need to add two simple pieces of code. first, add a new line inside your update() function that checks for collision detection between ball and bricks, as shown below: function update() { game.physics.arcade.collide(ball, paddle); game.physics.arcade.collide(ball, bricks, ballhitbrick); paddle.x = game.input.x || game.world.width*0.5; } the ball's position is calculated against the positions of all the bricks in the group. the third, optional parameter is the function executed when a collision occurs — ballhitbrick(). create this new function as the bottom of your code, just before the closing </script> tag, as follows: function ballhitbrick(ball, brick) { brick.kill(); } and that's it! reload your code and you should see the new collision...
Move the ball - Game development
« previousnext » this is the 4th step out of 16 of the gamedev phaser tutorial. you can find the source code as it should look after completing this lesson at gamedev-phaser-content-kit/demos/lesson04.html. we have our blue ball printed on screen, but it's doing nothing — it would be cool to make it move somehow. this article covers how to do just that. updating the ball's position on each frame remember the update() function and its definition? the code inside it is executed on every frame, so it's a perfect place to put the code that will update the ball's position on screen. add the following new lines of the code inside update(), as shown: function update() { ball.x += 1; ball.y += 1; } the code above adds 1 to the x and y properties representing the the bal...
Visual-js game engine - Game development
es one way - use windows bat-s file (in server root folder with prefix install_ ) second way - open cmd terminal and enter next command : npm install mysql npm install delivery npm install express npm install mkdirp npm install socket.io npm install nodemailer@0.7.0 very easy installation and project files generator . now you can use on-page-editor (nice for visual setup , checking positions and dimensions - not for logic ) . manual start from cmd : server_folder/node editor.js after starting on-page-editor open browser icon to open internet browser in editor mode . see video explanation : if you use editor.js to visual create game object method , you must start ***node build_from_editor_to_visual_js_file.js*** on the end of work. this tool will create visual.js in folder ...
Gecko FAQ - Gecko Redirect 1
rk to add bidi support in a future release) style sheets css 1 - full support, except for: the application of styles to html column elements the ability to turn off author styles the names of certain mozilla extension pseudo-classes lack the moz- prefix css 2 - partial support is expected and has already been built into gecko, including support for css2 positioning, but no commitment has been made to achieve a specific level of support dom level 0 level 1 core: full support making entityreferences available through dom1; per a provision of the dom1 spec for xml implementations, entities will be automatically expanded inline and therefore not available through dom1; our implementation extrapolates this provision to apply to entity...
Block (CSS) - MDN Web Docs Glossary: Definitions of Web-related terms
ment). for example, <p> is by default a block-level element, whereas <a> is an inline element — you can put several links next to one another in your html source and they will sit on the same line as one another in the rendered output. using the display property you can change whether an element displays inline or as a block (among many other options); blocks are also subject to the effects of positioning schemes and use of the position property. learn more general knowledge visual formatting model ...
Canonical order - MDN Web Docs Glossary: Definitions of Web-related terms
d as part of a css property value. it is defined by the formal syntax of the property and normally refers to the order in which longhand values should be specified as part of a single shorthand value. for example, background shorthand property values are made up of several background-* longhand properties. the canonical order of those longhand values is defined as background-image background-position background-size background-repeat background-attachment background-origin background-clip background-color furthermore, its syntax defines, that if a value for the background-size is given, it must be specified after the value for the background-position, separated by a slash. other values may appear in any order. learn more what does “canonical order” mean with respect to css pro...
Cipher - MDN Web Docs Glossary: Definitions of Web-related terms
modern ciphers are designed to withstand attacks discovered by a cryptanalyst. there is no guarantee that all attack methods have been discovered, but each algorithm is judged against known classes of attacks. ...
Delta - MDN Web Docs Glossary: Definitions of Web-related terms
the term delta refers to the difference between two values or states. the name originates from the greek letter Δ (delta), which is equivalent to the letter d in the roman alphabet. delta simply refers to the use of the letter Δ as a shorthand for difference. the term delta is commonly used when communicating changes in speed, position, or acceleration of a physical or virtual object. it's also used when describing changes in the volume or frequency of sound waves. for example, when describing how far an object on the screen moves left-to-right, one might use the term delta x or Δx. likewise, given the new value of x and its old value, you might compute the delta like this: let deltax = newx - oldx; more commonly, you receive the delta and use it to update a saved previous conditio...
Grid Lines - MDN Web Docs Glossary: Definitions of Web-related terms
e 1 will be on the left of the grid, row line 1 on the top. lines numbers respect the writing mode of the document and so in a right-to-left language for example, column line 1 will be on the right of the grid. the image below shows the line numbers of the grid, assuming the language is left-to-right. lines are also created in the implicit grid when implicit tracks are created to hold content positioned outside of the explicit grid, however these lines cannot be addressed by a number. placing items onto the grid by line number having created a grid, you can place items onto the grid by line number. in the following example the item is positioned from column line 1 to column line 3, and from row line 1 to row line 3. * {box-sizing: border-box;} .wrapper { border: 2px solid #f76707; ...
Grid Tracks - MDN Web Docs Glossary: Definitions of Web-related terms
the image below shows the first row track on a grid. ...
MDN Web Docs Glossary: Definitions of Web-related terms
sgml shadow tree shim signature signature (functions) signature (security) simd simple header simple response header sisd site site map sld sloppy mode slug smoke test smpte (society of motion picture and television engineers) smtp snap positions soap spa (single-page application) specification speculative parsing speed index sql sql injection sri stacking context state machine statement static method static typing strict mode string stun style origin stylesheet svg ...
HTML: A good basis for accessibility - Learn web development
nored, as it is one of the main places that accessibility is badly broken if not handled properly. out there on the web, the truth is that people do some very strange things with html markup. some abuses of html are due to legacy practices that have not been completely forgotten, and some are just plain ignorance. whatever the case, you should replace such bad code. sometimes you are not in the position to get rid of lousy markup — your pages might be generated by some kind of server-side framework over which you don't have full control, or you might have third party content on your page (such as ad banners) over which you have no control. the goal isn't "all or nothing." however, — every improvement you can make will help the cause of accessibility. text content one of the best accessibi...
HTML: A good basis for accessibility - Learn web development
nored, as it is one of the main places that accessibility is badly broken if not handled properly. out there on the web, the truth is that people do some very strange things with html markup. some abuses of html are due to legacy practices that have not been completely forgotten, and some are just plain ignorance. whatever the case, you should replace such bad code. sometimes you are not in the position to get rid of lousy markup — your pages might be generated by some kind of server-side framework over which you don't have full control, or you might have third party content on your page (such as ad banners) over which you have no control. the goal isn't "all or nothing." however, — every improvement you can make will help the cause of accessibility. text content one of the best accessibi...
Mobile accessibility - Learn web development
note: you can also see fully functional examples showing how to implement different control mechanisms at implementing game control mechanisms. responsive design responsive design ...
Accessible multimedia - Learn web development
what the scene looks like. chapter titles — chapter markers intended to help the user navigate the media resource implementing html5 video text tracks text tracks for displaying with html5 video need to be written in webvtt, a text format containing multiple strings of text along with metadata such as what time in the video you want each text string to be displayed, and even limited styling/positioning information. these text strings are called cues. a typical webvtt file will look something like this: webvtt 1 00:00:22.230 --> 00:00:24.606 this is the first subtitle. 2 00:00:30.739 --> 00:00:34.074 this is the second. ... to get this displayed along with the html media playback, you need to: save it as a .vtt file in a sensible place. link to the .vtt file with the <track> eleme...
Images, media, and form elements - Learn web development
c knowledge of working with files, html basics (study introduction to html), and an idea of how css works (study css first steps.) objective: to understand the way that some elements behave unusually when styled with css. replaced elements images and video are described as replaced elements. this means that css cannot affect the internal layout of these elements — only their position on the page amongst other elements. as we will see however, there are various things that css can do with an image. certain replaced elements, such as images and video, are also described as having an aspect ratio. this means that it has a size in both the horizontal (x) and vertical (y) dimensions, and will be displayed using the intrinsic dimensions of the file by default. sizing images as y...
Styling tables - Learn web development
. to do this, add the following to the bottom of your style.css file: /* caption */ caption { font-family: 'rock salt', cursive; padding: 20px; font-style: italic; caption-side: bottom; color: #666; text-align: right; letter-spacing: 1px; } there is nothing remarkable here, except for the caption-side property, which has been given a value of bottom. this causes the caption to be positioned on the bottom of the table, which along with the other declarations gives us this final look (see it live at punk-bands-complete.html): table styling quick tips before moving on, we thought we'd provide you with a quick list of the most useful points illustrated above: make your table markup as simple as possible, and keep things flexible, e.g. by using percentages, so the design is mo...
Floats - Learn web development
— see test your skills: floats. summary you now know all there is to know about floats in modern web development. ...
Beginner's guide to media queries - Learn web development
ng whether the addition of a media query, or using a layout method like flexbox or grid is the most appropriate way to make the components responsive. ...
Supporting older browsers - Learn web development
out and progressive enhancement using css grid: supporting browsers without grid a tutorial which uses the ie10 and 11 version of grid should i try to use the ie10 implementation of grid layout? ...
How CSS is structured - Learn web development
mdn's css reference is a good resource for more information about any shorthand property. try using the declarations (above) in your own css exercise to become more familiar with how it works. you can also experiment with different values. ...
Fundamental text and font styling - Learn web development
font-face. font-variant-caps: control the use of alternate capital glyphs. font-variant-east-asian: control the usage of alternate glyphs for east asian scripts, like japanese and chinese. font-variant-ligatures: control which ligatures and contextual forms are used in text. font-variant-numeric: control the usage of alternate glyphs for numbers, fractions, and ordinal markers. font-variant-position: control the usage of alternate glyphs of smaller sizes positioned as superscript or subscript. font-size-adjust: adjust the visual size of the font independently of its actual font size. font-stretch: switch between possible alternative stretched versions of a given font. text-underline-position: specify the position of underlines set using the text-decoration-line property underline value. ...
Styling links - Learn web development
rule however is interesting — here we are inserting a custom background image on external links in a similar manner to how we handled custom bullets on list items in the last article — this time however we are using background shorthand instead of the individual properties. we set the path to the image we want to insert, specify no-repeat so we only get one copy inserted, and then specify the position as 100% of the way over to the right of the text content, and 0 pixels from the top. we also use background-size to specify the size we want the background image to be shown at — it is useful to have a larger icon and then resize it like this as needed for responsive web design purposes. this does however only work with ie 9 and later, so if you need to support those older browsers, you'll jus...
What text editors are available? - Learn web development
with developers and other users (forum, email, irc) use the written documentation when you're learning how to use the editor. get in touch with other users if you're troubleshooting while installing or using the editor. does my text editor's look-and-feel matter to me? well, that's a matter of taste, but some people like customizing every bit of the ui (user interface), from colors to button positions. editors vary widely in flexibility, so check beforehand. it's not hard to find a text editor that can change color scheme, but if you want hefty customizing you may be better off with an ide. install and set up installing a text editor is usually quite straightforward. the method varies based on your platform but it shouldn't be too hard: windows. the developers will give you an .exe or .m...
Example - Learn web development
er: 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 ...
Test your skills: Advanced styling - Learn web development
in terms of the form element's height. this is due to native os styling being used in some cases. how can you remove this native styling? once you've removed the native styling, you'll need to add back one of the features it was providing, to keep same look and feel we originally had. how do you do this? one thing that is inconsistent across browsers (particularly looking at safari here) is the position of the standard blue focus outline. how can you remove this? there is a major problem with just getting rid of the blue focus outline. what is it? can you add some kind of styling back in so that users can tell when the search box is being hovered or focused? another thing that commonly denotes a search box is a magnifying glass icon. we've made one available in the same directory as our html f...
Example - Learn web development
tarea:focus { /* to give a little highligh on active elements */ border-color: #000; } textarea { /* to properly align multiline text field with their label */ vertical-align: top; /* to give enough room to type some text */ height: 5em; /* to allow users to resize any textarea vertically it works only on chrome, firefox and safari */ resize: vertical; } .button { /* to position the buttons to the same position of the text fields */ padding-left: 90px; /* same size as the label elements */ } button { /* this extra magin represent the same space as the space between the labels and their text fields */ margin-left: .5em; } result ...
HTML basics - Learn web development
it. <body></body> — the <body> element. this contains all the content that you want to show to web users when they visit your page, whether that's text, images, videos, games, playable audio tracks or whatever else. images let's turn our attention to the <img> element again: <img src="images/firefox-icon.png" alt="my test image"> as we said before, it embeds an image into our page in the position it appears. it does this via the src (source) attribute, which contains the path to our image file. we have also included an alt (alternative) attribute. in this attribute, you specify descriptive text for users who cannot see the image, possibly because of the following reasons: they are visually impaired. users with significant visual impairments often use tools called screen readers to rea...
The web and web standards - Learn web development
t to enter if you are looking for a job. 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. and at the same time, there is a skill shortage in the industry — so what better time to learn web development? it isn't all fun and games however — building web sites is a more complicated proposition than it used to be, and you'll have to put some time in to studying all the different technologies you need to use, all the techniques and best practices you need to know, and all the typical patterns you'll be called upon to implement. it'll take you a few months to really start to get into it, and then you'll need to keep learning so that your knowledge stays up-to-date with all the new tools a...
Tips for authoring fast-loading HTML pages - Learn web development
e a strict, no-tolerance input format). moreover, valid markup allows for the free use of other tools which can pre-process your web pages. for example, html tidy can remove whitespace and optional ending tags; however, it will refuse to run on a page with serious markup errors. chunk your content tables for layouts are a legacy method that should not be used anymore. layouts utilizing floats, positioning, flexbox, or grids should be used instead. tables are still considered valid markup but should be used for displaying tabular data. to help the browser render your page quicker, you should avoid nesting your tables. rather than deeply nesting tables as in: <table> <table> <table> ... </table> </table> </table> use non-nested tables or divs as in <table>...</table> <t...
Adding vector graphics to the Web - Learn web development
alue = solutionentry; solution.value = 'hide solution'; } else { textarea.value = userentry; solution.value = 'show solution'; } updatecode(); }); const htmlsolution = ''; let solutionentry = htmlsolution; textarea.addeventlistener('input', updatecode); window.addeventlistener('load', updatecode); // stop tab key tabbing out of textarea and // make it write a tab at the caret position instead textarea.onkeydown = function(e){ if (e.keycode === 9) { e.preventdefault(); insertatcaret('\t'); } if (e.keycode === 27) { textarea.blur(); } }; function insertatcaret(text) { const scrollpos = textarea.scrolltop; const caretpos = textarea.selectionstart; const front = (textarea.value).substring(0, caretpos); const back = (textarea.value).substring(textarea...
From object to iframe — other embedding technologies - Learn web development
f13.1!3m3!1m2!1s0x487bae6c05743d3d%3a0xf82fddd1e49fc0a1!2sthe+lowry!5e0!3m2!1sen!2suk!4v1518171785211" width="600" height="450" frameborder="0" style="border:0" allowfullscreen>\n</iframe>'; let solutionentry = htmlsolution; textarea.addeventlistener('input', updatecode); window.addeventlistener('load', updatecode); // stop tab key tabbing out of textarea and // make it write a tab at the caret position instead textarea.onkeydown = function(e){ if (e.keycode === 9) { e.preventdefault(); insertatcaret('\t'); } if (e.keycode === 27) { textarea.blur(); } }; function insertatcaret(text) { const scrollpos = textarea.scrolltop; const caretpos = textarea.selectionstart; const front = (textarea.value).substring(0, caretpos); const back = (textarea.value).substring(textare...
Video and audio content - Learn web development
thanks to html video, you can. to do so we use the webvtt file format and the <track> element. note: "transcribe" means "to write down spoken words as text." the resulting text is a "transcript." webvtt is a format for writing text files containing multiple strings of text along with metadata such as the time in the video at which each text string should be displayed, and even limited styling/positioning information. these text strings are called cues, and there are several kinds of cues which are used for different purposes. the most common cues are: subtitles translations of foreign material, for people who don't understand the words spoken in the audio. captions synchronized transcriptions of dialog or descriptions of significant sounds, to let people who can't hear the audio understa...
HTML table advanced features and accessibility - Learn web development
headers attributes to create associations between headers and cells. the way they are used is as follows: you add a unique id to each <th> element. you add a headers attribute to each <td> element. each headers attribute has to contain a list of the ids of all the <th> elements that act as a header for that cell, separated by spaces. this gives your html table an explicit definition of the position of each cell in the table, defined by the header(s) for each column and row it is part of, kind of like a spreadsheet. for it to work well, the table really needs both column and row headers. returning to our spending costs example, the previous two snippets could be rewritten like this: <thead> <tr> <th id="purchase">purchase</th> <th id="location">location</th> <th id="date">dat...
Build your own function - Learn web development
found on iconfinder.com, and designed by nazarrudin ansyari — thanks! (the actual icon pages were since moved or removed.) next, find the css inside your html file. we'll make a few changes to make way for the icons. first, update the .msgbox width from: width: 200px; to width: 242px; next, add the following lines inside the .msgbox p { ... } rule: padding-left: 82px; background-position: 25px center; background-repeat: no-repeat; now we need to add code to our displaymessage() function to handle displaying the icons. add the following block just above the closing curly brace (}) of your function: if (msgtype === 'warning') { msg.style.backgroundimage = 'url(icons/warning.png)'; panel.style.backgroundcolor = 'red'; } else if (msgtype === 'chat') { msg.style.backgroundi...
Introduction to events - Learn web development
="rabbit320.mp4" type="video/mp4"> <source src="rabbit320.webm" type="video/webm"> <p>your browser doesn't support html5 video. here is a <a href="rabbit320.mp4">link to the video</a> instead.</p> </video> </div> when the <button> is selected, the video is displayed, by changing the class attribute on the <div> from hidden to showing (the example's css contains these two classes, which position the box off the screen and on the screen, respectively): btn.onclick = function() { videobox.setattribute('class', 'showing'); } we then add a couple more onclick event handlers — the first one to the <div> and the second one to the <video>. now, when the area of the <div> outside the video is selected, the box should be hidden again and when the video itself is selected, the video should s...
Image gallery - Learn web development
ascript to turn this into a working program. the html body looks like this: <h1>image gallery example</h1> <div class="full-img"> <img class="displayed-img" src="images/pic1.jpg"> <div class="overlay"></div> <button class="dark">darken</button> </div> <div class="thumb-bar"> </div> the example looks like this: the most interesting parts of the example's css file: it absolutely positions the three elements inside the full-img <div> — the <img> in which the full-sized image is displayed, an empty <div> that is sized to be the same size as the <img> and put right over the top of it (this is used to apply a darkening effect to the image via a semi-transparent background color), and a <button> that is used to control the darkening effect. it sets the width of any images inside th...
Manipulating documents - Learn web development
">mozilla homepage</a></p> </section> </body> </html> the dom on the other hand looks like this: note: this dom tree diagram was created using ian hickson's live dom viewer. you can see here that each element and bit of text in the document has its own entry in the tree — each one is called a node. you will also encounter various terms used to describe the type of node, and their position in the tree in relation to one another: element node: an element, as it exists in the dom. root node: the top node in the tree, which in the case of html is always the html node (other markup vocabularies like svg and custom xml will have different root elements). child node: a node directly inside another node. for example, img is a child of section in the above example. descendant node: a...
Test your skills: Strings - Learn web development
? try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor. strings 2 in this task you are provided with two variables, quote and substring, which contain two strings. we would like you to: retrieve the length of the quote, and store it in a variable called quotelength. find the index position where substring appears in quote, and store that value in a variable called index. use a combination of the variables you have and available string properties/methods to trim down the original quote to "i do not like green eggs and ham.", and store it in a variable called revisedquote. try updating the live code below to recreate the finished example: download the starting point for this ...
Storing the information you need — Variables - Learn web development
ed by commas. try entering the following lines into your console: let mynamearray = ['chris', 'bob', 'jim']; let mynumberarray = [10, 15, 40]; once these arrays are defined, you can access each value by their location within the array. try these lines: mynamearray[0]; // should return 'chris' mynumberarray[2]; // should return 40 the square brackets specify an index value corresponding to the position of the value you want returned. you might have noticed that arrays in javascript are zero-indexed: the first element is at index 0. you'll learn a lot more about arrays in a future article. objects in programming, an object is a structure of code that models a real-life object. you can have a simple object that represents a box and contains information about its width, length, and height, or y...
JavaScript — Dynamic client-side scripting - Learn web development
avascript, you are strongly advised to get familiar with at least these two technologies first, and perhaps others as well. start by working through the following modules: getting started with the web introduction to html introduction to css having previous experience with other programming languages might also help. after getting familiar with the basics of javascript, you should be in a position to learn about more advanced topics, for example: javascript in depth, as taught in our javascript guide web apis modules this topic contains the following modules, in a suggested order for working through them. javascript first steps in our first javascript module, we first answer some fundamental questions such as "what is javascript?", "what does it look like?", and "what can it do?
CSS performance optimization - Learn web development
he gpu browsers are optimized to handle css animations, and handle animating properties that do not trigger a reflow (and therefore also a repaint) very well. to improve performance, the node being animated can be moved off the main thread and onto the gpu. properties that will lead to compositing include 3d transforms (transform: translatez(), rotate3d(), etc.), animating transform and opacity, position: fixed, will-change, and filter. some elements, including <video>, <canvas> and <iframe>, are also on their own layer. when an element is promoted as a layer, also known as composited, animating transform properties is done in the gpu, resulting in improved performance, especially on mobile. will-change property the css will-change property tells browsers which properties of an element are expe...
Ember app structure and componentization - Learn web development
the mark-all-complete button, explicitly highlighted for reasons given below (yellow in the image) each todo is an individual component (green in the image) the footer (blue in the image) something odd to note is that the mark-all-complete checkbox (marked in yellow), while in the "main" section, is rendered next to the "new-todo" input. this is because the default css absolutely positions the checkbox + label with negative top and left values to move it next to the input, rather than it being inside the "main" section. using the cli to create our components for us so to represent our app, we want to create 4 components: header list individual todo footer to create a component, we use the ember generate component command, followed by the name of the component. let’s ...
Getting started with React - Learn web development
y effect on your application. they're a signal to you (and your computer) that the multiple lines of code inside are part of the same expression. you could just as well write the header expression like this: const header = <header> <h1>mozilla developer network</h1> </header> however, this looks kind of awkward, because the <header> tag that starts the expression is not indented to the same position as its corresponding closing tag. of course, your browser can't read jsx without help. when compiled (using a tool like babel or parcel), our header expression would look like this: const header = react.createelement("header", null, react.createelement("h1", null, "mozilla developer network") ); it's possible to skip the compilation step and use react.createelement() to write your ui yourse...
Working with Svelte stores - Learn web development
c/components/alert.svelte. ...
Vue resources - Learn web development
your production ready files. to publish your site to the web, copy the contents of this folder to your hosting environment. note: the vue cli docs also include a specific guide on how to publish your app to many of the common hosting platforms. vue 3 vue 3 is a major release of the framework with a lot of major changes. it went into active beta in april, 2020. the biggest change is a new composition api that works as an alternative to the current property-based api. in this new api, a single setup() function is used on the component. only what you return from this function is available in your <template>s. you are required to be explicit about "reactive" properties when using this api. vue handles this for you using the options api. this makes the new api typically considered a more advanced...
Handling common JavaScript problems - Learn web development
example, the geolocation api (which exposes available location data for the device the web browser is running on) has a main entry point for its use — a geolocation property available on the global navigator object. therefore, you can detect whether the browser supports geolocation or not by using something like the following: if("geolocation" in navigator) { navigator.geolocation.getcurrentposition(function(position) { // show the location on a map, perhaps using the google maps api }); } else { // give the user a choice of static maps instead perhaps } you could also write such a test for a css feature, for example by testing for the existence of element.style.property (e.g. paragraph.style.transform !== undefined). but for both css and javascript, it is probably better to use an ...
Setting up your own test automation environment - Learn web development
sts. you can find some good background information at test design considerations. in general, you should make sure that your tests are: using good locator strategies: when you are interacting with the document, make sure that you use locators and page objects that are unlikely to change — if you have a testable element that you want to perform a test on, make sure that it has a stable id, or position on the page that can be selected using a css selector, which isn't going to just change with the next site iteration. you want to make your tests as non-brittle as possible, i.e. they won't just break when something changes. write atomic tests: each test should test one thing only, making it easy to keep track of what test file is testing which criterion. as an example, the google_test.js test w...
Introducing a complete toolchain - Learn web development
nt. creating a development environment this part of the toolchain is sometimes seen to be delaying the actual work, and it can be very easy to fall into a "rabbit hole" of tooling where you spend a lot of time trying to get the environment "just right". but you can look at this in the same way as setting up your physical work environment. the chair needs to be comfortable, and set up in a good position to help with your posture. you need power, wifi, and usb ports! there might be important decorations or music that help with your mental state — these are all important to doing your best work possible, and they should also only need to be set up once, if done properly. in the same way, setting up your development environment, if done well, needs doing only once and should be reusable in many ...
Accessibility API cross-reference
y busy aria-busy indicates the current "checked" state of checkboxes, radio buttons, and other widgets. checked checked checked aria-checked checked (boolean attribute) defines the total number of columns in a table, grid, or treegrid. n/a n/a aria-colcount defines an element's column index or position with respect to the total number of columns within a table, grid, or treegrid. n/a n/a aria-colindex defines the number of columns spanned by a cell or gridcell within a table, grid, or treegrid. n/a n/a aria-colspan identifies the element (or elements) whose contents or presence are controlled by the current element. ...
Software accessibility: Where are we today?
ls: mozilla's xul and html widgets already support proper keyboard accessibility, so let's not regress in that area. make sure that every new ui control that's developed provides the correct keyboard support. follow the accessible toolkit checklist whenever using xbl to create a new widget. support msaa and atk via nsiaccessible when developing new controls: mozilla is a great position to provide context so that custom controls can be made accessible. engineers can provide context simply by creating an nsiaccessible for each custom control. the infrastructure to do this is straightforward. other developers no matter what kind of work you do, the basis of accessibility is the need to understand that every user is different. after that, the exact techniques may change depending ...
Adding a new word to the en-US dictionary
build firefox and test your updated dictionary. ...
Testopia
r in the extensions directory. if you have made modifications to the testopia source code, you will need to merge them into the new testopia folder (capital t). if you are on windows or another case insensitive file system you should first rename the folder (testopia-old for example) and then unzip the tarball. you can then merge your changes before deleting the old version. api users take note: positional parameters are now deprecated. all params should now be sent in a hash (struct, dict, hashmap or whatever your language of choice calls key, value pairs). though all attempts have been made to provide continuing support for positional parameters, please be aware that some api calls may fail until you make this change. also, future versions may remove this support completely. as always please b...
Debugging Frame Reflow
hr framei htmlframeinner frameo htmlframeouter img image inline inline letter letter line line select select obj object page page place placeholder posinline positionedinline canvas canvas root root scroll scroll caption tablecaption cell tablecell bccell bctablecell col tablecol colg tablecolgroup tbl table tblo tableouter rowg...
Eclipse CDT
this is useful if you have maximized the editor using ctrl-m and you want to quickly see your search results. for example, without un-maximizing the editor. to side-by-side edit the same file in two different tabs, select the tab of the file that you want to edit, then from the menu bar select "window > new editor". this will open another tab containing the same file. now simply drag that tab to position it beside, above, or below the original. changes you make in one editor will be immediately reflected in the other. note that the search, call hierarchy, and other tabs have a "pin" button that allows you to open multiple tabs of these type. this is useful if you want to keep your existing search results open, for example, and have a new search open in a separate tab rather than overriding the c...
mach
lts in productivity wins), then you should consider implementing a mach command for it. some other cases where you should consider implementing something as a mach command: when your tool is a random script in the tree. random scripts are hard to find and may not conform to coding conventions or best practices. mach provides a framework in which your tool can live that will put it in a better position to succeed than if it were on its own. when the alternative is a make target. the build team generally does not like one-off make targets that aren't part of building (read: compiling) the tree. this includes things related to testing and packaging. these weigh down make files and add to the burden of maintaining the build system. instead, you are encouraged to implement ancillary functionality ...
Error codes returned by Mozilla APIs
046) ns_error_net_interrupt (0x804b0047) ns_error_proxy_connection_refused (0x804b0048) ns_error_already_opened (0x804b0049) returned from nsichannel.asyncopen() when trying to open the channel again (reopening is not supported). ns_error_first_header_field_component_empty (0x804b0022) while parsing for the first component of a header field using syntax such as that for content-disposition or content-type, the first component was found to be empty. javascript errors these errors typically occur when interfacing between javascript and native code, or to xpcom components. ns_error_xpc_not_enough_args (0x80570001) ns_error_xpc_need_out_object (0x80570002) ns_error_xpc_cant_set_out_val (0x80570003) ns_error_xpc_native_returned_failure (0x80570004) ns_error_xpc_can...
Experimental features in Firefox
onse. release channel version added enabled by default? nightly 56 no developer edition 56 no beta 56 no release 56 no preference name dom.payments.request.enabled and dom.payments.request.supportedregions visual viewport api the visual viewport api provides access to information describing the position of the visual viewport relative to the document as well as to the window's content area. it also supports events to monitor changes to this information. see bug 1550390 for more details. there currently is no real plan to ship this on desktop, but you can track the state of that just in case it changes in bug 1551302. release channel version added enabled by default? ...
HTMLIFrameElement.findAll()
invoking this method results in a mozbrowserfindchange event firing, which carries details about the search results. note: use of the browser api requires a privileged app, and browser and/or embed-apps permissions, depending on what you want to do. see using the browser api for more details. ...
mozbrowserfindchange
: active a boolean indicating whether a search is currently active (true), or not (false.) searchstring a domstring representing the string that is currently being searched for. searchlimit a number indicating the maximum number of searches that can be returned. numberofmatches a number indicating the number of matches returned by the search. activematchordinal a number indicating the position of the currently highlighted search result, e.g. 3 out of 5. example var browser = document.queryselector("iframe"); browser.addeventlistener("mozbrowserfindchange", function(event) { console.log("currently highlighted: " + event.details.activematchordinal + " out of " + event.details.numberofmatches); }); related events mozbrowserasyncscroll mozbrowsercontextmenu mozbro...
HTMLIFrameElement.sendMouseEvent()
fake a mouse event and send it to the browser <iframe>'s content. syntax instanceofhtmliframeelement.sendmouseevent(type, x, y, button, clickcount, modifiers); returns void. parameters type a string representing the event type. possible values are mousedown, mouseup, mousemove, mouseover, mouseout, or contextmenu. x a number representing the x position of the cursor relative to the browser <iframe>'s visible area in css pixels. y a number representing the y position of the cursor relative to the browser <iframe>'s visible area in css pixels. button a number representing which button has been pressed on the mouse: 0 (left button), 1 (middle button), or 2 (right button). clickcount the number of clicks that should be performed. modifiers ...
HTMLIFrameElement.sendTouchEvent()
ices only. syntax instanceofhtmliframeelement.sendtouchevent(type, x, y, rx, ry, rotationangles, forces, count, modifiers); returns void. parameters type a string representing the event type. possible values are touchstart, touchend, touchmove, or touchcancel. x an array of numbers representing the x position of each touch point relative to the browser <iframe>'s visible area in css pixels. y an array of numbers representing the y position of each touch point relative to the browser <iframe>'s visible area in css pixels. rx an array of numbers representing the x radius of each touch point in css pixels. ry an array of numbers representing the y radius of each touch point in css pixels. rotation...
Browser API
findall() or findnext(). htmliframeelement.download() downloads a specified url, storing it at the specified filename/path. htmliframeelement.executescript() allows a specified script to be executed against a page loaded in the browser <iframe>. htmliframeelement.findall() searches for a string in a browser <iframe>'s content; if found, the first instance of the string relative to the caret position will be highlighted. htmliframeelement.findnext() highlights the next or previous instance of a search result after a findall() search has been carried out. htmliframeelement.getcontentdimensions() retrieves the x and y dimensions of the content window. htmliframeelement.getmanifest() retrieves the manifest of an app loaded in the browser <iframe> and returns it as json. htmliframeelement.
::-moz-tree-image
activated by the properties attribute. ...
::-moz-tree-indentation
activated by the properties attribute. associated elements <xul:treeitem> style properties position ...
::-moz-tree-twisty
activated by the properties attribute. ...
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...
How Mozilla determines MIME Types
nsion-ext, where ext is the extension of the file. helper applications a somewhat related issue are the helper applications. when loading an uri with a type that mozilla can not handle, a helper app dialog shows up, and the displayed information comes from these sources: ask the os for a handler of the given <extension, mime type> pair. note that the extension here comes from the content-disposition header if present, and from the url itself otherwise. this is where the listed "default application" comes from. the "data source" (that is, the list of helper applications) is searched for an entry with the mime type of the uri. the data source is the mimetypes.rdf file in the profile directory. if this fails, the data source is searched via the extension (content-disposition as above). if one ...
Application Translation with Mercurial
arts of text in it which is different. below the license header which should never changed, the texts are organized in the following format: <!entity stringid "text which will be shown in firefox"> as you can see there is a bigger block of text not recognized. this is due to the texts which have in the english versionmoved from below the string with the id privatebrowsingpage.howtostart3 to a position above it. cut and paste these strings in the localized file so their position corresponds to the on in the english file. press the f5 key or click the reload button in winmerge's toolbar to re-compare the files. now copy the empty lines below privatebrowsingpage.learnmore and the line <!-- to be removed post-australis --> to the localized file. this text is a comment (which in .dtd files always...
Mozilla Content Localized in Your Language
italization what is the appropriate form of expressing capitalization in your language? note: if this doens't apply, how is expressed in your language to indicate importance or name of a movie, book title, product uis (save, file...). hyphens and compounds what is the appropriate form of expressing hyphens and compounds in your language? note: if this doens't apply, indicate so with n/a. prepositions and articles what is the appropriate form of expressing prepositions and articles in your language? note: if this doens't apply, indicate so with n/a. punctuation what is the appropriate form of expressing punctuation in your language? what are language specific puntuations used? even if there are same or similar punctuations, are they used differently than those in english. reference materi...
Localization content best practices
er if a string will contain a placeholder, always add the placeholder to the string to allow the localizer to change the word order if necessary. for example, it might seem ok in english to present the strings [username] says: to localizers simply as says: but this will cause serious issues in many other languages as the agent of an action often will not come in front of the verb, but some other position. for example in irish/gaelic the correct order is be [username] at saying:. if a placeholder is present, this can be correctly localized as tá %s ag rádh: but not without. similarly, if the ui string is flash version, do not simply present the translator with version for translation. present the whole string or, if there is a significant need for a placeholder, use a placeholder. the word vers...
Creating localizable web content
natives, use them by adding the $lang; parameter in the urls evaluate the impact of new pages on all our web properties, especially links to community sites and redirects. sometimes you can leave some freedom of modification for a block of text so that the localizers link to relevant local resources. images check that images are not going to be a problem for the audience (cultural references, positionning, mirroring for rtl, text in images...) and spot what sizes/margins can be tweaked by css or have to be fixed for all locales but english don't use text in icons images 1&2. bad: image 3. good: image 4. good: this icon is recognized as the international symbol for information. it can stay this way. use localized screenshots if possible screenshots are important informati...
Writing localizable code
o assume grammar in composite strings splitting sentences into several keys often inadvertently presumes a grammar, a sentence structure, and such composite strings are often very difficult to translate. when a composite string is needed, try to give the translators "room to move". 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. don't use preprocessor macros the use of #if #else #endif or #expand is strongly discouraged. there are few exceptions to this rule, but in general, the localized file should comply with standards and should not require build tools to be transformed. if you want to add build processing to localized files, be sure to request feedback from l10n@. in most cases, yo...
Basics
<msup> <mrow> <mo>(</mo> <mo>-</mo> <mi>z</mi> <mo>)</mo> </mrow> <mi>&alpha;</mi> </msup> </mrow> <mrow> <msup> <mi>e</mi> <mrow> <mn>2</mn> <mi>&pi;</mi> <mi>z</mi> </mrow> </msup> <mo>-</mo> <mn>1</mn> </mrow> </mfrac> </mrow> <mi>d</mi> <mi>z</mi> </mrow> </math> css content [class="background"] { background-image: url(http://www.mozilla.org/images/mozilla-banner.gif); opacity: 0.2; position: absolute; left: 0; width: 100%; height: 58px; } ...
MathML Demo: <mfrac> - fractions
> <mo>(</mo> <mo>-</mo> <mi>z</mi> <mo>)</mo> </mrow> <mi>&alpha;</mi> </msup> </mrow> <mrow> <msup> <mi>e</mi> <mrow> <mn>2</mn> <mi>&pi;</mi> <mi>z</mi> </mrow> </msup> <mo>-</mo> <mn>1</mn> </mrow> </mfrac> </mrow> <mi>d</mi> <mi>z</mi> </mrow> </math> css content [class="background"] { background-image: url(http://www.mozilla.org/images/mozilla-banner.gif); opacity: 0.2; position: absolute; left: 0; width: 100%; height: 58px; } ...
Using the viewport meta tag to control layout on mobile browsers
"viewport" content="width=device-width, initial-scale=1"> the width property controls the size of the viewport. 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%. (there are corresponding height and device-height values, which may be useful for pages with elements that change size or position based on the viewport height.) the initial-scale property controls the zoom level when the page is first loaded. the maximum-scale, minimum-scale, and user-scalable properties control how users are allowed to zoom the page in or out. usage of user-scalable=no can cause accessibility issues to users with visual impairments such as low vision. a pixel is not a pixel in recent years, screen re...
Mozilla Style System
rs who interact with the style system do so using the style structs. the style context has a getter for each struct, and nsiframe, which represents the concept of a css box (or rendering object), also has getters that forward to the frame's style context. thus, typical calling code looks like this: if (aframe->getstyledisplay()->mopacity < 1.0f) return pr_true; or like this: const nsstyleposition *stylepos = aframe->getstyleposition(); if (stylepos->mwidth.getunit() == estyleunit_coord) { nscoord w = stylepos->mwidth.getcoordvalue(); ... } else if (stylepos->mwidth.getunit() == estyleunit_percent) { ... rule tree style data computation css style sheet backend loading parsing data structures cascading html mapped attribute backend css style attribute backend handling ...
Preference reference
next time the application runs.reader.parse-on-load.force-enabledthe preference reader.parse-on-load.force-enabled controls if the reader mode used in firefox mobile should be enabled independent of the memory available in the device. ...
MailNews
mailnews stands for "mail and newsgroups". mailnews is the back end of the messaging parts of seamonkey and thunderbird. it provides a number of functions and capabilities, including: communications protocols - smtp, pop3, imap, nntp message management, including search and filtering message composition address book the mailnews code lives in the mailnews/ directory of comm-central. asynctestutils extended framework the asynctestutils extended framework is one mechanism for testing the mailnews component of thunderbird. see mailnews automated testing for a description of the other testing mechanisms. leak and bloat tests this page describes how to perform tests that measure memory leaks and bloat for mailnews and its sub-components. mailnews automated testing auto...
Date and Time
this chapter describes the date and time functions in nspr. nspr represents time in two ways, absolute time and clock/calendar time. nspr provides types and constants for both representations, and functions to convert time values between the two. absolute time representation treats time instants as points along the time line. a time instant is represented by its position on the time line relative to the origin, called the epoch. nspr defines the epoch to be midnight (00:00:00) 1 january 1970 utc (coordinated universal time). in this form, time is just a point on the time line. there is no notion of time zone. clock/calendar time, used for human interfaces, represents time in the familiar year, month, day, hour, minute, second components. in this form, the time zone information is importan...
PRIOMethods
parameters file_type type of file represented (tos). close close file and destroy descriptor. read read up to the specified number of bytes into buffer. write write specified number of bytes from buffer. available determine number of bytes available for reading. available64 same as previous field, except 64-bit. fsync flush all in-memory buffers of file to permanent store. seek position the file pointer to the desired place. seek64 same as previous field, except 64-bit. fileinfo get information about an open file. fileinfo64 same as previous field, except 64-bit. writev write from a vector of buffers. connect connect to the specified network address. accept accept a connection from a network peer. bind associate a network address with the file descriptor. listen ...
An overview of NSS Internals
d c pointer variable. when dealing with memory, nss makes use of arenas, which are an attempt to simplify management with the limited offerings of c (because there are no destructors). the idea is to group multiple memory allocations in order to simplify cleanup. performing an operation often involves allocating many individual data items, and the code might be required to abort a task at many positions in the logic. an arena is requested once processing of a task starts, and all memory allocations that are logically associated to that task are requested from the associated arena. the implementation of arenas makes sure that all individual memory blocks are tracked. once a task is done, regardless whether it completed or was aborted, the programmer simply needs to release the arena, and all ind...
Python binding for NSS
numerous python documentation extraction tools. also see the generated html documentation provided with each release. nss/nspr structs are exposed as python objects. nss/nspr functions which operate on a nss/nspr object (i.e. struct) become methods of that object. nss/nspr objects which are collections support the python iteration protocol. in other words they can be iterated over, indexed by position, or used as slices. nss/nspr objects whose collection elements can be referenced by name support associative indexing. nss/nspr objects which have "get" and "set" api function calls are exposed as python properties. all nss/nspr python objects can print their current value by evaluting the python object in a string context or by using the python str() function. support threading. the python g...
NSS tools : certutil
follows rfc #1485. -t trustargs specify the trust attributes to modify in an existing certificate or to apply to a certificate when creating it or adding it to a database. there are three available trust categories for each certificate, expressed in the order ssl, email, object signing for each trust setting. ...
NSS Tools certutil
f it contains spaces. the subject identification format follows rfc 1485. -t trustargs specify the trust attributes to modify in an existing certificate or to apply to a certificate when creating it or adding it to a database. there are three available trust categories for each certificate, expressed in this order: "ssl ,email ,object signing ". ...
certutil
follows rfc #1485. -t trustargs specify the trust attributes to modify in an existing certificate or to apply to a certificate when creating it or adding it to a database. there are three available trust categories for each certificate, expressed in the order ssl, email, object signing for each trust setting. ...
Renaming With Pork
make two copies of the source(analysis and test). this isn't strictly required, but will save time. 2. the first copy will be an analysis copy. convince gcc to create annotated .ii files while compiling the analysis copy. typically, make cxxflags="-wp,-k,-w0 -save-temps" will work. note the -k,-w0 options are passed down to the mcpp preprocessor such that it can annotate files with more precise position information. in order for this to work mcpp has to be integrated into your compiler as described in the pork installation instructions 3. in the analysis copy make a list of files to process. use absolute paths. find `pwd` -name \*.ii > /tmp/ls.txt 4. run renamer through pork-barrel. this makes it easier to refer to any diagnostics touch /tmp/err.txt tail -f /tmp/err.txt & ~/work/pork-barrel...
Pork
this information allows c++ to be automatically rewritten in a precise way. the inputs driving the rewriting would normally be provided by a program-analysis system outside of pork. (see dehydra, treehydra). pork has been tested mostly on linux, but in theory it should be possible to make it work on other systems. note: pork is not presently used at mozilla. please refer to the oink link below for a more up-to-date toolchain. ...
How to embed the JavaScript engine
); // argv.resize(2); js::autovaluearray<2> argv(cx); argv[0].setint32(1); argv[1].setint32(2); then call the function: // [spidermonkey 24] pass arguments length and the 'jsval *' pointer. // js_callfunctionname(cx, global, "func", 2, argv.begin(), rval.address()); js_callfunctionname(cx, global, "func", argv, &rval); example say the click event is for the top-most or focused ui element at position (x, y): jsobject *target, *event; js::autovaluearray<1> argv(cx); /* * find event target and make event object to represent this click. * pass cx to neweventobject so js_newobject can be called. */ target = findeventtargetat(cx, global, x, y); event = neweventobject(cx, "click", x, y); argv[0].setobjectornull(event); /* to emulate the dom, you might want to try "onclick" too. */ ok = js_cal...
JS::AutoVectorRooter
(length is zero). bool append(const t &v) appends an element v to the array. bool append(const t *ptr, size_t len) appends a sequence of t specified with a pointer ptr and length len to the array. bool appendall(const autovectorrooter<t> &other) appends all elements of other to the array. bool insert(t *p, const t &val) inserts an element val at the position specified by p. void infallibleappend(const t &v) appends an element v to the array. for use when space has already been reserved. void popback() pops an element from the array. t popcopy() pops an element from the array and returns it. bool growby(size_t inc) grows the array by inc. bool resize(size_t newlength) resizes the array to new...
JS_ConvertArguments
ror. this function also takes in consideration any additional custom types defined on cx using js_addargumentformatter. for example, if format is "biob", then js_convertarguments converts the first js value in argv into a bool, the second value into a double, the third value into a jsobject *, and the last value into a bool. to skip a given argument, pass an asterisk in the corresponding position in format. if argc is less than the number of arguments required by format, js_convertargument reports an error and returns false. if argc is greater than the number of arguments described in format, the extraneous arguments are ignored. on success, js_convertargument returns true. if any argument conversion fails or there are not enough arguments, it returns false. to perform the opposite con...
Shell global objects
jsfunction with a relazifiable jsscript. enableshellallocationmetadatabuilder() use shellallocationmetadatabuilder to supply metadata for all newly created objects. getallocationmetadata(obj) get the metadata for an object. bailout() force a bailout out of ionmonkey (if running in ionmonkey). bailafter(number) start a counter to bail once after passing the given amount of possible bailout positions in ionmonkey. injit() returns true when called within (jit-)compiled code. when jit compilation is disabled this function returns an error string. this function returns false in all other cases. depending on truthiness, you should continue to wait for compilation to happen or stop execution. inion() returns true when called within ion. when ion is disabled or when compilation is abnormally s...
Web Replay
r was generated or the message was logged. the tab will pause at this point and allow state to be inspected, forward/reverse stepping, and so forth. timeline the timeline is shown above the developer tools and provides several features to help with navigating the recording: the timeline changes color depending on whether the tab is currently recording (red) or replaying (blue). the current position within the recording is shown on the timeline with a progress indicator. console error/messages are marked on the timeline and can be clicked to seek to that point. advanced options preferences devtools.recordreplay.enablerewinding when disabled, firefox records a page signifcantly faster. default true. devtools.recordreplay.fastlogpoints when enabled, firefox web replay evaluates logpoi...
Mozilla Projects
ions 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 pork is a c++ parsing and rewriting tool chain. 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. this information allows c++ to be automatically rewritten in a precise way. the inputs driving the rewriting would normally be provided by a program-analysis system outside of pork. (see dehydra, treehydra). rhino rhino is an ...
Gecko events
object have changed. is supported: no event_document_content_changed the contents of the document have changed. is supported: no event_property_changed is supported: no event_selection_changed is supported: yes event_text_attribute_changed a text object's attributes changed. also see event_object_attribute_changed is supported: no event_text_caret_moved the caret has moved to a new position. is supported: yes event_text_changed this event indicates general text changes, i.e. changes to text that is exposed through the iaccessibletext and iaccessibleeditabletext interfaces. is supported: no event_text_inserted text was inserted. is supported: yes event_text_removed text was removed. event_text_updated text was updated. event_text_selection_changed the text selection changed. ...
The Places database
hat visit. it contains a reference to the moz_places table which contains the url and other global statistics. see history service design for more information. bookmarks tables moz_bookmarks: this table contains bookmarks, folders, separators and tags, and defines the hierarchy. the hierarchy is defined via the parent column, which points to the moz_bookmarks record which is the parent. the position column numbers each of the peers beneath a given parent starting with 0 and incrementing higher with each addition. the fk column provides the id number of the corresponding record in moz_places. moz_bookmarks_roots: lists special folders that are the root folders of certain content types in the bookmarks system. the records in this table are mapped to records in the moz_bookmarks table. book...
XPCOM array guide
Mozilla › Tech › XPCOM › Guide › Arrays
ack to in-place enumeration is that you cannot manipulate the array itself during the enumeration. for example, you should not delete elements of an array during the enumeration as this will often confuse the loop which is enumerating the array. enumerators most arrays provide access to an object which is used to enumerate members of the array. these enumerators maintain state about the current position in the array. enumerators are used to access the elements in an ordered way, without relying on the underlying array type. these enumerators include: nsisimpleenumerator - an enumerator for com objects. nsistringenumerator / nsiutf8stringenumerator - enumerators for strings obsolete arrays / enumerators there are some deprecated classes which should not be used by new code. nsisupportsa...
Component Internals
the code specific to the component itself. but where are the components? components reside in modules, and those modules are defined in shared library files that typically sit in the components directory of an xpcom application. 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. another, even more basic view of this relationship of components to the files and interfaces that define them is shown in onion peel view of xpcom component creation in the next chapter. the component is an abstraction sitting between the actual module in which it is implemented and the objects that its factory code creates for use by clients. xpco...
XPCOM Stream Guide
Mozilla › Tech › XPCOM › Guide › Streams
equest to the .onstartrequest(), .ondataavailable(), and .onstoprequest() methods of the listener. as for passing in the stream listener and starting the request: that will vary depending on the use case. seekable streams some streams are "seekable": they let you specify where in the stream you are reading from (instead of requiring it be from the beginning). they can also report their current position in the file. seekable streams implement the nsiseekablestream interface. the following stream types are known to implement nsiseekablestream: nsstorageinputstream nsstringinputstream nsmultiplexinputstream nspipeinputstream nsfileinputstream nsbufferedinputstream nsfileoutputstream nsbufferedoutputstream complex stream types several stream types leverage primitive stream types to do...
nsDependentCString
ource constructs an nsdependentstring when you don't know the length in advance. instead ns_strlen is used to measure the length. parameters char* data a pointer to the string. must not be null. nsdependentcstring(const nscstring_internal&, pruint32) constructs an nsdependentstring from an existing flat string. parameters nscstring_internal& str the existing flat string. pruint32 startpos the position within the existing string at which the dependent string should start. this is similar to using substring(str, startpos), except that the resulting string is flat. void nsdependentcstring() - source constructs an nsdependentstring to be rebound later. nsdependentcstring(const nsacstring_internal&) - source obsolete in gecko 9. this constructor should not be used. parameters nsacstring_internal&...
IAccessibleComponent
ound the returned color is the foreground color of this object or, if that is not supported, the default foreground color. return value s_ok. locationinparent() returns the location of the upper left corner of the object's bounding box relative to the immediate parent object. the coordinates of the bounding box are given relative to the parent's coordinate system. the coordinates of the returned position are relative to this object's parent or relative to the screen on which this object is rendered if it has no parent. if the object is not on any screen the returned position is (0,0). [propget] hresult locationinparent( [out] long x, [out] long y ); parameters x the x coordinate of the upper left corner of the object's bounding box relative to the immediate parent object. y the y coordinate...
IAccessibleEditableText
n indices is deleted from the text represented by this object. hresult deletetext( [in] long startoffset, [in] long endoffset ); parameters startoffset start index of the text to be deleted. the valid range is 0..length. endoffset end index of the text to be deleted. the valid range is 0..length. return value e_invalidarg if bad [in] passed. s_ok. inserttext() inserts text at the specified position. the specified string is inserted at the given index into the text represented by this object. hresult inserttext( [in] long offset, [in] bstr text ); parameters offset index at which to insert the text. the valid range is 0..length. text text that is inserted. return value e_invalidarg if bad [in] passed. s_ok. pastetext() pastes text from the clipboard. the text in the system clipboard i...
imgICache
ies findentryproperties(in nsiuri uri); void removeentry(in nsiuri uri); methods clearcache() evict images from the cache. void clearcache( in boolean chrome ); parameters chrome if true, evict only chrome images. if false, evict everything except chrome images. findentryproperties() find properties used to get properties such as 'type' and 'content-disposition' 'type' is a nsisupportscstring containing the images' mime type such as 'image/png' 'content-disposition' will be a nsisupportscstring containing the header if you call this before any data has been loaded from a uri, it will succeed, but come back empty. nsiproperties findentryproperties( in nsiuri uri ); parameters uri the uri to look up. return value null if the url was not...
imgIContainer
xels, that we are allowed to sample from. aviewportsize the size (in css pixels) of the viewport that would be available for the full image to occupy, if we were drawing the full image. (note that we might not actually be drawing the full image -- we might be restricted by asubimage -- but we still need the full image's viewport-size in order for svg images with the "viewbox" attribute to position their content correctly.) aflags flags of the flag_* variety. exceptions thrown missing exception missing description endframedecode() obsolete since gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) void endframedecode( in unsigned long framenumber ); parameters framenumber missing description exceptions thrown missing exceptio...
nsIAccessibleEvent
ument object have changed. event_document_content_changed 0x002f 0x002b the contents of the document have changed. event_property_changed 0x0030 0x002c event_selection_changed 0x0031 0x002d event_text_attribute_changed 0x0032 0x002e a text object's attributes changed. also see event_object_attribute_changed. event_text_caret_moved 0x0033 0x002f the caret has moved to a new position. event_text_changed 0x0034 0x0030 this event indicates general text changes. that is, changes to text that is exposed through the iaccessibletext and iaccessibleeditabletext interfaces. event_text_inserted 0x0035 0x0031 text was inserted. event_text_removed 0x0036 0x0032 text was removed. event_text_updated 0x0037 0x0033 text was updated. event_text_selection_changed 0x0038 0x...
nsIAccessibleRole
d gecko 1.9 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) constants constant value description role_nothing 0 used when accessible has no strong defined role. role_titlebar 1 represents a title or caption bar for a window. it is used by msaa only, supported automatically by ms windows. role_menubar 2 represents the menu bar (positioned beneath the title bar of a window) from which menus are selected by the user. the role is used by xul:menubar or role="menubar". role_scrollbar 3 represents a vertical or horizontal scroll bar, which is part of the client area or used in a control. role_grip 4 represents a special mouse pointer, which allows a user to manipulate user interface elements such as windows. for example, a user c...
nsIAnnotationService
pire_weeks 2 for general page settings, things the user is interested in seeing if they come back to this page some time in the near future. removed at 30 days. expire_months 3 something that the user will be interested in seeing in their history like favicons. if they haven't visited a page in a couple of months, they probably aren't interested in many other annotations, the positions of things, or other stuff you create, so put that in the weeks policy. removed at 180 days. expire_never 4 for data that should never expire as long as the uri is in the database. expire_with_history 5 for annotations that only live as long as the uri is in history (for example, has > 0 visits). this is only valid for page annotations. expire_days 6 f...
nsIContentView
oid scrollby( in float dxpx, in float dypx ); parameters dxpx the number of css pixels to scroll on the x axis; specify a positive value to scroll to the right or a negative value to scroll to the left. dypx the number of css pixels to scroll on the y axis; specify a positive value to scroll down or a negative value to scroll up. scrollto() scrolls the content view to the specified position, in chrome-document css pixels. fails if the view isn't valid. void scrollto( in float xpx, in float ypx ); parameters xpx the x coordinate to scroll to, in css pixels. ypx the y coordinate to scroll to, in css pixels. setscale() sets the content view's scale for each axis. void setscale( in float xscale, in float yscale ); parameters xscale horizontal scaling factor; s...
nsIDOMChromeWindow
l applications create a dialog like window which has a default button but it's not created by the dialog/wizard element, the applications should call this method for the accessibility and the usability on windows at onload event. void notifydefaultbuttonloaded( in nsidomelement defaultbutton ); parameters defaultbutton the default button element of the window. restore() restores the size and position of the window. void restore(); parameters none. setcursor() sets the mouse cursor to the specified cursor. the mouse cursor is locked to the specified cursor if it's not "auto". at that time, the cursor has been never changed by cursor moving. after you call this method with "auto", the cursor will be unlocked. void setcursor( in domstring cursor ); parameters cursor you can specify same val...
nsIEditor
ue(in nsidomelement aelement, in astring attributestr, out astring resultvalue); void removeattribute(in nsidomelement aelement, in astring aattribute); void cloneattribute(in astring aattribute, in nsidomnode asourcenode); void cloneattributes(in nsidomnode destnode, in nsidomnode sourcenode); nsidomnode createnode(in astring tag, in nsidomnode parent, in long position); void insertnode(in nsidomnode node, in nsidomnode parent, in long aposition); void splitnode(in nsidomnode existingrightnode, in long offset, out nsidomnode newleftnode); void joinnodes(in nsidomnode leftnode, in nsidomnode rightnode, in nsidomnode parent); void deletenode(in nsidomnode child); void marknodedirty(in nsidomnode node); directi...
nsIEditorMailSupport
to be inserted pasteascitedquotation() paste a string as quoted text, whose representation is dependent on the editor type, replacing the selected text (if any) void pasteascitedquotation( in astring acitation, in long aselectiontype ); parameters acitation the "mid" url of the source message. aselectiontype text or html? pasteasquotation() paste the text in the os clipboard at the cursor position, as a quotation (whose representation is dependent on the editor type), replacing the selected text (if any). void pasteasquotation( in long aselectiontype ); parameters aselectiontype text or html? rewrap() rewrap the selected part of the document, re-quoting if necessary. void rewrap( in boolean arespectnewlines ); parameters arespectnewlines try to maintain newlines in the original? ...
nsIFile
gecko 30.0 (firefox 30.0 / thunderbird 30.0 / seamonkey 2.27) nsifile is the correct platform-agnostic way to specify a file; you should always use this instead of a string to ensure compatibility. with an nsifile you can navigate to ancestors or descendants without having to deal with the different path separators used on different platforms, query the state of any file or directory at the position represented by the nsifile and create, move or copy items in the filesystem. an nsifile can be retrieved by either instantiating an nsilocalfile using a platform specific path string or by using cross-platform locations retrieved from the directory service. all methods with string parameters have two forms. the preferred form operates on utf-16 encoded characters strings. an alternate form oper...
nsIFocusManager
ovefocus_backwarddoc 4 move focus forward to the previous frame document, used when pressing shift+f6. movefocus_first 5 move focus to the first focusable element. movefocus_last 6 move focus to the last focusable element. movefocus_root 7 move focus to the root element in the document. movefocus_caret 8 move focus to a link at the position of the caret. this is a special value used to focus links as the caret moves over them in caret browsing mode. methods clearfocus() clears the focused element within awindow. if the current focusedwindow is a descendant of awindow, sets the current focusedwindow to awindow. void clearfocus( in nsidomwindow awindow ); parameters awindow exceptions thrown ns_error_invalid_...
nsIGeolocationUpdate
vides a way for a geolocation provider to notify the system that a new location is available. 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) interface provides a way for a geolocation provider to notify the system that a new location is available. method overview void update(in nsidomgeoposition position); methods update() notify the geolocation service that a new geolocation has been discovered. note: this must be called on the main thread. void update( in nsidomgeoposition position ); parameters position a nsidomgeoposition object describing the updated position information. see also using geolocation nsigeolocationprovider w3c geolocation specification ...
nsIHTMLEditor
oolean entirelist, in astring abullettype ); parameters alisttype entirelist abullettype nodeisblock() tests if a node is a block element according the the html 4.0 dtd. this does not consider css effect on display type. boolean nodeisblock( in nsidomnode node ); parameters node return value pastenoformatting() paste the text in the os clipboard at the cursor position, replacing the selected text (if any), but strip out any html styles and formatting. void pastenoformatting( in long aselectiontype ); parameters aselectiontype rebuilddocumentfromsource() rebuild the entire document from source html needed to be able to edit head and other outside-of-body content. void rebuilddocumentfromsource( in astring asourcestring ); parameters asourc...
nsIMsgCompFields
« xpcom api reference summary the nsimsgcompfields interface provides properties for an composition of an outgoing message. 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 ...
nsIMsgDBHdr
of the thread, it will return nsmsgkey_none. messagesize unsigned long indicates the size of this message in bytes. linecount unsigned long indicates the size of the message body in number of lines. statusoffset unsigned long indicates the offset within the message of the x-mozilla-status header. messageoffset unsigned long indicates the position of the offline copy of an imap or news messages within the offline store. offlinemessagesize unsigned long indicates the size of the offline copy of an imap or news message. date prtime indicates the date of this message; the equivalent header is the date: header. dateinseconds unsigned long readonly: indicates the date of this message as a unix timest...
nsIMsgDatabase
void markmdnneeded(in nsmsgkey key, in boolean bneeded, in nsidbchangelistener instigator); ismdnneeded() markmdnneeded only used when mail server is a pop3 server, or when the imap server does not support user defined permanentflags. boolean ismdnneeded(in nsmsgkey key); markmdnsent() void markmdnsent(in nsmsgkey key, ...
nsINavBookmarksService
o append to the end of the list. atitle the title for the new bookmark. return value returns the id of the newly-created bookmark. insertitem() obsolete since gecko 1.9 (firefox 3) note: insertbookmark() provides an alternative for this method. inserts a child item into the given folder. if this item already exists in the given folder, it will be moved to the new position. void insertitem( in print64 folder, in nsiuri item, in print32 index ); parameters folder the id of the parent folder. item the uri to insert. index the index to insert at, or -1 to append. insertseparator() this method inserts a bookmark separator into the given folder at the given index. the separator can be removed using getidforitemat() and removeitem(). long long insert...
nsIScriptableIO
e is generally used as a wrapper for other streams. by default, the buffer size is 1024 bytes; however, the size may be changed by specifying the abuffersize parameter. if the text mode is specified, a buffer is always used, regardless of whether or not it is specifically requested. append: when writing to files, indicates to append to the file rather than overwrite the existing file. the write position will be set to the end of the file before each write. if used in conjuction with the create mode, an existing file may be opened for appending, or a new file created. block: when this mode is specified, writing to a transport such as a socket doesn't return until all data has been written. this may cause a delay if the socket's underlying buffer is full. if you don't specify this mode, an excep...
nsISeekableStream
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. methods seek() this method moves the stream offset of the stream implementing this interface. void seek( in long whence, in long long offset ); parameters whence specifies how to interpret the 'offset' parameter in setting the stream offset associated with the implementi...
nsISelection
to pr_false, the function only returns true when the entire node is part of the selection. return value whether or not the range contains the requested noe. deletefromdocument() deletes this selection from the document the nodes belong to. void deletefromdocument(); extend() extends the selection by moving the selection end to the specified nsidomnode and offset, preserving the selection begin position. the new selection end result will always be from the anchornode to the new focusnode, regardless of direction. void extend( in nsidomnode parentnode, in long offset ); parameters parentnode the node where the selection will be extended to. offset where in the node to place the offset in the new selection end. native code only!extendnative void extendnative( in nsinode p...
nsISelectionPrivate
ibute type description cancacheframeoffset boolean frame offset cache can be used just during calling nseditor::endplaceholdertransaction. endplaceholdertransaction will give rise to reflow/refreshing view/scroll, and call times of nstextframe::getpointfromoffset whose return value is to be cached. see bug 35296 and bug 199412 native code only! interlineposition boolean type short returns the type of the selection (see nsiselectioncontroller for available constants). read only. constants constant value description endofprecedingline 0 startofnextline 1 tableselection_none 0 tableselection_cell 1 tableselection_row 2 ...
nsITreeColumn
is the primary column. if the primary attribute is not set, the column is not the primary column. read only. selectable boolean if true the nsitreecolumn is able to be selected. if the selectable attribute is not set, the column cells are not selectable. read only. type short the type of the column, see constants. read only. width long the width of nsitreecolumn. read only. x long the x position in the tree of the left edge of the nsitreecolumn. read only. constants constant value description type_text 1 text column type. type_checkbox 2 checkbox column type. type_progressmeter 3 progress meter column type. methods native code only!getidconst void getidconst( [shared] out wstring idconst ); parameters idconst getnext() get the next column in the nsitreecolumns. nsitr...
nsIWebBrowserFind
d or parent frames explicitly using nsiwebbrowserfindinframes, but if one, but not both, of searchsubframes and searchparentframes are set, this returns false. searchstring wstring the string to search for. this must be non-empty to search. wrapfind boolean whether the search wraps around to the start (or end) of the document if no match was found between the current position and the end (or beginning). works correctly when searching backwards. default is false. methods findnext() finds, highlights, and scrolls into view the next occurrence of the search string, using the current search settings. fails if the search string is empty. boolean findnext(); parameters none. return value whether an occurrence was found. see also nsiwebbrowserfindinframes ...
nsIWebNavigation
ing uri for the currently loaded uri or null. read only. sessionhistory nsishistory the session history object used by this web navigation instance. methods goback() tells the object to navigate to the previous session history item. when a page is loaded from session history, all content is loaded from the cache (if available) and page state (such as form values and scroll position) is restored. void goback( ); goforward() tells the object to navigate to the next session history item. when a page is loaded from session history, all content is loaded from the cache (if available) and page state (such as form values and scroll position) is restored. void goforward( ); gotoindex() tells the object to navigate to the session history item at a given index. void gotoinde...
nsIZipReader
ching entries in the zip file. set this parameter to null (javascript) or emptycstring() (c++) to get all entries; otherwise, use the following syntax: * matches anything. ? matches one character. $ matches the end of the string. [abc] matches one occurrence of a, b, or c. the only character that must be escaped inside the brackets is ]. ^ and - must never appear in the first and second positions within the brackets, respectively. (in the former case, the behavior specified for '[^az]' will happen.) [a-z] matches any character between a and z. the characters a and z must either both be letters or both be numbers, with the character represented by 'a' having a lower ascii value than the character represented by 'z'. [^az] matches any character except a or z. if ] is to appear inside t...
Events
there are a lot of events that can be fired in mail code. some of these are standard events, such as those created by the dom. others are internal to gecko or other parts of mozilla application code. this reference will help you track those events down and learn how to use them. composition event name event type fired when... compose-send-message a message gets sent compose-window-close a compose window gets closed compose-window-init a compose window has been opened compose-window-reopen a cached compose window has been reopened. no load event is fired in this case. folders event name event type fired when... msgcreatedbview onactivecreatedview ...
Index
o both thunderbird and the seamonkey application suite. 34 mail and rdf mozilla mail exposes many of it's data structures to rdf through a few datasources. this allows exposure of mailnews-specific data to user interface using rdf templates. 35 mail client architecture overview sections in grey refer to modules outside of mail/news 36 mail composition back end by richard h. pizzarro <rhp@netscape.com> contents 37 mail event system mozilla mail requires an event system to notify different subsystems that data has changed. this document describes the system that events are passed amongst the mail objects. 38 mailnews filters mailnews, thunderbird mailnews filters consist of a set of search te...
Folders and message lists
is corresponding to the selected messages. like selectedmessages, this also includes messages in selected collapsed threads when so enabled. changing the current message selection in addition to getting the currently-selected messages, you can also change the selection: gfolderdisplay.selectmessage(msghdr): selects a single message, as specified by msghdr (an nsimsgdbhdr) and scrolls to its position in the message list. gfolderdisplay.selectmessages(arrayofmsghdrs): selects all the messages in the array arrayofmsghdrs. like selectmessage, this function will attempt to scroll the view so the entire selection is visible (which may not be possible for large selections). gfolderdisplay.clearselection(): clears the list of selected messages. listing messages in a folder if you have a message...
Using the Multiple Accounts API
r? preference: mail.server.server.newsrc.file - platform specific file path to newsrc file identities preference: mail.identity.identity.fullname - the user's full name, i.e. john smith preference: mail.identity.identity.useremail - the user's e-mail address, i.e. jsmith@isp.com preference: mail.identity.identity.reply_to - reply to address during message composition, should only be used if different than useremail. (replyto: header in mail messages) preference: mail.identity.identity.organization - user's organization (organization: header in mail messages) preference: mail.identity.identity.compose_html - boolean, should we compose messages in html (true) or plain text (false)? preference: mail.identity.identity.attach_vcard - boolean, should we...
Examples
mac os x these examples require mac os x to operate. add image to iphoto an extension that adds a contextual menu item to images that lets you easily add them to iphoto on mac os x. using objective-c from js-ctypes an example how to use objective-c from js-ctypes, by converting objective-c code into c code. ...
UInt64
type is "' + ccon + '"'); } } } } function uint64_add(...uint64) { ensureuint64(uint64); var hi = uint64.hi(uint64[0]); var lo = uint64.lo(uint64[0]);; for (var i=1; i<uint64.length; i++) { hi += uint64.hi(uint64[i]); lo += uint64.lo(...
Debugger.Memory - Firefox Developer Tools
normal: the string’s text is counted in its size. substring: the string is a substring of some other string, and points to that string for its storage. this representation may result in a small string retaining a very large string. however, the memory consumed by the string itself is a small constant independent of its size, since it is simply a reference to the larger string, a start position, and a length. concatenations: when asked to concatenate two strings, spidermonkey may elect to delay copying the strings’ data, and represent the result simply as a pointer to the two original strings. again, such a string retains other strings, but the memory consumed by the string itself is a small constant independent of its size, since it is simply a pair of pointers. spidermonke...
Debugger.Source - Firefox Developer Tools
tances for such sources should return undefined.) if the instance refers to webassembly code, the url of the script that called new webassembly.module with the string "> wasm" appended. sourcemapurl if the instance refers to javascript source, if this source was produced by a minimizer or translated from some other language, and we know the url of a source map document relating the source positions in this source to the corresponding source positions in the original source, then this property’s value is that url. otherwise, this is null. (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 sour...
Debugger-API - Firefox Developer Tools
ow 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. a debugger.script represents a block of javascript code—either a function body or a top-level script. 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. a debugger.frame represents a running stack frame. you can use these to walk the stack and find each frame’s script and environment. you can also set onstep and onpop handlers on frames. a debugger.environment represents an environment, associating var...
Aggregate view - Firefox Developer Tools
s() call). we can use the disclosure arrow to expand the tree to find out exactly where we're allocating memory: this is where the "bytes" and "count" columns are useful: they show allocation size and number of allocations at that exact point. so in the example above, we can see that we made 4002 allocations, accounting for 89% of the total heap, in createtoolbarbutton(), at alloc.js line 9, position 23: that is, the exact point where we create the <span> elements. the file name and line number is a link: if we click it, we go directly to that line in the debugger: inverted call stack the call stack view is top-down: it shows allocations that happen at that point or points deeper in the call tree. so it's good for getting an overview of where your program is memory-hungry. however, this ...
Dominators view - Firefox Developer Tools
ects are being allocated. this option is called "allocation stack" in firefox 46. to enable this, you must check the box labeled "record call stacks" before you run the code that allocates the objects. then take a snapshot, then select "call stack" in the "label by" drop-down. now the node's name will contain the name of the function that allocated it, and the file, line number and character position of the exact spot where the function allocated it. clicking the file name will take you to that spot in the debugger. sometimes you'll see "(no stack available)" here. in particular, allocation stacks are currently only recorded for objects, not for arrays, strings, or internal structures. retaining paths panel the retaining paths panel is new in firefox 47. the retaining paths panel show...
Network request details - Firefox Developer Tools
kb)": { "headers": [ { "name": "accept-ranges", "value": "bytes" }, { "name": "age", "value": "0" }, { "name": "backend-timing", "value": "d=74716 t=1560258099074460" }, { "name": "cache-control", "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" }...
Network request list - Firefox Developer Tools
for example, a weak cipher was used) failed https (for example, a certificate was invalid) http localhost indicates that the url belongs to a known tracker that would be blocked with content blocking enabled. timeline the request list also displays a timeline for the different parts of each request. each timeline is given a horizontal position in its row relative to the other network requests, so you can see the total time taken to load the page. for more details on the color-coding used here, see the section on the timings page. starting in firefox 45, the timeline also contains two vertical lines: the blue line marks the point at which the page's domcontentloaded event is triggered. the red line marks the point at which the page...
Examine and edit HTML - Firefox Developer Tools
working with editable text: copy and paste you can use the popup menu to copy nodes in the html tree and paste them into the desired location. drag and drop you can reorganize the html content of a page by moving nodes in the html tree. just click and hold on any element and drag it up or down in the tree. when you release the mouse button, the element will be inserted at the corresponding position: you can cancel the drag and drop by pressing the esc key. inserting new nodes there's a "+" icon at the top of the markup view: click this icon to insert an empty <div> into the document as the last child of the currently selected element. you can then edit the new node's content and styling just as you would any other node in the document. you can access the same functionality using ...
CSS Grid Inspector: Examine grid layouts - Firefox Developer Tools
sy access to grid features. in the html pane in the html pane, elements laid out using a grid have a "grid" marker beside them. in the css pane in the css pane's rules view, any instance of a display: grid declaration gets a grid icon included within it: . clicking the icon toggles the display of a grid overlay on the page, which appears over the element, laid out like a grid to show the position of its grid lines and tracks: the overlay is still shown when you select other elements, so you can edit related css properties and see how the grid is affected. the layout view grid section when grids are included on a page, the css pane's layout view includes a "grid" section containing a number of options for viewing those grids. you can find out more about those in the section below. n...
How to - Firefox Developer Tools
links for various how to's can be found here. these links describe in depth the how to techniques. ...
Page Inspector - Firefox Developer Tools
to find your way around the inspector, here's a quick tour of the ui. you can split the rules view out into its own pane, separate from the other tabs on the css pane — this is called 3-pane mode. ...
Paint Flashing Tool - Firefox Developer Tools
:hover #moving-box-left-margin{ margin-left: 74%; } body:hover #moving-box-transform { transform: translate(300%); } to see the transition, move the mouse into the space below: now switch paint flashing on, and try it again. you should see that the margin-left version triggers a series of repaints as the element moves, while the transform version only causes repaints in the start and end positions. why? well, when you use transform, the browser creates a separate layer for the element. so when the element is moved, all that's changed is the relation of the two layers to each other, which is handled in composition: neither layer needs a repaint. in this case, with a simple style, the extra repaints don't make much of a difference. but if the style were computationally expensive to paint,...
AbstractRange.endOffset - Web APIs
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. ...
AbstractRange.startContainer - Web APIs
the read-only startcontainer property of the abstractrange interface returns the start node for the range. syntax var startnode = range.startcontainer value the dom node inside which the start position of the range is found. specifications specification status comment domthe definition of 'startcontainer ' in that specification. living standard static rangethe definition of 'startcontainer' in that specification. editor's draft initial definition. ...
AbstractRange.startOffset - Web APIs
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. ...
AnalyserNode.getFloatFrequencyData() - Web APIs
); //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'); canvasctx.clearrect(0, 0, canvas.width, canvas.height); function draw() { //schedule next redraw requestanimationframe(draw); //get spectrum data analysernode.getfloatfrequencydata(...
Animation.onremove - Web APIs
x)` }, { duration: 500, fill: 'forwards' } ); anim.commitstyles(); //anim.persist() anim.onremove = function() { console.log('animation removed'); } console.log(anim.replacestate); }); here we have a <div> element, and an event listener that fires the event handler code whenever the mouse moves. the event handler sets up an animation that animates the <div> element to the position of the mouse pointer. this could result in a huge animations list, which could create a memory leak. for this reason, modern browsers automatically remove overriding forward filling animations. a console message is logged each time an animation it removed, invoked when the remove event is fired. specifications specification status comment web animationsthe definition of...
Animation.persist() - Web APIs
Web › API › Animation › persist
x)` }, { duration: 500, fill: 'forwards' } ); anim.commitstyles(); //anim.persist() anim.onremove = function() { console.log('animation removed'); } console.log(anim.replacestate); }); here we have a <div> element, and an event listener that fires the event handler code whenever the mouse moves. the event handler sets up an animation that animates the <div> element to the position of the mouse pointer. this could result in a huge animations list, which could create a memory leak. for this reason, modern browsers automatically remove overriding forward filling animations. you can see the replacestate of the animation being logged at the end of the handler. this will be active for each animation by default, or persisted if the persist() call is uncommented. specifications ...
Animation.replaceState - Web APIs
x)` }, { duration: 500, fill: 'forwards' } ); anim.commitstyles(); //anim.persist() anim.onremove = function() { console.log('animation removed'); } console.log(anim.replacestate); }); here we have a <div> element, and an event listener that fires the event handler code whenever the mouse moves. the event handler sets up an animation that animates the <div> element to the position of the mouse pointer. this could result in a huge animations list, which could create a memory leak. for this reason, modern browsers automatically remove overriding forward filling animations. you can see the replacestate of the animation being logged at the end of the handler. this will be active for each animation by default, or persisted if the persist() call is uncommented. specifications ...
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 some cases, an animation may run on a separate thread or process and will continue updating even while long-running javascript delays the main thread. 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. after calling updateplaybackrate(...
Animation - Web APIs
Web › API › Animation
r. animation.play() starts or resumes playing of an animation, or begins the animation again if it previously finished. animation.reverse() reverses playback direction, stopping at the start of the animation. if the animation is finished or unplayed, it will play from end to beginning. animation.updateplaybackrate() sets the speed of an animation after first synchronizing its playback position. automatically removing filling animations it is possible to trigger a large number of animations on the same element. if they are indefinite (i.e., forwards-filling), this can result in a huge animations list, which could create a memory leak. for this reason, modern browsers have implemented the part of the web animations spec that automatically removes overriding forward filling animations,...
AudioBufferSourceNode.loopEnd - Web APIs
slider controls are used to change the playbackrate, loopstart and loopend properties on the fly. when the audio is played to the end, it loops, but you can control how long the loops last by altering loopstart and loopend. 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. then the current play position will loop back to the 20 second mark and continue playing until the 25 second mark, ad infinitum (or at least until stop() is called). for a full working example, see this code running live, or view the source. function getdata() { source = audioctx.createbuffersource(); request = new xmlhttprequest(); request.open('get', 'viper.ogg', true); request.responsetype = 'arraybuffer'; ...
AudioContext.createMediaElementSource() - Web APIs
g graph to manipulate. returns a mediaelementaudiosourcenode. example this simple example creates a source from an <audio> element using createmediaelementsource(), then passes the audio through a gainnode before feeding it into the audiodestinationnode for playback. when the mouse pointer is moved, the updatepage() function is invoked, which calculates the current gain as a ratio of mouse y position divided by overall window height. you can therefore increase and decrease the volume of the playing music by moving the mouse pointer up and down. note: you can also view this example running live, or view the source. var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); var myaudio = document.queryselector('audio'); var pre = document.queryselector('pre'); var myscript = d...
AudioContext.getOutputTimestamp() - Web APIs
the getoutputtimestamp() property of the audiocontext interface returns a new audiotimestamp object containing two audio timestamp values relating to the current audio context. the two values are as follows: audiotimestamp.contexttime: the time of the sample frame currently being rendered by the audio output device (i.e., output audio stream position), in the same units and origin as the context's audiocontext.currenttime. basically, this is the time after the audio context was first created. audiotimestamp.performancetime: an estimation of the moment when the sample frame corresponding to the stored contexttime value was rendered by the audio output device, in the same units and origin as performance.now(). this is the time after the document containing the audio context was first rendered.
Background Tasks API - Web APIs
if (logfragment) { logelem.appendchild(logfragment); logfragment = null; } if (scrolledtoend) { logelem.scrolltop = logelem.scrollheight - logelem.clientheight; } statusrefreshscheduled = false; } first, scrolledtoend is set to true if the text in the log is scrolled to the bottom; otherwise it's set to false. we'll use that to determine if we should update the scroll position to ensure that the log stays at the end when we're done adding content to it. next, we update the progress and status information if any tasks have been enqueued. if the current maximum value of the progress bar is different from the current total number of enqueued tasks (totaltaskcount), then we update the contents of the displayed total number of tasks (totaltaskcountelem) and the maximum ...
BaseAudioContext.createStereoPanner() - Web APIs
syntax baseaudiocontext.createstereopanner(); returns a stereopannernode. example in our stereopannernode example (see source code) html we have a simple <audio> element along with a slider <input> to increase and decrease pan value. in the javascript we create a mediaelementaudiosourcenode and a stereopannernode, and connect the two together using the connect() method. ...
CSSNumericValue - Web APIs
the cssnumericvalue interface of the css typed object model api represents operations that all numeric values can perform. interfaces based on cssnumericvalue below is a list of interfaces based on the cssnumericvalue interface. cssmathinvert cssmathmax cssmathmin cssmathnegate cssmathproduct cssmathsum cssmathvalue cssnumericarray cssperspective csspositionvalue cssrotate cssskew cssskeyx cssskeyw csstranslate cssunitvalue properties none. event handlers no methods cssnumericvalue.add adds a supplied number to the cssnumericvalue. cssnumericvalue.sub subtracts a supplied number from the cssnumericvalue. cssnumericvalue.mul multiplies the cssnumericvalue by the supplied value. cssnumericvalue.div divides the cssnumericvalue by the supplied value. cssnumer...
CSSStyleSheet.insertRule() - Web APIs
trule(rule [, index]) parameters rule a domstring containing the rule to be inserted. what the inserted rule must contain depends on its type: for rule-sets, both a selector and a style declaration. for at-rules, both an at-identifier and the rule content. index optional a positive integer less than or equal to stylesheet.cssrules.length, representing the newly inserted rule's position in cssstylesheet.cssrules. the default is 0. (in older implementations, this was required. see browser compatibility for details.) return value the newly inserted rule's index within the stylesheet's rule-list. restrictions css has some intuitive and not-so-intuitive restrictions affecting where rules can be inserted. violating them will likely raise a domexception. if index > cssrulelist...
CSSStyleSheet - Web APIs
ownerrule read only if this stylesheet is imported into the document using an @import rule, the ownerrule property returns the corresponding cssimportrule; otherwise, this property's value is null. methods inherits methods from its parent, stylesheet. deleterule() deletes the rule at the specified index into the stylesheet's rule list. insertrule() inserts a new rule at the specified position in the stylesheet, given the textual representation of the rule. legacy properties these properties are legacy properties first introduced by microsoft long ago; they shouldn't be used but are not likely to be removed anytime soon. rules read only the rules property is functionally identical to the standard cssrules property; it returns a live cssrulelist which maintains an up-to-date lis...
CSSStyleValue - Web APIs
the cssstylevalue interface of the the css typed object model api is the base class of all css values accessible through the typed om api. an instance of this class may be used anywhere a string is expected. interfaces based on cssstylevalue below is a list of interfaces based on the cssstylevalue interface. 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. specifications specification status ...
CSSUnitValue.CSSUnitValue() - Web APIs
object which returns a new cssunitvalue object which represents values that contain a single unit type. for example, "42px" would be represented by a cssnumericvalue. syntax var cssunitvalue = new cssunitvalue() parameters value returns a double indicating the number of units. unit returns a usvstring indicating the type of unit. examples the following shows a method of creating a csspositionvalue from individual cssunitvalue constructors. let pos = new csspositionvalue( new cssunitvalue(5, "px"), new cssunitvalue(10, "px")); specifications specification status comment css typed om level 1the definition of 'cssunitvalue' in that specification. working draft initial definition. ...
CSSUnitValue.unit - Web APIs
Web › API › CSSUnitValue › unit
the cssunitvalue.unit read-only property of the cssunitvalue interface returns a usvstring indicating the type of unit. syntax var astring = cssunitvalue.unit; value a usvstring. examples the following creates a csspositionvalue from individual cssunitvalue constructors, then queries the cssunitvalue.unit. let pos = new csspositionvalue( new cssunitvalue( 5, "px" ), new cssunitvalue( 10, "em" )); console.log( pos.x.unit ); // "px" console.log( pos.y.unit ); // "em" specifications specification status comment css typed om level 1the definition of 'cssunitvalue.unit' in that specification. working draft initial definition. ...
CSSUnitValue.value - Web APIs
the cssunitvalue.value property of the cssunitvalue interface returns a double indicating the number of units. syntax var cssunitvalue = cssunitvalue.value; cssunitvalue.value = cssunitvalue; value a double. examples the following creates a csspositionvalue from individual cssunitvalue constructors, then queries the cssunitvalue.value. let pos = new csspositionvalue( new cssunitvalue( 5, "px" ), new cssunitvalue( 10, "px" )); console.log( pos.x.value ); // 5 console.log( pos.y.value ); // 10 specifications specification status comment css typed om level 1the definition of 'cssunitvalue.value' in that specification. working draft initial definition. ...
CSSUnitValue - Web APIs
ype. for example, "42px" would be represented by a cssnumericvalue. constructor cssstylevalue.cssunitvalue() creates a new cssunitvalue object. properties cssunitvalue.value returns a double indicating the number of units. cssunitvalue.unit returns a usvstring indicating the type of unit. event handlers none. methods none. examples the following shows a method of creating a csspositionvalue from individual cssunitvalue constructors. let pos = new csspositionvalue( new cssunitvalue(5, "px"), new cssunitvalue(10, "px")); specifications specification status comment css typed om level 1the definition of 'cssunitvalue' in that specification. working draft initial definition. ...
CSSValueList.item() - Web APIs
Web › API › CSSValueList › item
index. the order in this collection represents the order of the values in the css style property. if the index is greater than or equal to the number of values in the list, this method returns null. syntax var cssvalue = cssvaluelist.item(index); parameters index an unsigned long representing the index of the css value within the collection. return value a cssvalue object at the index position in the cssvaluelist, or null if that is not a valid index. specifications specification status comment document object model (dom) level 2 style specificationthe definition of 'cssvaluelist.item' in that specification. obsolete initial definition ...
Managing screen orientation - Web APIs
locking the screen orientatio...
CSS Typed Object Model API - Web APIs
lue passed cssnumericvalue.max - returns the maximum value passed cssnumericvalue.equals - returns true if all the values are the exact same type and value, in the same order. otherwise, false cssnumericvalue.to - converts value into another one with the specified unit. cssnumericvalue.tosum cssnumericvalue.type cssnumericvalue.parse - returns a number parsed from a css string csspositionvalue represents values for properties that take a position, for example object-position. csstransformvalue an interface representing a list of transform list values. they "contain" one or more csstransformcomponents, which represent individual transform function values. cssunparsedvalue represents property values that reference custom properties. it consists of a list of string fragments...
CanvasGradient.addColorStop() - Web APIs
0 represents the start of the gradient and 1 represents the end; an index_size_err is raised if the number is outside that range. color a css <color> value representing the color of the stop. ...
CanvasRenderingContext2D.lineJoin - Web APIs
the canvasrenderingcontext2d.linejoin property of the canvas 2d api determines the shape used to join two line segments where they meet. this property has no effect wherever two connected segments have the same direction, because no joining area will be added in this case. degenerate segments with a length of zero (i.e., with all endpoints and control points at the exact same position) are also ignored. note: lines can be drawn with the stroke(), strokerect(), and stroketext() methods. syntax ctx.linejoin = "bevel" || "round" || "miter"; options there are three possible values for this property: "round", "bevel", and "miter". the default is "miter". "round" rounds off the corners of a shape by filling an additional sector of disc centered at the common endpoint of connected segment...
CanvasRenderingContext2D.scale() - Web APIs
tical scaling. examples scaling a shape this example draws a scaled rectangle. a non-scaled rectangle is then drawn for comparison. html <canvas id="canvas"></canvas> javascript the rectangle has a specified width of 8 and a height of 20. the transformation matrix scales it by 9x horizontally and by 3x vertically. thus, its final size is a width of 72 and a height of 60. notice that its position on the canvas also changes. since its specified corner is (10, 10), its rendered corner becomes (90, 30). 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 r...
CanvasRenderingContext2D.shadowColor - Web APIs
s must be non-zero, as well. syntax ctx.shadowcolor = color; color a domstring parsed as a css <color> value. the default value is fully-transparent black. examples adding a shadow to shapes this example adds a shadow to two squares; the first one is filled, and the second one is stroked. the shadowcolor property sets the shadows' color, while shadowoffsetx and shadowoffsety set their position relative to the shapes. html <canvas id="canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); // shadow ctx.shadowcolor = 'red'; ctx.shadowoffsetx = 10; ctx.shadowoffsety = 10; // filled rectangle ctx.fillrect(20, 20, 100, 100); // stroked rectangle ctx.linewidth = 6; ctx.strokerect(170, 20, 100, 100); result shadows on t...
CanvasRenderingContext2D.translate() - Web APIs
y moving the canvas and its origin x units horizontally and y units vertically on the grid. parameters x distance to move in the horizontal direction. positive values are to the right, and negative to the left. y distance to move in the vertical direction. positive values are down, and negative are up. examples moving a shape this example draws a square that is moved from its default position by the translate() method. an unmoved square of the same size is then drawn for comparison. html <canvas id="canvas"></canvas> javascript the translate() method translates the context by 110 horizontally and 30 vertically. the first square is shifted by those amounts from its default position. const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); // moved s...
A basic ray-caster - Web APIs
t the canvas showing the current view. i know i could have started with a simpler example, but i'm sure the canvas tutorial will get to that, and i wanted to see if i could do this. so every update, the raycaster looks to see if you've pressed any keys lately, to conserve calculations by not casting if you're idle. if you have, then the canvas is cleared, the ground and sky are drawn, the camera position and/or orientation are updated, and the rays are cast out. as the rays intersect walls, then they render a vertical sliver of canvas in the color of the wall they've hit, blended with a darker version of the color according to the distance to the wall. the height of the sliver is also modulated by the distance from the camera to the wall, and is drawn centered over the horizon line. the code i e...
Compositing and clipping - Web APIs
by drawing an arc and calling clip(). clipping paths are also part of the canvas save state. if we wanted to keep the original clipping path we could have saved the canvas state before creating the new one. everything that's drawn after creating the clipping path will only appear inside that path. you can see this clearly in the linear gradient that's drawn next. after this a set of 50 randomly positioned and scaled stars is drawn, using the custom drawstar() function. again the stars only appear inside the defined clipping path. screenshotlive sample « previousnext » ...
Drawing text - Web APIs
« previousnext » after having seen how to apply styles and colors in the previous chapter, we will now have a look at how to draw text onto the canvas. drawing text the canvas rendering context provides two methods to render text: filltext(text, x, y [, maxwidth]) fills a given text at the given (x,y) position. optionally with a maximum width to draw. stroketext(text, x, y [, maxwidth]) strokes a given text at the given (x,y) position. optionally with a maximum width to draw. a filltext example the text is filled using the current fillstyle. function draw() { var ctx = document.getelementbyid('canvas').getcontext('2d'); ctx.font = '48px serif'; ctx.filltext('hello world', 10, 50); } <canvas id="canvas" width="300" height="100"></canvas> draw(); a strok...
Optimizing canvas - Web APIs
ly upon user input, the gameplay layer would change with every new frame, and the background would remain generally unchanged. <div id="stage"> <canvas id="ui-layer" width="480" height="320"></canvas> <canvas id="game-layer" width="480" height="320"></canvas> <canvas id="background-layer" width="480" height="320"></canvas> </div> <style> #stage { width: 480px; height: 320px; position: relative; border: 2px solid black; } canvas { position: absolute; } #ui-layer { z-index: 3; } #game-layer { z-index: 2; } #background-layer { z-index: 1; } </style> use plain css for large background images if you have a static background image, you can draw it onto a plain <div> element using the css background property and position it under the canvas. this will negate the ne...
DOMMatrix - Web APIs
Web › API › DOMMatrix
his article to explain the mathematics involved, this 4×4 size is enough to describe any transformation you might apply to either 2d or 3d geometries. [m11m21m31m41m12m22m32m42m13m23m33m43m14m24m34m44]\left [ \begin{matrix} m_{11} & m_{21} & m_{31} & m_{41} \\ m_{12} & m_{22} & m_{32} & m_{42} \\ m_{13} & m_{23} & m_{33} & m_{43} \\ m_{14} & m_{24} & m_{34} & m_{44} \end{matrix} \right ] the positions of the 16 elements (m11 through m44) which comprise the 4×4 abstract matrix. the dommatrix interface is designed with the intent that it will be used for all matrices within markup, supplanting the svgmatrix and cssmatrix interfaces. specifications specification status comment geometry interfaces module level 1the definition of 'dommatrix' in that specification...
DOMMatrixReadOnly.flipX() - Web APIs
ginal matrix flipped about the x-axis. syntax dommatrix.flipx() return value returns a dommatrix containing a new matrix being the result of the original matrix flipped about the x-axis, which is equivalent to multiplying the matrix by dommatrix(-1, 0, 0, 1, 0, 0). the original matrix is not modified. examples this svg contains two paths in the shape of a triangle, both drawn to the same position. note that the x co-ordinate of the viewbox attribute is negative, showing us content from both sides of the x-axis. <svg width="100" height="100" viewbox="-50 0 100 100"> <path fill="red" d="m 0 50 l 50 0 l 50 100 z" /> <path id="flipped" fill="blue" d="m 0 50 l 50 0 l 50 100 z" /> </svg> this javascript first creates an identity matrix, then uses the `flipx()` method to create a new matr...
DOMMatrixReadOnly.translate() - Web APIs
0. if this is anything other than 0, the resulting matrix will be 3d. return value returns a dommatrix containing a new matrix being the result of the matrix being translated by the given vector. the original matrix is not modified. if a translation is applied about the z-axis, the resulting matrix will be a 4x4 3d matrix. examples this svg contains two squares, one red and one blue, each positioned at the document origin: <svg width="250" height="250" viewbox="0 0 50 50"> <rect width="25" height="25" fill="red" /> <rect id="transformed" width="25" height="25" fill="blue" /> </svg> the following javascript first creates an identity matrix, then uses the translate() method to create a new, translated matrix — which is then applied to the blue square as a transform. the red square is...
DataTransfer.mozSetDataAt() - Web APIs
lled 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. data should be added in order of preference, with the most specific format added first and the least specific format added last. if data of the given format already exists, it is replaced in the same position as the old data. the data should be either a string, a boolean or number type (which will be converted into a string) or an nsisupports. note: this method is gecko-specific. 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. data a nsivariant representing the data to add to the drag...
DataTransfer.setData() - Web APIs
that is, the order of the types list is not changed when replacing data of the same type. ...
DataTransfer - Web APIs
ta() retrieves the data for a given type, or an empty string if data for that type does not exist or the data transfer contains no data. datatransfer.setdata() set the data for a given type. if data for the type does not exist, it is added at the end, such that the last item in the types list will be the new format. if data for the type already exists, the existing data is replaced in the same position. datatransfer.setdragimage() set the image to be used for dragging if a custom one is desired. gecko methods note: all of the methods in this section are gecko-specific. datatransfer.addelement() sets the drag source to the given element. deprecated methods datatransfer.mozcleardataat() removes the data associated with the given format for an item at the specified index. the i...
DeviceMotionEvent - Web APIs
warning: currently, firefox and chrome do not handle the coordinates the same way. take care about this while using them. constructor devicemotionevent.devicemotionevent() creates a new devicemotionevent. properties devicemotionevent.accelerationread only an object giving the acceleration of the device on the three axis x, y and z. acceleration is expressed in m/s2. devicemotionevent.accelerationincludinggravityread only an object giving the acceleration of the device on the three axis x, y and z with the effect of gravity. ...
Document.createDocumentFragment() - Web APIs
of the main dom tree. the usual use case is to create the document fragment, append elements to the document fragment and then append the document fragment to the dom tree. in the dom tree, the document fragment is replaced by all its children. since the document fragment is in memory and not part of the main dom tree, appending children to it does not cause page reflow (computation of element's position and geometry). historically, using document fragments could result in better performance. you can also use the documentfragment constructor to create a new fragment: let fragment = new documentfragment(); example this example creates a list of major web browsers in a documentfragment, then adds the new dom subtree to the document to be displayed. html <ul id="ul"> </ul> javascript var ele...
Document: keypress event - Web APIs
abetic, numeric, and punctuation keys. examples of keys that don't produce a character value are modifier keys such as alt, shift, ctrl, or meta. since this event has been deprecated, you should look to use beforeinput or keydown instead. interface keyboardevent bubbles yes cancelable yes default action varies: keypress event; launch text composition system; blur and focus events; domactivate event; other event examples addeventlistener keypress example this example logs the keyboardevent.code value whenever you press a key. <p>press inside this iframe first to focus it, then try pressing keys on the keyboard.</p> <p id="log"></p> const log = document.getelementbyid('log'); document.addeventlistener('keypress', logkey); function ...
DocumentOrShadowRoot.elementFromPoint() - Web APIs
pointer-events set to none will be ignored, and the element below it will be returned. if the method is run on another document (like an <iframe>'s subdocument), the coordinates are relative to the document where the method is being called. if the specified point is outside the visible bounds of the document or either coordinate is negative, the result is null. if you need to find the specific position inside the element, use document.caretpositionfrompoint(). syntax const element = document.elementfrompoint(x, y) parameters x the horizontal coordinate of a point, relative to the left edge of the current viewport. y the vertical coordinate of a point, relative to the top edge of the current viewport. return value the topmost element object located at the specified coordinates. exam...
DocumentOrShadowRoot.getSelection() - Web APIs
syntax var selection = documentorshadowrootinstance.getselection() parameters none. returns a selection object. ...
Traversing an HTML table with JavaScript and DOM Interfaces - Web APIs
each <tbody>'s child (<tr>) has two children (<td>). finally, each <td> has one child: a text node. example: setting the background color of a paragraph getelementsbytagname(tagnamevalue) is a method available in any dom element or the root document element. when called, it returns an array with all of the element's descendants matching the tag name. the first element of the list is located at position [0] in the array. 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 ...
Document Object Model (DOM) - Web APIs
static type svgangle svgcolor svgicccolor svgelementinstance svgelementinstancelist svglength svglengthlist svgmatrix svgna...
Element: MSGestureChange event - Web APIs
it is a proprietary event specific to microsoft edge and internet explorer. ...
Element: MSGestureHold event - Web APIs
it is a proprietary event specific to microsoft edge and internet explorer. bubbles unknown cancelable unknown interface msgestureevent event handler property unknown the uievent.detail property of an msgesturehold event has 3 possible values: msgesture_flag_begin this value indicates that the user started contacting the touch surface. msgesture_flag_end this value indicates that the user has stopped touching the touch surface. ...
Element.clientLeft - Web APIs
udes the width of the vertical scrollbar if the text direction of the element is right–to–left and if there is an overflow causing a left vertical scrollbar to be rendered. clientleft does not include the left margin or the left padding. clientleft is read-only. 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. note: this property will round the value to an integer. if you need a fractional value, use element.getboundingclientrect(). note: when an element has display: inline, clientleft returns 0 regardless of the element's border. syntax var left = element.clientleft; example padding-top lorem ipsum dolor sit amet, consecte...
Element: keypress event - Web APIs
abetic, numeric, and punctuation keys. examples of keys that don't produce a character value are modifier keys such as alt, shift, ctrl, or meta. since this event has been deprecated, you should look to use beforeinput or keydown instead. interface keyboardevent bubbles yes cancelable yes default action varies: keypress event; launch text composition system; blur and focus events; domactivate event; other event examples addeventlistener keypress example this example logs the keyboardevent.code value whenever you press a key after focussing the <input> element. <div> <label for="sample">focus the input and type something:</label> <input type="text" name="text" id="sample"> </div> <p id="log"></p> const log = document.getelementb...
Element: paste event - Web APIs
ugh the browser's user interface. 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. a handler for this event can access the clipboard contents by calling getdata() on the event's clipboarddata property. to override the default behavior (for example to insert some different data or a transformation of the clipboard contents) an event handler must cancel the default action using event.preventdefault(), and then insert its desired data manually. it's possible to construct and d...
Element.scrollLeft - Web APIs
on systems using display scaling, scrollleft may give you a decimal value. ...
Element.setCapture() - Web APIs
to be no setcapture support on this browser"; } } function mousedown(e) { e.target.setcapture(); e.target.addeventlistener("mousemove", mousemoved, false); } function mouseup(e) { e.target.removeeventlistener("mousemove", mousemoved, false); } function mousemoved(e) { var output = document.getelementbyid("output"); output.innerhtml = "position: " + e.clientx + ", " + e.clienty; } </script> </head> <body onload="init()"> <p>this is an example of how to use mouse capture on elements in gecko 2.0.</p> <p><a id="mybutton" href="#">test me</a></p> <div id="output">no events yet</div> </body> </html> view live examples notes the element may not be scrolled completely to the top or bottom, depending on the layout of other elem...
Comparison of Event Targets - Web APIs
naltarget will show the text node. unlike .originaltarget, .explicitoriginaltarget will never contain anonymous content. event.originaltarget event.webidl the original target of the event, before any retargetings. see anonymous content#event_flow_and_targeting for details. event.composedtarget event.webidl the original non-native target of the event before composition from shadow dom. use of explicitoriginaltarget and originaltarget todo: only available in a mozilla-based browser? todo: only suitable for extension-developers? 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-colla...
Event.preventDefault() - Web APIs
native html form validation instead. html here's the form: <div class="container"> <p>please enter your name using lowercase letters only.</p> <form> <input type="text" id="my-textbox"> </form> </div> css we use a little bit of css for the warning box we'll draw when the user presses an invalid key: .warning { border: 2px solid #f39389; border-radius: 2px; padding: 10px; position: absolute; background-color: #fbd8d4; color: #3b3c40; } javascript and here's the javascript code that does the job. first, listen for keypress events: var mytextbox = document.getelementbyid('my-textbox'); mytextbox.addeventlistener('keypress', checkname, false); the checkname() function, which looks at the pressed key and decides whether to allow it: function checkname(evt) { var ch...
Event - Web APIs
Web › API › Event
ure settings of each handler triggered. interfaces based on event below is a list of interfaces which are based on the main event interface, with links to their respective documentation in the mdn api reference. note that all event interfaces have names which end in "event". ...
Using files from web applications - Web APIs
used. note that in this case the input element must not be hidden using display: none (nor visibility: hidden), otherwise the label would not be keyboard-accessible. use the visually-hidden technique instead. ...
Using FormData Objects - Web APIs
note: if you pass in a reference to the form, the request method specified in the form will be used over the method specified in the open() call. you can also append a file or blob directly to the formdata object, like this: data.append("myfile", myblob, "filename.txt"); when using the append() method it is possible to use the third optional parameter to pass a filename inside the content-disposition header that is sent to the server. when no filename is specified (or the parameter isn't supported), the name "blob" is used. using a formdata event a more recent addition to the platform than the formdata object is the formdata event — this is fired on an htmlformelement object after the entry list representing the form's data is constructed. this happens when the form is submitted, but can ...
FormData.append() - Web APIs
Web › API › FormData › append
rted to a string. filename optional the filename reported to the server (a usvstring), when a blob or file is passed as the second parameter. the default filename for blob objects is "blob". the default filename for file objects is the file's filename. note: if you specify a blob as the data to append to the formdata object, the filename that will be reported to the server in the "content-disposition" header used to vary from browser to browser. returns void. example the following line creates an empty formdata object: var formdata = new formdata(); // currently empty you can add key/value pairs to this using formdata.append: formdata.append('username', 'chris'); formdata.append('userpic', myfileinput.files[0], 'chris.jpg'); as with regular form data, you can append multiple values w...
FormData.set() - Web APIs
Web › API › FormData › set
rted to a string. filename optional the filename reported to the server (a usvstring), when a blob or file is passed as the second parameter. the default filename for blob objects is "blob". the default filename for file objects is the file's filename. note: if you specify a blob as the data to append to the formdata object, the filename that will be reported to the server in the "content-disposition" header used to vary from browser to browser. 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 converte...
Gamepad.axes - Web APIs
Web › API › Gamepad › axes
the gamepad.axes property of the gamepad interface returns an array representing the controls with axes present on the device (e.g. analog thumb sticks).- each entry in the array is a floating point value in the range -1.0 – 1.0, representing the axis position from the lowest value (-1.0) to the highest value (1.0). syntax readonly attribute double[] axes; example function gameloop() { if(navigator.webkitgetgamepads) { var gp = navigator.webkitgetgamepads()[0]; } else { var gp = navigator.getgamepads()[0]; } if(gp.axes[0] != 0) { b -= gp.axes[0]; } else if(gp.axes[1] != 0) { a += gp.axes[1]; } else if(gp.axes[2] != 0) { b += gp.axes[2]; } else if(gp.axes[3] != 0) { a -= gp.axes[3]; } ball.style.left = a*2 + "px"; ball.style.top = ...
GeolocationCoordinates.altitude - Web APIs
the geolocationcoordinates.altitude read-only property is a double representing the altitude of the position in meters, relative to sea level. this value is null if the implementation cannot provide this data. syntax let alt = geolocationcoordinatesinstance.altitude value a double representing the altitude of the position in meters, relative to sea level. specifications specification status comment geolocation apithe definition of 'coordinates.altitude' in that specification. recommendation initial definition ...
GeolocationCoordinates.latitude - Web APIs
the geolocationcoordinates.latitude read-only property is a double representing the latitude of the position in decimal degrees. syntax let lat = geolocationcoordinatesinstance.latitude value a double representing the latitude of the position in decimal degrees. specifications specification status comment geolocation apithe definition of 'geolocationcoordinates.latitude' in that specification. recommendation initial specification. ...
GeolocationCoordinates - Web APIs
the geolocationcoordinates interface represents the position and altitude of the device on earth, as well as the accuracy with which these properties are calculated. properties the geolocationcoordinates interface doesn't inherit any properties. geolocationcoordinates.latitude read only secure context returns a double representing the position's latitude in decimal degrees. geolocationcoordinates.longitude read only secure context returns a double representing the position's longitude in decimal degrees. geolocationcoordinates.altitude read only secure context returns a double representing the position's altitude in meters, relative to sea level. this value can be null if the implementation cannot provide the data. geolocationcoordinates.accuracy read only secure context ...
GlobalEventHandlers.onclick - Web APIs
"; document.getelementbyid('demo').style = "color: red"; } result getting the coordinates of clicks this example displays the coordinates at which the most recent mouse button click occurred. html <p>click anywhere in this example.</p> <p id="log"></p> javascript let log = document.getelementbyid('log'); document.onclick = inputchange; function inputchange(e) { log.textcontent = `position: (${e.clientx}, ${e.clienty})`; } result specification specification status comment html living standardthe definition of 'onclick' in that specification. living standard ...
GlobalEventHandlers.onmousedown - Web APIs
sole argument. example this example reveals part of an image when you press and hold a mouse button. it uses the onmousedown, onmouseup, and onmousemove event handlers. ...
GlobalEventHandlers.onmousemove - Web APIs
ion expression. the function receives a mouseevent object as its sole argument. examples tooltips this example creates link tooltips that follow your mouse. it uses the onmousemove, onmouseover, and onmouseout event handlers. ...
HTMLElement: pointermove event - Web APIs
changes coordinates, and the pointer has not been canceled by a browser touch-action. bubbles yes cancelable yes interface pointerevent event handler property onpointermove usage notes the event, which is of type pointerevent, provides all the information you need to know about the user's interaction with the pointing device, including the position, movement distance, button states, and much more. examples to add a handler for pointermove events using addeventlistener(): const para = document.queryselector('p'); para.addeventlistener('pointermove', (event) => { console.log('pointer moved'); }); you can also use the onpointermove event handler property: const para = document.queryselector('p'); para.onpointermove = (event) => { co...
HTMLImageElement.align - Web APIs
you should instead use the css propertiy vertical-align, which does in fact also work on images despite its name. you can also use the float property to float the image to the left or right margin. the align property reflects the html align content attribute. syntax htmlimageelement.align = alignmode; alignmode = htmlimageelement.align; value a domstring specifying one of the following strings which set the alignment mode for the image. baseline alignment these three values specify the alignment of the element relative to the text baseline. ...
HTMLImageElement.loading - Web APIs
any lazy-loaded images located in the visual viewport may not yet be visible. 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. to prevent this reflow from occurring, you should explicitly specify the size of the image's presentation using the image element's width and height attributes. by establishing the intrinsic aspect ratio in this manner, you prevent elements from shifting around while the document loads, which can be disconcerting or offp...
HTMLInputElement.setSelectionRange() - Web APIs
optionally, in newer browser versions, you can specify the direction in which selection should be considered to have occurred. 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. this method updates the htmlinputelement.selectionstart, selectionend, and selectiondirection properties in one call. 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. ...
HTMLMediaElement.currentTime - Web APIs
perty specifies the current playback time in seconds. changing the value of currenttime this value seeks the media to the new time. syntax var currenttime = htmlmediaelement.currenttime; htmlmediaelement.currenttime = 35; value a double-precision floating-point value indicating the current playback time in seconds. if the media is not yet playing, the value of currenttime indicates the time position within the media at which playback will begin once the play() method is called. setting currenttime to a new value seeks the media to the given time, if the media is available. for media without a known duration—such as media being streamed live—it's possible that the browser may not be able to obtain parts of the media that have expired from the media buffer. also, media whose timeline doe...
HTMLMediaElement.fastSeek() - Web APIs
the htmlmediaelement.fastseek() method quickly seeks the media to the new time with precision tradeoff. note: if you need to seek with precision, you should set htmlmediaelement.currenttime instead. syntax htmlmediaelement.fastseek(time); parameters time a double. return value none. example this example quickly seeks to 20-second position of the video element. let myvideo = document.getelementbyid("myvideoelement"); myvideo.fastseek(20); specifications specification status comment html living standardthe definition of 'fastseek()' in that specification. living standard initial definition; living specification. ...
HTMLMediaElement.initialTime - Web APIs
this property is obsolete, you can use a media fragments uri in the htmlmediaelement.src attribute instead. syntax ... value a double. example ... ...
HTMLMediaElement.load() - Web APIs
n begin. pending play promises are aborted with an "aborterror" domexception. appropriate events will be sent to the media element itself as the load process proceeds: if the element is already in the process of loading media, that load process is aborted and the abort event is sent. if the element has already been initialized with media, the emptied event is sent. if resetting the playback position to the beginning of the media actually changes the playback position (that is, it was not already at the beginning), a timeupdate event is sent. once media has been selected and loading is ready to begin, the loadstart event is delivered. from this point onward, events are sent just like any media load. example this example finds a <video> element in the document and resets it by calling loa...
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. examples these examples add an event listener for the htmlmediaelement's loadeddata event, then post a message when that event handler has reacted to the event firing. ...
HTMLMediaElement.seekToNextFrame() - Web APIs
this non-standard method is part of an experimentation process around support for non-real-time access to media for tasks including filtering, editing, and so forth. you should not use this method in production code, because its implementation may change—or be removed outright—without notice. you are, however, invited to experiment with it. this method lets you access frames of video media without the media being performed in real time. ...
HTMLSelectElement.item() - Web APIs
in javascript, using the array bracket syntax with an unsigned long, like selectelt[index] is equivalent to selectelt.nameditem(index). syntax var item = collection.item(index); var item = collection[index]; parameters index is an unsigned long. return value item is a htmloptionelement. ...
HTMLTableRowElement.rowIndex - Web APIs
even when the <thead>, <tbody>, and <tfoot> elements are out of order in the html, browsers render the table in the right order. therefore the rows count from <thead> to <tbody>, from <tbody> to <tfoot>. syntax var index = htmltablerowelement.rowindex value returns the index of the row, or -1 if the row is not part of a table. example this example uses javascript to label all the row numbers in a table. ...
msSetVideoRectangle - Web APIs
re may also be large incompatibilities between implementations and the behavior may change in the future. the htmlvideoelement.mssetvideorectangle() method sets the dimensions of a sub-rectangle within a video. this proprietary method is specific to internet explorer and microsoft edge. syntax htmlvideoelement.mssetvideorectangle(); parameters left a number representing left-side position. top a number representing top position. right a number representing right-side position. bottom a number representing bottom position. return value this method does not return a value. example htmlvideoelement.mssetvideorectangle(left: 2, top: 0, right: 4, bottom: 4); see also htmlvideoelement microsoft api extensions ...
The HTML DOM API - Web APIs
the structural features implemented by the node interface are also available to html elements, allowing them to be nested within each other, created and deleted, moved around, and so forth. the htmlelement interface is generic, however, providing only the functionality common to all html elements such as the element's id, its coordinates, the html making up the element, information about scroll position, and so forth. in order to expand upon the functionality of the core htmlelement interface to provide the features needed by a specific element, the htmlelement class is subclassed to add the needed properties and methods. for example, the <canvas> element is represented by an object of type htmlcanvaselement. htmlcanvaselement augments the htmlelement type by adding properties such as height an...
Drag Operations - Web APIs
type can provide data with more details for use within the application whereas the other types can include just a single url or text version. note that both the text/uri-list and text/plain contain the same data in this example. this will often be true, but doesn't need to be the case. if you attempt to add data twice with the same format, the new data will replace the old data, but in the same position within the list of types as the old data. you can clear the data using the cleardata() method, which takes one argument: the type of the data to remove. event.datatransfer.cleardata("text/uri-list"); the type argument to the cleardata() method is optional. if the type is not specified, the data associated with all types is removed. if the drag contains no drag data items, or all of the items ...
Dragging and Dropping Multiple Items - Web APIs
ou to add multiple items during a dragstart event. this function similarly to setdata() var dt = event.datatransfer; dt.mozsetdataat("text/plain", "data to drag", 0); dt.mozsetdataat("text/plain", "second data to drag", 1); this example adds two items to be dragged. the last argument specifies the index of the item to add. you should add them in order starting with 0 as you cannot add items at positions farther than the last item, however you can replace existing items by using indices you have already added. using 0 as the index is equivalent to calling setdata(). you can clear an item using the mozcleardataat() method. event.datatransfer.mozcleardataat("text/plain", 1); caution: removing the last format for a particular index will remove that item entirely, shifting the remaining items do...
History.go() - Web APIs
Web › API › History › go
the history.go() method loads a specific page from the session history. you can use it to move forwards and backwards through the history depending on the value of a parameter. this method is asynchronous. add a listener for the popstate event in order to determine when the navigation has completed. syntax history.go([delta]) parameters delta optional the position in the history to which you want to move, relative to the current page. a negative value moves backwards, a positive value moves forwards. so, for example, history.go(2) moves forward two pages and history.go(-2) moves back two pages. if no value is passed or if delta equals 0, it has the same result as calling location.reload(). examples to move back one page (the equivalent of calling back()): history.go(-1) to move forwa...
Ajax navigation example - Web APIs
it is shared between all ajax pages.</p> include/before_content.php:...
History API - Web APIs
move backward through history: window.history.back() this acts exactly as if the user clicked on the back button in their browser toolbar. similarly, you can move forward (as if the user clicked the forward button), like this: window.history.forward() moving to a specific point in history you can use the go() method to load a specific page from session history, identified by its relative position to the current page. (the current page's relative position is 0.) to move back one page (the equivalent of calling back()): window.history.go(-1) to move forward a page, just like calling forward(): window.history.go(1) similarly, you can move forward 2 pages by passing 2, and so forth. another use for the go() method is to refresh the current page by either passing 0, or by invoking it w...
IDBCursor.advance() - Web APIs
Web › API › IDBCursor › advance
note: this feature is available in web workers. syntax cursor.advance(count); parameters count the number of times to move the cursor forward. exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbcursor's transaction is inactive. typeerror the value passed into the count parameter was zero or a negative number. invalidstateerror the cursor is currently being iterated or has iterated past its end. ...
IDBCursor.delete() - Web APIs
Web › API › IDBCursor › delete
once the record is deleted, the cursor's value is set to null. be aware that you can't call delete() (or idbcursor.update()) on cursors obtained from idbindex.openkeycursor(). for such needs, you have to use idbindex.opencursor() instead. note: this feature is available in web workers. syntax myidbcursor.delete(); returns an idbrequest object on which subsequent events related to this operation are fired. the result attribute is set to undefined. ...
IDBCursor.key - Web APIs
Web › API › IDBCursor › key
if the cursor is outside its range, this is set to undefined. the cursor's key can be any data type. note: this feature is available in web workers. syntax var key = cursor.key; value a value of any type. example in this simple fragment we create a transaction, retrieve an object store, then use a cursor to iterate through all the records in the object store. within each iteration we log the key of the cursor to the console, something like this (its the album title in each case, which is our key). ...
IDBIndex.openCursor() - Web APIs
if the key range is not specified or is null, then the range includes all the records. a success event is always fired on the result object. 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. ...
IDBIndex.openKeyCursor() - Web APIs
if the key range is not specified or is null, then the range includes all the keys. a success event is always fired on the result object. ...
Basic concepts - Web APIs
nd execute at the same time. on the other hand, the scopes of writing transactions cannot overlap. you can still start several transactions with the same scope at the same time, but they just queue up and execute one after another. cursor a mechanism for iterating over multiple records with a key range. the cursor has a source that indicates which index or object store it is iterating. it has a position within the range, and moves in a direction that is increasing or decreasing in the order of record keys. for the reference documentation on cursors, see idbcursor. key range a continuous interval over some data type used for keys. records can be retrieved from object stores and indexes using keys or a range of keys. you can limit or filter the range using lower and upper bounds. for example, ...
InputEvent() - Web APIs
data: (optional) a string containing characters to insert. this may be an empty string if the change doesn't insert text (such as when deleting characters, for example). datatransfer: (optional) a datatransfer object containing information about richtext or plaintext data being added to or removed from editible content. iscomposing: (optional) a boolean indicating that the event is part of a composition session, meaning it is after a compositionstart event but before a compositionend event. the default is false. ranges: (optional) an array of static ranges that will be affected by a change to the dom if the input event is not canceled. the inputeventinit dictionary also accepts fields from uieventinit and from eventinit dictionaries. ...
InputEvent.isComposing - Web APIs
the inputevent.iscomposing read-only property returns a boolean value indicating if the event is fired after compositionstart and before compositionend. syntax var bool = event.iscomposing; example var inputevent = new inputevent('syntheticinput', false); console.log(inputevent.iscomposing); // return false specifications specification status comment document object model (dom) level 3 events specificationthe definition of 'inputevent.iscomposing' in that specification. obsolete initial definition. ...
KeyboardEvent.isComposing - Web APIs
syntax var bool = event.iscomposing; example var kbdevent = new keyboardevent("synthetickey", false); console.log(kbdevent.iscomposing); // return false specifications specification status comment ui eventsthe definition of 'keyboardevent.prototype.iscomposing' in that specification. ...
KeyframeEffect.setKeyframes() - Web APIs
e keyframe object looks like so: let rotate360 = [ { transform: 'rotate(360deg)' } ]; we have only specified the end state of the animation, and the beginning state is implied. attributes keyframes may specify property-value pairs for any of the animatable css properties. the property names are specified using camel-case so for example background-color becomes backgroundcolor and background-position-x becomes backgroundpositionx. shorthand values such as margin are also permitted. two exceptional css properties are: float, which must be written as cssfloat since "float" is a reserved word in javascript. it's just for reference here, this will have no effect on animation since "float" is not an animatable css property. offset, which must be written as cssoffset since "offset" represents ...
LayoutShiftAttribution - Web APIs
the layoutshiftattribution interface of the layout instability api provides debugging information about elements which have shifted. properties layoutshiftattribution.node returns the element that has shifted (null if it has been removed). layoutshiftattribution.previousrect returns a domrect representing the position of the element before the shift. layoutshiftattribution.currentrect returns a domrect representing the position of the element after the shift. specifications specification status comment layout instability apithe definition of 'layoutshiftattribution' in that specification. editor's draft initial definition. ...
LockedFile.location - Web APIs
non-standard this feature is non-standard and is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. summary the location property is a zero-based index representing the position of the read/write pointer within the file. its value indicates at which bytes within the file any write or read operation will start. this value is changed automatically after every read and write operation. the special value null means end-of-file. this property can be changed at will. syntax var location = instanceoflockedfile.location value a number. specifications specification status comment ...
LockedFile.readAsArrayBuffer() - Web APIs
t work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. summary the readasarraybuffer method is used to read the content of the lockedfile object and provide the result of that reading as an arraybuffer. in many ways, it performs like the filereader.readasarraybuffer() method. the reading operation starts at the position given by the lockedfile.location property. syntax var request = instanceoflockedfile.readasarraybuffer(size); parameters size a number representing the number of bytes to read in the file. return a filerequest object to handle the success or failure of the operation. in case of success, the request's result is an arraybuffer representing the data that have been read. specifications ...
LockedFile.readAsText() - Web APIs
the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. summary the readastext method is used to read the content of the lockedfile object and provide the result of that reading as a string. in many ways, it performs like the filereader.readastext() method. the reading operation starts at the position given by the lockedfile.location property. syntax var request = instanceoflockedfile.readastext(size[, encoding]); parameters size a number representing the number of bytes to read in the file. encoding optional a string indicating the encoding to use for the returned data. by default, utf-8 is assumed if this parameter is not specified. return a filerequest object to handle the succe...
LockedFile.write() - Web APIs
Web › API › LockedFile › write
non-standard this feature is non-standard and is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. summary the write method is used to write some data within the file. the write starts at the position set in lockedfile.location and moves that position by the number of written bytes. syntax var request = instanceoflockedfile.write(data); parameters data the data to write into the file. it can be a string or an arraybuffer. return a filerequest object to handle the success or failure of the operation. specifications specification status comment filesystem api edit...
LockedFile - Web APIs
terface provides tools to deal with a given file with all the necessary locks. properties lockedfile.filehandle read only the filehandle object from which the lock was opened. lockedfile.mode read only the mode for accessing the file; can be readonly or readwrite. lockedfile.active read only a flag indicating if the file can be accessed (true) or not (false). lockedfile.location the position of the reading/writing pointer within the file. events handler lockedfile.oncomplete the complete event is triggered each time a read or write operation is successful. lockedfile.onabort the abort event is triggered each time the abort() method is called. lockedfile.onerror the error event is triggered each time something goes wrong. methods lockedfile.getmetadata() allows to retr...
MediaElementAudioSourceNode - Web APIs
rcenode. methods inherits methods from its parent, audionode. example this simple example creates a source from an <audio> element using createmediaelementsource(), then passes the audio through a gainnode before feeding it into the audiodestinationnode for playback. when the mouse pointer is moved, the updatepage() function is invoked, which calculates the current gain as a ratio of mouse y position divided by overall window height. you can therefore increase and decrease the volume of the playing music by moving the mouse pointer up and down. note: you can also view this example running live, or view the source. var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); var myaudio = document.queryselector('audio'); var pre = document.queryselector('pre'); var myscript = d...
MediaSession.setActionHandler() - Web APIs
ese in order to allow that type of action to be performed. the following strings identify the currently available types of media session action: nexttrack advances playback to the next track. pause pauses playback of the media. play begins (or resumes) playback of the media. previoustrack moves back to the previous track. seekbackward seeks backward through the media from the current position. seekforward seeks forward from the current position through the media. seekto moves the playback position to the specified time within the media. skipad skips past the currently playing advertisement or commercial. this action may or may not be available, depending on the platform and user agent, or may be disabled due to subscription level or other circumstances. stop halts playback ent...
MediaSession - Web APIs
nterface. properties metadata returns an instance of mediametadata which contains rich media metadata, for display in a platform ui. playbackstate indicates whether the current media session is playing. valid values are none, paused, or playing. methods setactionhandler() sets an event handler for a media session action, such as play or pause. see the method page for a full list. 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: "podcas...
Media Session action types - Web APIs
ese in order to allow that type of action to be performed. the following strings identify the currently available types of media session action: nexttrack advances playback to the next track. pause pauses playback of the media. play begins (or resumes) playback of the media. previoustrack moves back to the previous track. seekbackward seeks backward through the media from the current position. the mediasessionactiondetails property seekoffset specifies the amount of time to seek backward. seekforward seeks forward from the current position through the media. the mediasessionactiondetails property seekoffset specifies the amount of time to seek forward. seekto moves the playback position to the specified time within the media. the time to which to seek is specified in the mediasess...
MediaSessionActionDetails.action - Web APIs
}; let actiontype = mediasessionactiondetails.action; value a domstring specifying which of the action types the callback is being invoked for: nexttrack advances playback to the next track. pause pauses playback of the media. play begins (or resumes) playback of the media. previoustrack moves back to the previous track. seekbackward seeks backward through the media from the current position. seekforward seeks forward from the current position through the media. seekto moves the playback position to the specified time within the media. skipad skips past the currently playing advertisement or commercial. this action may or may not be available, depending on the platform and user agent, or may be disabled due to subscription level or other circumstances. stop halts playback ent...
MediaSessionActionDetails.seekOffset - Web APIs
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. this is typically in the range of five to ten seconds. specifications specification status comment media session standardthe definition of 'mediasessionactiondetails.seekoffset' in that specification. draft initial definition. ...
MediaSessionActionDetails.seekTime - Web APIs
the mediasessionactiondetails dictionary's seektime property is always included when a seekto action is sent to the action handler callback. its value is the absolute time, in seconds, to move the current play position to. to change the time by an offset rather than moving to an absolute time, the seekforward or seekbackward actions should be used instead. syntax let mediasessionactiondetails = { seektime: abstimeinseconds }; let abstime = mediasessionactiondetails.seektime; value a floating-point value indicating the absolute time in seconds into the media to which to move the current play position. 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 ...
Media Session API - Web APIs
ediametadata allows a web page to provide rich media metadata, for display in a platform ui. mediasession allows a web page to provide custom behaviors, for standard media playback interactions. dictionaries mediaimage a mediaimage object contains information describing an image associated with the media. this might be a cd or dvd cover, a movie poster, a poster frame, or the like. 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. mediasessionactiondetails provides information needed in order to perform the action which has been requested, including the type of action to perform and ...
MouseEvent.clientX - Web APIs
crolled horizontally. syntax var x = instanceofmouseevent.clientx return value a double floating point value, as redefined by the cssom view module. originally, this property was defined as a long integer. see the "browser compatibility" section for details. example this example displays your mouse's coordinates whenever you trigger the mousemove event. ...
MouseEvent.clientY - Web APIs
scrolled vertically. syntax var y = instanceofmouseevent.clienty return value a double floating point value, as redefined by the cssom view module. originally, this property was defined as a long integer. see the "browser compatibility" section for details. example this example displays your mouse's coordinates whenever you trigger the mousemove event. ...
MouseEvent.screenX - Web APIs
global (screen) coordinates. syntax var x = instanceofmouseevent.screenx return value a double floating point value. early versions of the spec defined this as an integer referring to the number of pixels. see the "browser compatibility" section for details. example this example displays your mouse's coordinates whenever you trigger the mousemove event. ...
MouseEvent.screenY - Web APIs
global (screen) coordinates. syntax var y = instanceofmouseevent.screeny return value a double floating point value. early versions of the spec defined this as an integer referring to the number of pixels. see the "browser compatibility" section for details. example this example displays your mouse's coordinates whenever you trigger the mousemove event. ...
msSaveBlob - Web APIs
urned as long as the download notification bar is displayed, or false if a failure occured. notes when a site calls this method, the behavior is the same as when windows internet explorer downloads a file with the following in the header, where x-download-options removes the file open button from the browser file download dialog: content-length: <blob.size> content-type: <blob.type> content-disposition: attachment;filename=<defaultname> x-download-options: noopen specifications not part of any specifications. ...
msSaveOrOpenBlob - Web APIs
ed. defaultname the file name to be used when saving file. return value true is returned as long as the download notification bar is displayed, or false if a failure occurred. notes when a site calls this method, the behavior is the same as when windows internet explorer downloads a file with the following in the header: content-length: <blob.size> content-type: <blob.type> content-disposition: attachment;filename=<defaultname> specifications not part of any specifications. ...
Online and offline events - Web APIs
event) { var condition = navigator.online ? ...
Node.appendChild() - Web APIs
Web › API › Node › appendChild
the node.appendchild() method adds a node to the end of the list of children of a specified parent node. if the given child is a reference to an existing node in the document, appendchild() moves it from its current position to the new position (there is no requirement to remove the node from its parent node before appending it to some other node). this means that a node can't be in two points of the document simultaneously. so if the node already has a parent, the node is first removed, then appended at the new position. the node.clonenode() method can be used to make a copy of the node before appending it under the new parent. note that the copies made with clonenode will not be automatically kept in sync. if the given child is a documentfragment, the entire contents of the documentfragment a...
Node.insertBefore() - Web APIs
Web › API › Node › insertBefore
(that is, it will automatically be removed from its existing parent before appending it to the specified new parent.) this means that a node cannot be in two locations of the document simultaneously. note: the node.clonenode() can be used to make a copy of the node before appending it under the new parent. ...
NodeIterator.nextNode() - Web APIs
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. in old browsers, as specified in old versions of the specifications, the method may throws the invalid_state_err domexception if this method is called after the nodeiterator.detach()method. recent browsers never throw. ...
NodeIterator.previousNode() - Web APIs
this method returns null when the current node is the first node in the set. in old browsers, as specified in old versions of the specifications, the method may throws the invalid_state_err domexception if this method is called after the nodeiterator.detach()method. recent browsers never throw. ...
OVR_multiview2 - Web APIs
xt.framebuffertexturemultiviewovr(gl.draw_framebuffer, gl.depth_stencil_attachment, depthstenciltex, 0, 0, 2); gl.drawelements(...); // draw will be broadcasted to the layers of colortex and depthstenciltex. shader code #version 300 es #extension gl_ovr_multiview2 : require precision mediump float; layout (num_views = 2) in; in vec4 inpos; uniform mat4 u_viewmatrices[2]; void main() { gl_position = u_viewmatrices[gl_viewid_ovr] * inpos; } specifications specification status ovr_multiview2 community approved ...
PannerNode.coneInnerAngle - Web APIs
n the sound is rotated // by between 15 (30/2) and 22.5 (45/2) degrees either direction, // the volume will decrease gradually panner.coneouterangle = 45; // this value determines the volume of the sound outside of both inner and outer cone // setting it to 0 means there is no sound, so we can clearly hear when we leave the cone // 0 is also the default panner.coneoutergain = 0; // increase the z position to ensure the cone has an effect // (otherwise the sound is located at the same position as the listener) panner.positionz.setvalueattime(1, context.currenttime); having set up the pannernode, we can now schedule some updates to its y-axis rotation: // calculate the vector for no rotation // this means the sound will play at full volume const [x1, y1, z1] = yrotationtovector(0); // schedule the...
PannerNode.coneOuterAngle - Web APIs
n the sound is rotated // by between 15 (30/2) and 22.5 (45/2) degrees either direction, // the volume will decrease gradually panner.coneouterangle = 45; // this value determines the volume of the sound outside of both inner and outer cone // setting it to 0 means there is no sound, so we can clearly hear when we leave the cone // 0 is also the default panner.coneoutergain = 0; // increase the z position to ensure the cone has an effect // (otherwise the sound is located at the same position as the listener) panner.positionz.setvalueattime(1, context.currenttime); having set up the pannernode, we can now schedule some updates to its y-axis rotation: // calculate the vector for no rotation // this means the sound will play at full volume const [x1, y1, z1] = yrotationtovector(0); // schedule the...
PannerNode.coneOuterGain - Web APIs
n the sound is rotated // by between 15 (30/2) and 22.5 (45/2) degrees either direction, // the volume will decrease gradually panner.coneouterangle = 45; // this value determines the volume of the sound outside of both inner and outer cone // setting it to 0 means there is no sound, so we can clearly hear when we leave the cone // 0 is also the default panner.coneoutergain = 0; // increase the z position to ensure the cone has an effect // (otherwise the sound is located at the same position as the listener) panner.positionz.setvalueattime(1, context.currenttime); having set up the pannernode, we can now schedule some updates to its y-axis rotation: // calculate the vector for no rotation // this means the sound will play at full volume const [x1, y1, z1] = yrotationtovector(0); // schedule the...
PannerNode.refDistance - Web APIs
raph 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); // this tone should d...
PannerNode.rolloffFactor - Web APIs
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 should decay slower than...
PerformanceEventTiming - Web APIs
the performanceeventtiming interface of the event timing api provides timing information for the event types listed below. auxclick beforeinput click compositionend compositionstart compositionupdate contextmenu dblclick dragend dragenter dragleave dragover dragstart drop input keydown keypress keyup mousedown mouseenter mouseleave mouseout mouseover mouseup pointerover pointerenter pointerdown pointerup pointercancel pointerout pointerleave gotpointercapture lostpointercapture touchstart touchend touchcancel properties performanceeventtiming.processingstart returns the time at which event dispatch started. performanceeventtiming.processingend returns the time at which the event dispatch ended. performanceeventtiming.cancelable returns the ...
Point - Web APIs
Web › API › Point
the css transforms level 1 specification, which represents a point in 2-dimensional space. it is non-standard, not broadly compatible, and should not be used. although it is not directly related to this defunct interface, you are probably looking for dompoint, which is part of the geometry interfaces module level 1 specification. properties x a floating-point value specifying the point's position with respect to the x (horizontal) axis. y a floating-point value specifying the point's position with respect to the y (vertical) axis. specifications this class was specified in the defunct 20 march 2009 working draft of css 2d transforms module level 3. it is not present in the current working draft of the css transforms level 1 specification. ...
PointerEvent.tangentialPressure - Web APIs
the tangentialpressure read-only property of the pointerevent interface represents the normalized tangential pressure of the pointer input (also known as barrel pressure or cylinder stress). syntax var tanpressure = pointerevent.tangentialpressure; return value a float representing the normalized tangential pressure of the pointer input in the range -1 to 1, inclusive, where 0 is the neutral position of the control. note that some hardware may only support positive values in the range 0 to 1. for hardware that does not support tangential pressure, the value will be 0. example in this snippet, when a pointerdown event is fired, different functions are called depending on the value of the event's tangentialpressure property. someelement.addeventlistener('pointerdown', function(event) { if...
PointerEvent - Web APIs
revent.pressure read only the normalized pressure of the pointer input in the range 0 to 1, where 0 and 1 represent the minimum and maximum pressure the hardware is capable of detecting, respectively. pointerevent.tangentialpressure read only the normalized tangential pressure of the pointer input (also known as barrel pressure or cylinder stress) in the range -1 to 1, where 0 is the neutral position of the control. pointerevent.tiltx read only the plane angle (in degrees, in the range of -90 to 90) between the y–z plane and the plane containing both the pointer (e.g. pen stylus) axis and the y axis. pointerevent.tilty read only the plane angle (in degrees, in the range of -90 to 90) between the x–z plane and the plane containing both the pointer (e.g. pen stylus) axis and the x axi...
Pointer events - Web APIs
the contact geometry of the pointer. pressure the normalized pressure of the pointer input in the range of 0 to 1, where 0 and 1 represent the minimum and maximum pressure the hardware is capable of detecting, respectively. tangentialpressure the normalized tangential pressure of the pointer input (also known as barrel pressure or cylinder stress) in the range -1 to 1, where 0 is the neutral position of the control. tiltx the plane angle (in degrees, in the range of -90 to 90) between the y–z plane and the plane containing both the pointer (e.g. pen stylus) axis and the y axis. tilty the plane angle (in degrees, in the range of -90 to 90) between the x–z plane and the plane containing both the pointer (e.g. pen stylus) axis and the x axis. twist the clockwise rotation of the pointer...
RTCDataChannel.onbufferedamountlow - Web APIs
presenting the event which has occurred. example this example responds to the bufferedamountlow event by fetching up to 64kb of a file represented by an object source and calling rtcdatachannel.send() to queue up the retrieved data for sending on the data channel. pc = new rtcpeerconnection(); dc = pc.createdatachannel("sendfile"); /* ... */ dc.onbufferedamountlow = function() { if (source.position <= source.length) { dc.send(source.readfile(65536)); } } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcdatachannel.onbufferedamountlow' in that specification. candidate recommendation initial specification. ...
Range() - Web APIs
Web › API › Range › Range
we then select the range using window.getselection() and selection.addrange(). ...
Range.collapsed - Web APIs
Web › API › Range › collapsed
it returns true if the start and end boundary points of the range are the same point in the dom, false if not. a collapsed range is empty (containing no content), and specifies a single point in a dom tree. to collapse a range, see the range.collapse() method. ...
Range.commonAncestorContainer - Web APIs
range.startcontainer and range.endcontainer both refer to the same node, this node is the common ancestor container. since a range need not be continuous, and may also partially select nodes, this is a convenient way to find a node which encloses a range. this property is read-only. 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(). syntax rangeancestor = range.commonancestorcontainer; example in this example, we create an event listener to handle pointerup events on a list. the listener gets the common ancestors of each piece of selected text, and triggers an animation to highlight them. html <ul> <li>strings <ul> <li>cello</li> <li>violin ...
Range.compareNode() - Web APIs
Web › API › Range › compareNode
the possible values are: node_before (0) node starts before the range node_after (1) node ends after the range node_before_and_after (2) node starts before and ends after the range node_inside (3) node starts after and ends before the range, i.e. ...
Range.endContainer - Web APIs
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. living standard no change. ...
Range.isPointInRange() - Web APIs
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. ...
Range.setEndAfter() - Web APIs
Web › API › Range › setEndAfter
the parent node of end of the range will be the same as that for the referencenode. 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. living standard no change. document object model (dom) level 2 traversal and range specificationthe definition of 'range.setendafter()' in that specification. ...
Range.setEndBefore() - Web APIs
the parent node of end of the range will be the same as that for the referencenode. 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. living standard no change. document object model (dom) level 2 traversal and range specificationthe definition of 'range.setendbefore()' in that specification. ...
Range.setStartAfter() - Web APIs
the parent node of the start of the range will be the same as that for the referencenode. 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. living standard no change. ...
Range.setStartBefore() - Web APIs
the parent node of the start of the range will be the same as that for the referencenode. 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. living standard no change. ...
Range.startContainer - Web APIs
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. living standard no change. ...
SVGGraphicsElement: paste event - Web APIs
ugh the browser's user interface. 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. a handler for this event can access the clipboard contents by calling getdata() on the event's clipboarddata property. to override the default behavior (for example to insert some different data or a transformation of the clipboard contents) an event handler must cancel the default action using event.preventdefault(), and then insert its desired data manually. it's possible to construct and d...
SVGLengthList - Web APIs
tem are immediately reflected in the list. the first item is number 0. exceptions: a domexception with code no_modification_allowed_err is raised when the list corresponds to a read only attribute or when the object itself is read only. insertitembefore(in svglength newitem, in unsigned long index) svglength inserts a new item into the list at the specified position. the first item is number 0. if newitem is already in a list, it is removed from its previous list before it is inserted into this list. the inserted item is the item itself and not a copy. if the item is already in this list, note that the index of the item to insert before is before the removal of the item. if the index is equal to 0, then the new item is inserted at the front of the list. if t...
SVGNumberList - Web APIs
re immediately reflected in the list. the first item is number 0. exceptions: a domexception with code no_modification_allowed_err is raised when the list corresponds to a read only attribute or when the object itself is read only. insertitembefore(in svgnumber newitem, in unsigned long index) svgnumber inserts a new item into the list at the specified position. the first item is number 0. if newitem is already in a list, it is removed from its previous list before it is inserted into this list. the inserted item is the item itself and not a copy. if the item is already in this list, note that the index of the item to insert before is before the removal of the item. if the index is equal to 0, then the new item is inserted at the front of the ...
SVGPathSegList - Web APIs
e first item is number 0. exceptions: a domexception with code no_modification_allowed_err is raised when the list cannot be modified. insertitembefore(in svgpathseg newitem, in unsigned long index) svgpathseg inserts a new item into the list at the specified position. the first item is number 0. if newitem is already in a list, it is removed from its previous list before it is inserted into this list. the inserted item is the item itself and not a copy. if the item is already in this list, note that the index of the item to insert before is before the removal of the item. if the index is equal to 0, then the new item is inserted at the...
SVGPointList - Web APIs
ber 0. exceptions: a domexception with code no_modification_allowed_err is raised when the list corresponds to a read only attribute or when the object itself is read only. insertitembefore(in svgpoint newitem, in unsigned long index) svgpoint inserts a new item into the list at the specified position. the first item is number 0. if newitem is already in a list, it is removed from its previous list before it is inserted into this list. the inserted item is the item itself and not a copy. if the item is already in this list, note that the index of the item to insert before is before the removal of the item. if the index is equal to 0, then the new item is inserted at the front of the list. if t...
The 'X' property - Web APIs
usage context name x value <length> | <percentage> initial 0 applies to <mask> , ‘svg’, ‘rect’, ‘image’, ‘foreignobject’ inherited no percentages refer to the size of the current viewport (see units) media visual computed value absolute length or percentage animatable yes simple usage a <coordinate> is a length in the user coordinate system that is the given distance from the origin of the user coordinate system along the relevant axis (the x-axis for x coordinates, the y-axis for y coordinates). ...
SVGStringList - Web APIs
re immediately reflected in the list. the first item is number 0. exceptions: a domexception with code no_modification_allowed_err is raised when the list corresponds to a read only attribute or when the object itself is read only. insertitembefore(in domstring newitem, in unsigned long index) domstring inserts a new item into the list at the specified position. the first item is number 0. if newitem is already in a list, it is removed from its previous list before it is inserted into this list. the inserted item is the item itself and not a copy. if the item is already in this list, note that the index of the item to insert before is before the removal of the item. if the index is equal to 0, then the new item is inserted at the front of the list. if t...
SVGTransformList - Web APIs
ediately reflected in the list. the first item is number 0. exceptions: a domexception with code no_modification_allowed_err is raised when the list corresponds to a read only attribute or when the object itself is read only. insertitembefore(in svgtransform newitem, in unsigned long index) svgtransform inserts a new item into the list at the specified position. the first item is number 0. if newitem is already in a list, it is removed from its previous list before it is inserted into this list. the inserted item is the item itself and not a copy. if the item is already in this list, note that the index of the item to insert before is before the removal of the item. if the index is equal to 0, then the new item is inserted at the front of the list. if t...
Screen.availHeight - Web APIs
e, on a mac whose dock is located at the bottom of screen (which is the default), the value of availheight is approximately the value of height (the total height of the screen in css pixels) minus the heights of the dock and menu bar, as seen in the diagram below. example if your web application needs to open a new window, such as a tool palette which can contain multiple panels, and wants to position it so that it occupies the entire vertical space available, you can do so using code similar to what's seen here. in the main window, when it's time to open the panels, code like the following is used. let palettewindow = window.open("panels.html", "panels", "left=0, top=0, width=200"); the panels window's html, in panels.html, has javascript code of its own, which is executed as soon as the w...
ScrollToOptions.behavior - Web APIs
ted by scrolltooptions. syntax behavior: scrollbehavior value an enum, the value of which can be one of the following: smooth: the scrolling animates smoothly. auto: the scrolling happens in a single jump. examples in our scrolltooptions example (see it live) we include a form that allows the user to enter three values — two numbers representing the left and top properties (i.e. the positions to scroll to along the x and y axes), and a checkbox indicating whether they want smooth scrolling enabled or not. when the form is submitted, an event handler is run that puts the entered values into a scrolltooptions dictionary, and then invokes the window.scrollto() method, passing the dictionary as a parameter: form.addeventlistener('submit', (e) => { e.preventdefault(); var scrollopti...
ScrollToOptions.left - Web APIs
the left property of the scrolltooptions dictionary specifies the number of pixels along the x axis to scroll the window or element. syntax left: double value a double. examples in our scrolltooptions example (see it live) we include a form that allows the user to enter three values — two numbers representing the left and top properties (i.e. the positions to scroll to along the x and y axes), and a checkbox indicating whether they want smooth scrolling enabled or not. when the form is submitted, an event handler is run that puts the entered values into a scrolltooptions dictionary, and then invokes the window.scrollto() method, passing the dictionary as a parameter: form.addeventlistener('submit', (e) => { e.preventdefault(); var scrolloptions = { left: leftinput.value, t...
ScrollToOptions.top - Web APIs
the top property of the scrolltooptions dictionary specifies the number of pixels along the y axis to scroll the window or element. syntax top: double value a double. examples in our scrolltooptions example (see it live) we include a form that allows the user to enter three values — two numbers representing the left and top properties (i.e. the positions to scroll to along the x and y axes), and a checkbox indicating whether they want smooth scrolling enabled or not. when the form is submitted, an event handler is run that puts the entered values into a scrolltooptions dictionary, and then invokes the window.scrollto() method, passing the dictionary as a parameter: form.addeventlistener('submit', (e) => { e.preventdefault(); var scrolloptions = { left: leftinput.value, top...
ScrollToOptions - Web APIs
ltooptions.behavior specifies whether the scrolling should animate smoothly, or happen instantly in a single jump. this is actually defined on the scrolloptions dictionary, which is implemented by scrolltooptions. examples in our scrolltooptions example (see it live) we include a form that allows the user to enter three values — two numbers representing the left and top properties (i.e. the positions to scroll to along the x and y axes), and a checkbox indicating whether they want smooth scrolling enabled or not. when the form is submitted, an event handler is run that puts the entered values into a scrolltooptions dictionary, and then invokes the window.scrollto() method, passing the dictionary as a parameter: form.addeventlistener('submit', (e) => { e.preventdefault(); var scrollopti...
SecurityPolicyViolationEvent.SecurityPolicyViolationEvent() - Web APIs
ucted. this can include the following properties, but bear in mind that if you do include an eventinitdict, certain properties must be included (marked below with required): blockeduri: the blockeduri of the securitypolicyviolationevent. if not included, the default value is "". columnnumber: the columnnumber of the securitypolicyviolationevent. if not included, the default value is 0. disposition: the disposition of the securitypolicyviolationevent (required). documenturi: the documenturi of the securitypolicyviolationevent (required). effectivedirective: the effectivedirective of the securitypolicyviolationevent (required). linenumber: the linenumber of the securitypolicyviolationevent. if not included, the default value is 0. originalpolicy: the originalpolicy of the securitypol...
SecurityPolicyViolationEvent - Web APIs
tionevent() creates a new securitypolicyviolationevent object instance. properties securitypolicyviolationevent.blockeduriread only a usvstring representing the uri of the resource that was blocked because it violates a policy. securitypolicyviolationevent.columnnumberread only the column number in the document or worker at which the violation occurred. securitypolicyviolationevent.dispositionread only indicates how the violated policy is configured to be treated by the user agent. this will be "enforce" or "report". securitypolicyviolationevent.documenturiread only a usvstring representing the uri of the document or worker in which the violation was found. securitypolicyviolationevent.effectivedirectiveread only a domstring representing the directive whose enforcement uncovere...
Selection.extend() - Web APIs
Web › API › Selection › extend
the selection.extend() method moves the focus of the selection to a specified point. the anchor of the selection does not move. the selection will be from the anchor to the new focus, regardless of direction. 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. if not specified, the default value 0 is used. specifications specification status comment selection apithe definition of 'selection.extend()' in that specification. working draft current browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.c...
Selection.isCollapsed - Web APIs
keep in mind that a collapsed selection may still have one (or more, in gecko) ranges, so selection.rangecount may not be zero. ...
Selection.modify() - Web APIs
Web › API › Selection › modify
the selection.modify() method applies a change to the current selection or cursor position, using simple textual commands. syntax sel.modify(alter, direction, granularity) parameters alter the type of change to apply. specify "move" to move the current cursor position or "extend" to extend the current selection. direction the direction in which to adjust the current selection. you can specify "forward" or "backward" to adjust in the appropriate direction based on the language at the selection point. if you want to adjust in a specific direction, you can specify "left" or "right". granularity the distance to adjust the current selection or cursor position. you can move by "character", "word", "sentence", "line", "paragraph", "lineboundary", "sentenceboundary", "paragraphbound...
Selection.setBaseAndExtent() - Web APIs
. if the value is 1, the whole node minus the first child node is included. and so on. focusnode the node at the end of the selection. focusoffset the number of child nodes from the start of the focus node that should be included in the selection. so for example, if the value is 0 the whole node is excluded. if the value is 1, the first child node is included. and so on. note: if the focus position appears before the anchor position in the document, the direction of the selection is reversed — the caret is placed at the beginning of the text rather the end, which matters for any keyboard command that might follow. for example, shift + ➡︎ would cause the selection to narrow from the beginning rather than grow at the end. return value void. exceptions if anchoroffset is larger than...
ShadowRoot - Web APIs
ed into, or embedded in a document. methods the shadowroot interface includes the following methods defined on the documentorshadowroot mixin. note that this is currently only implemented by chrome; other browsers still implement them on the document interface. documentorshadowroot.getselection() returns a selection object representing the range of text selected by the user, or the current position of the caret. documentorshadowroot.elementfrompoint() returns the topmost element at the specified coordinates. documentorshadowroot.elementsfrompoint() returns an array of all elements at the specified coordinates. documentorshadowroot.caretpositionfrompoint() returns a caretposition object containing the dom node containing the caret, and caret's character offset within that node. examp...
SourceBufferList: indexed property getter - Web APIs
return value a sourcebuffer object. ...
SpeechRecognition.onresult - Web APIs
this code is excerpted from our speech color changer example. recognition.onresult = function(event) { // the speechrecognitionevent results property returns a speechrecognitionresultlist object // the speechrecognitionresultlist object contains speechrecognitionresult objects. // it has a getter so it can be accessed like an array // the first [0] returns the speechrecognitionresult at position 0. // each speechrecognitionresult object contains speechrecognitionalternative objects that contain individual results. // these also have getters so they can be accessed like arrays. // the second [0] returns the speechrecognitionalternative at position 0. // we then return the transcript property of the speechrecognitionalternative object var color = event.results[0][0].transcript; ...
SpeechRecognitionAlternative.confidence - Web APIs
this code is excerpted from our speech color changer example. recognition.onresult = function(event) { // the speechrecognitionevent results property returns a speechrecognitionresultlist object // the speechrecognitionresultlist object contains speechrecognitionresult objects. // it has a getter so it can be accessed like an array // the first [0] returns the speechrecognitionresult at position 0. // each speechrecognitionresult object contains speechrecognitionalternative objects that contain individual results. // these also have getters so they can be accessed like arrays. // the second [0] returns the speechrecognitionalternative at position 0. // we then return the transcript property of the speechrecognitionalternative object var color = event.results[0][0].transcript; ...
SpeechRecognitionAlternative.transcript - Web APIs
this code is excerpted from our speech color changer example. recognition.onresult = function(event) { // the speechrecognitionevent results property returns a speechrecognitionresultlist object // the speechrecognitionresultlist object contains speechrecognitionresult objects. // it has a getter so it can be accessed like an array // the first [0] returns the speechrecognitionresult at position 0. // each speechrecognitionresult object contains speechrecognitionalternative objects that contain individual results. // these also have getters so they can be accessed like arrays. // the second [0] returns the speechrecognitionalternative at position 0. // we then return the transcript property of the speechrecognitionalternative object var color = event.results[0][0].transcript; ...
SpeechRecognitionAlternative - Web APIs
this code is excerpted from our speech color changer example. recognition.onresult = function(event) { // the speechrecognitionevent results property returns a speechrecognitionresultlist object // the speechrecognitionresultlist object contains speechrecognitionresult objects. // it has a getter so it can be accessed like an array // the first [0] returns the speechrecognitionresult at position 0. // each speechrecognitionresult object contains speechrecognitionalternative objects that contain individual results. // these also have getters so they can be accessed like arrays. // the second [0] returns the speechrecognitionalternative at position 0. // we then return the transcript property of the speechrecognitionalternative object var color = event.results[0][0].transcript; ...
SpeechRecognitionEvent.results - Web APIs
this code is excerpted from our speech color changer example. recognition.onresult = function(event) { // the speechrecognitionevent results property returns a speechrecognitionresultlist object // the speechrecognitionresultlist object contains speechrecognitionresult objects. // it has a getter so it can be accessed like an array // the first [0] returns the speechrecognitionresult at position 0. // each speechrecognitionresult object contains speechrecognitionalternative objects that contain individual results. // these also have getters so they can be accessed like arrays. // the second [0] returns the speechrecognitionalternative at position 0. // we then return the transcript property of the speechrecognitionalternative object var color = event.results[0][0].transcript; ...
SpeechRecognitionEvent - Web APIs
this code is excerpted from our speech color changer example. recognition.onresult = function(event) { // the speechrecognitionevent results property returns a speechrecognitionresultlist object // the speechrecognitionresultlist object contains speechrecognitionresult objects. // it has a getter so it can be accessed like an array // the first [0] returns the speechrecognitionresult at position 0. // each speechrecognitionresult object contains speechrecognitionalternative objects that contain individual results. // these also have getters so they can be accessed like arrays. // the second [0] returns the speechrecognitionalternative at position 0. // we then return the transcript property of the speechrecognitionalternative object var color = event.results[0][0].transcript; ...
SpeechRecognitionResult.isFinal - Web APIs
ognitionresultinstance.isfinal; returns a boolean. examples recognition.onresult = function(event) { // the speechrecognitionevent results property returns a speechrecognitionresultlist object // the speechrecognitionresultlist object contains speechrecognitionresult objects. // it has a getter so it can be accessed like an array // the first [0] returns the speechrecognitionresult at position 0. // each speechrecognitionresult object contains speechrecognitionalternative objects that contain individual results. // these also have getters so they can be accessed like arrays. // the second [0] returns the speechrecognitionalternative at position 0. // we then return the transcript property of the speechrecognitionalternative object var color = event.results[0][0].transcript; ...
SpeechRecognitionResult.item() - Web APIs
this code is excerpted from our speech color changer example. recognition.onresult = function(event) { // the speechrecognitionevent results property returns a speechrecognitionresultlist object // the speechrecognitionresultlist object contains speechrecognitionresult objects. // it has a getter so it can be accessed like an array // the first [0] returns the speechrecognitionresult at position 0. // each speechrecognitionresult object contains speechrecognitionalternative objects that contain individual results. // these also have getters so they can be accessed like arrays. // the second [0] returns the speechrecognitionalternative at position 0. // we then return the transcript property of the speechrecognitionalternative object var color = event.results[0][0].transcript; ...
SpeechRecognitionResult.length - Web APIs
this code is excerpted from our speech color changer example. recognition.onresult = function(event) { // the speechrecognitionevent results property returns a speechrecognitionresultlist object // the speechrecognitionresultlist object contains speechrecognitionresult objects. // it has a getter so it can be accessed like an array // the first [0] returns the speechrecognitionresult at position 0. // each speechrecognitionresult object contains speechrecognitionalternative objects that contain individual results. // these also have getters so they can be accessed like arrays. // the second [0] returns the speechrecognitionalternative at position 0. // we then return the transcript property of the speechrecognitionalternative object var color = event.results[0][0].transcript; ...
SpeechRecognitionResult - Web APIs
this code is excerpted from our speech color changer example. recognition.onresult = function(event) { // the speechrecognitionevent results property returns a speechrecognitionresultlist object // the speechrecognitionresultlist object contains speechrecognitionresult objects. // it has a getter so it can be accessed like an array // the first [0] returns the speechrecognitionresult at position 0. // each speechrecognitionresult object contains speechrecognitionalternative objects that contain individual results. // these also have getters so they can be accessed like arrays. // the second [0] returns the speechrecognitionalternative at position 0. // we then return the transcript property of the speechrecognitionalternative object var color = event.results[0][0].transcript; ...
SpeechRecognitionResultList.item() - Web APIs
this code is excerpted from our speech color changer example. recognition.onresult = function(event) { // the speechrecognitionevent results property returns a speechrecognitionresultlist object // the speechrecognitionresultlist object contains speechrecognitionresult objects. // it has a getter so it can be accessed like an array // the first [0] returns the speechrecognitionresult at position 0. // each speechrecognitionresult object contains speechrecognitionalternative objects that contain individual results. // these also have getters so they can be accessed like arrays. // the second [0] returns the speechrecognitionalternative at position 0. // we then return the transcript property of the speechrecognitionalternative object var color = event.results[0][0].transcript; ...
SpeechRecognitionResultList.length - Web APIs
this code is excerpted from our speech color changer example. recognition.onresult = function(event) { // the speechrecognitionevent results property returns a speechrecognitionresultlist object // the speechrecognitionresultlist object contains speechrecognitionresult objects. // it has a getter so it can be accessed like an array // the first [0] returns the speechrecognitionresult at position 0. // each speechrecognitionresult object contains speechrecognitionalternative objects that contain individual results. // these also have getters so they can be accessed like arrays. // the second [0] returns the speechrecognitionalternative at position 0. // we then return the transcript property of the speechrecognitionalternative object var color = event.results[0][0].transcript; ...
SpeechRecognitionResultList - Web APIs
this code is excerpted from our speech color changer example. recognition.onresult = function(event) { // the speechrecognitionevent results property returns a speechrecognitionresultlist object // the speechrecognitionresultlist object contains speechrecognitionresult objects. // it has a getter so it can be accessed like an array // the first [0] returns the speechrecognitionresult at position 0. // each speechrecognitionresult object contains speechrecognitionalternative objects that contain individual results. // these also have getters so they can be accessed like arrays. // the second [0] returns the speechrecognitionalternative at position 0. // we then return the transcript property of the speechrecognitionalternative object var color = event.results[0][0].transcript; ...
SpeechSynthesisEvent.charIndex - Web APIs
syntax event.charindex; value a number. ...
SpeechSynthesisEvent - Web APIs
the speechsynthesisevent interface of the web speech api contains information about the current state of speechsynthesisutterance objects that have been processed in the speech service. properties the speechsynthesisevent interface also inherits properties from its parent interface, event. speechsynthesisevent.charindex read only returns the index position of the character in the speechsynthesisutterance.text that was being spoken when the event was triggered. speechsynthesisevent.elapsedtime read only returns the elapsed time in milliseconds after the speechsynthesisutterance.text started being spoken that the event was triggered at. speechsynthesisevent.name read only returns the name associated with certain types of events occuring as the speechsynthesisutterance.text is being s...
StaticRange.StaticRange() - Web APIs
syntax var staticrange = new staticrange(rangespec) parameters rangespec the required rangespec parameter is an object adhering to the staticrangeinit dictionary. the four required rangespec properties are: startcontainer the node in which the starting point of the range is located. ...
StaticRange.endOffset - Web APIs
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. ...
StaticRange.startContainer - Web APIs
the read-only startcontainer property of the staticrange interface returns the start node for the range. syntax var node = staticnode.startcontainer value the dom node inside which the start position of the range is found. specifications specification status comment domthe definition of 'startcontainer ' in that specification. living standard static rangethe definition of 'startcontainer' in that specification. editor's draft initial definition. ...
StaticRange.startOffset - Web APIs
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. ...
StereoPannerNode.StereoPannerNode() - Web APIs
dionode that represents a simple stereo panner node that can be used to pan an audio stream left or right. syntax var stereopannernode = stereopannernode(context, options) parameters inherits parameters from the audionodeoptions dictionary. context a reference to an audiocontext. options optional options are as follows: pan: a floating point number in the range [-1,1] indicating the position of an audionode in an output image. the value -1 represents full left and 1 represents full right. the default value is 0. return value a new stereopannernode object instance. specifications specification status comment web audio apithe definition of 'stereopannernode()' in that specification. working draft initial definition. browser compatibility ...
StereoPannerNode - Web APIs
the pan property takes a unitless value between -1 (full left pan) and 1 (full right pan). this interface was introduced as a much simpler way to apply a simple panning effect than having to use a full pannernode. ...
TextRange - Web APIs
Web › API › TextRange
ovetoelementtext() causes the range to contain the text of the specified element. can only be used on element objects. textrange.parentelement() returns the parent element of the range, which is the smallest element that contains the range completely. if the selection contains more than one element, when you modify the contents of the selection, the contents will be placed in the corresponding position of the parent element instead of the child element. textrange.pastehtml() paste the html content into the given range and replace any previous text and html elements in the range. textrange.querycommandenabled() returns a boolean indicating whether the specified command can be executed successfully with the execcommand method in the current state of the given document. you can also see docume...
TextTrack.mode - Web APIs
Web › API › TextTrack › mode
a non-visual form (for example, the text might be spoken to describe the action in the video). tracks whose kind is "chapters" are used by the user agent or the web site or web app to construct and present an interface for navigating the named chapters, where each cue in the list represents a chapter in the media. the user can then navigate to the desired chapter, which begins at the cue's start position and ends at the cue's end position. example in this example, we configure the text track's cues so that every time a cue is finished, the video automatically pauses playback. 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. window.addeventlistener("load", event => { let trackelem = doc...
TextTrack - Web APIs
Web › API › TextTrack
rface—part of the api for handling webvtt (text tracks on media presentations)—describes and controls the text track associated with a particular <track> element. properties this interface also inherits properties from eventtarget. texttrack.activecues read only a texttrackcuelist object listing the currently active set of text track cues. track cues are active if the current playback position of the media is between the cues' start and end times. thus, for displayed cues such as captions or subtitles, the active cues are currently being displayed. texttrack.cues read only a texttrackcuelist which contains all of the track's cues. texttrack.id read only a domstring which identifies the track, if it has one. if it doesn't have an id, then this value is an empty string (""). if the...
Using Touch Events - Web APIs
ated). the touch interface represents a single contact point on a touch-sensitive device. the contact point is typically referred to as a touch point or just a touch. a touch is usually generated by a finger or stylus on a touchscreen, pen or trackpad. a touch point's properties include a unique identifier, the touch point's target element as well as the x and y coordinates of the touch point's position relative to the viewport, page, and screen. the touchlist interface represents a list of contact points with a touch surface, one touch point per contact. thus, if the user activated the touch surface with one finger, the list would contain one item, and if the user touched the surface with three fingers, the list length would be three. the touchevent interface represents an event sent when the...
TrackDefaultList.TrackDefault() - Web APIs
the trackdefault() getter method of the trackdefaultlist interface allows the trackdefault objects in the list to be accessed with an array operator (i.e. [].) syntax var mytrackdefault = trackdefaultlist[index]; parameters index the index position of the trackdefault object you want to return. returns a trackdefault object. errors no specific errors are returned, but if the supplied index is great than or equal to trackdefaultlist.length, the operation will return undefined. example tbd. ...
WebGL2RenderingContext.transformFeedbackVaryings() - Web APIs
domstring specifying the the names of the varying variables to use. buffermode a glenum specifying the mode to use when capturing the varying variables. either gl.interleaved_attribs or gl.separate_attribs. return value none. examples var transformfeedback = gl.createtransformfeedback(); gl.bindtransformfeedback(gl.transform_feedback, transformfeedback); var transformfeedbackoutputs = ['gl_position', 'anotheroutput']; gl.transformfeedbackvaryings(shaderprog, transformfeedbackoutputs, gl.interleaved_attribs); gl.linkprogram(shaderprog); specifications specification status comment webgl 2.0the definition of 'transformfeedbackvaryings' in that specification. editor's draft initial definition for webgl. opengl es 3.0the def...
WebGL2RenderingContext.vertexAttribI4[u]i[v]() - Web APIs
the webgl2renderingcontext.vertexattribi4[u]i[v]() methods of the webgl 2 api specify integer values for generic vertex attributes. syntax void gl.vertexattribi4i(index, v0, v1, v2, v3); void gl.vertexattribi4ui(index, v0, v1, v2, v3); void gl.vertexattribi4iv(index, value); void gl.vertexattribi4uiv(index, value); parameters index a gluint specifying the position of the vertex attribute to be modified. v0, v1, v2, v3 an integer number for the vertex attribute value. value a uint32array/int32array or sequences of gluint/ glint for integer vector vertex attribute values. return value none. examples gl.vertexattribi4i(a_foobar, 10); specifications specification status comment webgl 2.0the definition of 'vertexattribi' in that specification. ...
WebGLRenderingContext.disableVertexAttribArray() - Web APIs
syntax void gl.disablevertexattribarray(index); parameters index a gluint specifying the index of the vertex attribute to disable. return value none. examples gl.disablevertexattribarray(0); specifications specification status comment webgl 1.0the definition of 'disablevertexattribarray' in that specification. recommendation initial definition. ...
WebGLRenderingContext.getUniformLocation() - Web APIs
: getuniform() returns the value of the uniform at the given location. 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. the value is represented as a sequence of glfloat values or as a float32array. the uniform itself is declared in the shader program using glsl. syntax webgluniformlocation = webglrenderingcontext.getuniformlocation(program, name); parameters program the webglprogram in which to locate the specified uniform variable. name a domstring specifying the name of the uniform variable whose l...
WebGLRenderingContext.getVertexAttrib() - Web APIs
syntax any gl.getvertexattrib(index, pname); parameters index a gluint specifying the index of the vertex attribute. pname a glenum specifying the information to query. possible values: gl.vertex_attrib_array_buffer_binding: returns the currently bound webglbuffer. gl.vertex_attrib_array_enabled: returns a glboolean that is true if the vertex attribute is enabled at this index. otherwise false. gl.vertex_attrib_array_size: returns a glint indicating the size of an element of the vertex array. ...
WebGLRenderingContext.vertexAttrib[1234]f[v]() - Web APIs
ric vertex attributes. syntax void gl.vertexattrib1f(index, v0); void gl.vertexattrib2f(index, v0, v1); void gl.vertexattrib3f(index, v0, v1, v2); void gl.vertexattrib4f(index, v0, v1, v2, v3); void gl.vertexattrib1fv(index, value); void gl.vertexattrib2fv(index, value); void gl.vertexattrib3fv(index, value); void gl.vertexattrib4fv(index, value); parameters index a gluint specifying the position of the vertex attribute to be modified. v0, v1, v2, v3 a floating point number for the vertex attribute value. value a float32array for floating point vector vertex attribute values. return value none. description while vertex attributes are usually used to specify values which are different for each vertex (using vertexattribpointer), it can be useful to specify a constant value. fo...
Basic scissoring - Web APIs
ntwidth; canvas.height = canvas.clientheight; var gl = canvas.getcontext("webgl") || canvas.getcontext("experimental-webgl"); if (!gl) { paragraph.innerhtml = "failed to get webgl context. " + "your browser or device may not support webgl."; return; } gl.viewport(0, 0, gl.drawingbufferwidth, gl.drawingbufferheight); // enable scissoring operation and define the position and // size of the scissoring area. gl.enable(gl.scissor_test); gl.scissor(40, 20, 60, 130); // clear the drawing buffer solid yellow. gl.clearcolor(1.0, 1.0, 0.0, 1.0); gl.clear(gl.color_buffer_bit); }, false); the source code of this example is also available on github. « previousnext » ...
Canvas size and WebGL - Web APIs
d clientheight properties, respectively. in contrast, no such assignment is done for the second canvas. the internal width and height properties of the canvas remain at default values, which are different than the actual size of the canvas element in the browser window. the effect is clearly visible when using scissor() and clear() to draw a square in the center of the canvas, by specifying its position and size in pixels. in the first canvas, we get the desired result. in the second, the square has the wrong shape, size, and position. <p>compare the two canvases.</p> <canvas>your browser does not seem to support html5 canvas.</canvas> <canvas>your browser does not seem to support html5 canvas.</canvas> body { text-align : center; } canvas { display : inline-block; width : 120...
Hello GLSL - Web APIs
>your browser does not seem to support html5 canvas.</canvas> body { text-align : center; } canvas { width : 280px; height : 210px; margin : auto; padding : 0; border : none; background-color : black; } button { display : block; font-size : inherit; margin : 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); ...
Textures from code - Web APIs
ot seem to support html5 canvas.</canvas> body { text-align : center; } canvas { width : 280px; height : 210px; margin : auto; padding : 0; border : none; background-color : black; } button { display : block; font-size : inherit; margin : auto; padding : 0.6em; } <script type="x-shader/x-vertex" id="vertex-shader"> #version 100 precision highp float; attribute vec2 position; void main() { gl_position = vec4(position, 0.0, 1.0); gl_pointsize = 128.0; } </script> <script type="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/d...
Data in WebGL - Web APIs
Web › API › WebGL API › Data
sed to pass data from the vertex shader to the fragment shader. this is commonly used to share a vertex's normal vector after it has been computed by the vertex shader. <<how to use>> uniforms uniforms are set by the javascript code and are available to both the vertex and fragment shaders. they're used to provide values that will be the same for everything drawn in the frame, such as lighting positions and magnitudes, global transformation and perspective details, and so forth. <<add details>> buffers <<add information>> textures <<add information>> ...
Animating objects with WebGL - Web APIs
our sample loads a copy from a cdn in our html's <head>. making the square rotate let's start by making the square rotate. the first thing we'll need is a variable in which to track the current rotation of the square: var squarerotation = 0.0; now we need to update the drawscene() function to apply the current rotation to the square when drawing it. after translating to the initial drawing position for the square, we apply the rotation like this: mat4.rotate(modelviewmatrix, // destination matrix modelviewmatrix, // matrix to rotate squarerotation, // amount to rotate in radians [0, 0, 1]); // axis to rotate around this rotates the modelviewmatrix by the current value of squarerotation, around the z axis. to actually animate, we need...
Writing a WebSocket server in Java - Web APIs
26, the following 2 bytes (16-bit unsigned integer), if 127, the following 8 bytes (64-bit unsigned integer, the most significant bit must be 0) are the length. i can take 128 because the first bit is always 1. - 167, 225, 225 and 210 are the bytes of the key to decode. it changes every time. - the remaining encoded bytes are the message. ...
Keyframe Formats - Web APIs
e keyframe object looks like so: let rotate360 = [ { transform: 'rotate(360deg)' } ]; we have only specified the end state of the animation, and the beginning state is implied. attributes keyframes may specify property-value pairs for any of the animatable css properties. the property names are specified using camel-case so for example background-color becomes backgroundcolor and background-position-x becomes backgroundpositionx. shorthand values such as margin are also permitted. two exceptional css properties are: float, which must be written as cssfloat since "float" is a reserved word in javascript. it's just for reference here, this will have no effect on animation since "float" is not an animatable css property. offset, which must be written as cssoffset since "offset" represents ...
Web Animations API Concepts - Web APIs
ge is loaded to infinity — or until the window is closed. spread along that timeline according to their durations are our animations. each animation is anchored to a point in the timeline by its starttime, representing the moment along the document’s timeline when the animation starts playing. all the animation's playback relies on this timeline: seeking the animation moves the animation’s position along the timeline; slowing down or speeding up the playback rate condenses or expands its spread across the timeline; repeating the animation lines up additional iterations of it along the timeline. in the future, we might have timelines based on gestures or scroll position or even parent and child timelines. the web animations api opens up so many possibilities! animation the animation model ...
Web Audio API - Web APIs
hannels of an audio source out into a set of mono outputs. channelmergernode the channelmergernode interface reunites different mono inputs into a single output. each input will be used to fill a channel of the output. audio spatialization these interfaces allow you to add audio spatialization panning effects to your audio sources. audiolistener the audiolistener interface represents the position and orientation of the unique person listening to the audio scene used in audio spatialization. pannernode the pannernode interface represents the position and behavior of an audio source signal in 3d space, allowing you to create complex panning effects. stereopannernode the stereopannernode interface represents a simple stereo panner node that can be used to pan an audio stream left or righ...
Window.convertPointFromNodeToPage() - Web APIs
this method is non-standard and should not be used. please review the browser compatibility section before using this method, as it's not widely supported (nor is the point object it uses). syntax point = window.convertpointfromnodetopage(node, nodepoint); parameters node the node in whose coordinate system the point specified by nodepoint is described. ...
Window.devicePixelRatio - Web APIs
</code>. try it and watch what happens!</p> </div> <div class="pixel-ratio"></div> </div> css body { font: 22px arial, sans-serif; } .container { top: 2em; width: 22em; height: 14em; border: 2px solid #22d; margin: 0 auto; padding: 0; background-color: #a9f; } .inner-container { padding: 1em 2em; text-align: justify; text-justify: auto; } .pixel-ratio { position: relative; margin: auto; height: 1.2em; text-align: right; bottom: 0; right: 1em; font-weight: bold; } result specifications specification status comment css object model (cssom) view modulethe definition of 'window.devicepixelratio' in that specification. working draft initial definition browser compatibility the compatibility table on ...
Window.getSelection() - Web APIs
syntax selection = window.getselection(); return value a selection object. when cast to string, either by appending an empty string ("") or using selection.tostring(), this object returns the text selected. when called on an <iframe> that is not displayed (eg. where display: none is set) firefox will return null, whereas other browsers will return a selection object with selection.type set to none. ...
Privileged features - Web APIs
minimizable this setting can only apply to dialog windows; minimizable requires dialog=yes. if minimizable is on, the new dialog window will have a minimize system command icon in the titlebar and it will be minimizable. ...
Window: popstate event - Web APIs
() or replacestate(), set the entry's title to the string returned by its document.title attribute. if the browser has state information it wishes to store with the current-entry before navigating away from it, it then does so. the entry is now said to have "persisted user state." this information the browser might add to the history session entry may include, for instance, the document's scroll position, the values of form inputs, and other such data. if new-entry has a different document object than current-entry, the browsing context is updated so that its document property refers to the document referred to by new-entry, and the context's name is updated to match the context name of the now-current document. each form control within new-entry's document that has autocomplete configured with...
Window.requestAnimationFrame() - Web APIs
id, that uniquely identifies the entry in the callback list. this is a non-zero value, but you may not make any other assumptions about its value. you can pass this value to window.cancelanimationframe() to cancel the refresh callback request. example in this example, an element is animated for 2 seconds (2000 milliseconds). the element moves at a speed of 0.1px/ms to the right, so its relative position (in css pixels) can be calculated in function of the time elapsed since the start of the animation (in milliseconds) with 0.1 * elapsed. the element's final position is 200px (0.1 * 2000) to the right of its initial position. const element = document.getelementbyid('some-element-you-want-to-animate'); let start; function step(timestamp) { if (start === undefined) start = timestamp; cons...
Window.scrollBy() - Web APIs
Web › API › Window › scrollBy
u want to scroll by. - or - options is a scrolltooptions dictionary. examples to scroll down one page: window.scrollby(0, window.innerheight); to scroll up: window.scrollby(0, -window.innerheight); using options: window.scrollby({ top: 100, left: 100, behavior: 'smooth' }); notes window.scrollby() scrolls by a particular amount, whereas window.scroll() scrolls to an absolute position in the document. see also window.scrollbylines() and window.scrollbypages(). specification specification status comment css object model (cssom) view modulethe definition of 'window.scrollby()' in that specification. working draft initial definition. browser compatibility the compatibility table in this page is generated from structured data. if you'd l...
Window.scrollX - Web APIs
Web › API › Window › scrollX
cise and may contain a decimal component. if the document isn't scrolled at all left or right, then scrollx is 0. if you need an integer value, you can use math.round() to round it off. in more technical terms, scrollx returns the x coordinate of the left edge of the current viewport. if there is no viewport, the returned value is 0. example this example checks the current horizontal scroll position of the document. if it's greater than 400 pixels, the window is scrolled back to the beginning. 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. additionally, older versions of internet ...
Window.scrollY - Web APIs
Web › API › Window › scrollY
t isn't scrolled at all up or down, then scrolly is 0. if you need an integer value, you can use math.round() to round it off. in more technical terms, scrolly returns the y coordinate of the top edge of the current viewport. if there is no viewport, the returned value is 0. 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. } window.scrollbypages(1); notes use this property to check that the document hasn't already been scrolled when using relative scroll functions such as scrollby(), scrollbylines(), or scrollbypages(). the pageyoffset property is an alias for the scrolly property: window.pageyoffset === window.scrolly; // always true for cross-browser compatibility, use windo...
WindowOrWorkerGlobalScope.setInterval() - Web APIs
if the mydaemon.task function returns a false value the daemon is paused. mydaemon.rate the time lapse (in number of milliseconds) between each invocation (read/write). mydaemon.length the total number of invocations. it can be a positive integer or infinity (read/write). minidaemon instances methods mydaemon.isatend() returns a boolean expressing whether the daemon is at the start/end position or not. mydaemon.synchronize() synchronize the timer of a started daemon with the time of its invocation. mydaemon.pause() pauses the daemon. mydaemon.start([reverse]) starts the daemon forward (index of each invocation increasing) or backwards (index decreasing). minidaemon global object methods minidaemon.forcecall(minidaemon) forces a single callback to the minidaemon.task function...
Worklet - Web APIs
Web › API › Worklet
s.paintworklet. chrome: main thread gecko: paint thread css painting api audioworklet for audio processing with custom audionodes. web audio render thread web audio api animationworklet for creating scroll-linked and other high performance procedural animations. compositor thread css animation worklet api layoutworklet for defining the positioning and dimensions of custom elements. css layout api for 3d rendering with webgl, you don't use worklets. instead, you write vertex shaders and fragment shaders using glsl code, and those shaders will then run on the graphics card. properties the worklet interface does not define any properties. methods worklet.addmodule() adds the script module at the given url to the cur...
XRFrame.getViewerPose() - Web APIs
the getviewerpose() method, a member of the xrframe interface, returns a xrviewerpose object which describes the viewer's pose (position and orientation) relative to the specified reference space. see the getpose() method for a way to calculate a pose that represents the difference between two spaces. syntax var xrviewerpose = xrframe.getviewerpose(referencespace); parameters referencespace an xrreferencespace object specifying the space to use as the reference point or base for the computation of the viewer's current pose. return value a xrviewerpose describing the viewer's position and orientation relative to the specified reference space. exceptions invalidstateerror a domexception indicating that getviewerpose() was not called within the context of a callback to a s...
XRFrame.session - Web APIs
Web › API › XRFrame › session
an xrframe object's read-only session property returns the xrsession object that generated the frame. syntax var xrsession = xrframe.session; value a xrsession object representing the webxr session for which this xrframe describes the object positions and orientations. specifications specification status comment webxr device apithe definition of 'xrframe.session' in that specification. working draft initial definition. ...
XRHandedness - Web APIs
so it should be rendered visibly if possible. if gripspace is non-null, the function proceeds to get the pose for the gripspace transformed into the current reference space. assuming that's then valid, a function called myrenderhandobject() is called with the grip's pose and the value of handedness. with these values in hand (no pun intended), myrenderhandobject() can draw the appropriate model positioned and formed for the correct hand. specifications specification status comment webxr device apithe definition of 'xrhandedness' in that specification. working draft initial definition. ...
XRInputSource.handedness - Web APIs
so it should be rendered visibly if possible. if gripspace is non-null, the function proceeds to get the pose for the gripspace transformed into the current reference space. assuming that's then valid, a function called myrenderhandobject() is called with the grip's pose and the value of handedness. with these values in hand (no pun intended), myrenderhandobject() can draw the appropriate model positioned and formed for the correct hand. specifications specification status comment webxr device apithe definition of 'xrinputsource.handedness' in that specification. working draft initial definition. ...
XRInputSource - Web APIs
e object defining the origin of the target ray and the direciton in which it extends. this space is established using the method defined by targetraymode. methods the xrinputsource interface defines no methods. usage notes actions and the target ray if the device provides an indication of the direction in which it is pointed, this is done using a target ray. this is a ray extending from the position of the device outward in the direction in which it is pointed. a target ray emitted by a hand controller. if the device includes a trigger or other squeezable input, such as a hand gesture device that recognizes when the user squeezes their fist, that action is called a primary squeeze action. a primary squeeze action should correspond to a gripping act in reality, such as taking hold of an...
XRInputSourceEvent.frame - Web APIs
t described by the object took place. usage notes the event frame does not correspond to a visual frame as is delivered to the frame rendering callback function (see rendering and the webxr frame rendering callback for details on the callback). instead, the xrframe specified by the frame property is simply a method to provide access to the getpose() method, which you can use to get the relative positions of the objects in the scene at the time the event occurred. however, since the event frame isn't an animation frame, there is no viewer pose available to represent the viewer's current point of view; the results of calling getviewerpose() will be an xrviewerpose with an empty views list. examples this code shows a handler for the selectstart event which gets the target ray's pose from the fr...
XRInputSourceEventInit.frame - Web APIs
spaces to the world reference space. usage notes the event frame does not correspond to a visual frame as is delivered to the frame rendering callback function (see rendering and the webxr frame rendering callback for details on the callback). instead, the xrframe specified by the frame property is simply a method to provide access to the getpose() method, which you can use to get the relative positions of the objects in the scene at the time the event occurred. examples this example creates a new select event and sends it to the xrsession. let event = new xrinputsourceevent("select", { frame: eventframe, inputsource: source }; if (event) { xrsession.dispatchevent(event); } specifications specification status comment webxr device apithe definition of 'xrin...
XRReferenceSpace.onreset - Web APIs
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. ...
XRReferenceSpaceEventInit.transform - Web APIs
the transform is defined using the old coordinate system, which allows it to be used to convert coordinates from the pre-event coordinate system to the post-event coordiante system. syntax let eventinitdict = { referencespace: xrreferencespace, transform: xrrigidtransform }); value an xrrigidtransform object providing a transform that can be used to convert coordinates from the pre-event coordinate system to the post-event coordinate system. ...
XRRigidTransform.orientation - Web APIs
gth is not exactly 1.0 meters, it will be normalized for you. syntax let orientation = xrrigidtransform.orientation; value a dompointreadonly object which contains a unit quaternion providing the orientation component of the transform. as a unit quaternion, the length of the returned quaternion is always 1.0 meters. 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. specifications specification status comment webxr device apithe definition of 'x...
XRSession.onsqueezeend - Web APIs
response to the end of the squeeze operation, this code looks to see if there is an object currently being held by the user by checking to see if the variable user.heldobject contains a reference to an object representing the held item. if heldobject has an object reference, that object is passed to a function called cancelobjectdrag(), which would be written to return the object to its original position. this takes care of the situation in which the drag is aborted or canceled. xrsession.onsqueezeend = event => { if (event.inputsource.handedness == user.handedness) { let targetraypose = event.frame.getpose(event.inputsource.targetrayspace, myrefspace; if (user.heldobject) { cancelobjectdrag(user.heldobject); } } }; this code presumes that if the user actually intention...
XRSession.renderState - Web APIs
the read-only renderstate property of an xrsession object indicates the returns a xrrenderstate object describing how the user's environment which should be rendered. the information provided covers the minimum and maximum distance at which to render objects, the vertical field of view to use when rendering the in the inline session mode, and the xrwebgllayer to render into for inline composition. while this property is read only, you can call the xrsession method updaterenderstate() to make changes. syntax var xrrenderstate = xrsession.renderstate; value an xrrenderstate object describing how to render the scene. specifications specification status comment webxr device apithe definition of 'xrsession.renderstate' in that specification. working draft ...
XRSession: selectend event - Web APIs
the presentation of the object-dragging process, using the transform to perform a hit test, determining which object to pick up. mybegintracking() returns an object representing the object the user has begun to drag. upon receiving a select event, the mydropobject() function is called with the target object and the current target ray pose transform as inputs. this places the object into its new position in the world and triggers any effects that may arise from doing so (like scheduling an animation of a splash if dropped in water, etc). the selectend event results in a mystoptracking() function being called with the object being dragged and the final target ray pose's transform. xrsession.addeventlistener("selectstart", onselectionevent); xrsession.addeventlistener("select", onselectionevent)...
XRSession: selectstart event - Web APIs
the presentation of the object-dragging process, using the transform to perform a hit test, determining which object to pick up. mybegintracking() returns an object representing the object the user has begun to drag. upon receiving a select event, the mydropobject() function is called with the target object and the current target ray pose transform as inputs. this places the object into its new position in the world and triggers any effects that may arise from doing so (like scheduling an animation of a splash if dropped in water, etc). the selectend event results in a mystoptracking() function being called with the object being dragged and the final target ray pose's transform. xrsession.addeventlistener("selectstart", onselectionevent); xrsession.addeventlistener("select", onselectionevent)...
XRSession: squeezeend event - Web APIs
the presentation of the object-dragging process, using the transform to perform a hit test, determining which object to pick up. mybegintracking() returns an object representing the object the user has begun to drag. upon receiving a squeeze event, the mydropobject() function is called with the target object and the current target ray pose transform as inputs. this places the object into its new position in the world and triggers any effects that may arise from doing so (like scheduling an animation of a splash if dropped in water, etc). the squeezeend event results in a mystoptracking() function being called with the object being dragged and the final target ray pose's transform. xrsession.addeventlistener("squeezestart", onsqueezeevent); xrsession.addeventlistener("squeeze", onsqueezeevent);...
XRSession: squeezestart event - Web APIs
the presentation of the object-dragging process, using the transform to perform a hit test, determining which object to pick up. mybegintracking() returns an object representing the object the user has begun to drag. upon receiving a squeeze event, the mydropobject() function is called with the target object and the current target ray pose transform as inputs. this places the object into its new position in the world and triggers any effects that may arise from doing so (like scheduling an animation of a splash if dropped in water, etc). the squeezeend event results in a mystoptracking() function being called with the object being dragged and the final target ray pose's transform. xrsession.addeventlistener("squeezestart", onsqueezeevent); xrsession.addeventlistener("squeeze", onsqueezeevent);...
XRSession - Web APIs
Web › API › XRSession
xrsession supports both inline and immersive virtual and augmented reality modes. ...
XRSpace - Web APIs
Web › API › XRSpace
ice api is an abstract interface providing a common basis for every class which represents a virtual coordinate system within the virtual world, in which its origin corresponds to a physical location. spatial data in webxr is always expressed relative to an object based upon one of the descendant interfaces of xrspace, at the time at which a given xrframe takes place. numeric values such as pose positions are thus coordinates in the corresponding xrspace, relative to that space's origin. note: the xrspace interface is never used directly; instead, all spaces are created using one of the interfaces based on xrspace. at this time, those are xrreferencespace and xrboundedreferencespace. interfaces based on xrspace below is a list of interfaces based on the xrspace interface. xrboundedreferen...
XRTargetRayMode - Web APIs
s that project a target ray outward from the user. for each such input, this example looks for inputs whose targetraymode is tracked-pointer, indicating that the input is in fact intended to represent a targeting device rather than a gazing device, screen tap, or mouse click. for tracked pointers, a function myrendertargetrayasbeam() is called to render a beam from the input controller's virtual position outward in the direction it's pointing. the code should continue to perform tasks such as drawing controllers or any objects representative of the user's hands' positions in the virtual space, as well as any other input-related tasks. function updateinputsources(session, frame, refspace) { for (let source of session.getinputsources()) { let targetraypose = frame.getpose(inputsource.target...
XRViewerPose.views - Web APIs
this code is derived from drawing a frame in movement, orientation, and motion: a webxr example. you can see more context and see much more on that page. specifications specification status comment webxr device apithe definition of 'xrviewerpose.views' in that specification. ...
XRViewport - Web APIs
properties height read only the height, in pixels, of the viewport. width read only the width, in pixels, of the viewport. 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. ...
XRWebGLLayer.getNativeFramebufferScaleFactor() static method - Web APIs
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. while rendering a frame for this scene, we get the viewport for the view and apply it to webgl, then render the scene. this ensures that the scene we render will not only match the viewpoint we need to express (which is defined by the position and orientation data in the pose), but that the rendered output will be constrained within the correct portion of the frame buffer for the eye we're drawing, regardless of any scaling that is being performed. examples in this example, we request a frame buffer at the device's native resolution, regardless of any performance concerns: function requestnativescalewebgllayer(gl, xrsession) { ret...
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. ...
XRWebGLLayerInit.ignoreDepthValues - Web APIs
ntry in the depth buffer corresponds to the depth of the fragment whose color is at the same location in the color buffer, and must have a value between 0.0 and 1.0, where 0.0 corresponds to the distance specified in the xrsession object's renderstate record's depthnear and 1.0 represents the distance given by depthfar. ignoring depth values causes the compositor to rely solely upon the relative position of objects to establish depth, and may result in less effective and less comfortable 3d effects. the default is false (depth values are used by default). example in this example, a new xrwebgllayer is created for a webxr session, xrsession. it's configured to ignore depth values or an alpha channel. xrsession.updaterenderstate({ baselayer: new xrwebgllayer(xrsession, gl, { alpha: false,...
XRWebGLLayerInit - Web APIs
r. otherwise, no stencil buffer is allocated. the default is false. 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. const layeroptions = { ignoredepthvalues: true }; xrsession.updaterenderstate({ baselayer: new xrwebgllayer(xrsession, gl, layeroptions); }); specifications specification status comment webxr device apithe definition of 'xrwebgllayerinit' in that specification. working draft initial definition. ...
Introduction - Web APIs
the look of content. css (cascade style sheets) was one of the first ways proposed by the w3c. css is a simple way to apply style rules to a web document. these style rules define how the document (the content) should be laid out. however, it has several limitations, such as lack of programming structures and ability to create complex layout models. css also has limited support for changing the position of an element. xsl (extensible stylesheet language) transformations are composed of two parts: xsl elements, which allow the transformation of an xml tree into another markup tree and xpath, a selection language for trees. xslt takes an xml document (the content) and creates a brand new document based on the rules in the xsl stylesheet. this allows xslt to add, remove and reorganize elements fro...
msGetRegionContent - Web APIs
non-standard this feature is non-standard and is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. the msgetregioncontent returns an array of range instances corresponding to the content from the region flow that is positioned in the region. this proprietary method is specific to internet explorer browser. syntax var retval = element.msgetregioncontent(); parameters retval [out, reval] type: msrangecollection the name of the property to enable. return value type: boolean returned ranges are sorted by document position and do not overlap. if an element is not a region, this method throws a domexception wi...
Using the aria-valuetext attribute - Accessibility
man readable text alternative of aria-valuenow for a range widget such as progressbar, spinbutton or slider. authors should only set the aria-valuetext attribute when the rendered value cannot be accurately represented as a number. for example, a slider may have rendered values of small, medium, and large. in this case, the values of aria-valuenow could range from 1 through 3, which indicate the position of each value in the value space, but thearia-valuetext would be one of the strings: small, medium, or large. value string representation of a number possible effects on user agents and assistive technology if the aria-valuetext attribute is absent, assistive technologies will rely solely on the aria-valuenow attribute for the current value. if aria-valuetext is specified, assistive technolo...
Using the link role - Accessibility
note: where possible, it is recommended that you use a native <a> element rather than the link role, as native elements are more widely supported by older user agents and assistive technology. native <a> elements also support keyboard and focus requirements by default, without need for additional customization. the tabindex attribute may optionally be used with this role to directly specify the position of the element in the tab order. possible effects on user agents and assistive technology when the link role is added to an element, or such an element becomes visible, the user agent should do the following: expose the element as having a link role in the operating system's accessibility api. fire an accessible link event using the operating system's accessibility api if it supports it. ...
ARIA: application role - Accessibility
nt. aria-roledescription used to give the application a more descriptive role text for screen readers to speak. this should be localized. keyboard interactions keyboard interaction is completely under the web author's control and can be anything associated with the particular widget being implemented. in a slides application, for example, a widget could be created that uses the arrow keys to position elements on the slide, and uses audio feedback via an aria live region to communicate the position and overlap status with other objects. focus is being managed via aria-activedescendant. the tab , space and enter keys, as well as escape , must be handled by the application. the one exception is if focus is set to a standard widget inside the application that supports keyboard navigation from th...
ARIA: feed role - Accessibility
rticle> or element with role article. each article should have an aria-labelledby referring to the article title or other child that can serve as a distinguishing label. each article should preferably have aria-describedby referring to one or more elements inside the article that serve as the primary content of the article. each article element has aria-posinset set to a value that represents its position in the feed and an aria-setsize set to a value that represents either the total number of articles that have been loaded or the total number in the feed, depending on which value is more helpful to users. if the total number in the feed is not known, set aria-setsize="-1". required javascript features none, except as required by any attributes. for example, setting aria-busy to true during t...
ARIA: grid role - Accessibility
the grid role is for a widget that contains one or more rows of cells. the position of each cell is significant and can be focused using keyboard input. <table role="grid" aria-labelledby="id-select-your-seat"> <caption id="id-select-your-seat">select your seat</caption> <tbody role="presentation"> <tr role="presentation"> <td></td> <th>row a</th> <th>row b</th> </tr> <tr> <th scope="row">aisle 1</th> <td tabindex="0"> <button id="1a" tabindex="-1">1a</button> </td> <td tabindex="-1"> <button id="1b" tabindex="-1">1b</button> </td> <!-- more columns --> </tr> <tr> <th scope="row">aisle 2</th> <td tabindex="-1"> <button id="2a" tabindex="-1">2a</button> </td> <td tabindex=...
ARIA: tab role - Accessibility
p>content for the first panel</p> </div> <div id="panel-2" role="tabpanel" tabindex="0" aria-labelledby="tab-2" hidden> <p>content for the second panel</p> </div> <div id="panel-3" role="tabpanel" tabindex="0" aria-labelledby="tab-3" hidden> <p>content for the third panel</p> </div> </div> .tabs { padding: 1em; } [role="tablist"] { margin-bottom: -1px; } [role="tab"] { position: relative; z-index: 1; background: white; border-radius: 5px 5px 0 0; border: 1px solid grey; border-bottom: 0; padding: 0.2em; } [role="tab"][aria-selected="true"] { z-index: 3; } [role="tabpanel"] { position: relative; padding: 0 0.5em 0.5em 0.7em; border: 1px solid grey; border-radius: 0 0 5px 5px; background: white; z-index: 2; } [role="tabpanel"]:focus { border...
ARIA: table role - Accessibility
if the table contains sortable columns or rows, the aria-sort attribute should be added on the header cell element (not the table itself). if any rows or columns are hidden, the aria-colcount or aria-rowcount should be included indicating the total number of columns or rows, respectively, along with the aria-colindex or aria-rowindex on each cell. the aria-colindex or aria-rowindex is set to the position of a cell within the row or column, respectively. if the table includes cells that span multiple rows or multiple columns, then aria-rowspan or aria-colspan should be included as well. realize, it is much simpler to simply use the <table> element, along with all the related semantic elements and attributes that are all supported by all assistive technologies. to create an interactive widget that...
ARIA: listbox role - Accessibility
nded that a checkbox, link or other method be used to select all items, and ctrl+a could be used as a shortcut key for this. when the listbox role is added to an element, or such an element becomes visible, screen readers announce the label and role of the listbox when it gets focus. if an option or item is focused within the list, it gets announced next, followed by an indication of the item's position with the list if the screen reader supports this. as focus moves within the list, the screen reader announces the relevant items. associated aria roles, states, and properties associated roles option one or more nested options are required. all selected options have aria-selected set to true. all options that are not selected have aria-selected set to false. if an option is not selectable,...
WAI-ARIA Roles - Accessibility
figure is generally considered to be one or more images, code snippets, or other content that puts across information in a different way to a regular flow of text.aria: form rolethe form landmark role can be used to identify a group of elements on a page that provide equivalent functionality to an html form.aria: grid rolethe grid role is for a widget that contains one or more rows of cells. the position of each cell is significant and can be focused using keyboard input.aria: gridcell rolethe gridcell role is used to make a cell in a grid or treegrid. it is intended to mimic the functionality of the html td element for table-style grouping of information.aria: heading rolethe heading role defines this element as a heading to a page or section. to give the page more structure, a level should also...
Cognitive accessibility - Accessibility
these people, also provide things like icons and colors. also, provide feedback on when there is a successful form submission. provide instructions for user input start the form with text instructions on how to operate it. include labels or instructions when users need to input information, using the <label>, <fieldset>, and <legend> elements to do so. labels should be descriptive and positioned close to the input they relate to. when requiring a specific format for input, provide an example formatted in the proper way. additionally, consider performing server-side validation to help format input data, to aid in the ease of user input. if a form control is required, indicate it both visually and via code. if a form control changes context, describe what will happen in a way that the u...
Accessibility documentation index - Accessibility
nt way to a regular flow of text. 63 aria: form role aria, aria role, aria figure, accessibility, reference, rôle, form the form landmark role can be used to identify a group of elements on a page that provide equivalent functionality to an html form. 64 aria: grid role aria, html the grid role is for a widget that contains one or more rows of cells. the position of each cell is significant and can be focused using keyboard input. 65 aria: gridcell role aria, html the gridcell role is used to make a cell in a grid or treegrid. it is intended to mimic the functionality of the html td element for table-style grouping of information. 66 aria: heading role aria, aria role, aria heading, reference the heading role defi...
Keyboard-navigable JavaScript widgets - Accessibility
us() tab navigable not present follows the platform convention of the element (yes for form controls, links, etc.). follows the platform convention of the element. negative (i.e. tabindex="-1") yes no; author must focus the element with focus() in response to arrow or other key presses. zero (i.e. tabindex="0") yes in tab order relative to element's position in document (note that interactive elements like <a> have this behavior by default, they don't need the attribute). positive (e.g. tabindex="33") yes tabindex value determines where this element is positioned in the tab order: smaller values will position elements earlier in the tab order than larger values (for example, tabindex="7" will be positioned before tabindex="11"). ...
Operable - Accessibility
4.3 logical focus order (a) the "tabbing order" of focusable page features (e.g. links, buttons, form inputs) makes logical sense, meaning that the page is still usable by non-sighted/keyboard users. see ui controls for general advice on tabbing to controls. if you need to place elements in an unusual layout, it is better to make sure the source order is sensible, then use css features like positioning to handle the layout. 2.4.4 link purpose (in context) (a) the purpose/destination of a link can be determined from the link text, or from its surroundings (e.g. the surrounding text). exceptions are where the link purpose is ambiguous to all users (see ambiguous to users in general for a useful explanation of this). see meaningful text labels. also note that you should minimize...
Understandable - Accessibility
ed of the impending change before it occurs. again, sensible design should be implemented. for example, if pressing a button causes the application to exit the current view, the user should be asked to confirm this action, save their work if appropriate, etc. globaleventhandlers.oninput is useful here. 3.2.3 consistent navigation (aa) navigation menu/control style and positioning should be consistent between different pages or views of a web page, and the existing items should appear in the same order, even if for example new iteam are added. if the user has initiated a change, e.g. choosing a different color scheme or position for the navigation, their choice should be respected across all pages. again, sensible design — make the navigation controls the same ac...
-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-repeat-x - CSS: Cascading Style Sheets
mage is not repeated; only one copy of the mask image is drawn. the remainder of the masked element's content is not displayed. repeat the mask image is repeated both horizontally and vertically. space the image is repeated as much as possible without clipping. the first and last images are pinned to either side of the element, and whitespace is distributed evenly between the images. the mask-position property is ignored unless only one image can be displayed without clipping. the only case where clipping happens using space is when there isn't enough room to display one image. round as the allowed space increases in size, the repeated images will stretch (leaving no gaps) until there is room for another one to be added. when the next image is added, all of the current ones compress to allow...
-webkit-mask-repeat-y - CSS: Cascading Style Sheets
only one copy of the mask image is drawn in vertical direction. the vertical remainder of the masked element's content is not displayed. repeat the mask image is repeated vertically. space the image is repeated as much as possible without clipping. the first and last images are pinned to the top and bottom edge of the element, and whitespace is distributed evenly between the images. the mask-position property is ignored unless only one image can be displayed without clipping. the only case where clipping happens using space is when there isn't enough room to display one image. round as the allowed vertical space increases in size, the repeated images will stretch (leaving no gaps) until there is room for another one to be added. when the next image is added, all of the current ones compress...
::-webkit-inner-spin-button - CSS: Cascading Style Sheets
the ::-webkit-inner-spin-button css pseudo-element is used to style the inner part of the spinner button of number picker input elements. syntax ::-webkit-inner-spin-button examples these examples work only in browsers based on webkit and blink. changing the cursor in the spin controls in this example, the css cursor is changed to pointer whenever the cursor is positioned over the inner part of the input's spin controls. html <input type="number"> css input[type=number]::-webkit-inner-spin-button { cursor: pointer; } result specifications not part of any standard. ...
:first - CSS: Cascading Style Sheets
Web › CSS › :first
print!</button> css @page :first { margin-left: 50%; margin-top: 50%; } p { page-break-after: always; } javascript document.queryselector("button").addeventlistener('click', () => { window.print(); }); result press the "print!" button to print the example. the words on the first page should be somewhere around the center, while other pages will have their contents at the default position. specifications specification status comment css paged media module level 3the definition of ':first' in that specification. working draft no change. css level 2 (revision 1)the definition of ':first' in that specification. recommendation initial definition. ...
:host-context() - CSS: Cascading Style Sheets
shadow dom containing the css it is used inside (so you can select a custom element from inside its shadow dom) — but only if the selector given as the function's parameter matches the shadow host's ancestor(s) in the place it sits inside the dom hierarchy. in other words, this allows a custom element, or anything within that custom element's shadow dom, to apply different styles based on its position within the outer dom or classes/attributes applied to ancestor elements. one typical use of this is with a descendant selector expression — for example h1 — to select only instances of the custom element that are inside an <h1>. another typical use would be to allow inner elements to react to classes or attributes on any anscestor elements - for example, applying a different text color when...
:nth-child() - CSS: Cascading Style Sheets
the :nth-child() css pseudo-class matches elements based on their position in a group of siblings. /* selects the second <li> element in a list */ li:nth-child(2) { color: lime; } /* selects every fourth element among any group of siblings */ :nth-child(4n) { color: lime; } syntax the nth-child pseudo-class is specified with a single argument that describes a pattern for matching element indices in a list of siblings. element indices are 1-based. keyword values odd represents elements whose numeric position in a series of siblings is odd: 1, 3, 5, etc. even represents elements whose numeric position in a series of siblings is even: 2, 4, 6, etc. functional notation <an+b> represents elements in a list whose indices match those found in a custom pattern of numbers, defined...
:nth-last-of-type() - CSS: Cascading Style Sheets
/* selects every fourth <p> element among any group of siblings, counting backwards from the last one */ p:nth-last-of-type(4n) { color: lime; } note: this pseudo-class is essentially the same as :nth-of-type, except it counts items backwards from the end, not forwards from the beginning. syntax the nth-last-of-type pseudo-class is specified with a single argument, which represents the pattern for matching elements, counting from the end. see :nth-last-child for a more detailed explanation of its syntax. ...
:nth-of-type() - CSS: Cascading Style Sheets
/* selects every fourth <p> element among any group of siblings */ p:nth-of-type(4n) { color: lime; } syntax the nth-of-type pseudo-class is specified with a single argument, which represents the pattern for matching elements. see :nth-child for a more detailed explanation of its syntax. ...
:valid - CSS: Cascading Style Sheets
Web › CSS › :valid
cating valid and invalid form fields in this example, we use structures like this, which include extra <span>s to generate content on; we'll use these to provide indicators of valid/invalid data: <div> <label for="fname">first name *: </label> <input id="fname" name="fname" 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. we then absolutely position ...
system - CSS: Cascading Style Sheets
is interpreted as 1, the next as 2, and so on. however, in the numeric system, the first counter symbol is interpreted as 0, the next as 1, then 2, and so on. at least two counter symbols must be specified in the symbols descriptor or the counter style is not valid. additive used to represent "sign-value" numbering systems, such as roman numerals, which rather than reuse digits in different positions to obtain different values, define additional digits for larger values. the value of a number in such a system can be found out by adding the digits in the number. an additional descriptor called additive-symbols must be specified with at least one additive tuple, or else the counter style rule will not be valid. an additive tuple is similar to a composite counter symbol, which is made up of ...
CSSOM View - CSS: Cascading Style Sheets
cssom view is a module of css that lets you manipulate the visual view of a document, in particular its scrolling behavior. reference properties scroll-behavior guides coordinate systems a guide to the coordinate systems used to specify the position of a location in a display context, whether that context is a window on a monitor, a viewport on a mobile device, or a position on a sheet of paper when printing. specifications specification status comment css object model (cssom) view module working draft initial definition. ...
Using CSS animations - CSS: Cascading Style Sheets
ation names set, but only one duration and iteration count. in this case all three animations are given the same duration and iteration count: animation-name: fadeinout, moveleft300px, bounce; animation-duration: 3s; animation-iteration-count: 1; in this second example, we have three values set on all three properties. in this case each animation is run with the corresponding values in the same position on each property, so for example fadeinout has a duration of 2.5s and an iteration count of 2, etc. animation-name: fadeinout, moveleft300px, bounce; animation-duration: 2.5s, 5s, 1s; animation-iteration-count: 2, 1, 5; in this third case, there are three animations specified, but only two durations and iteration counts. in such cases where there are not enough values to give a separate value t...
Introduction to the CSS basic box model - CSS: Cascading Style Sheets
every box is composed of four parts (or areas), defined by their respective edges: the content edge, padding edge, border edge, and margin edge. the content area, bounded by the content edge, contains the "real" content of the element, such as text, an image, or a video player. ...
Mastering margin collapsing - CSS: Cascading Style Sheets
margin collapsing occurs in three basic cases: adjacent siblings the margins of adjacent siblings are collapsed (except when the latter sibling needs to be cleared past floats). ...
Using multi-column layouts - CSS: Cascading Style Sheets
are too long; if it takes too long for the eyes to move from the end of the one line to the beginning of the next, they lose track of which line they were on. therefore, to make maximum use of a large screen, authors should have limited-width columns of text placed side by side, just as newspapers do. unfortunately this is impossible to do with css and html without forcing column breaks at fixed positions, or severely restricting the markup allowed in the text, or using heroic scripting. this limitation is solved by adding new css properties to extend the traditional block layout mode. using columns column count and width two css properties control whether and how many columns will appear: column-count and column-width. the column-count property sets the number of columns to a particular numb...
CSS Containment - CSS: Cascading Style Sheets
it only needs to check this element — everything inside the element is scoped to that element and does not affect the rest of the page, and the containing box establishes an independent formatting context. in addition: float layout will be performed independently. margins won't collapse across a layout containment boundary the layout container will be a containing block for absolute/fixed position descendants. the containing box creates a stacking context, therefore z-index can be used. paint containment article { contain: paint; } paint containment essentially clips the box to the padding edge of the principal box. there can be no visible overflow. the same things are true for paint containment as layout containment (see above). another advantage is that if the containing box is o...
OpenType font features guide - CSS: Cascading Style Sheets
igatures), and there are also more specialized categories like 'discretionary ligatures', 'historical ligatures', and 'contextual alternates'. while these last ones are not technically ligatures, they are generally similar in that they replace specific combinations of letters when they appear together. while more common in script typefaces, in the below example they are used to create arrows: position (font-variant-position) position variants are used to enable typographic superscript and subscript glyphs. these are designed to work with the surrounding text without altering the baseline or line spacing. this is one of the key benefits over using the <sub> or sup elements. capitals (font-variant-caps) one of the more common use cases for opentype features is proper small caps. these are c...
CSS Fonts - CSS: Cascading Style Sheets
Web › CSS › CSS Fonts
le fonts guide for more information and usage information. ...
Box alignment in CSS Grid Layout - CSS: Cascading Style Sheets
he box alignment specification are designed to work with writing modes in css. this means that if you are working in a right to left language, such as arabic, the start of the grid would be the top and right, so the default of justify-content: start would be for grid tracks to start on the right hand side of the grid. setting auto margins, using margin-right or margin-left however, or absolutely positioning items using the top, right, bottom and left offsets would not honor writing modes. in the next guide, we will look further into this interaction between css grid layout, box alignment and writing modes. this will be important to understand, if you develop sites that are then displayed in multiple languages, or if you want to mix languages or writing modes in a design. ...
Consistent list indentation - CSS: Cascading Style Sheets
what's key is that the markers are placed outside the "principal box" of the <li> elements, not the <ul>. they're sort of like appendages to the list items, hanging outside the content-area of the <li> but still attached to the <li>. 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. if it's changed to inside, then the markers are brought inside the <li>'s content, as though they're an inline box placed at the very beginning of the <li>. indenting it twice so how will all this appear in a document? at the moment, we have a situation analogous to these styles: ul, li {margin-left: 0; padding-left: 0;} if we dropped this list into a document as-is, there would b...
CSS Lists - CSS: Cascading Style Sheets
using css counters explains how to use the css counter properties to control list counters. ...
Basic concepts of Logical Properties and Values - CSS: Cascading Style Sheets
logical properties and values specification introduces flow-relative mappings for many of the properties and values in css. this article introduces the specification, and explains flow relative properties and values. why do we need logical properties? css traditionally has sized things according to the physical dimensions of the screen. therefore we describe boxes as having a width and height, position items from the top and left, float things left, assign borders, margin, and padding to the top, right, bottom, left, etc. the logical properties and values specification defines mappings for these physical values to their logical, or flow relative, counterparts — e.g. start and end as opposed to left and right/top and bottom. an example of why these mappings might be needed is as follows. i ha...
CSS Masking - CSS: Cascading Style Sheets
css masking is a css module that defines means, including masking and clipping, for partially or fully hiding portions of visual elements. 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. recommendation initial definition ...
CSS Ruby Layout - CSS: Cascading Style Sheets
Web › CSS › CSS Ruby
css ruby layout is a module of css that provides the rendering model and formatting controls related to the display of ruby annotation. ...
CSS Scroll Snap - CSS: Cascading Style Sheets
note: the previous version of this module was called scroll snap points and has been deprecated. css scroll snap is the current implementation. ...
Using the :target pseudo-class in selectors - CSS: Cascading Style Sheets
the intent is to create a "blanket" style that will apply to all targeted elements, then the universal selector comes in handy: :target { color: red; } example in the following example, there are five links that point to elements in the same document. selecting the "first" link, for example, will cause <h1 id="one"> to become the target element. note that the document may jump to a new scroll position, since target elements are placed on the top of the browser window if possible. <h4 id="one">...</h4> <p id="two">...</p> <div id="three">...</div> <a id="four">...</a> <em id="five">...</em> <a href="#one">first</a> <a href="#two">second</a> <a href="#three">third</a> <a href="#four">fourth</a> <a href="#five">fifth</a> conclusion in cases where a fragment identifier points to a portion of...
CSS Text Decoration - CSS: Cascading Style Sheets
coration is a module of css that defines features relating to text decoration, such as underlines, text shadows, and emphasis marks. 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. examples .under { text-decoration: underline red; } .over { text-decoration: wavy overline lime; } .line { text-decoration: line-through; } .plain { text-decoration: none; } .underover { text-decoration: dashed underline overline; } .thick { text-decoration...
CSS data types - CSS: Cascading Style Sheets
Web › CSS › CSS Types
int> <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> <position> <quote> <ratio> <resolution> <shape-box> <shape-radius> <string> <time> <time-percentage> <timing-function> <toggle-value> <transform-function> <type-or-unit> <url> <url-modifier> <zero> specifications specification status comment css values and units module level 4 editor's draft css values and units module level 3 candidate reco...
Grid wrapper - CSS: Cascading Style Sheets
...
Layout mode - CSS: Cascading Style Sheets
a css layout mode, sometimes simply called layout, is an algorithm that determines the position and size of boxes based on the way they interact with their sibling and ancestor boxes. there are several of them: normal flow — all elements are part of normal flow until you do something to take them out of it. normal flow includes block layout, designed for laying out boxes such as paragraphs and inline layout, which lays out inline items such as text. table layout, designed for laying out tables. float layout, designed to cause an item to position itself left or right with the rest of the content in normal flow wrapping around it. positioned layout, designed for positioning elements without much interaction with other elements. multi-column layout, designed for laying content out in column...
Mozilla CSS extensions - CSS: Cascading Style Sheets
al -moz-hidden-unscrollable text-align -moz-center -moz-left -moz-right text-decoration -moz-anchor-decoration -moz-user-select -moz-all -moz-none width, min-width, and max-width -moz-min-content -moz-fit-content -moz-max-content -moz-available pseudo-elements and pseudo-classes a – d ::-moz-anonymous-block eg@:- bug 331432 ::-moz-anonymous-positioned-block :-moz-any :-moz-any-link [matches :link and :visited] :-moz-broken ::-moz-canvas ::-moz-color-swatch ::-moz-cell-content :-moz-drag-over f – i :-moz-first-node ::-moz-focus-inner ::-moz-focus-outer :-moz-focusring :-moz-full-screen :-moz-full-screen-ancestor :-moz-handler-blocked :-moz-handler-crashed :-moz-handler-disabled ::-moz-inline-table l :-moz-last-...
Pseudo-classes - CSS: Cascading Style Sheets
ointer hovers over it. /* any button over which the user's pointer is hovering */ button:hover { color: blue; } pseudo-classes let you apply a style to an element not only in relation to the content of the document tree, but also in relation to external factors like the history of the navigator (:visited, for example), the status of its content (like :checked on certain form elements), or the position of the mouse (like :hover, which lets you know if the mouse is over an element or not). note: in contrast to pseudo-classes, pseudo-elements can be used to style a specific part of an element. syntax selector:pseudo-class { property: value; } like regular classes, you can chain together as many pseudo-classes as you want in a selector. index of standard pseudo-classes :active :any-...
Syntax - CSS: Cascading Style Sheets
Web › CSS › Syntax
the css syntax reflects this goal and its basic building blocks are: the property which is an identifier, that is a human-readable name, that defines which feature is considered. the value which describe how the feature must be handled by the engine. each property has a set of valid values, defined by a formal grammar, as well as a semantic meaning, implemented by the browser engine. ...
Viewport concepts - CSS: Cascading Style Sheets
.documentelement.clientheight /* 533 */ window.innerheight /* 533 */ window.outerheight /* 596 in firefox, 900 in chrome */ the viewport was originally 1200 x 800 pixels. upon zooming in, the viewport became 800 x 533 pixels. this is the layout viewport. sticky headers or footers, with the following styles, will stick to the top and bottom of the layout viewport respectively. body > header { position: fixed; top: 0; } body > footer { position: fixed; bottom: 0; } we got the 800 x 533 measurement when we zoomed in using the keyboard. the header and footer stayed flush against the top and bottom of the window. but what if we had pinched-zoomed on a tablet? what if a dynamic keyboard pops open on a phone? the web contains two viewports, the layout viewport and the visual viewport. the v...
Actual value - CSS: Cascading Style Sheets
ay round the thickness of the border to the nearest integer. calculating a property's actual value the user agent performs four steps to calculate a property's actual (final) value: first, the specified value is determined based on the result of cascading, inheritance, or using the initial value. next, the computed value is calculated according to the specification (for example, a span with position: absolute will have its computed display changed to block). then, layout is calculated, resulting in the used value. finally, the used value is transformed according to the limitations of the local environment, resulting in the actual value. specifications specification status comment css level 2 (revision 1)the definition of 'actual value' in that specification. ...
backdrop-filter - CSS: Cascading Style Sheets
er-radius: 5px; font-family: sans-serif; text-align: center; line-height: 1; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); max-width: 50%; max-height: 50%; padding: 20px 40px; } html, body { height: 100%; width: 100%; } body { background-image: url(https://picsum.photos/id/1080/6858/4574), linear-gradient(rgb(219, 166, 166), rgb(0, 0, 172)); background-position: center center; background-repeat: no-repeat; background-size: cover; } .container { align-items: center; display: flex; justify-content: center; height: 100%; width: 100%; } html <div class="container"> <div class="box"> <p>backdrop-filter: blur(10px)</p> </div> </div> result specifications specification status comment filter effects mod...
backface-visibility - CSS: Cascading Style Sheets
iv { backface-visibility: visible; } .hidebf div { backface-visibility: hidden; } /* define the container div, the cube div, and a generic face */ .container { width: 150px; height: 150px; margin: 75px 0 0 75px; border: none; } .cube { width: 100%; height: 100%; perspective: 550px; perspective-origin: 150% 150%; transform-style: preserve-3d; } .face { display: block; position: absolute; width: 100px; height: 100px; border: none; line-height: 100px; font-family: sans-serif; font-size: 60px; color: white; text-align: center; } /* define each face based on direction */ .front { background: rgba(0, 0, 0, 0.3); transform: translatez(50px); } .back { background: rgba(0, 255, 0, 1); color: black; transform: rotatey(180deg) translatez(50px); } .ri...
border-radius - CSS: Cascading Style Sheets
a single radius to make circular corners, or two radii to make elliptical corners. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. the radius applies to the whole background, even if the element has no border; the exact position of the clipping is defined by the background-clip property. the border-radius property does not apply to table elements when border-collapse is collapse. note: as with any shorthand property, individual sub-properties cannot inherit, such as in border-radius:0 0 inherit inherit, which would partially override existing definitions. instead, the individual longhand properties have to be used. co...
box-sizing - CSS: Cascading Style Sheets
padding you added, and the content box will shrink to absorb that extra width. this typically makes it much easier to size elements. note: it is often useful to set box-sizing to border-box to layout elements. this makes dealing with the sizes of elements much easier, and generally eliminates a number of pitfalls you can stumble on while laying out your content. on the other hand, when using position: relative or position: absolute, use of box-sizing: content-box allows the positioning values to be relative to the content, and independent of changes to border and padding sizes, which is sometimes desirable. syntax the box-sizing property is specified as a single keyword chosen from the list of values below. values content-box this is the initial and default value as specified by the c...
clear - CSS: Cascading Style Sheets
Web › CSS › clear
non-floating blocks, it moves the border edge of the element down until it is below the margin edge of all relevant floats. the non-floated block's top margin collapses. vertical margins between two floated elements on the other hand will not collapse. when applied to floating elements, the margin edge of the bottom element is moved below the margin edge of all relevant floats. this affects the position of later floats, since later floats cannot be positioned higher than earlier ones. the floats that are relevant to be cleared are the earlier floats within the same block formatting context. if an element contains only floated elements, its height collapses to nothing. if you want it to always be able to resize, so that it contains floating elements inside it, you need to self-clear its childr...
contain - CSS: Cascading Style Sheets
Web › CSS › contain
the entire page, leading to obvious performance benefits. this property is useful on pages that contain a lot of widgets that are all independent, as it can be used to prevent each widget's internals from having side effects outside of the widget's bounding-box. note: if applied (with value: paint, strict or content), this property creates: a new containing block (for the descendants whose position property is absolute or fixed). a new stacking context. a new block formatting context. 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 pro...
cursor - CSS: Cascading Style Sheets
Web › CSS › cursor
css level 2 (revision 1)the definition of 'cursor' in that specification. recommendation initial definition. ...
<custom-ident> - CSS: Cascading Style Sheets
ya, persian, simp-chinese-formal, simp-chinese-informal, tamil, telugu, thai, tibetan, trad-chinese-formal, trad-chinese-informal, upper-armenian, disclosure-open, and disclosure-close. grid-row-start grid-row-end grid-column-start grid-column-end forbids the span value. will-change forbids the global css values (unset, initial, and inherit), as well as the values will-change, auto, scroll-position, and contents. examples valid identifiers nono79 a mix of alphanumeric characters and numbers ground-level a mix of alphanumeric characters and a dash -test a dash followed by alphanumeric characters _internal an underscore followed by alphanumeric characters \22 toto a unicode character followed by a sequence of alphanumeric characters bili\.bob ...
<display-inside> - CSS: Cascading Style Sheets
play-outside> keywords. syntax valid <display-inside> values: flow the element lays out its contents using flow layout (block-and-inline layout). if its outer display type is inline or run-in, and it is participating in a block or inline formatting context, then it generates an inline box. otherwise it generates a block container box. depending on the value of other properties (such as position, float, or overflow) and whether it is itself participating in a block or inline formatting context, it either establishes a new block formatting context (bfc) for its contents or integrates its contents into its parent formatting context. flow-root the element generates a block element box that establishes a new block formatting context, defining where the formatting root lies. table these...
<easing-function> - CSS: Cascading Style Sheets
</option> <option>ease</option> <option>ease-in</option> <option>ease-in-out</option> <option>ease-out</option> <option>cubic-bezier(0.1, -0.6, 0.2, 0)</option> <option>cubic-bezier(0, 1.1, 0.8, 4)</option> <option>steps(5, end)</option> <option>steps(3, start)</option> <option>steps(4)</option> </select> </li> </ul> css body > div { position: relative; height: 100px; } div > div { position: absolute; width: 50px; height: 50px; background-color: blue; background-image: radial-gradient(circle at 10px 10px, rgba(25,255,255,0.8),rgba(25,255,255,0.4)); border-radius: 50%; top: 25px; animation: 1.5s infinite alternate; } @keyframes move-right { from { left: 10%; } to { left: 90%; } } li { display: fl...
flex-basis - CSS: Cascading Style Sheets
test</li> </ul> <ul class="container"> <li class="flex flex6">6: flex-basis test</li> </ul> css .container { font-family: arial, sans-serif; margin: 0; padding: 0; list-style-type: none; display: flex; flex-wrap: wrap; } .flex { background: #6ab6d8; padding: 10px; margin-bottom: 50px; border: 3px solid #2e86bb; color: white; font-size: 14px; text-align: center; position: relative; } .flex:after { position: absolute; z-index: 1; left: 0; top: 100%; margin-top: 10px; width: 100%; color: #333; font-size: 12px; } .flex1 { flex-basis: auto; } .flex1:after { content: 'auto'; } .flex2 { flex-basis: max-content; } .flex2:after { content: 'max-content'; } .flex3 { flex-basis: min-content; } .flex3:after { content: 'min-content'; } .fle...
font-feature-settings - CSS: Cascading Style Sheets
tings: "smcp", "swsh" 2; /* global values */ font-feature-settings: inherit; font-feature-settings: initial; font-feature-settings: unset; whenever possible, web authors should instead use the font-variant shorthand property or an associated longhand property such as font-variant-ligatures, font-variant-caps, font-variant-east-asian, font-variant-alternates, font-variant-numeric or font-variant-position. 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. in particular, font-feature-settings shouldn't be used to enable small caps. values normal text is laid out using default settings. <feature-tag-value> when rende...
grid-auto-columns - CSS: Cascading Style Sheets
the grid-auto-columns css property specifies the size of an implicitly-created grid column track or pattern of tracks. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. if a grid item is positioned into a column that is not explicitly sized by grid-template-columns, implicit grid tracks are created to hold it. this can happen either by explicitly positioning into a column that is out of range, or by the auto-placement algorithm creating additional columns. syntax /* keyword values */ grid-auto-columns: min-content; grid-auto-columns: max-content; grid-auto-columns: auto; /* <length> values */ grid-auto-columns: ...
grid-auto-rows - CSS: Cascading Style Sheets
the grid-auto-rows css property specifies the size of an implicitly-created grid row track or pattern of tracks. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. if a grid item is positioned into a row that is not explicitly sized by grid-template-rows, implicit grid tracks are created to hold it. this can happen either by explicitly positioning into a row that is out of range, or by the auto-placement algorithm creating additional rows. syntax /* keyword values */ grid-auto-rows: min-content; grid-auto-rows: max-content; grid-auto-rows: auto; /* <length> values */ grid-auto-rows: 100px; grid-auto-rows: 20cm; g...
height - CSS: Cascading Style Sheets
Web › CSS › height
nding wcag 2.0 formal definition initial valueautoapplies toall elements but non-replaced inline elements, table columns, and column groupsinheritednopercentagesthe percentage is calculated with respect to the height of the generated box's containing block. if the height of the containing block is not specified explicitly (i.e., it depends on content height), and this element is not absolutely positioned, the value computes to auto. 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 h...
<image> - CSS: Cascading Style Sheets
Web › CSS › image
ss gradient. css determines an object's concrete size using (1) its intrinsic dimensions; (2) its specified size, defined by css properties like width, height, or background-size; and (3) its default size, determined by the kind of property the image is used with: kind of object (css property) default object size background-image the size of the element's background positioning area list-style-image the size of a 1em character border-image-source the size of the element's border image area cursor the browser-defined size matching the usual cursor size on the client's system mask-image ? shape-outside ? mask-border-source ? symbols for @counter-style at risk feature. if supported, the ...
margin - CSS: Cascading Style Sheets
Web › CSS › margin
ge> the size of the margin as a percentage, relative to the width of the containing block. auto the browser selects a suitable margin to use. for example, in certain cases this value can be used to center an element. ...
mask-clip - CSS: Cascading Style Sheets
Web › CSS › mask-clip
ntent is clipped to the border box. margin-box the painted content is clipped to the margin box. fill-box the painted content is clipped to the object bounding box. stroke-box the painted content is clipped to the stroke bounding box. view-box uses the nearest svg viewport as reference box. 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. no-clip the painted content is not clipped. border this keyword behaves the same as border-box. padding this keyword behaves the same as padding-box. content this keyword behaves the same as content-box. te...
mask-composite - CSS: Cascading Style Sheets
a compositing operation used on the current mask layer with the mask layers below it. /* 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. values for the composition the current mask layer is referred to as source, while all layers below it are referred to as destination. add the source is placed over the destination. subtract the source is placed, where it falls outside of the destination. intersect the parts of source that overlap the destination, replace the destination. exclude the non-overlapping regions of source and destination are combined. ...
max-height - CSS: Cascading Style Sheets
nding wcag 2.0 formal definition initial valuenoneapplies toall elements but non-replaced inline elements, table columns, and column groupsinheritednopercentagesthe percentage is calculated with respect to the height of the generated box's containing block. ...
min-height - CSS: Cascading Style Sheets
t, argument)). formal definition initial valueautoapplies toall elements but non-replaced inline elements, table columns, and column groupsinheritednopercentagesthe percentage is calculated with respect to the height of the generated box's containing block. ...
overflow-anchor - CSS: Cascading Style Sheets
the overflow-anchor css property provides a way to opt out of the browser's scroll anchoring behavior, which adjusts scroll position to minimize content shifts. scroll anchoring behavior is enabled by default in any browser that supports it. therefore, changing the value of this property is typically only required if you are experiencing problems with scroll anchoring in a document or part of a document and need to turn the behavior off. 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. none the element won't be selected as a potential anchor. formal definition initial valueautoappl...
overscroll-behavior-block - CSS: Cascading Style Sheets
when the scroll boundaries of the yellow inner box are reached, the whole page does not begin to scroll.</p> </div> </div> </main> css main { height: 3000px; width: 500px; background-color: white; background-image: repeating-linear-gradient(to bottom, rgba(0,0,0,0) 0px, rgba(0,0,0,0) 19px, rgba(0,0,0,0.5) 20px); } main > div { height: 300px; width: 400px; overflow: auto; position: relative; top: 50px; left: 50px; overscroll-behavior-block: contain; } div > div { height: 1500px; width: 100%; background-color: yellow; background-image: repeating-linear-gradient(to bottom, rgba(0,0,0,0) 0px, rgba(0,0,0,0) 19px, rgba(0,0,0,0.5) 20px); } p { padding: 10px; background-color: rgba(255,0,0,0.5); margin: 0; width: 340px; position: relative; top: 10px; ...
overscroll-behavior-inline - CSS: Cascading Style Sheets
t when the scroll boundaries of the yellow inner box are reached, the whole page does not begin to scroll.</p> </div> </div> </main> css main { height: 400px; width: 3000px; background-color: white; background-image: repeating-linear-gradient(to right, rgba(0,0,0,0) 0px, rgba(0,0,0,0) 19px, rgba(0,0,0,0.5) 20px); } main > div { height: 300px; width: 400px; overflow: auto; position: relative; top: 50px; left: 50px; overscroll-behavior-inline: contain; } div > div { height: 100%; width: 1500px; background-color: yellow; background-image: repeating-linear-gradient(to right, rgba(0,0,0,0) 0px, rgba(0,0,0,0) 19px, rgba(0,0,0,0.5) 20px); } p { padding: 10px; background-color: rgba(255,0,0,0.5); margin: 0; width: 360px; position: relative; top: 10px; ...
overscroll-behavior-x - CSS: Cascading Style Sheets
ts comforably inside the viewport, but its content is given a large width so it will scroll horizontally. by default, when the inner box is scrolled and a scroll boundary is reached, the whole page will begin to scroll, which is probably not what we want. to avoid this, you can set overscroll-behavior-x: contain on the inner box: main > div { height: 300px; width: 500px; overflow: auto; position: relative; top: 100px; left: 100px; overscroll-behavior-x: contain; } specifications specification status comment css overscroll behavior module level 1the definition of 'overscroll-behavior-x' in that specification. working draft ...
place-content - CSS: Cascading Style Sheets
ayout system such as grid or flexbox. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
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. this allows the author to exclude regions of the scrollport that are obscured by other content (such as fixed-positioned toolbars or sidebars) or simply to put more breathing room between a targetted element and the edges of the scrollport. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* keyword values */ scroll-padding-block-end: auto; /* <length> values */ scroll-padding-block-end: 10px; s...
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. this allows the author to exclude regions of the scrollport that are obscured by other content (such as fixed-positioned toolbars or sidebars) or simply to put more breathing room between a targetted element and the edges of the scrollport. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* keyword values */ scroll-padding-block-start: auto; /* <length> values */ scroll-padding-block-start:...
scroll-padding-block - CSS: Cascading Style Sheets
e interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. 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. this allows the author to exclude regions of the scrollport that are obscured by other content (such as fixed-positioned toolbars or sidebars) or simply to put more breathing room between a targeted element and the edges of the scrollport. constituent properties 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: 1e...
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. this allows the author to exclude regions of the scrollport that are obscured by other content (such as fixed-positioned toolbars or sidebars) or simply to put more breathing room between a targetted element and the edges of the scrollport. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* keyword values */ scroll-padding-bottom: auto; /* <length> values */ scroll-padding-bottom: 10px; scroll-padding-bottom: 1em; scroll-...
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. this allows the author to exclude regions of the scrollport that are obscured by other content (such as fixed-positioned toolbars or sidebars) or simply to put more breathing room between a targetted element and the edges of the scrollport. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* keyword values */ scroll-padding-inline-end: auto; /* <length> values */ scroll-padding-inline-end: 10p...
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. this allows the author to exclude regions of the scrollport that are obscured by other content (such as fixed-positioned toolbars or sidebars) or simply to put more breathing room between a targetted element and the edges of the scrollport. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* keyword values */ scroll-padding-inline-start: auto; /* <length> values */ scroll-padding-inline-st...
scroll-padding-inline - CSS: Cascading Style Sheets
e interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. 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. this allows the author to exclude regions of the scrollport that are obscured by other content (such as fixed-positioned toolbars or sidebars) or simply to put more breathing room between a targetted element and the edges of the scrollport. constituent properties this 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-inli...
scroll-padding-left - CSS: Cascading Style Sheets
the source for this interactive example is stored in a github repository. ...
scroll-padding-right - CSS: Cascading Style Sheets
the source for this interactive example is stored in a github repository. ...
scroll-padding-top - CSS: Cascading Style Sheets
the source for this interactive example is stored in a github repository. ...
scroll-padding - CSS: Cascading Style Sheets
interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. 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. this allows the author to exclude regions of the scrollport that are obscured by other content (such as fixed-positioned toolbars or sidebars), or simply to put more breathing room between a targeted element and the edges of the scrollport. constituent properties 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; scr...
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. elements within the scroll container may still define snap points on behalf of the scroll container. repeat(<length-percentage>) defines an interval at which snap points are defined, starting from the container's relevant start edge. only positive lengths are allowed. ...
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. elements within the scroll container may still define snap points on behalf of the scroll container. repeat(<length-percentage>) defines an interval at which snap points are defined, starting from the container's relevant start edge. only positive lengths are allowed. ...
scroll-snap-stop - CSS: Cascading Style Sheets
the scroll-snap-stop css property defines whether the scroll container is allowed to "pass over" possible snap positions. /* 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. always the scroll container must not "pass over" a possible snap position; and must snap to the first of this elements' snap positions. formal definition initial valuenormalapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax normal | always examples snapping in different axes this example is duplicate...
scrollbar-color - CSS: Cascading Style Sheets
the thumb refers to the moving part of the scrollbar, which usually floats on top of the track. syntax /* keyword values */ scrollbar-color: auto; scrollbar-color: dark; scrollbar-color: light; /* <color> values */ scrollbar-color: rebeccapurple green; /* two valid colors. the first applies to the thumb of the scrollbar, the second to the track. ...
text-combine-upright - CSS: Cascading Style Sheets
this property only has an effect in vertical writing modes. this is used to produce an effect that is known as tate-chū-yoko (縦中横) in japanese, or as 直書橫向 in chinese. ...
text-emphasis - CSS: Cascading Style Sheets
ion specified is applied across the whole element. however, text-emphasis does inherit, which means it is possible to change emphasis marks for descendents. the size of the emphasis symbol, like ruby symbols, is about 50% of the size of the font, and text-emphasis may affect line height when the current leading is not enough for the marks. text-emphasis doesn't reset the value of text-emphasis-position. this is because if the style and the color of emphasis marks may vary in a text, it is extremely unlikely that their position will. in the very rare cases when this is needed, the property text-emphasis-position. constituent properties this property is a shorthand for the following css properties: text-emphasis-color text-emphasis-style syntax /* initial value */ text-emphasis: none; /...
text-underline-offset - CSS: Cascading Style Sheets
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. ...
matrix3d() - CSS: Cascading Style Sheets
dth: 100px; height: 100px; transform-style: preserve-3d; transition: transform 1.5s; transform: rotate3d(1, 1, 1, 30deg); margin: 50px auto; } #example-element:hover, #example-element:focus { transform: rotate3d(1, 1, 1, 30deg) matrix3d(1,0,0,0,0,1,6,0,0,0,1,0,50,100,0,1.1); } .face { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; position: absolute; backface-visibility: inherit; font-size: 60px; color: #fff; } .front { background: rgba(90,90,90,.7); transform: translatez(50px); } .back { background: rgba(0,210,0,.7); transform: rotatey(180deg) translatez(50px); } .right { background: rgba(210,0,0,.7); transform: rotatey(90deg) translatez(50px); } .left { background: rgba(0,0,210,.7); transform: ro...
perspective() - CSS: Cascading Style Sheets
iv class="face left">c</div> </div> <p>with perspective (9cm):</p> <div class="perspective-box-far"> <div class="face front">a</div> <div class="face top">b</div> <div class="face left">c</div> </div> <p>with perspective (4cm):</p> <div class="perspective-box-closer"> <div class="face front">a</div> <div class="face top">b</div> <div class="face left">c</div> </div> css .face { position: absolute; width: 100px; height: 100px; line-height: 100px; font-size: 100px; text-align: center; } p + div { width: 100px; height: 100px; transform-style: preserve-3d; margin-left: 100px; } .no-perspective-box { transform: rotatex(-15deg) rotatey(30deg); } .perspective-box-far { transform: perspective(9cm) rotatex(-15deg) rotatey(30deg); } .perspective-box-closer { tra...
rotate() - CSS: Cascading Style Sheets
ultiple transformations to an element, be careful about the order in which you specify your transformations. ...
rotate3d() - CSS: Cascading Style Sheets
defined by the transform-origin property). if, as specified, the vector is not normalized (i.e., if the sum of the square of its three coordinates is not 1), the user agent will normalize it internally. a non-normalizable vector, such as the null vector, [0, 0, 0], will cause the rotation to be ignored, but without invaliding the whole css property. note: unlike rotations in the 2d plane, the composition of 3d rotations is usually not commutative. in other words, the order in which the rotations are applied impacts the result. syntax the amount of rotation created by rotate3d() is specified by three <number>s and one <angle>. the <number>s represent the x-, y-, and z-coordinates of the vector denoting the axis of rotation. the <angle> represents the angle of rotation; if positive, the movement ...
rotateX() - CSS: Cascading Style Sheets
active example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. the axis of rotation passes through an origin, defined by the transform-origin css property. note: rotatex(a) is equivalent to rotate3d(1, 0, 0, a). note: unlike rotations in the 2d plane, the composition of 3d rotations is usually not commutative. in other words, the order in which the rotations are applied impacts the result. syntax the amount of rotation created by rotatex() is specified by an <angle>. if positive, the movement will be clockwise; if negative, it will be counter-clockwise. rotatex(a) values a is an <angle> representing the angle of the rotation. a positive angle denotes...
rotateY() - CSS: Cascading Style Sheets
active example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. the axis of rotation passes through an origin, defined by the transform-origin css property. note: rotatey(a) is equivalent to rotate3d(0, 1, 0, a). note: unlike rotations in the 2d plane, the composition of 3d rotations is usually not commutative. in other words, the order in which the rotations are applied impacts the result. syntax the amount of rotation created by rotatey() is specified by an <angle>. if positive, the movement will be clockwise; if negative, it will be counter-clockwise. rotatey(a) values a is an <angle> representing the angle of the rotation. a positive angle denotes...
rotateZ() - CSS: Cascading Style Sheets
e is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. the axis of rotation passes through an origin, defined by the transform-origin css property. note: rotatez(a) is equivalent to rotate(a) or rotate3d(0, 0, 1, a). note: unlike rotations in the 2d plane, the composition of 3d rotations is usually not commutative. in other words, the order in which the rotations are applied impacts the result. syntax the amount of rotation created by rotatez() is specified by an <angle>. if positive, the movement will be clockwise; if negative, it will be counter-clockwise. rotatez(a) values a is an <angle> representing the angle of the rotation. a positive angle denotes...
scaleZ() - CSS: Cascading Style Sheets
s the identity transform. the scaling is not isotropic, and the angles of the element are not conserved. scalez(-1) defines an axial symmetry, with the z-axis passing through the origin (as specified by the transform-origin property). 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. note: scalez(sz) is equivalent to to scale3d(1, 1, sz). syntax scalez(s) values s is a <number> representing the scaling factor to apply on the z-coordinate of each point of the element. cartesian coordinates on ℝ2 homogeneous coordinates on ℝℙ2 cartesian coordinates on ℝ3 homogeneous coordinates on ℝℙ3 ...
translate() - CSS: Cascading Style Sheets
its result is a <transform-function> data type. this transformation is characterized by a two-dimensional vector. its coordinates define how much the element moves in each direction. syntax /* single <length-percentage> values */ transform: translate(200px); transform: translate(50%); /* double <length-percentage> values */ transform: translate(100px, 200px); transform: translate(100px, 50%); transform: translate(30%, 200px); transform: translate(30%, 50%); values single <length-percentage> values this value is a <length> or <percentage> representing the abscissa (horizontal, x-coordinate) of the translating vector. ...
translate3d() - CSS: Cascading Style Sheets
its result is a <transform-function> data type. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. this transformation is characterized by a three-dimensional vector. its coordinates define how much the element moves in each direction. syntax translate3d(tx, ty, tz) values tx is a <length> or <percentage> representing the abscissa of the translating vector. ty is a <length> or <percentage> representing the ordinate of the translating vector. tz is a <length> representing the z component of the translating vector. ...
translateX() - CSS: Cascading Style Sheets
its result is a <transform-function> data type. note: translatex(tx) is equivalent to translate(tx, 0) or translate3d(tx, 0, 0). syntax /* <length-percentage> values */ transform: translatex(200px); transform: translatex(50%); values <length-percentage> is a <length> or <percentage> representing the abscissa of the translating vector. a percentage value refers to the width of the reference box defined by the transform-box property. ...
translateY() - CSS: Cascading Style Sheets
its result is a <transform-function> data type. note: translatey(ty) is equivalent to translate(0, ty) or translate3d(0, ty, 0). syntax /* <length-percentage> values */ transform: translatey(200px); transform: translatey(50%); values <length-percentage> the value is a <length> or <percentage> representing the ordinate of the translating vector. a percentage value refers to the height of the reference box defined by the transform-box property. ...
<transform-function> - CSS: Cascading Style Sheets
ain> css main { width: 400px; height: 200px; padding: 50px; background-image: linear-gradient(135deg, white, cyan, white); } #example-element { width: 100px; height: 100px; transform-style: preserve-3d; transition: transform 1.5s; transform: rotate3d(1, 1, 1, 30deg); } .face { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; position: absolute; backface-visibility: inherit; font-size: 60px; color: #fff; } .front { background: rgba(90,90,90,.7); transform: translatez(50px); } .back { background: rgba(0,210,0,.7); transform: rotatey(180deg) translatez(50px); } .right { background: rgba(210,0,0,.7); transform: rotatey(90deg) translatez(50px); } .left { background: rgba(0,0,210,.7); transform: ro...
transform - CSS: Cascading Style Sheets
Web › CSS › transform
ual formatting model. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. if the property has a value different than none, a stacking context will be created. in that case, the element will act as a containing block for any position: fixed; or position: absolute; elements that it contains. only transformable elements can be transformed. that is, all elements whose layout is governed by the css box model except for: non-replaced inline boxes, table-column boxes, and table-column-group boxes. syntax /* keyword values */ transform: none; /* function values */ transform: matrix(1.0, 2.0, 3.0, 4.0, 5.0, 6.0); transform: mat...
vertical-align - CSS: Cascading Style Sheets
ource for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. the vertical-align property can be used in two contexts: to vertically align an inline element's box inside its containing line box. ...
CSS: Cascading Style Sheets
Web › CSS
oked at css fundamentals, how to style text, and how to style and manipulate the boxes that your content sits inside. now it's time to look at how to place your boxes in the right place concerning the viewport, and one another. 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. use css to solve common problems this module provides links to sections of content explaining how to use css to solve common problems when creating a web page. reference css reference: this exhaustive reference for seasoned web developers describes every property and concept of css. css key concepts: the syn...
regexp:match() - EXSLT
Web › EXSLT › regexp › match
as captured by the regular expression. if the match isn't a global one, the first match element has the value of the portion of the string matched by the entire regular expression. ...
Adding captions and subtitles to HTML5 video - Developer guides
lt, so an event listener needs to be added to our subtitles button to toggle it: subtitles.addeventlistener('click', function(e) { if (subtitlesmenu) { subtitlesmenu.style.display = (subtitlesmenu.style.display == 'block' ? ...
Audio and Video Delivery - Developer guides
hould also be removed before calling load(). note that just setting the src attribute to an empty string will actually cause the browser to treat it as though you're setting a video source to a relative path. this causes the browser to attempt another download to something that is unlikely to be a valid video. seeking through media media elements provide support for moving the current playback position to specific points in the media's content. this is done by setting the value of the currenttime property on the element; see htmlmediaelement for further details on the element's properties. simply set the value to the time, in seconds, at which you want playback to continue. you can use the element's seekable property to determine the ranges of the media that are currently available for seeking...
Event developer guide - Developer guides
Web › Guide › Events
he remaining pages describe how to use events of different kinds defined by web browsers. unfortunately, these events have been defined piece by piece as web browsers have evolved so that there is no satisfying systematic characterization of the events built-in or defined by modern web browsers. the device on which the web browser is running can trigger events, for example due to a change in its position and orientation in the real world, as discussed partially by the page on orientation coordinate systems and the page on the use of 3d transforms. that is different, but similar, to the change in device vertical orientation. the window in which the browser is displayed can trigger events; for example, change size if the user maximizes the window or otherwise changes it. the process loading of a ...
Making content editable - Developer guides
be editable. by using some javascript event handlers, you can transform your web page into a full and fast rich text editor. this article provides some information about this functionality. note: in firefox 63 beta/dev edition, some of the rich-text editing features have been disabled by default, for better cross-browser compatibility. these are object resizing on <img>, <table>, and absolutely-positioned elements; inline table editing to add or remove rows and columns; and the grabber that allows moving of absolutely-positioned elements. see bug 1449564 and firefox-specific html editing ui has been deprecated for additional details. how does it work? all you have to do is set the contenteditable attribute on nearly any html element to make it editable. here's a simple example which creates ...
Constraint validation - Developer guides
traint combining several fields: postal code validation the postal code format varies from one country to another. not only do most countries allow an optional prefix with the country code (like d- in germany, f- in france or switzerland), but some countries have postal codes with only a fixed number of digits; others, like the uk, have more complex structures, allowing letters at some specific positions. note: this is not a comprehensive postal code validation library, but rather a demonstration of the key concepts. as an example, we will add a script checking the constraint validation for this simple form: <form> <label for="zip">zip : </label> <input type="text" id="zip"> <label for="country">country : </label> <select id="country"> <option value="ch">switzerland</o...
HTML5 - Developer guides
Web › Guide › HTML › HTML5
w limit. online and offline events in order to build a good offline-capable web application, you need to know when your application is actually offline. incidentally, you also need to know when your application has returned to an online status again. device access touch events handlers to react to events created by a user pressing touch screens. using geolocation let browsers locate the position of the user using geolocation. detecting device orientation get the information when the device on which the browser runs changes orientation. this can be used as an input device (e.g., to make games that react to the position of the device) or to adapt the layout of a page to the orientation of the screen (portrait or landscape). pointer lock api allows locking the pointer to the content, so...
Printing - Developer guides
is.__container__); } function setprint () { this.contentwindow.__container__ = this; this.contentwindow.onbeforeunload = closeprint; this.contentwindow.onafterprint = closeprint; this.contentwindow.focus(); // required for ie this.contentwindow.print(); } function 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...
Applying color to HTML elements using CSS - HTML: Hypertext Markup Language
rgb(255, 0, 0, 0.5) or rgb(100%, 0, 0, 50%). hsl functional notation designers and artists often prefer to work using the hsl (hue/saturation/luminosity) color method. on the web, hsl colors are represented using hsl functional notation. the hsl() css function is very similar to the rgb() function in usage otherwise. figure 1. an hsl color cylinder. hue defines the actual color based on the position along a circular color wheel representing the colors of the visible spectrum. saturation is a percentage of how much of the way between being a shade of gray and having the maximum possible amount of the given hue. as the value of luminance (or lightness) increases, the color transitions from the darkest possible to the brightest possible (from black to white). image courtesy of user sharkd on wi...
HTML attribute: step - HTML: Hypertext Markup Language
Web › HTML › Attributes › step
...
Date and time formats used in HTML - HTML: Hypertext Markup Language
s normally 365 days long, except during leap years. leap years a leap year is any year which is divisible by 400 or the year is divisible by 4 but not by 100. although the calendar year is normally 365 days long, it actually takes the planet earth approximately 365.2422 days to complete a single orbit around the sun. leap years help to adjust the calendar to keep it synchronized with the actual position of the planet in its orbit. adding a day to the year every four years essentially makes the average year 365.25 days long, which is close to correct. the adjustments to the algorithm (taking a leap year when the year can be divided by 400, and skipping leap years when the year is divisible by 100) help to bring the average even closer to the correct number of days (365.2425 days). scientists occ...
<applet>: The Embed Java Applet element - HTML: Hypertext Markup Language
Web › HTML › Element › applet
sing content, embedded content, interactive content, palpable content. permitted content zero or more <param> elements, then transparent. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that accepts embedded content. dom interface htmlappletelement attributes align this attribute is used to position the applet on the page relative to content that might flow around it. the html 4.01 specification defines values of bottom, left, middle, right, and top, whereas microsoft and netscape also might support absbottom, absmiddle, baseline, center, and texttop. alt this attribute causes a descriptive text alternate to be displayed on browsers that do not support java. page designers should also reme...
<area> - HTML: Hypertext Markup Language
Web › HTML › Element › area
ank" on <area> elements implicitly provides the same rel behavior as setting rel="noopener". deprecated attributes name define a names for the clickable area so that it can be scripted by older browsers. nohref indicates that no hyperlink exists for the associated area. note: since html5, omitting the href attribute is sufficient. tabindex a numeric value specifying the position of the defined area in the browser tabbing order. this attribute is global in html5. type no effect. browsers ignore it. (the w3c 5.3 fork of the html specification defines it as valid, but the canonical html specification doesn’t, and it has no effect in any user agents.) examples <map name="primary"> <area shape="circle" coords="75,75,75" href="left.html" alt="click to go left"> <a...
<article>: The Article Contents element - HTML: Hypertext Markup Language
Web › HTML › Element › article
examples include: a forum post, a magazine or newspaper article, or a blog entry. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
<del>: The Deleted Text element - HTML: Hypertext Markup Language
Web › HTML › Element › del
p></del> result accessibility concerns the presence of the del element is not announced by most screen reading technology in its default configuration. it can be made to be announced by using the css content property, along with the ::before and ::after pseudo-elements. 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. because of this, it is important to not abuse this technique and only apply it in situations where not knowing content has been deleted would adv...
<div>: The Content Division element - HTML: Hypertext Markup Language
Web › HTML › Element › div
nt. or (in whatwg html): <dl> element. implicit aria role no corresponding role permitted aria roles any dom interface htmldivelement attributes this element includes the global attributes. note: the align attribute is obsolete; do not use it anymore. instead, you should use css properties or techniques such as css grid or css flexbox to align and position <div> elements on the page. usage notes the <div> element should be used only when no other semantic element (such as <article> or <nav>) is appropriate. examples a simple example <div> <p>any kind of content here. such as &lt;p&gt;, &lt;table&gt;. you name it!</p> </div> the result looks like this: a styled example this example creates a shadowed box by applying a style to the...
<embed>: The Embed External Content element - HTML: Hypertext Markup Language
Web › HTML › Element › embed
es. height the displayed height of the resource, in css pixels. this must be an absolute value; percentages are not allowed. src the url of the resource being embedded. type the mime type to use to select the plug-in to instantiate. width the displayed width of the resource, in css pixels. this must be an absolute value; percentages are not allowed. usage notes you can use the object-position property to adjust the positioning of the embedded object within the element's frame, and the object-fit property to control how the object's size is adjusted to fit within the frame. examples <embed type="video/quicktime" src="movie.mov" width="640" height="480" title="title of my video"> accessibility concerns use the title attribute on an embed element to label its content so that people ...
<iframe>: The Inline Frame element - HTML: Hypertext Markup Language
Web › HTML › Element › iframe
a frame, a script can get a reference to its parent window with window.parent. script access to a frame's content is subject to the same-origin policy. scripts cannot access most properties in other window objects if the script was loaded from a different origin, including scripts inside a frame accessing the frame's parent. cross-origin communication can be achieved using window.postmessage(). positioning and scaling as a replaced element, the position, alignment, and scaling of the embedded document within the <iframe> element's box, can be adjusted with the object-position and object-fit properties. examples a simple <iframe> an <iframe> in action. after creating the frame, when the user clicks a button, its title is displayed in an alert. html <iframe src="https://mdn-samples.mozilla.
<input type="button"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › button
ton" value="clear canvas"> </div> <canvas class="mycanvas"> <p>add suitable fallback here.</p> </canvas> body { background: #ccc; margin: 0; overflow: hidden; } .toolbar { background: #ccc; width: 150px; height: 75px; padding: 5px; } input[type="color"], input[type="button"] { width: 90%; margin: 0 auto; display: block; } input[type="range"] { width: 70%; } span { position: relative; bottom: 5px; } var canvas = document.queryselector('.mycanvas'); var width = canvas.width = window.innerwidth; var height = canvas.height = window.innerheight-85; var ctx = canvas.getcontext('2d'); ctx.fillstyle = 'rgb(0,0,0)'; ctx.fillrect(0,0,width,height); var colorpicker = document.queryselector('input[type="color"]'); var sizepicker = document.queryselector('input[type="rang...
<input type="date"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › date
class="validity"></span> </label> <p> <button>submit</button> </p> </form> if you submit it, you'll see that the browser displays an error and highlights the input as invalid if your entry doesn't match the pattern ####-##-## (where # is a digit from 0 to 9). of course, this doesn't stop people from entering invalid dates, or incorrect formats. so we still have a problem. span { position: relative; } span::after { right: -18px; position: absolute; } input:invalid + span::after { content: '✖'; } input:valid + span::after { content: '✓'; } at the moment, the best way to deal with dates in forms in a cross-browser way is to have the user enter the day, month, and year in separate controls, or to use a javascript library such as jquery date picker. examples in this...
<input type="hidden"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › hidden
rm, pretending to be a bank, and emailing the form to unsuspecting users to trick them into transferring money to the wrong place. this kind of attack is called a cross site request forgery (csrf); pretty much any reputable server-side framework uses hidden secrets to prevent such attacks. as stated previously, placing the secret in a hidden input doesn't inherently make it secure. the key's composition and encoding would do that. the value of the hidden input is that it keeps the secret associated with the data and automatically includes it when the form is sent to the server. you need to use well-designed secrets to actually secure your website. validation hidden inputs don't participate in constraint validation; they have no real value to be constrained. examples let's look at how we mig...
<input type="radio"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › radio
: html { font-family: sans-serif; } div:first-of-type { display: flex; align-items: flex-start; margin-bottom: 5px; } label { margin-right: 15px; line-height: 32px; } input { -webkit-appearance: none; -moz-appearance: none; appearance: none; border-radius: 50%; width: 16px; height: 16px; border: 2px solid #999; transition: 0.2s all linear; margin-right: 5px; position: relative; top: 4px; } input:checked { border: 6px solid black; } button, legend { color: white; background-color: black; padding: 5px 10px; border-radius: 0; border: 0; font-size: 14px; } button:hover, button:focus { color: #999; } button:active { background-color: white; color: black; outline: 1px solid black; } most notable here is the use of the -moz-appearance pr...
<ins> - HTML: Hypertext Markup Language
Web › HTML › Element › ins
</ins> result accessibility concerns the presence of the <ins> element is not announced by most screen reading technology in its default configuration. it can be made to be announced by using the css content property, along with the ::before and ::after pseudo-elements. 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. because of this, it is important to not abuse this technique and only apply it in situations where not knowing content has been inserted would ...
<mark>: The Mark Text element - HTML: Hypertext Markup Language
Web › HTML › Element › mark
ok like this: accessibility concerns the presence of the mark element is not announced by most screen reading technology in its default configuration. it can be made to be announced by using the css content property, along with the ::before and ::after pseudo-elements. 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. because of this, it is important to not abuse this technique and only apply it in situations where not knowing content has been highlighted w...
<marquee>: The Marquee element (Obsolete) - HTML: Hypertext Markup Language
Web › HTML › Element › marquee
red and the value 60 is used instead, unless truespeed is specified. truespeed by default, scrolldelay values lower than 60 are ignored. if truespeed is present, those values are not ignored. vspace sets the vertical margin in pixels or percentage value. width sets the width in pixels or percentage value. event handlers onbounce fires when the marquee has reached the end of its scroll position. it can only fire when the behavior attribute is set to alternate. onfinish fires when the marquee has finished the amount of scrolling that is set by the loop attribute. it can only fire when the loop attribute is set to some number that is greater than 0. onstart fires when the marquee starts scrolling. methods start() starts scrolling of the marquee. stop() stops scrolling of the m...
<object> - HTML: Hypertext Markup Language
Web › HTML › Element › object
m> element in the same document. height the height of the displayed resource, in css pixels. -- (absolute values only. no percentages) name the name of valid browsing context (html5), or the name of the control (html 4). standbyhtml 4 onlyobsolete since html5 a message that the browser can show while loading the object's implementation and data. tabindexhtml 4 onlyobsolete since html5 the position of the element in the tabbing navigation order for the current document. type the content type of the resource specified by data. at least one of data and type must be defined. typemustmatchhtml5 this boolean attribute indicates if the type attribute and the actual content type of the resource must match to be used. usemap a hash-name reference to a <map> element; that is a '#' followed by ...
<picture>: The Picture element - HTML: Hypertext Markup Language
Web › HTML › Element › picture
tag omission none, both the starting and ending tag are mandatory. permitted parents any element that allows embedded content. implicit aria role no corresponding role permitted aria roles no role permitted dom interface htmlpictureelement attributes this element includes only global attributes. usage notes you can use the object-position property to adjust the positioning of the image within the element's frame, and the object-fit property to control how the image is resized to fit within the frame. note: use these properties on the child <img> element, not the <picture> element. examples these examples demonstrate how different attributes of the <source> element change the selection of the image inside <picture>. the media...
<rp>: The Ruby Fallback Parenthesis element - HTML: Hypertext Markup Language
Web › HTML › Element › rp
please clone https://github.com/mdn/interactive-examples and send us a pull request. content categories none. permitted content text tag omission the end tag can be omitted if the element is immediately followed by an <rt> or another <rp> element, or if there is no more content in the parent element. permitted parents a <ruby> element. <rp> must be positioned immediately before or after an <rt> element. implicit aria role no corresponding role permitted aria roles any dom interface htmlelement attributes this element only includes the global attributes. usage notes ruby annotations are for showing pronunciation of east asian characters, like using japanese furigana or taiwanese bopomofo characters. the...
<s> - HTML: Hypertext Markup Language
Web › HTML › Element › s
salmon</span> sold out accessibility concerns the presence of the s element is not announced by most screen reading technology in its default configuration. it can be made to be announced by using the css content property, along with the ::before and ::after pseudo-elements. 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. because of this, it is important to not abuse this technique and only apply it in situations where not knowing content has been struc...
<sup>: The Superscript element - HTML: Hypertext Markup Language
Web › HTML › Element › sup
ending tag are mandatory. permitted parents any element that accepts phrasing content. implicit aria role no corresponding role permitted aria roles any dom interface htmlelement attributes this element only includes the global attributes. usage notes the <sup> element should only be used for typographical reasons—that is, to change the position of the text to comply with typographical conventions or standards, rather than solely for presentation or appearance purposes. for example, to style the wordmark of a business or product which uses a raised baseline should be done using css (most likely vertical-align) rather than <sup>. this would be done using, for example, vertical-align: super or, to shift the baseline up 50%, vertical-align...
<td>: The Table Data Cell element - HTML: Hypertext Markup Language
Web › HTML › Element › td
cell height. use the css height property instead. scope this enumerated attribute defines the cells that the header (defined in the <th>) element relates to. only use this attribute with the <th> element to define the row or column for which it is a header. valign this attribute specifies how a text is vertically aligned inside a cell. possible values for this attribute are: baseline: positions the text near the bottom of the cell and aligns it with the baseline of the characters instead of the bottom. if characters don't descend below the baseline, the baseline value achieves the same effect as bottom. bottom: positions the text near the bottom of the cell. middle: centers the text in the cell. and top: positions the text near the top of the cell. to achieve a similar effect...
<textarea> - HTML: Hypertext Markup Language
Web › HTML › Element › textarea
lt, its display value is block. compared to other form elements it is relatively easy to style, with its box model, fonts, color scheme, etc. being easily manipulable using regular css. styling html forms provides some useful tips on styling <textarea>s. baseline inconsistency the html specification doesn't define where the baseline of a <textarea> is, so different browsers set it to different positions. for gecko, the <textarea> baseline is set on the baseline of the first line of the textarea's first line, on another browser it may be set on the bottom of the <textarea> box. don't use vertical-align: baseline on it; the behavior is unpredictable. controlling whether a textarea is resizable in most browsers, <textarea>s are resizable — you'll notice the drag handle in the right hand corner...
<th> - HTML: Hypertext Markup Language
Web › HTML › Element › th
st standard. height deprecated since html4, obsolete since html5 this attribute is used to define a recommended cell height. note: do not use this attribute as it is obsolete in the latest standard: use the css height property instead. valign obsolete since html5 this attribute specifies how a text is vertically aligned inside a cell. possible values for this attribute are: baseline: positions the text near the bottom of the cell and aligns it with the baseline of the characters instead of the bottom. if characters don't descend below the baseline, the baseline value achieves the same effect as bottom. bottom: positions the text near the bottom of the cell. middle: centers the text in the cell. and top: positions the text near the top of the cell. note: do not use this attri...
<title>: The Document Title element - HTML: Hypertext Markup Language
Web › HTML › Element › title
lly display about the first 55–60 characters of a page title. text beyond that may be lost, so try not to have titles longer than that. if you must use a longer title, make sure the important parts come earlier and that nothing critical is in the part of the title that is likely to be dropped. don't use "keyword blobs." if your title is just a list of words, algorithms often reduce your page's position in the search results. try to make sure your titles are as unique as possible within your own site. duplicate—or near-duplicate—titles can contribute to inaccurate search results. example <title>awesome interesting stuff</title> this example establishes a page whose title (as displayed at the top of the window or in the window's tab) as "awesome interesting stuff". accessibility concer...
<wbr> - HTML: Hypertext Markup Language
Web › HTML › Element › wbr
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. content categories flow content, phrasing content. permitted content empty tag omission it is an empty element; it must have a start tag, but must not have an end tag. permitted parents any element that accepts phrasing content. ...
tabindex - HTML: Hypertext Markup Language
its order is defined by the document's source order. a positive value means the element should be focusable in sequential keyboard navigation, with its order defined by the value of the number. that is, tabindex="4" is focused before tabindex="5" and tabindex="0", but after tabindex="3". if multiple elements share the same positive tabindex value, their order relative to each other follows their position in the document source. the maximum value for tabindex is 32767. if not specified, it takes the default value 0. avoid using tabindex values greater than 0. doing so makes it difficult for people who rely on assistive technology to navigate and operate page content. instead, write the document with the elements in a logical sequence. if you set the tabindex attribute on a <div>, then ...
Evolution of HTTP - HTTP
ustiness of a mostly academic network, to a jungle where advertisers, random individuals or criminals compete to get as much private information about people, try to impersonate them or even to replace data transmitted by altered ones. as the applications built over http became more and more powerful, having access to more and more private information like address books, e-mail, or the geographic position of the user, the need to have tls became ubiquitous even outside the e-commerce use case. using http for complex applications the original vision of tim berners-lee for the web wasn't a read-only medium. he envisioned a web where people can add and move documents remotely, a kind of distributed file system. around 1996, http has been extended to allow authoring, and a standard called webdav was...
Basics of HTTP - HTTP
on concepts like resources and uniform resource identifiers (uris), simple message structure, and client-server communication flow. on top of these basic concepts, numerous extensions have been developed over the years that add updated functionality and semantics with new http methods or headers. articles overview of http describes what http is and its role in web architecture, including its position in the protocol stack. evolution of http http was created in the early 1990s and has been extended several times. this article goes through its history and describes http/0.9, http/1.0, http/1.1, and the modern http/2, as well as novelties introduced over the years. resources and uris a brief introduction to the concept of resources, identifiers, and locations on the web. identifying resourc...
Content Security Policy (CSP) - HTTP
Web › HTTP › CSP
or process them in whatever manner you determine is appropriate. violation report syntax the report json object contains the following data: blocked-uri the uri of the resource that was blocked from loading by the content security policy. if the blocked uri is from a different origin than the document-uri, then the blocked uri is truncated to contain just the scheme, host, and port. disposition either "enforce" or "report" depending on whether the content-security-policy-report-only header or the content-security-policy header is used. document-uri the uri of the document in which the violation occurred. effective-directive the directive whose enforcement caused the violation. original-policy the original policy as specified by the content-security-policy http header. referrer ...
Configuring servers for Ogg media - HTTP
guide to media types and formats on the web. in particular, the article on media container formats will be especially helpful when configuring serers to host media properly. handle http 1.1 byte range requests correctly in order to support seeking and playing back regions of the media that aren't yet downloaded, gecko uses http 1.1 byte-range requests to retrieve the media from the seek target position. in addition, gecko uses byte-range requests to seek to the end of the media (assuming you serve the content-length header) in order to determine the duration of the media. your server should accept the accept-ranges: bytes http header if it can accept byte-range requests. it must return 206: partial content to all byte range requests; otherwise, browsers can't be sure you actually support byte ...
Content negotiation - HTTP
ct token is a name followed by a '/' and a version number, like firefox/4.0.1. there may be as many of them as the user-agent wants. a comment is a free string delimited by parentheses. obviously parentheses cannot be used in that string. the inner format of a comment is not defined by the standard, though several browser put several tokens in it, separated by ';'. the vary response header in opposition to the previous accept-* headers which are sent by the client, the vary http header is sent by the web server in its response. it indicates the list of headers used by the server during the server-driven content negotiation phase. the header is needed in order to inform the cache of the decision criteria so that it can reproduce it, allowing the cache to be functional while preventing serving err...
Content-Type - HTTP
" value="some text"> <input type="file" name="myfile"> <button type="submit">submit</button> </form> the request looks something like this (less interesting headers are omitted here): post /foo http/1.1 content-length: 68137 content-type: multipart/form-data; boundary=---------------------------974767299852498929531610575 -----------------------------974767299852498929531610575 content-disposition: form-data; name="description" some text -----------------------------974767299852498929531610575 content-disposition: form-data; name="myfile"; filename="foo.txt" content-type: text/plain (content of the uploaded file foo.txt) -----------------------------974767299852498929531610575-- specifications specification title rfc 7233, section 4.1: content-type in multipar...
Feature-Policy - HTTP
sks should execute in frames while they're outside of the visible viewport. fullscreen controls whether the current document is allowed to use element.requestfullscreen(). when this policy is disabled, the returned promise rejects with a typeerror. geolocation controls whether the current document is allowed to use the geolocation interface. when this policy is disabled, calls to getcurrentposition() and watchposition() will cause those functions' callbacks to be invoked with a positionerror code of permission_denied. gyroscope controls whether the current document is allowed to gather information about the orientation of the device through the gyroscope interface. layout-animations controls whether the current document is allowed to show layout animations. legacy-image-formats con...
HTTP headers - HTTP
Web › HTTP › Headers
where a fetch originates from. timing-allow-origin specifies origins that are allowed to see values of attributes retrieved via features of the resource timing api, which would otherwise be reported as zero due to cross-origin restrictions. do not track dnt expresses the user's tracking preference. tk indicates the tracking status of the corresponding response. downloads content-disposition indicates if the resource transmitted should be displayed inline (default behavior without the header), or if it should be handled like a download and the browser should present a “save as” dialog. message body information content-length the size of the resource, in decimal number of bytes. content-type indicates the media type of the resource. content-encoding used to specify the ...
JavaScript data types and data structures - JavaScript
number, but it is loosely so. a bigint behaves like a number in cases where it is converted to boolean: if, ||, &&, boolean, !. bigints cannot be operated on interchangeably with numbers. instead a typeerror will be thrown. string type javascript's string type is used to represent textual data. it is a set of "elements" of 16-bit unsigned integer values. each element in the string occupies a position in the string. the first element is at index 0, the next at index 1, and so on. the length of a string is the number of elements in it. unlike some programming languages (such as c), javascript strings are immutable. this means that once a string is created, it is not possible to modify it. however, it is still possible to create another string based on an operation on the original string. for ...
Regular expressions - JavaScript
bal i case-insensitive search. regexp.prototype.ignorecase m multi-line search. regexp.prototype.multiline s allows . to match newline characters. regexp.prototype.dotall u "unicode"; treat a pattern as a sequence of unicode code points. regexp.prototype.unicode y perform a "sticky" search that matches starting at the current position in the target string. see sticky. regexp.prototype.sticky to include a flag with the regular expression, use this syntax: var re = /pattern/flags; or var re = new regexp('pattern', 'flags'); note that the flags are an integral part of a regular expression. they cannot be added or removed later. for example, re = /\w+\s/g creates a regular expression that looks for one or more cha...
JavaScript Guide - JavaScript
ar 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 proxy handlers and traps revocable proxy reflect javascript modules exporting importing default exports renaming features aggregating modules dynamic module loading next » ...
SyntaxError: invalid regular expression flag "x" - JavaScript
'pattern', 'flags'); regular expression flags flag description g global search. i case-insensitive search. m multi-line search. s allow . to match newlines (added in ecmascript 2018) u unicode; treat pattern as a sequence of unicode code points y perform a "sticky" search that matches starting at the current position in the target string. see sticky examples there are only six valid regular expression flags. /foo/bar; // syntaxerror: invalid regular expression flag "b" did you intend to create a regular expression? an expression containing two slashes is interpreted as a regular expression literal. let obj = { url: /docs/web }; // syntaxerror: invalid regular expression flag "w" or did you m...
TypeError: can't define property "x": "obj" is not extensible - JavaScript
de and sloppy mode, a call to object.defineproperty() throws when adding a new property to a non-extensible object. var obj = { }; object.preventextensions(obj); object.defineproperty(obj, 'x', { value: "foo" } ); // typeerror: can't define property "x": "obj" is not extensible to fix this error, you will either need to remove the call to object.preventextensions() entirely, or move it to a position so that the property is added earlier and only later the object is marked as non-extensible. of course you can also remove the property that was attempted to be added, if you don't need it. 'use strict'; var obj = {}; obj.x = 'foo'; // add property first and only then prevent extensions object.preventextensions(obj); ...
SyntaxError: JSON.parse: bad parsing - JavaScript
this string has to be valid json and will throw this error if incorrect syntax was encountered. examples json.parse() does not allow trailing commas both lines will throw a syntaxerror: json.parse('[1, 2, 3, 4,]'); json.parse('{"foo": 1,}'); // syntaxerror json.parse: unexpected character // at line 1...
Array.prototype.copyWithin() - JavaScript
u'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax arr.copywithin(target[, start[, end]]) parameters target zero-based index at which to copy the sequence to. if negative, target will be counted from the end. if target is at or greater than arr.length, nothing will be copied. if target is positioned after start, the copied sequence will be trimmed to fit arr.length. start optional zero-based index at which to start copying elements from. if negative, start will be counted from the end. if start is omitted, copywithin will copy from index 0. end optional zero-based index at which to end copying elements from. copywithin copies up to but not including end. if negative, end will be coun...
Array.prototype.find() - JavaScript
lity with the value instead of using a testing function. if you need to find if any element satisfies the provided testing function, use array.prototype.some(). syntax arr.find(callback(element[, index[, array]])[, thisarg]) parameters callback function to execute on each value in the array, taking 3 arguments: element the current element in the array. index optional the index (position) of the current element in the array. array optional the array that find was called on. thisarg optional object to use as this inside callback. return value the value of the first element in the array that satisfies the provided testing function. otherwise, undefined is returned. description the find method executes the callback function once for each index of the array until the c...
Array.prototype.flat() - JavaScript
depth optional the depth level specifying how deep a nested array structure should be flattened. defaults to 1. return value a new array with the sub-array elements concatenated into it. ...
Array.from() - JavaScript
clojure, php etc) const range = (start, stop, step) => array.from({ length: (stop - start) / step + 1}, (_, i) => start + (i * step)); // generate numbers range 0..4 range(0, 4, 1); // [0, 1, 2,...
Array.prototype.sort() - JavaScript
more elements there are to sort, it may be more efficient to use map for sorting. the idea is to traverse the array once to extract the actual values used for sorting into a temporary array, sort the temporary array, and then traverse the temporary array to achieve the right order. ...
Atomics.notify() - JavaScript
count optional the number of sleeping agents to notify. defaults to +infinity. ...
Function.name - JavaScript
heir name is "anonymous". (new function).name; // "anonymous" anonymous function expression anonymous function expressions that were created using the keyword function or arrow functions would have ""(an empty string) as their name. (function() {}).name; // "" (() => {}).name; // "" inferred function names variables and methods can infer the name of an anonymous function from its syntactic position (new in ecmascript 2015). let f = function() {}; let object = { somemethod: function() {} }; console.log(f.name); // "f" console.log(object.somemethod.name); // "somemethod" you can define a function with a name in a function expression: let object = { somemethod: function object_somemethod() {} }; console.log(object.somemethod.name); // logs "object_somemethod" try { object_somemethod ...
Intl.Locale.prototype.numberingSystem - JavaScript
rals — algorithmic gong gunjala gondi digits gonm masaram gondi digits grek greek upper case numerals — algorithmic greklow greek lower case numerals — algorithmic gujr gujarati digits guru gurmukhi digits hanidays han-character day-of-month numbering for lunar/other traditional calendars hanidec positional decimal system using chinese number ideographs as digits hans simplified chinese numerals — algorithmic hansfin simplified chinese financial numerals — algorithmic hant traditional chinese numerals — algorithmic hantfin traditional chinese financial numerals — algorithmic hebr hebrew numerals — algorithmic hmng pa...
Promise.prototype.catch() - JavaScript
; }; })(this.promise); // calling catch on an already resolved promise promise.resolve().catch(function xxx(){}); // logs: // > > > > > > called .catch on promise{} with arguments: arguments{1} [0: function xxx()] // > > > > > > called .then on promise{} with arguments: arguments{2} [0: undefined, 1: function xxx()] description the catch method is used for error handling in promise composition. since it returns a promise, it can be chained in the same way as its sister method, then(). examples using and chaining the catch method var p1 = new promise(function(resolve, reject) { resolve('success'); }); p1.then(function(value) { console.log(value); // "success!" throw new error('oh, no!'); }).catch(function(e) { console.error(e.message); // "oh, no!" }).then(function(){ cons...
Promise.prototype.then() - JavaScript
e.log(thenprom); }); // logs, in order: // promise {[[promisestatus]]: "pending", [[promisevalue]]: undefined} // "this gets called after the end of the main stack. the value received and returned is: 33" // promise {[[promisestatus]]: "resolved", [[promisevalue]]: 33} description as the then and promise.prototype.catch() methods return promises, they can be chained — an operation called composition. examples using the then method var p1 = new promise((resolve, reject) => { resolve('success!'); // or // reject(new error("error!")); }); p1.then(value => { console.log(value); // success! }, reason => { console.error(reason); // error! }); chaining the then method returns a promise which allows for method chaining. if the function passed as handler to then returns a promise, a...
RegExpInstance.lastIndex - JavaScript
equal to or less than the length of the string and if the regular expression matches the empty string, then the regular expression matches input starting from lastindex. 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. examples using lastindex consider the following sequence of statements: var re = /(hi)?/g; matches the empty string. console.log(re.exec('hi')); console.log(re.lastindex); returns ["hi", "hi"] with lastindex equal to 2. console.log(re.exec('hi')); console.log(re.lastindex); returns ["", undefined], an empty array whose zeroth element is the match stri...
String.prototype.charCodeAt() - JavaScript
ii character set. examples using charcodeat() the following example returns 65, the unicode value for a. 'abc'.charcodeat(0) // returns 65 fixing charcodeat() to handle non-basic-multilingual-plane characters if their presence earlier in the string is unknown this version might be used in for loops and the like when it is unknown whether non-bmp characters exist before the specified index position. function fixedcharcodeat(str, idx) { // ex. fixedcharcodeat('\ud800\udc00', 0); // 65536 // ex. fixedcharcodeat('\ud800\udc00', 1); // false idx = idx || 0; var code = str.charcodeat(idx); var hi, low; // high surrogate (could change last hex to 0xdb7f // to treat high private surrogates // as single characters) if (0xd800 <= code && code <= 0xdbff) { hi = code; low =...
String.prototype.includes() - JavaScript
the includes() method determines whether one string may be found within another string, returning true or false as appropriate. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax str.includes(searchstring[, position]) parameters searchstring a string to be searched for within str. position optional the position within the string at which to begin searching for searchstring. (defaults to 0.) return value true if the search string is found anywhere within the given string; otherwise, false if not. description this method lets you determine whether or not a string includes another string. case-sensitivity...
String.prototype.normalize() - JavaScript
like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax str.normalize([form]) parameters form optional one of "nfc", "nfd", "nfkc", or "nfkd", specifying the unicode normalization form. if omitted or undefined, "nfc" is used. these values have the following meanings: "nfc" canonical decomposition, followed by canonical composition. "nfd" canonical decomposition. "nfkc" compatibility decomposition, followed by canonical composition. "nfkd" compatibility decomposition. return value a string containing the unicode normalization form of the given string. errors thrown rangeerror a rangeerror is thrown if form isn't one of the values specified above. description unic...
String.prototype.split() - JavaScript
multiple characters, that entire character sequence must be found in order to split. if separator is omitted or does not occur in str, the returned array contains one element consisting of the entire string. if separator appears at the beginning (or end) of the string, it still has the effect of splitting. the result is an empty (i.e. zero length) string, which appears at the first (or last) position of the returned array. if separator is an empty string (""), str is converted to an array of each of its utf-16 "characters". warning: when the empty string ("") is used as a separator, the string is not split by user-perceived characters (grapheme clusters) or unicode characters (codepoints), but by utf-16 codeunits. this destroys surrogate pairs. see “how do you get a string to a char...
String.prototype.startsWith() - JavaScript
tswith() method determines whether a string begins with the characters of a specified string, returning true or false as appropriate. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax str.startswith(searchstring[, position]) parameters searchstring the characters to be searched for at the start of this string. position optional the position in this string at which to begin searching for searchstring. defaults to 0. return value true if the given characters are found at the beginning of the string; otherwise, false. description this method lets you determine whether or not a string begins with another st...
String - JavaScript
dex) returns a number that is the utf-16 code unit value at the given index. string.prototype.codepointat(pos) returns a nonnegative integer number that is the code point value of the utf-16 encoded code point starting at the specified pos. string.prototype.concat(str [, ...strn ]) combines the text of two (or more) strings and returns a new string. string.prototype.includes(searchstring [, position]) determines whether the calling string contains searchstring. string.prototype.endswith(searchstring [, length]) determines whether a string ends with the characters of the string searchstring. string.prototype.indexof(searchvalue [, fromindex]) returns the index within the calling string object of the first occurrence of searchvalue, or -1 if not found. string.prototype.lastindexof(search...
TypedArray.prototype.includes() - JavaScript
of the typed array types here. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax typedarray.includes(searchelement[, fromindex]); parameters searchelement the element to search for. fromindex optional. the position in this array at which to begin searching for searchelement; defaults to 0. return value a boolean. examples using includes var uint8 = new uint8array([1,2,3]); uint8.includes(2); // true uint8.includes(4); // false uint8.includes(3, 3); // false // nan handling (only true for float32 and float64) new uint8array([nan]).includes(nan); // false, since the nan passed to the construct...
TypedArray.prototype.reduce() - JavaScript
alue will be equal to initialvalue and currentvalue will be equal to the first value in the typed array. if no initialvalue was provided, then previousvalue will be equal to the first value in the typed array and currentvalue will be equal to the second. if the typed array is empty and no initialvalue was provided, typeerror would be thrown. if the typed array has only one element (regardless of position) and no initialvalue was provided, or if initialvalue is provided but the typed array is empty, the solo value would be returned without calling callback. polyfill this method uses the same algorithm as array.prototype.reduce(), so the same polyfill can be used here: simply replace array.prototype.reduce with typedarray.prototype.reduce. examples sum up all values within an array var total =...
TypedArray.prototype.reduceRight() - JavaScript
equal to initialvalue and currentvalue will be equal to the last value in the typed array. if no initialvalue was provided, then previousvalue will be equal to the last value in the typed array and currentvalue will be equal to the second-to-last value. if the typed array is empty and no initialvalue was provided, typeerror would be thrown. if the typed array has only one element (regardless of position) and no initialvalue was provided, or if initialvalue is provided but the typed array is empty, the solo value would be returned without calling callback. examples sum up all values within an array var total = new uint8array([0, 1, 2, 3]).reduceright(function(a, b) { return a + b; }); // total == 6 specifications specification ecmascript (ecma-262)the definition of '%typ...
Bitwise AND (&) - JavaScript
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax a & b description the operands are converted to 32-bit integers and expressed by a series of bits (zeroes and ones). numbers with more than 32 bits get their most significant bits discarded. ...
Bitwise OR (|) - JavaScript
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax a | b description the operands are converted to 32-bit integers and expressed by a series of bits (zeroes and ones). numbers with more than 32 bits get their most significant bits discarded. ...
Bitwise XOR (^) - JavaScript
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax a ^ b description the operands are converted to 32-bit integers and expressed by a series of bits (zeroes and ones). numbers with more than 32 bits get their most significant bits discarded. ...
Optional chaining (?.) - JavaScript
ethod?.(); note: if there is a property with such a name and which is not a function, using ?. will still raise a typeerror exception (someinterface.custommethod is not a function). note: if someinterface itself is null or undefined, a typeerror exception will still be raised (someinterface is null). if you expect that someinterface itself may be null or undefined, you have to use ?. at this position as well: someinterface?.custommethod?.() dealing with optional callbacks or event handlers if you use callbacks or fetch methods from an object with a destructuring assignment, you may have non-existent values that you cannot call as functions unless you have tested their existence. using ?., you can avoid this extra test: // written as of es2019 function dosomething(oncontent, onerror) { t...
delete operator - JavaScript
not on the prototype). however, in the case of internet explorer, when one uses delete on a property, some confusing behavior results, preventing other browsers from using simple objects like object literals as ordered associative arrays. 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. if you want to use an ordered associative array in a cross-browser environment, use a map object if available, or simulate this structure with two separate arrays (one for the keys and the other for the values), or build an array of single-property objects, etc. examples // c...
<math> - MathML
Web › MathML › Element › math
the background color. you can use #rgb, #rrggbb and html color names. mathcolor the text color. you can use #rgb, #rrggbb and html color names. display this enumerated attribute specifies how the enclosed mathml markup should be rendered. it can have one of the following values: block, which means that this element will be displayed outside the current span of text, as a block that can be positioned anywhere without changing the meaning of the text; inline, which means that this element will be displayed inside the current span of text, and cannot be moved out of it without changing the meaning of that text. if not present, its default value is inline. mode deprecated in favor of the display attribute. possible values are: display (which has the same effect as display="block")...
<mo> - MathML
Web › MathML › Element › mo
ل maxsize if stretchy is true, this attribute specifies the maximum size of the operator. allowed values are: infinity an arbitrary length minsize if stretchy is true, this attribute specifies the minimum size of the operator. allowed values are: infinity an arbitrary length movablelimits specifies whether attached under- and overscripts move to sub- and superscript positions when displaystyle is false. allowed values are either true or false. rspace the amount of space after the operator (see length for values and units). the constant thickmathspace (5/18em) is the default value. separator there is no visual effect for this attribute, but it specifies whether the operator is a separator (such as commas). allowed values are true or false. stretchy specifies w...
<mphantom> - MathML
attributes class, id, style provided for use with stylesheets. mathbackground the background color. you can use #rgb, #rrggbb and html color names. examples sample rendering: rendering in your browser: x + y + z <math> <mrow> <mi> x </mi> <mo> + </mo> <mphantom> <mi> y </mi> <mo> + </mo> </mphantom> <mi> z </mi> </mrow> </math> specifications specification status comment mathml 3.0the definition of 'mphantom' in that specification. ...
<mtable> - MathML
Web › MathML › Element › mtable
"top bottom axis"). possible values are: axis, baseline (default), bottom, center and top. rowlines specifies row borders. multiple values separated by space are allowed and apply to the corresponding rows (e.g. rowlines="none none solid"). possible values are: none (default), solid and dashed. unimplemented rowspacing specifies the space between table rows. unimplemented side specifies the position where <mlabeledtr> label elements should be placed. possible values are: left, right (default), leftoverlap and rightoverlap. width specifies the width of the entire table. accepts length values. examples alignment with row number rendering: <math> <mi>x</mi> <mo>=</mo> <mtable frame="solid" rowlines="solid" align="axis 3"> <mtr> <mtd><mi>a</mi></mtd> ...
MathML documentation index - MathML
Web › MathML › Index
thml:element, mathml:script and limit schemata the mathml <mover> element is used to attach an accent or a limit over an expression. 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. 24 <mphantom> mathml, mathml reference, mathml:element, mathml:general layout schemata the mathml <mphantom> element is rendered invisibly, but dimensions (such as height, width, and baseline position) are still kept. 25 <mroot> mathml, mathml reference, mathml:element, mathml:general layout schemata the mathml <mroot> eleme...
Digital audio concepts - Web media technologies
ual samples within an audio file. most audio files use 16-bit signed integers for each sample, but others use 32-bit floating-point values or 24-bit or 32-bit integers. some older audio file formats—which you won't find in use on the web—used 8-bit integer samples. in addition, samples may use signed or unsigned values, as well. the size of an individual sample is called the sample size. the position of each audio source within the audio signal is called a channel. each channel contains a sample indicating the amplitude of the audio being produced by that source at a given moment in time. for instance, in stereo sound, there are two audio sources: one speaker on the left, and one on the right. each of these is represented by one channel, and the number of channels contained in the audio signa...
Using images in HTML - Web media technologies
Web › Media › images
nt contains zero or more <source> elements and one <img> element which provides versions of an image for different display/device scenarios. the browser considers each child <source> element and chooses the best match among them. 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. object-position the object-position css property specifies the alignment of content in a selected replaced element within the element's box. areas of the box which aren't covered by the replaced element's object will show the element's background. background-image the background-image css property sets one or more background images for an element. guides these articles provide guidance on selecting and...
Web media technologies
and web audio apis unexpected automatic playback of media or audio can be an unwelcome surprise to users. while autoplay serves a purpose, it should be used carefully. to give users control over this, many browsers now provide forms of autoplay blocking. this article is a guide to autoplay, with tips on when and how to use it and how to work with browsers to handle autoplay blocking gracefully. 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 guide covers how to accomplish this. playing video in a 3d environment in this guide, we examine how to play video into a...
CSS and JavaScript animation performance - Web Performance
the main thread. the most common property is the css transform. if an element is promoted as a layer, animating transform properties can be done in the gpu, meaning better performance/efficiency, especially on mobile. find out more details in offmainthreadcompositing. to enable the omta (off main thread animation) in firefox, you can go to about:config and search for the layers.offmainthreadcomposition.async-animations. toggle its value to true. after enabling omta, try running the above test again. you should see that the fps of the css animations will now be significantly higher. note: in nightly/developer edition, you should see that omta is enabled by default, so you might have to do the tests the other way around (test with it enabled first, then disable to test without omta.) summa...
Critical rendering path - Web Performance
t. the head section (generally) doesn't contain any visible information, and is therefore not included in the render tree. if there's a display: none; set on an element, neither it, nor any of its descendants, are in the render tree. layout once the render tree is built, layout becomes possible. layout is dependent on the size of screen. the layout step determines where and how the elements are positioned on the page, determining the width and height of each element, and where they are in relation to each other. what is the width of an element? block level elements, by definition, have a default width of 100% of the width of their parent. an element with a width of 50%, will be half of the width of its parent. unless otherwise defined, the body has a width of 100%, meaning it will be 100% of th...
Add to Home screen - Progressive web apps (PWAs)
pwas flag on macos. adding an install button to make our pwa installable on desktop, we first added a button to our document to allow users to do the installation — this isn't made available automatically on desktop apps, and the installation needs to be triggered by a user gesture: <button class="add-button">add to home screen</button> we then gave it some simple styling: .add-button { position: absolute; top: 1px; left: 1px; } javascript for handling the install at the bottom of our index.js file, we added some javascript to handle the installation. first of all, we declare a deferredprompt variable (which we'll explain later on), get a reference to our install button, and set it to display: none initially: let deferredprompt; const addbtn = document.queryselector('.add-button')...
SVG Presentation Attributes - SVG: Scalable Vector Graphics
g 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: auto|baseline|before-edge|text-before-edge|middle|central|after-edge|text-after-edge|ideographic|alphabetic|hanging|mathematical|inherit; animatable: yes baseline-shift it allows repositioning of the dominant-baseline relative to the dominant-baseline of the parent text content element. value: auto|baseline|super|sub|<percentage>|<length>|inherit; animatable: yes clip deprecated it defines what portion of an element is visible. value: auto|<shape()>|inherit; animatable: yes clip-path it binds the element it is applied to with a given <clippath> element. value: none|<funciri>|...
baseline-shift - SVG: Scalable Vector Graphics
the baseline-shift attribute allows repositioning of the dominant-baseline relative to the dominant-baseline of the parent text content element. the shifted object might be a sub- or superscript. note: as a presentation attribute baseline-shift can be used as a css property. note: this property is going to be deprecated and authors are advised to use vertical-align instead. as a presentation attribute, it can be applied to any element but it has effect only on the following four elements: <altglyph>, <textpath>, <tref>, and <tspan> usage notes value <length-percentage> | sub | super default value 0 animatable yes sub the dominant-baseline is shifted to the default position for subscripts. super the dominant-baseline is shifted to the default po...
begin - SVG: Scalable Vector Graphics
Web › SVG › Attribute › begin
sts of an element id followed by a dot and one of the supported events for that element. all valid events (not necessarily supported by all elements) are defined by the dom and html specifications. those are: focus, blur, focusin, focusout, activate, auxclick, click, dblclick, mousedown, mouseenter, mouseleave, mousemove, mouseout, mouseover, mouseup, wheel, beforeinput, input, keydown, keyup, compositionstart, compositionupdate, compositionend, load, unload, abort, error, select, resize, scroll, beginevent, endevent, and repeatevent. an optional offset value as defined in <offset-value> can be appended. <repeat-value> this value defines a qualified repeat event. the element animation start time is defined relative to the time that the repeat event is raised with the specified iteration value. ...
calcMode - SVG: Scalable Vector Graphics
terpolation. linear simple linear interpolation between values is used to calculate the animation function. except for <animatemotion>, this is the default value. paced defines interpolation to produce an even pace of change across the animation. this is only supported for values that define a linear numeric range, and for which some notion of "distance" between points can be calculated (e.g. position, width, height, etc.). if paced is specified, any keytimes or keysplines will be ignored. for <animatemotion>, this is the default value. spline interpolates from one value in the values list to the next according to a time function defined by a cubic bézier spline. the points of the spline are defined in the keytimes attribute, and the control points for each interval are defined in the keysp...
direction - SVG: Scalable Vector Graphics
the direction attribute specifies the inline-base direction of a <text> or <tspan> element. it defines the start and end points of a line of text as used by the text-anchor and inline-size properties. it also may affect the direction in which characters are positioned if the unicode-bidi property's value is either embed or bidi-override. it applies only to glyphs oriented perpendicular to the inline-base direction, which includes the usual case of horizontally-oriented latin or arabic text and the case of narrow-cell latin or arabic characters rotated 90 degrees clockwise relative to a top-to-bottom inline-base direction. in many cases, the bidirectional unicode algorithm produces the desired result automatically, so this attribute doesn't need to be specified in those cases. for other cases, s...
dominant-baseline - SVG: Scalable Vector Graphics
y re-determine all three values. others only re-establish the baseline-table font-size. when the initial value, auto, would give an undesired result, this property can be used to explicitly set the desired scaled-baseline-table. if there is no baseline table in the nominal font, or if the baseline table lacks an entry for the desired baseline, then the browser may use heuristics to determine the position of the desired baseline. note: as a presentation attribute, dominant-baseline can be used as a css property. see css dominant-baseline for further information. as a presentation attribute, it can be applied to any element but it only has effect on the text content elements, including: <altglyph>, <text>, <textpath>, <tref>, and <tspan> html, body, svg { height: 100%; } text { font: bold...
end - SVG: Scalable Vector Graphics
Web › SVG › Attribute › end
ts of an element id followed by a dot and one of the supported events for that element. all valid events (not necessarily supported by all elements) are defined by the dom and html specifications. those are: focus, blur, focusin, focusout, activate, auxclick, click, dblclick, mousedown, mouseenter, mouseleave, mousemove, mouseout, mouseover, mouseup, wheel, beforeinput, input, keydown, keyup, compositionstart, compositionupdate, compositionend, load, unload, abort, error, select, resize, scroll, beginevent, endevent, and repeatevent . an optional offset value as defined in <offset-value> can be appended. <repeat-value> this value defines a qualified repeat event. the element animation end time is defined relative to the time that the repeat event is raised with the specified iteration value. a...
k1 - SVG: Scalable Vector Graphics
Web › SVG › Attribute › k1
the k1 attribute defines one of the values to be used within the the arithmetic operation of the <fecomposite> filter primitive. ...
k2 - SVG: Scalable Vector Graphics
Web › SVG › Attribute › k2
the k2 attribute defines one of the values to be used within the the arithmetic operation of the <fecomposite> filter primitive. ...
k3 - SVG: Scalable Vector Graphics
Web › SVG › Attribute › k3
the k3 attribute defines one of the values to be used within the the arithmetic operation of the <fecomposite> filter primitive. ...
k4 - SVG: Scalable Vector Graphics
Web › SVG › Attribute › k4
the k4 attribute defines one of the values to be used within the the arithmetic operation of the <fecomposite> filter primitive. ...
mask - SVG: Scalable Vector Graphics
Web › SVG › Attribute › mask
as a presentation attribute, it can be applied to any element but it has noticeable effects mostly on the following nineteen elements: <a>, <circle>, <clippath>, <ellipse>, <g>, <glyph>, <image>, <line>, <marker>, <mask>, <path>, <pattern>, <polygon>, <polyline>, <rect>, <svg>, <symbol>, <text>, <use> usage notes value see the...
shape-rendering - SVG: Scalable Vector Graphics
pe anti-aliasing. crispedges this value indicates that the user agent shall attempt to emphasize the contrast between clean edges of artwork over rendering speed and geometric precision. to achieve crisp edges, the user agent might turn off anti-aliasing for all lines and curves or possibly just for straight lines which are close to vertical or horizontal. also, the user agent might adjust line positions and line widths to align edges with device pixels. geometricprecision indicates that the user agent shall emphasize geometric precision over speed and crisp edges. specifications specification status comment scalable vector graphics (svg) 2the definition of 'shape-rendering' in that specification. candidate recommendation no change scalable vector ...
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. only one element is using this attribute: <textpath> html,body,svg { 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"> ...
stroke-miterlimit - SVG: Scalable Vector Graphics
m2, 0 l0.5 ,-3 l0.5 ,3" /> <!-- impact of a large miter limit (8) --> <path stroke="black" fill="none" stroke-linejoin="miter" stroke-miterlimit="8" id="p3" d="m1,29 l7 ,-3 l7 ,3 m2, 0 l3.5 ,-3 l3.5 ,3 m2, 0 l2 ,-3 l2 ,3 m2, 0 l0.75,-3 l0.75,3 m2, 0 l0.5 ,-3 l0.5 ,3" /> <!-- the following pink lines highlight the position of the path for each stroke --> <path stroke="pink" fill="none" stroke-width="0.05" d="m1, 9 l7,-3 l7,3 m2,0 l3.5,-3 l3.5,3 m2,0 l2,-3 l2,3 m2,0 l0.75,-3 l0.75,3 m2,0 l0.5,-3 l0.5,3 m1,19 l7,-3 l7,3 m2,0 l3.5,-3 l3.5,3 m2,0 l2,-3 l2,3 m2,0 l0.75,-3 l0.75,3 m2,0 l0.5,-3 l0.5,3 m1,29 l7,-3 l7,3 m2,0 l3.5,-3 l3.5,3 m2,0 l2,-3 l2,3 m2,0 l0.75,-3 l0.75,3 m2,0 l0.5,-3 l0...
<altGlyph> - SVG: Scalable Vector Graphics
Web › SVG › Element › altGlyph
value type: <list-of-coordinates> ; default value: absolute x-coordinate of ancestor <text> or <tspan>; animatable: yes y this attribute defines the corresponding absolute y-coordinates for rendering the element. value type: <list-of-coordinates> ; default value: absolute y-coordinate of ancestor <text> or <tspan>; animatable: yes dx this attribute indicates a shift along the x-axis on the position of the element. value type: <list-of-coordinates> ; default value: relative x-coordinate of ancestor <text> or <tspan>; animatable: yes dy this attribute indicates a shift along the x-axis on the position of the element. value type: <list-of-coordinates> ; default value: relative y-coordinate of ancestor <text> or <tspan>; animatable: yes rotate this attribute defines the supplemental rotat...
<cursor> - SVG: Scalable Vector Graphics
Web › SVG › Element › cursor
note: the css cursor property should be used instead of this element. the <cursor> svg element can be used to define a platform-independent custom cursor. a recommended approach for defining a platform-independent custom cursor is to create a png image and define a cursor element that references the png image and identifies the exact position within the image which is the pointer position (i.e., the hot spot). the png format is recommended because it supports the ability to define a transparency mask via an alpha channel. if a different image format is used, this format should support the definition of a transparency mask (two options: provide an explicit alpha channel or use a particular pixel color to indicate transparency). if the transparency mask can be determined, the mask def...
<ellipse> - SVG: Scalable Vector Graphics
Web › SVG › Element › ellipse
radius. note: ellipses are unable to specify the exact orientation of the ellipse (if, for example, you wanted to draw an ellipse tilted at a 45 degree angle), but it can be rotated by using the transform attribute. html,body,svg { height:100% } <svg viewbox="0 0 200 100" xmlns="http://www.w3.org/2000/svg"> <ellipse cx="100" cy="50" rx="100" ry="50" /> </svg> attributes cx the x position of the ellipse. value type: <length>|<percentage> ; default value: 0; animatable: yes cy the y position of the ellipse. value type: <length>|<percentage> ; default value: 0; animatable: yes rx the radius of the ellipse on the x axis. value type: auto|<length>|<percentage> ; default value: auto; animatable: yes ry the radius of the ellipse on the y axis. value type: auto|<length>|<percen...
<feDiffuseLighting> - SVG: Scalable Vector Graphics
the light map produced by this filter primitive can be combined with a texture image using the multiply term of the arithmetic operator of the <fecomposite> filter primitive. multiple light sources can be simulated by adding several of these light maps together before applying it to the texture image. ...
<feSpecularLighting> - SVG: Scalable Vector Graphics
the result of the lighting calculation is added. ...
<font-face> - SVG: Scalable Vector Graphics
Web › SVG › Element › font-face
rder. attributes global attributes core attributes specific attributes font-family font-style font-variant font-weight font-stretch font-size unicode-range units-per-em panose-1 stemv stemh slope cap-height x-height accent-height ascent descent widths bbox ideographic alphabetic mathematical hanging v-ideographic v-alphabetic v-mathematical v-hanging underline-position underline-thickness strikethrough-position strikethrough-thickness overline-position overline-thickness dom interface this element implements the svgfontfaceelement interface. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the definition of '<font-face>' in that specification. recommendation initial defini...
<rect> - SVG: Scalable Vector Graphics
Web › SVG › Element › rect
the rectangles may have their corners rounded. html,body,svg { height:100% } <svg viewbox="0 0 220 100" xmlns="http://www.w3.org/2000/svg"> <!-- simple rectangle --> <rect width="100" height="100" /> <!-- rounded corner rectangle --> <rect x="120" width="100" height="100" rx="15" /> </svg> attributes x the x coordinate of the rect. value type: <length>|<percentage> ; default value: 0; animatable: yes y the y coordinate of the rect. value type: <length>|<percentage> ; default value: 0; animatable: yes width the width of the rect. ...
<stop> - SVG: Scalable Vector Graphics
Web › SVG › Element › stop
this element is always a child of a <lineargradient> or <radialgradient> element. 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. ...
<symbol> - SVG: Scalable Vector Graphics
Web › SVG › Element › symbol
ech, or as braille, and thus promote accessibility. ...
<text> - SVG: Scalable Vector Graphics
Web › SVG › Element › text
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. value type: <length>|<percentage> ; default value: 0; animatable: yes y the y coordinate of the starting point of the text baseline. value type: <length>|<percentage> ; default value: 0; animatable: yes dx shifts the text position horizontally from a previous text element. value type: <length>|<percentage> ; default value: none; animatable: yes dy shifts the text position vertically from a previous text element. value type: <length>|<percentage> ; default value: none; animatable: yes rotate rotates orientation of each individual glyph. can rotate glyphs individually. value type: <list-of-number> ; default value: non...
<use> - SVG: Scalable Vector Graphics
Web › SVG › Element › use
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. that's why the circles have different x positions, but the same stroke value. --> </svg> the effect is the same as if the nodes were deeply cloned into a non-exposed dom, then pasted where the use element is, much like cloned template elements in html5. most attributes on use do not override those already on the element referenced by use. (this differs from how css style attributes override those set 'earlier' in the cascade). only the...
Basic Transformations - SVG: Scalable Vector Graphics
="10"> <g fill="red"> <rect x="0" y="0" width="10" height="10" /> <rect x="20" y="0" width="10" height="10" /> </g> </svg> all following transformations are summed up in an element's transform attribute. transformations can be chained simply by concatenating them, separated by whitespace. translation it may be necessary to move an element around, even though you can position it with the according attributes. for this purpose, the translate() transformation stands ready. <svg width="40" height="50" style="background-color:#bff;"> <rect x="0" y="0" width="10" height="10" transform="translate(30,40)" /> </svg> the example will render a rectangle, translated to the point (30,40) instead of (0,0). if the second value is not given, it is assumed to be 0. rotatio...
Getting started - SVG: Scalable Vector Graphics
se page for more info. 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 "svg" is drawn. the interior of each letter is filled in with white. 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. fine adjustments can be made to the font size and vertical position to ensure the final result is aesthetically pleasing. basic properties of svg files the first important thing to notice is the order of rendering elements. the globally valid rule for svg f...
SVG Tutorial - SVG: Scalable Vector Graphics
Web › SVG › Tutorial
to draw beautiful images, you might find more useful resources at inkscape's documentation page. another good introduction to svg is provided by the w3c's svg primer. the tutorial is in an early stage of development. if you're able, please help out by chipping in and writing a paragraph or two. extra points for writing a whole page! introducing svg from scratch introduction getting started positions basic shapes paths fills and strokes gradients patterns texts basic transformations clipping and masking other content in svg filter effects svg fonts svg image tag tools for svg svg and css the following topics are more advanced and hence should get their own tutorials. scripting svg with javascript tbd svg filters tutorial tbd animations with smil in svg tbd creating fon...
Tutorials
oked at css fundamentals, how to style text, and how to style and manipulate the boxes that your content sits inside. now it's time to look at how to place your boxes in the right place in relation to the viewport, and one another. 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. css reference complete reference to css, with details on support by firefox and other browsers. fluid grids design layouts that fluidly resize with the browser window, while still using a typographic grid. css challenges flex your css skills, and see where you need more practice. advanced level using css transforms apply rotatio...
Using shadow DOM - Web Components
) { imgurl = this.getattribute('img'); } else { imgurl = 'img/default.png'; } let img = document.createelement('img'); img.src = imgurl; icon.appendchild(img); styling the shadow dom after that we create a <style> element and populate it with some css to style it: // create some css to apply to the shadow dom let style = document.createelement('style'); style.textcontent = ` .wrapper { position: relative; } .info { font-size: 0.8rem; width: 200px; display: inline-block; border: 1px solid black; padding: 10px; background: white; border-radius: 10px; opacity: 0; transition: 0.6s all; position: absolute; bottom: 20px; left: 10px; z-index: 3; } img { width: 1.2rem; } .icon:hover + .info, .icon:focus + .info { opacity: 1; }`; attaching the shadow dom to th...
Using templates and slots - Web Components
m to get populated with that. within the rendered <details> output, the content in the <element-details> elements fills the named slots from the shadow root. in other words, the dom tree from the <element-details> elements get composed together with the content of the shadow root. for both <element-details> elements, an attributes heading gets automatically added from the shadow root before the position of the "attributes" named slot. because the first <element-details> has a <dl> element which explicitly references the "attributes" named slot from its shadow root, the contents of that <dl> replace the "attributes" named slot from the shadow root. because the second <element-details> doesn’t explicitly reference the "attributes" named slot from its shadow root, its content for that named slo...
last - XPath
Web › XPath › Functions › last
defined xpath 1.0 4.1 gecko support supported. ...
substring - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the substring function returns a part of a given string. syntax substring(string ,start [,length] ) arguments string the string to evaluate. start the position withinstring the substring begins length(optional) the length of the substring. if omitted, the returned string will contain every character from thestart position to the end ofstring. returns a string. notes as in other xpath functions, the position is not zero-based. the first character in the string has a position of 1, not 0. defined xpath 1.0 4.2 gecko support supported. ...
Functions - XPath
further reading page. ...
Index - XPath
Web › XPath › Index
g white-space from a string, replaces sequences of whitespace characters by a single space, and returns the resulting string. 40 not xslt, xslt_reference the not function evaluates a boolean expression and returns the opposite value. 41 number xslt, xslt_reference the number function converts an object to a number and returns the number. 42 position xslt, xslt_reference the position function returns a number equal to the context position from the expression evaluation context. 43 round xslt, xslt_reference the round function returns a number that is the nearest integer to the given number. 44 starts-with xslt, xslt_reference the starts-with checks whether the first string starts with ...
<xsl:number> - XSLT: Extensible Stylesheet Language Transformations
Web › XSLT › Element › number
es to the first node in the ancestor-or-self axis that matches the count attribute and then counts that node plus all its preceding siblings (stopping when it reaches a match to the from attribute, if there is one) that also match the count attribute.if no match is found, the sequence will be an empty list. multiple numbers nodes as a composite sequence that reflects the hierarchic position of the node, e.g. 1.2.2.5. (the nested format can be specified with the format attribute, e.g. a.1.1). the processor looks at all ancestors of the current node and the current node itself, stopping when it reaches a match for the from attribute, if there is one. for each node in this list that matches the count attribute, the processor counts how many preceding matching siblings it has, and adds ...
XSLT elements reference - XSLT: Extensible Stylesheet Language Transformations
Web › XSLT › Element
use the {{listsubpages}} macro once the bcd for <xsl:fallback>, <xsl:import>, <xsl:namespace-alias>, <xsl:number>, <xsl:output>, <xsl:stylesheet>, <xsl:text> and <xsl:value-of> is fully migrated. <xsl:apply-imports><xsl:apply-templates><xsl:attribute-set><xsl:attribute><xsl:call-template><xsl:choose...
PI Parameters - XSLT: Extensible Stylesheet Language Transformations
in the null namespace: <?xslt-param name="books" select="//book"?> set the parameter 'show-toc' to boolean true: <?xslt-param name="show-toc" select="true()"?> the select attribute context the following context is used to parse and evaluate the expression in the select attribute. the context node is the node used as initial current node used when executing the stylesheet. the context position is the position of the context node in the initial current node list used when executing the stylesheet. the context size is the size of the initial current node list used when executing the stylesheet. no variables are available. the function library is the standard xpath function library. the namespace declarations are determined by the xslt-param-namespace pis, see below. if the select a...
The Netscape XSLT/XPath Reference - XSLT: Extensible Stylesheet Language Transformations
le() (supported) false() (supported) floor() (supported) format-number() (supported) function-available() (supported) generate-id() (supported) id() (partially supported) key() (supported) lang() (supported) last() (supported) local-name() (supported) name() (supported) namespace-uri() (supported) normalize-space() (supported) not() (supported) number() (supported) position() (supported) round() (supported) starts-with() (supported) string() (supported) string-length() (supported) substring() (supported) substring-after() (supported) substring-before() (supported) sum() (supported) system-property() (supported) translate() (supported) true() (supported) unparsed-entity-url() (not supported) ...
Understanding WebAssembly text format - WebAssembly
note: just like memory, tables can also be created from javascript (see webassembly.table()) as well as imported to/from another wasm module. mutating tables and dynamic linking because javascript has full access to function references, the table object can be mutated from javascript usin...