Search completed in 1.43 seconds.
CSS Object Model (CSSOM) - MDN Web Docs Glossary: Definitions of Web-related terms
the css object model (
cssom) is a map of all css selectors and relevant properties for each selector in the form of a tree, with a root node, sibling, descendant, child, and other relationship.
... the
cssom is very similar to the document object model (dom).
... the
cssom, together with the dom, to build the render tree, which is in turn used by the browser to layout and paint the web page.
...
cssom api the css object model is also a set of apis allowing the manipulation of css from javascript.
CSSOMString - Web APIs
cssomstring is used to denote string data in
cssom specifications and can refer to either domstring or usvstring.
... when a specification says
cssomstring, it depends on the browser vendors to choose whether to use domstring or usvstring.
... while browser implementations that use utf-8 internally to represent strings in memory can use usvstring when the specification says
cssomstring, implementations that already represent strings as 16-bit sequences might choose to use domstring instead.
... implementation differences browser domstring or usvstring for
cssomstring firefox (gecko) usvstring chrome (blink) usvstring safari (webkit) usvstring edge (edgehtml) - opera (blink) usvstring specifications specification status comment css object model (
cssom)the definition of '
cssomstring' in that specification.
CSS Object Model (CSSOM) - Web APIs
cssrulelist cssstyledeclaration cssstylesheet cssstylerule csssupportsrule cssvariablesmap cssviewportrule elementcssinlinestyle fontface fontfaceset fontfacesetloadevent geometryutils getstyleutils linkstyle medialist mediaquerylist mediaquerylistevent mediaquerylistlistener screen stylesheet stylesheetlist transitionevent several other interfaces are also extended by the
cssom-related specifications: document, window, element, htmlelement, htmlimageelement, range, mouseevent, and svgelement.
...oduct cssmathsum cssmathvalue cssmatrixcomponent cssnumericarray cssnumericvalue cssperspective csspositionvalue cssrotate cssscale cssskew cssskewx cssskewy cssstylevalue csstransformcomponent csstransformvalue csstranslate cssunitvalue cssunparsedvalue cssvariablereferencevalue stylepropertymap stylepropertymapreadonly obsolete
cssom interfaces cssprimitivevalue cssvalue cssvaluelist tutorials determining the dimensions of elements (it needs some updating as it was made in the dhtml/ajax era).
... css object model (
cssom) view module working draft defined the screen and mediaquerylist interfaces and the mediaquerylistevent event and mediaquerylistlistener event listener.
... css object model (
cssom) working draft extended the css interface and provides the base for the modern
cssom specification.
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.
... specifications specification status comment css object model (
cssom) view module working draft initial definition.
Index - Web APIs
87 animationevent() api, animationevent,
cssom, constructor, experimental, reference, web animations the animationevent() constructor returns a newly created animationevent, representing an event in relation with an animation.
... 88 animationevent.animationname api, animationevent,
cssom, experimental, property, reference, web animations the animationevent.animationname read-only property is a domstring containing the value of the animation-name css property associated with the transition.
... 89 animationevent.elapsedtime api, animationevent,
cssom, experimental, property, reference, web animations the animationevent.elapsedtime read-only property is a float giving the amount of time the animation has been running, in seconds, when this event fired, excluding any time the animation was paused.
...And 132 more matches
Populating the page: how browsers work - Web Performance
parsing is the step the browser takes to turn the data it receives over the network into the dom and
cssom, which is used by the renderer to paint a page to the screen.
... building the
cssom the second step in the critical rendering path is processing css and building the
cssom tree.
...the dom and
cssom are both trees.
...And 8 more matches
FontFace - Web APIs
fontface.display a
cssomstring that determines how a font face is displayed based on whether and when it is downloaded and ready to use.
... fontface.family a
cssomstring that retrieves or sets the family of the font.
... fontface.featuresettings a
cssomstring that retrieves or sets infrequently used font features that are not available from a font's variant properties.
...And 5 more matches
Critical rendering path - Web Performance
optimizing the critical render path improves render performance.the critical rendering path includes the document object model (dom), css object model (
cssom), render tree and layout.
...with the dom and
cssom complete, the browser builds the render tree, computing the styles for all the visible content.
...the
cssom contains all the styles of the page; information on how to style that dom.
...And 4 more matches
Houdini - MDN Web Docs Glossary: Definitions of Web-related terms
houdini gives developers access to the css object model (
cssom), enabling developers to write code the browser can parse as css.
... while many of the features houdini enables can be created with javascript, interacting directly with the
cssom before javascript is enabled provides for faster parse times.
... browsers create the
cssom — including layout, paint, and composite processes — before applying any style updates found in scripts: layout, paint, and composite processes are repeated for updated javascript styles to be implemented.
... see also houdini houdini: an introduction
cssom css paint api css typed om ...
MouseEvent.pageX - Web APIs
the
cssom view module redefined it as a double float.
... 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.
... .box { width: 400px; height: 250px; border: 2px solid darkblue; background-color: blue; color: white; font: 16px "zilla", "open sans", "helvetica", "arial", sans-serif; } result try this out here: specifications specification status comment css object model (
cssom) view modulethe definition of 'pagex' in that specification.
... prior to being added to the
cssom view specification, pagex and pagey were available on the uievent interface in a limited subset of browsers for a short time.
Index - MDN Web Docs Glossary: Definitions of Web-related terms
56 css object model (
cssom) css,
cssom, dom, glossary, web performance the css object model (
cssom) is a map of all css selectors and relevant properties for each selector in the form of a tree, with a root node, sibling, descendant, child, and other relationship.
... the
cssom is very similar to the document object model (dom).
...houdini gives developers access to the css object model (
cssom), enabling developers to write code the browser can parse as css.
CSS.escape() - Web APIs
the css.escape() static method returns a
cssomstring containing the escaped string passed as parameter, mostly for use as part of a css selector.
... syntax escapedstr = css.escape(str); parameters str the
cssomstring to be escaped.
...scape() method can be used: var element = document.queryselector('#' + css.escape(id) + ' > img'); the escape() method can also be used for escaping strings, although it escapes characters that don't strictly need to be escaped: var element = document.queryselector('a[href="#' + css.escape(fragment) + '"]'); specification specification status comment css object model (
cssom)the definition of 'css.escape()' in that specification.
Using dynamic styling information - Web APIs
the css object model (
cssom), part of the dom, exposes specific interfaces allowing manipulation of a wide amount of information regarding css.
... initially defined in the dom level 2 style recommendation, these interfaces forms now a specification, css object model (
cssom) which aims at superseding it.
... modify a stylesheet rule with
cssom <html> <head> <title>modifying a stylesheet rule with
cssom</title> <style type="text/css"> body { background-color: red; } </style> <script type="text/javascript"> var stylesheet = document.stylesheets[0]; stylesheet.cssrules[0].style.backgroundcolor="blue"; </script> </head> <body> the stylesheet declaration for the body's background color is modified via javascript.
CSS reference - CSS: Cascading Style Sheets
also included is a brief dom-css /
cssom reference.
...note that css rule definitions are entirely (ascii) text-based, whereas dom-css /
cssom (the rule management system) is object-based.
...scade comments descriptor inheritance shorthand properties specificity value definition syntax css unit and value types values actual value computed value initial value resolved value specified value used value layout block formatting context box model containing block layout mode margin collapsing replaced elements stacking context visual formatting model dom-css /
cssom major object types documentorshadowroot.stylesheets stylesheets[i].cssrules cssrules[i].csstext (selector & style) cssrules[i].selectortext htmlelement.style htmlelement.style.csstext (just style) element.classname element.classlist important methods cssstylesheet.insertrule() cssstylesheet.deleterule() ...
CSS Houdini
houdini is a group of apis that give developers direct access to the css object model (
cssom), enabling developers to write code the browser can parse as css, thereby creating new css features without waiting for them to be implemented natively in browsers.
...browsers parse the
cssom — including layout, paint, and composite processes — before applying any style updates found in scripts.
... css properties and values api reference css properties and values api guide css typed om converting
cssom value strings into meaningfully typed javascript representations and back can incur a significant performance overhead.
CSS3 - Archive of obsolete content
css paged media module level 3 working draft css object model (
cssom) view module working draft css intrinsic & extrinsic sizing module level 3 working draft css ruby layout module level 1 working draft css overflow module level 3 working draft css basic box model working draft css scrollbars level 1 working draft ...
... css object model (
cssom) working draft css font loading module level 3 working draft css scoping module level 1 working draft css inline layout working draft css images module level 4 working draft extends: the image() functional notation to describe the directionality of the im...
CSS performance optimization - Learn web development
browsers follow a specific rendering path: paint only occurs after layout, which occurs after the render tree is created, which in turn requires both the dom and the
cssom trees.
... to optimize the
cssom construction, remove unnecessary styles, minify, compress and cache it, and split css not required at page load into additional files to reduce css render blocking.
CSSRuleList - Web APIs
example // get the first style sheet’s first rule var first_rule = document.stylesheets[0].cssrules[0]; see also cssrule cssrulelist implementations there are multiple properties in the
cssom that will return a cssrulelist.
... they are: cssstylesheet property cssrules cssmediarule property cssrules csskeyframesrule property cssrules cssmozdocumentrule property cssrules specifications specification status comment css object model (
cssom)the definition of 'cssrulelist' in that specification.
Element.getClientRects() - Web APIs
however, the
cssom working draft specifies that it returns a domrect for each border box.
...v); } } (function() { /* call function addclientrectsoverlay(elt) for all elements with assigned class "withclientrectsoverlay" */ var elt = document.getelementsbyclassname('withclientrectsoverlay'); for (var i = 0; i < elt.length; i++) { addclientrectsoverlay(elt[i]); } })(); result specifications specification status comment css object model (
cssom) view modulethe definition of 'element.getclientrects()' in that specification.
ElementCSSInlineStyle - Web APIs
the elementcssinlinestyle mixin describes
cssom-specific features common to the htmlelement, svgelement and mathmlelement interfaces.
... specifications specification status comment css object model (
cssom)the definition of 'htmlorforeignelement' in that specification.
MediaList - Web APIs
medialist.item() a getter that returns a
cssomstring representing a media query as text, given the media query's index value inside the medialist.
... const stylesheets = document.stylesheets; let stylesheet = stylesheets[0]; console.log(stylesheet.media.mediatext); specifications specification status comment css object model (
cssom)the definition of 'medialist' in that specification.
MouseEvent.clientX - Web APIs
syntax var x = instanceofmouseevent.clientx return value a double floating point value, as redefined by the
cssom view module.
...o see its position.</p> <p id="screen-log"></p> javascript let screenlog = document.queryselector('#screen-log'); document.addeventlistener('mousemove', logkey); function logkey(e) { screenlog.innertext = ` screen x/y: ${e.screenx}, ${e.screeny} client x/y: ${e.clientx}, ${e.clienty}`; } result specifications specification status comment css object model (
cssom) view modulethe definition of 'clientx' in that specification.
MouseEvent.clientY - Web APIs
syntax var y = instanceofmouseevent.clienty return value a double floating point value, as redefined by the
cssom view module.
...o see its position.</p> <p id="screen-log"></p> javascript let screenlog = document.queryselector('#screen-log'); document.addeventlistener('mousemove', logkey); function logkey(e) { screenlog.innertext = ` screen x/y: ${e.screenx}, ${e.screeny} client x/y: ${e.clientx}, ${e.clienty}`; } result specifications specification status comment css object model (
cssom) view modulethe definition of 'clienty' in that specification.
MouseEvent.pageY - Web APIs
the
cssom view module redefined it as a double float.
... examples var pagey = event.pagey; specifications specification status comment css object model (
cssom) view modulethe definition of 'pagey' in that specification.
MouseEvent - Web APIs
lick on var canceled = !cb.dispatchevent(evt); if(canceled) { // a handler called preventdefault alert("canceled"); } else { // none of the handlers called preventdefault alert("not canceled"); } } document.getelementbyid("button").addeventlistener('click', simulateclick); result specifications specification status comment css object model (
cssom) view modulethe definition of 'mouseevent' in that specification.
... css object model (
cssom) view modulethe definition of 'mouseevent' in that specification.
Screen.colorDepth - Web APIs
per the
cssom, some implementations return 24 for compatibility reasons.
... syntax bitdepth = window.screen.colordepth; example // check the color depth of the screen if ( window.screen.colordepth < 8) { // use low-color version of page } else { // use regular, colorful page } specification specification status comment css object model (
cssom) view modulethe definition of 'screen.colordepth' in that specification.
Screen.pixelDepth - Web APIs
per the
cssom, some implementations return 24 for compatibility reasons.
... syntax let depth = window.screen.pixeldepth example // if there is not adequate bit depth // choose a simpler color if ( window.screen.pixeldepth > 8 ) { document.style.color = "#faebd7"; } else { document.style.color = "#ffffff"; } specifications specification status comment css object model (
cssom) view modulethe definition of 'screen.pixeldepth' in that specification.
ScrollToOptions - Web APIs
the scrolltooptions dictionary of the
cssom view spec contains properties specifying where an element should be scrolled to, and whether the scrolling should be smooth.
...'smooth' : 'auto' } window.scrollto(scrolloptions); }); specifications specification status comment css object model (
cssom) view modulethe definition of 'scrolltooptions' in that specification.
Web APIs
aambient light eventsbbackground tasksbattery api beaconbluetooth apibroadcast channel apiccss counter stylescss font loading api
cssomcanvas apichannel messaging apiconsole apicredential management apiddomeencoding apiencrypted media extensionsffetch apifile system api frame timing apifullscreen apiggamepad api geolocation apihhtml drag and drop apihigh resolution timehistory apiiimage capture apiindexeddbintersection observer apillong tasks api mmedia capabilities api media capture and streamsmedia session apimedia source e...
... bluetoothremotegattserver 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 caretposi...
scroll-behavior - CSS: Cascading Style Sheets
the scroll-behavior css property sets the behavior for a scrolling box when scrolling is triggered by the navigation or
cssom scrolling apis.
...width: 339px; padding: 5px; border: 1px solid black; } scroll-container { display: block; width: 350px; height: 200px; overflow-y: scroll; scroll-behavior: smooth; } scroll-page { display: flex; align-items: center; justify-content: center; height: 100%; font-size: 5em; } result specifications specification status comment css object model (
cssom) view modulethe definition of 'scroll-behavior' in that specification.
Web Performance
optimizing the critical render path improves render performance.the critical rendering path includes the document object model (dom), css object model (
cssom), render tree and layout.css and javascript animation performancebrowsers are able to optimize rendering flows.
... glossary terms beacon brotli compression client hints code splitting
cssom domain sharding effective connection type first contentful paint first cpu idle first input delay first interactive first meaningful paint first paint http http/2 jank latency lazy load long task lossless compression lossy compression main thread minification network throttling packet page load time page prediction parse perceived performance prefetch prerender quic ra...
DOMSubtreeModified - Archive of obsolete content
this event has been deprecated in favor of the mutation observer api this event can cause infinite loops if you decide to change the dom inside the event handler, hence it has been disabled in a number of browsers (see domattrmodified and domsubtreemodified events are no longer fired when style attribute is changed via
cssom for example).
MDN Web Docs Glossary: Definitions of Web-related terms
edia control flow cookie copyleft cors cors-safelisted request header cors-safelisted response header crawler crlf cross axis cross-site scripting crud cryptanalysis cryptographic hash function cryptography csp csrf css css object model (
cssom) css pixel css preprocessor d data structure decryption delta denial of service descriptor (css) deserialization developer tools dhtml digest digital certificate distributed denial of service dmz dns doctype document directive ...
Index - Learn web development
338 css performance optimization css, performance, reference, tutorial css is render blockingto optimize the
cssom construction, remove unnecessary styles, minify, compress and cache it, and split css not required at page load into additional files to reduce css render blocking.
nsIDOMClientRect
see also
cssom view module : the clientrect interfacewd this object was renamed a few times: initial name was textrectangle, then clientrect, then domrect.
CSS numeric factory functions - Web APIs
50 console.log( height.unit ) // vmax in this example, we set the margin on our element using the css.px() factory function: myelement.attributestylemap.set('margin', css.px(40)); let currentmargin = myelement.attributestylemap.get('margin'); console.log(currentmargin.value, currentmargin.unit); // 40, 'px' specification specification status comment css object model (
cssom)the definition of 'numeric factory functions' in that specification.
CSS - Web APIs
css object model (
cssom)the definition of 'css' in that specification.
CSSGroupingRule - Web APIs
specification specification status comment css object model (
cssom)the definition of 'cssgroupingrule' in that specification.
CSSNamespaceRule - Web APIs
it has no specific methods: specification specification status comment css object model (
cssom)the definition of 'cssnamespacerule' in that specification.
CSSPageRule - Web APIs
specifications specification status comment css object model (
cssom)the definition of 'csspagerule' in that specification.
CSSPseudoElement.type - Web APIs
syntax var typeofpseudoelement = csspseudoelement.type; value a
cssomstring containing one of the following values: "::before" "::after" "::marker" examples the example below demonstrates the relationship between csspseudoelement.type and element.pseudo(): const myelement = document.queryselector('q'); const myselector = '::after'; const csspseudoelement = myelement.pseudo(myselector); const typeofpseudoelement = csspseudoelement.type; console.log(myselector === typeofpseudoelement); // outputs true specifications specification status comment css pseudo-elements level 4the definition of 'type' in...
CSSRule.cssText - Web APIs
syntax string = cssrule.csstext example <style> body { background-color: darkblue; } </style> <script> var stylesheet = document.stylesheets[0]; alert(stylesheet.cssrules[0].csstext); // body { background-color: darkblue; } </script> specifications specification status comment css object model (
cssom)the definition of 'cssrule: csstext' in that specification.
CSSRule - Web APIs
specifications specification status comment css object model (
cssom)the definition of 'cssrule' in that specification.
CSSStyleDeclaration.cssText - Web APIs
example <span id="s1" style="color: red;"> some text </span> <script> var elem = document.getelementbyid("s1"); alert(elem.style.csstext); // "color: red;" </script> specifications specification status comment css object model (
cssom)the definition of 'cssstyledeclaration: csstext' in that specification.
CSSStyleDeclaration.getPropertyPriority() - Web APIs
example the following javascript code checks whether margin is marked as important in a css selector rule: var declaration = document.stylesheets[0].cssrules[0].style; var isimportant = declaration.getpropertypriority('margin') === 'important'; specifications specification status comment css object model (
cssom)the definition of 'cssstyledeclaration.getpropertypriority()' in that specification.
CSSStyleDeclaration.getPropertyValue() - Web APIs
example the following javascript code queries the value of the margin property in a css selector rule: var declaration = document.stylesheets[0].cssrules[0].style; var value = declaration.getpropertyvalue('margin'); // "1px 2px" specifications specification status comment css object model (
cssom)the definition of 'cssstyledeclaration.getpropertyvalue()' in that specification.
CSSStyleDeclaration.item() - Web APIs
javascript has a special simpler syntax for obtaining an item from a nodelist by index: var propertyname = style[index]; example var style = document.getelementbyid('div1').style; var propertyname = style.item(1); // or simply style[1] - returns the second style listed specifications specification status comment css object model (
cssom)the definition of 'cssstyledeclaration.item()' in that specification.
CSSStyleDeclaration.length - Web APIs
le the following gets the number of explicitly set styles on the following html element: <div id="div1" style="margin: 0 10px; background-color: #ca1; font-family: monospace"></div> javascript code: var mydiv = document.getelementbyid('div1'); var divstyle = mydiv.style; var len = divstyle.length; // 6 specifications specification status comment css object model (
cssom)the definition of 'cssstyledeclaration.length' in that specification.
CSSStyleDeclaration.parentRule - Web APIs
example the following javascript code gets the parent css style rule from a cssstyledeclaration: var declaration = document.stylesheets[0].rules[0].style; var rule = declaration.parentrule; specifications specification status comment css object model (
cssom)the definition of 'cssstyledeclaration.parentrule' in that specification.
CSSStyleDeclaration.removeProperty() - Web APIs
example the following javascript code removes the background-color css property from a selector rule: var declaration = document.stylesheets[0].rules[0].style; var oldvalue = declaration.removeproperty('background-color'); specifications specification status comment css object model (
cssom)the definition of 'cssstyledeclaration.removeproperty()' in that specification.
CSSStyleDeclaration.setProperty() - Web APIs
', newbgcolor); } function setrandomcolor() { const newcolor = randomcolor(); boxpararule.style.setproperty('color', newcolor); } borderbtn.addeventlistener('click', setrandomborder); bgcolorbtn.addeventlistener('click', setrandombgcolor); colorbtn.addeventlistener('click', setrandomcolor); result specifications specification status comment css object model (
cssom)the definition of 'cssstyledeclaration.setproperty()' in that specification.
CSSStyleDeclaration - Web APIs
example var styleobj = document.stylesheets[0].cssrules[0].style; console.log(styleobj.csstext); for (var i = styleobj.length; i--;) { var namestring = styleobj[i]; styleobj.removeproperty(namestring); } console.log(styleobj.csstext); specifications specification status comment css object model (
cssom)the definition of 'cssstyledeclaration' in that specification.
CSSStyleRule - Web APIs
specifications specification status comment css object model (
cssom)the definition of 'cssstylerule' in that specification.
CSSStyleSheet.addRule() - Web APIs
therefore, given existing code such as the following: cssstylesheet.addrule(selector, styles, 0); you can rewrite this to use the more standard insertrule() like this: cssstylesheet.insertrule(`${selector} {${styles}}`, 0); specifications specification status comment css object model (
cssom)the definition of 'cssstylesheet.addrule()' in that specification.
CSSStyleSheet.cssRules - Web APIs
specifications specification status comment css object model (
cssom)the definition of 'cssstylesheet.cssrules' in that specification.
CSSStyleSheet.deleteRule() - Web APIs
mystyles.deleterule(0); specifications specification status comment css object model (
cssom)the definition of 'cssstylesheet.deleterule()' in that specification.
CSSStyleSheet.insertRule() - Web APIs
h // then isescaped gets xored by itself, zeroing it isescaped ^= newcharcode===92?1:isescaped; // 92 = "\\".charcodeat(0) } // else, there is no unescaped bracket return originalinsertrule.call(this, selectorandrule, "", arguments[2]); }; } })(cssstylesheet.prototype); specifications specification status comment css object model (
cssom)the definition of 'cssstylesheet.insertrule' in that specification.
CSSStyleSheet.ownerRule - Web APIs
{ /* rule is not imported */ } } this snipped obtains a reference to the stylesheet associated with the @import and processes it in some manner: let rulelist = document.stylesheets[0].cssrules; for (let rule of rulelist) { if (rule.ownerrule) { checkstylesheet(rule.ownerrule.stylesheet); } } specifications specification status comment css object model (
cssom)the definition of 'cssstylesheet.ownerrule' in that specification.
CSSStyleSheet.removeRule() - Web APIs
mystyles.removerule(0); you can rewrite this to use the standard deleterule() method very easily: mystyles.deleterule(0); specifications specification status comment css object model (
cssom)the definition of 'cssstylesheet.removerule()' in that specification.
CSSStyleSheet.rules - Web APIs
specifications specification status comment css object model (
cssom)the definition of 'cssstylesheet.rules' in that specification.
CSSStyleSheet - Web APIs
.ownerrule cssimportrule .stylesheet <?xml-stylesheet ?> processing instruction in the (non-html) document yes .ownernode processinginstruction .sheet http link header yes n/a n/a n/a user agent (default) style sheets no n/a n/a n/a specifications specification status comment css object model (
cssom)the definition of 'cssstylesheet' in that specification.
Using the CSS Typed Object Model - Web APIs
the css typed om makes css manipulation more logical and performant by providing object features (rather than
cssom string manipulation), providing access to types, methods, and an object model for css values.
CaretPosition - Web APIs
methods caretposition.getclientrect specification specification status comment css object model (
cssom) view modulethe definition of 'caretposition' in that specification.
Document.scrollingElement - Web APIs
syntax var element = document.scrollingelement; example var scrollelm = document.scrollingelement; scrollelm.scrolltop = 0; specifications specification status comment css object model (
cssom) view modulethe definition of 'scrollingelement' in that specification.
Document - Web APIs
css object model (
cssom) view modulethe definition of 'document' in that specification.
DocumentOrShadowRoot.caretPositionFromPoint() - Web APIs
var br = document.createelement('br'); textnode.parentnode.insertbefore(br, replacement); } } window.onload = function (){ var paragraphs = document.getelementsbytagname("p"); for (i=0 ; i < paragraphs.length; i++) { paragraphs[i].addeventlistener("click", insertbreakatpoint, false); } }; specifications specification status comment css object model (
cssom) view modulethe definition of 'caretpositionfrompoint()' in that specification.
Element.clientHeight - Web APIs
example specification specification status comment css object model (
cssom) view modulethe definition of 'clientheight' in that specification.
Element.clientLeft - Web APIs
padding-bottom left top right bottom margin-top margin-bottom border-top border-bottom specifications specification status comment css object model (
cssom) view modulethe definition of 'clientleft' in that specification.
Element.clientTop - Web APIs
specifications specification status comment css object model (
cssom) view modulethe definition of 'clienttop' in that specification.
Element.clientWidth - Web APIs
example specification specification status comment css object model (
cssom) view modulethe definition of 'clientwidth' in that specification.
Element.scroll() - Web APIs
examples // put the 1000th vertical pixel at the top of the element element.scroll(0, 1000); using options: element.scroll({ top: 100, left: 100, behavior: 'smooth' }); specification specification status comment css object model (
cssom) view modulethe definition of 'element.scroll()' in that specification.
Element.scrollBy() - Web APIs
examples // scroll an element element.scrollby(300, 300); using options: element.scrollby({ top: 100, left: 100, behavior: 'smooth' }); specification specification status comment css object model (
cssom) view modulethe definition of 'element.scrollby()' in that specification.
Element.scrollHeight - Web APIs
document.registration.accept.checked = false; checkreading.noticebox.id = "notice"; otoberead.parentnode.insertbefore(checkreading.noticebox, otoberead); otoberead.parentnode.insertbefore(document.createelement("br"), otoberead); otoberead.onscroll = checkreading; checkreading.call(otoberead); } specifications specification status comment css object model (
cssom) view modulethe definition of 'element.scrollheight' in that specification.
Element.scrollIntoView() - Web APIs
specifications specification status comment css object model (
cssom) view modulethe definition of 'element.scrollintoview()' in that specification.
Element.scrollLeft - Web APIs
er { width: 100px; height: 100px; border: 1px solid #ccc; overflow-x: scroll; } #content { width: 250px; background-color: #ccc; } javascript const button = document.getelementbyid('slide'); button.onclick = function () { document.getelementbyid('container').scrollleft += 20; }; result specifications specification status comment css object model (
cssom) view modulethe definition of 'scrollleft' in that specification.
Element.scrollTo() - Web APIs
examples element.scrollto(0, 1000); using options: element.scrollto({ top: 100, left: 100, behavior: 'smooth' }); specifications specification status comment css object model (
cssom) view modulethe definition of 'element.scrollto()' in that specification.
Element.scrollTop - Web APIs
if you can see this, scrolltop is maxed-out padding-bottom left top right bottom margin-top margin-bottom border-top border-bottom specifications specification status comment css object model (
cssom) view modulethe definition of 'scrolltop' in that specification.
Element.scrollWidth - Web APIs
the container.'); } else { alert('no overflows!'); } } buttonone.addeventlistener('click', function() { alertoverflow(divone); }); buttontwo.addeventlistener('click', function() { alertoverflow(divtwo); }); </script> </html> result specification specification status comment css object model (
cssom) view modulethe definition of 'element.scrollwidth' in that specification.
Element - Web APIs
css object model (
cssom) view modulethe definition of 'element' in that specification.
ElementCSSInlineStyle.style - Web APIs
note the presence of the value bold for font-weight in the computed style and the absence of it in the element's style property specifications specification status comment css object model (
cssom)the definition of 'the elementcssinlinestyle.style property' in that specification.
FontFace.display - Web APIs
syntax var display = fontface.display fontface.display = display value a
cssomstring with one of the following values.
FontFace.featureSettings - Web APIs
syntax var featuresettingdescriptor = fontface.featuresettings; fontface.featuresettings = featuresettingdescriptor; value a
cssomstring containing a descriptor.
FontFace.stretch - Web APIs
syntax var stretchdescriptor = fontface.stretch; fontface.stretch = stretchdescriptor; value a
cssomstring containing a descriptor as it would be defined in a style sheet's @font-face rule.
FontFace.style - Web APIs
syntax var style = fontface.style; fontface.style = value; value a
cssomstring containing the descriptors defined in the style sheet's @font-face rule.
FontFace.unicodeRange - Web APIs
syntax var unicoderangedescriptor = fontface.unicoderange; fontface.unicoderange = unicoderangedescriptor; value a
cssomstring containing a descriptor as it would appear in a style sheet's @font-face rule.
FontFace.variant - Web APIs
syntax var variantsubproperty = fontface.variant; fontface.variant = variantsubproperty; value a
cssomstring containing a descriptor as it would be defined in a style sheet's @font-face rule.
FontFace.weight - Web APIs
syntax var weightdescriptor = fontface.weight; fontface.weight = weightdescriptor; value a
cssomstring containing a descriptor as it would be defined in a style sheet's @font-face rule.
GeometryUtils - Web APIs
geometryutils.convertquadfromnode() fixme: needs a description geometryutils.convertrectfromnode() fixme: needs a description geometryutils.convertpointfromnode() fixme: needs a description specifications specification status comment css object model (
cssom) view modulethe definition of 'geometryutils' in that specification.
HTMLElement.offsetLeft - Web APIs
var longspan = document.getelementbyid("longspan"); box.style.left = longspan.offsetleft + document.body.scrollleft + "px"; box.style.top = longspan.offsettop + document.body.scrolltop + "px"; box.style.width = longspan.offsetwidth + "px"; box.style.height = longspan.offsetheight + "px"; </script> specification specification status comment css object model (
cssom) view modulethe definition of 'offsetleft' in that specification.
HTMLElement.offsetTop - Web APIs
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.
HTMLElement.offsetWidth - Web APIs
example specification specification status comment css object model (
cssom) view modulethe definition of 'offsetwidth' in that specification.
HTMLElement - Web APIs
specifications specification status comment css object model (
cssom) view modulethe definition of 'htmlelement' in that specification.
HTMLImageElement.x - Web APIs
ble: .group1 { background-color: #d7d9f2; } table { border-collapse: collapse; border: 2px solid rgb(100, 100, 100); font-family: sans-serif; } td, th { border: 1px solid rgb(100, 100, 100); padding: 10px 14px; } td > img { max-width: 4em; } result the resulting table looks like this: specifications specification status comment css object model (
cssom) view modulethe definition of 'htmlimageelement.x' in that specification.
HTMLImageElement.y - Web APIs
ble: .group1 { background-color: #d7d9f2; } table { border-collapse: collapse; border: 2px solid rgb(100, 100, 100); font-family: sans-serif; } td, th { border: 1px solid rgb(100, 100, 100); padding: 10px 14px; } td > img { max-width: 4em; } result the resulting table looks like this: specifications specification status comment css object model (
cssom) view modulethe definition of 'htmlimageelement.y' in that specification.
HTMLImageElement - Web APIs
e constructor img1.src = 'image1.png'; img1.alt = 'alt'; document.body.appendchild(img1); var img2 = document.createelement('img'); // use dom htmlimageelement img2.src = 'image2.jpg'; img2.alt = 'alt text'; document.body.appendchild(img2); // using first image in the document alert(document.images[0].src); specifications specification status comment css object model (
cssom) view modulethe definition of 'extensions to htmlimageelement' in that specification.
HTMLLIElement - Web APIs
as the standard way of defining the list type is via the css list-style-type property, use the
cssom methods to set it via a script.
LinkStyle - Web APIs
specifications specification status comment css object model (
cssom)the definition of 'linkstyle' in that specification.
MediaList.mediaText - Web APIs
const stylesheets = document.stylesheets; let stylesheet = stylesheets[0]; console.log(stylesheet.media.mediatext); specifications specification status comment css object model (
cssom)the definition of 'mediatext' in that specification.
MediaQueryList.addListener() - Web APIs
screen — less than 600px wide.'; document.body.style.backgroundcolor = 'red'; } else { /* the viewport is more than than 600 pixels wide */ para.textcontent = 'this is a wide screen — more than 600px wide.'; document.body.style.backgroundcolor = 'blue'; } } mql.addlistener(screentest); specifications specification status comment css object model (
cssom) view modulethe definition of 'addlistener' in that specification.
MediaQueryList.matches - Web APIs
tener) { mq.addeventlistener("change", callback); } else { mq.addlistener(callback); } } addmqlistener(window.matchmedia("(orientation:landscape)"), event => { if (event.matches) { /* now in landscape orientation */ } else { /* now in portrait orientation */ } } ); specifications specification status comment css object model (
cssom) view modulethe definition of 'matches' in that specification.
MediaQueryList.media - Web APIs
css .mq-value { font: 18px arial, sans-serif; font-weight: bold; color: #88f; padding: 0.4em; border: 1px solid #dde; } result specifications specification status comment css object model (
cssom) view modulethe definition of 'media' in that specification.
MediaQueryList.onchange - Web APIs
ner( "change", (e) => { if (e.matches) { /* the viewport is 600 pixels wide or less */ console.log('this is a narrow screen — less than 600px wide.') } else { /* the viewport is more than than 600 pixels wide */ console.log('this is a wide screen — more than 600px wide.') } }) specifications specification status comment css object model (
cssom) view modulethe definition of 'onchange' in that specification.
MediaQueryList.removeListener() - Web APIs
= 'red'; } else { /* the viewport is more than than 600 pixels wide */ para.textcontent = 'this is a wide screen — more than 600px wide.'; document.body.style.backgroundcolor = 'blue'; } } mql.addlistener(screentest); // later on, when it is no longer needed mql.removelistener(screentest); specifications specification status comment css object model (
cssom) view modulethe definition of 'removelistener' in that specification.
MediaQueryList - Web APIs
specifications specification status comment css object model (
cssom) view modulethe definition of 'mediaquerylist' in that specification.
MediaQueryListEvent.MediaQueryListEvent() - Web APIs
examples var media = '(max-width: 600px)'; var matches = true; var mymediaquerylistevent = new mediaquerylistevent({media, matches}); specifications specification status comment css object model (
cssom) view modulethe definition of 'mediaquerylistevent()' in that specification.
MediaQueryListEvent.matches - Web APIs
creen — less than 600px wide.'; document.body.style.backgroundcolor = 'red'; } else { /* the viewport is more than than 600 pixels wide */ para.textcontent = 'this is a wide screen — more than 600px wide.'; document.body.style.backgroundcolor = 'blue'; } } mql.addlistener(screentest); specifications specification status comment css object model (
cssom) view modulethe definition of 'matches' in that specification.
MediaQueryListEvent.media - Web APIs
wide.'; document.body.style.backgroundcolor = 'red'; } else { /* the viewport is more than than 600 pixels wide */ para.textcontent = 'this is a wide screen — more than 600px wide.'; document.body.style.backgroundcolor = 'blue'; } console.log(e.media); } mql.addlistener(screentest); specifications specification status comment css object model (
cssom) view modulethe definition of 'media' in that specification.
MediaQueryListEvent - Web APIs
screen — less than 600px wide.'; document.body.style.backgroundcolor = 'red'; } else { /* the viewport is more than than 600 pixels wide */ para.textcontent = 'this is a wide screen — more than 600px wide.'; document.body.style.backgroundcolor = 'blue'; } } mql.addlistener(screentest); specifications specification status comment css object model (
cssom) view modulethe definition of 'mediaquerylistevent' in that specification.
MediaQueryListListener - Web APIs
specifications specification status comment css object model (
cssom) view modulethe definition of 'mediaquerylistlistener' in that specification.
MouseEvent() - Web APIs
specifications specification status comment css object model (
cssom) view modulethe definition of 'mouseevent' in that specification.
MouseEvent.offsetX - Web APIs
specifications specification status comment css object model (
cssom) view modulethe definition of 'mouseevent' in that specification.
MouseEvent.offsetY - Web APIs
specifications specification status comment css object model (
cssom) view modulethe definition of 'mouseevent' in that specification.
MouseEvent.screenX - Web APIs
r other roomy elements, you can get the coordinates of that event (e.g., a click) and route it properly, as the following example demonstrates: function checkclickmap(e) { if (e.screenx < 50) doredbutton(); if (50 <= e.screenx && e.screenx < 100) doyellowbutton(); if (e.screenx >= 100) doredbutton(); } specifications specification status comment css object model (
cssom) view modulethe definition of 'screenx' in that specification.
MouseEvent.screenY - Web APIs
o see its position.</p> <p id="screen-log"></p> javascript let screenlog = document.queryselector('#screen-log'); document.addeventlistener('mousemove', logkey); function logkey(e) { screenlog.innertext = ` screen x/y: ${e.screenx}, ${e.screeny} client x/y: ${e.clientx}, ${e.clienty}`; } result specifications specification status comment css object model (
cssom) view modulethe definition of 'screeny' in that specification.
MouseEvent.x - Web APIs
specifications specification status comment css object model (
cssom) view modulethe definition of 'mouseevent.x' in that specification.
MouseEvent.y - Web APIs
specifications specification status comment css object model (
cssom) view modulethe definition of 'mouseevent.y' in that specification.
Range.getBoundingClientRect() - Web APIs
(1), 0); const clientrect = range.getboundingclientrect(); const highlight = document.getelementbyid('highlight'); highlight.style.left = `${clientrect.x}px`; highlight.style.top = `${clientrect.y}px`; highlight.style.width = `${clientrect.width}px`; highlight.style.height = `${clientrect.height}px`; result specification specification status comment css object model (
cssom) view modulethe definition of 'range.getboundingclientrect()' in that specification.
Range.getClientRects() - Web APIs
syntax rectlist = range.getclientrects() example range = document.createrange(); range.selectnode(document.getelementsbytagname("div").item(0)); rectlist = range.getclientrects(); specification specification status comment css object model (
cssom) view modulethe definition of 'range.getclientrects()' in that specification.
Range - Web APIs
css object model (
cssom) view modulethe definition of 'extensions to range' in that specification.
Screen.availHeight - Web APIs
specifications specification status comment css object model (
cssom) view modulethe definition of 'screen.availheight' in that specification.
Screen.availWidth - Web APIs
syntax var width = window.screen.availwidth example var screenavailwidth = window.screen.availwidth; console.log(screenavailwidth); specifications specification status comment css object model (
cssom) view modulethe definition of 'screen.availwidth' in that specification.
Screen.height - Web APIs
specification specification status comment css object model (
cssom) view modulethe definition of 'screen.height' in that specification.
Screen.width - Web APIs
specification specification status comment css object model (
cssom) view modulethe definition of 'screen.width' in that specification.
Screen - Web APIs
void seteventhandler(domstring type, eventhandler handler) eventhandler geteventhandler(domstring type) example if (screen.pixeldepth < 8) { // use low-color version of page } else { // use regular, colorful page } specification specification status comment css object model (
cssom) view modulethe definition of 'screen' in that specification.
ScrollToOptions.behavior - Web APIs
'smooth' : 'auto' } window.scrollto(scrolloptions); }); specifications specification status comment css object model (
cssom) view modulethe definition of 'behavior' in that specification.
ScrollToOptions.left - Web APIs
'smooth' : 'auto' } window.scrollto(scrolloptions); }); specifications specification status comment css object model (
cssom) view modulethe definition of 'left' in that specification.
ScrollToOptions.top - Web APIs
'smooth' : 'auto' } window.scrollto(scrolloptions); }); specifications specification status comment css object model (
cssom) view modulethe definition of 'top' in that specification.
StyleSheet.disabled - Web APIs
} specification specification status comment css object model (
cssom)the definition of 'stylesheet.disabled' in that specification.
Stylesheet.href - Web APIs
specifications specification status comment css object model (
cssom)the definition of 'stylesheet: href' in that specification.
StyleSheet.media - Web APIs
ingify(document.stylesheets[isheetindex].media)); } /* will log: document.stylesheets[0].media: {"0":"screen"} document.stylesheets[0].media: {"0":"screen","1":"handheld"} document.stylesheets[1].media: {"0":"screen","1":"print"} document.stylesheets[1].media: {"0":"screen"} */ </script> </body> </html> specifications specification status comment css object model (
cssom)the definition of 'stylesheet: media' in that specification.
StyleSheet.ownerNode - Web APIs
specifications specification status comment css object model (
cssom)the definition of 'stylesheet: ownernode' in that specification.
StyleSheet.title - Web APIs
specifications specification status comment css object model (
cssom)the definition of 'stylesheet: title' in that specification.
StyleSheet.type - Web APIs
syntax string = stylesheet.type example mystylesheet.type = 'text/css'; specifications specification status comment css object model (
cssom)the definition of 'stylesheet: type' in that specification.
StyleSheet - Web APIs
specifications specification status comment css object model (
cssom)the definition of 'stylesheet' in that specification.
StyleSheetList - Web APIs
ignoring...', stylesheet.href); } }) .filter(boolean) .join('\n'); specifications specification status comment css object model (
cssom)the definition of 'cssstylesheetlist' in that specification.
Window.devicePixelRatio - Web APIs
d #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.
Window.innerHeight - Web APIs
specification specification status comment css object model (
cssom) view modulethe definition of 'window.innerheight' in that specification.
Window.innerWidth - Web APIs
h of the frame viewport within a frameset var intframewidth = self.innerwidth; // this will return the width of the viewport of the closest frameset var intframesetwidth = parent.innerwidth; // this will return the width of the viewport of the outermost frameset var intouterframesetwidth = top.innerwidth; specification specification status comment css object model (
cssom) view modulethe definition of 'window.innerwidth' in that specification.
Window.matchMedia() - Web APIs
specifications specification status comment css object model (
cssom) view modulethe definition of 'window.matchmedia()' in that specification.
Window.moveBy() - Web APIs
function budge() { moveby(10, -10); } specification specification status comment css object model (
cssom) view modulethe definition of 'window.moveby()' in that specification.
Window.moveTo() - Web APIs
function origin() { window.moveto(0, 0); } specification specification status comment css object model (
cssom) view modulethe definition of 'window.moveto()' in that specification.
Window.open() - Web APIs
living standard css object model (
cssom) view modulethe definition of 'the features argument to the open() method' in that specification.
Window.outerHeight - Web APIs
specification specification status comment css object model (
cssom) view modulethe definition of 'window.outerheight' in that specification.
Window.outerWidth - Web APIs
specification specification status comment css object model (
cssom) view modulethe definition of 'window.outerwidth' in that specification.
Window.pageXOffset - Web APIs
specification specification status comment css object model (
cssom) view modulethe definition of 'window.pagexoffset' in that specification.
Window.pageYOffset - Web APIs
specification specification status comment css object model (
cssom) view modulethe definition of 'window.pageyoffset' in that specification.
Window.resizeBy() - Web APIs
specifications specification status comment css object model (
cssom) view modulethe definition of 'window.resizeby()' in that specification.
Window.resizeTo() - Web APIs
function quarter() { window.resizeto( window.screen.availwidth / 2, window.screen.availheight / 2 ); } specification specification status comment css object model (
cssom) view modulethe definition of 'window.resizeto()' in that specification.
Window.screen - Web APIs
syntax let screenobj = window.screen; example if (screen.pixeldepth < 8) { // use low-color version of page } else { // use regular, colorful page } specifications specification status comment css object model (
cssom) view modulethe definition of 'window.screen' in that specification.
Window.screenLeft - Web APIs
if(!window.screenleft) { window.screenleft = window.screenx; window.screentop = window.screeny; } specifications specification status comment css object model (
cssom) view modulethe definition of 'window.screenleft' in that specification.
Window.screenTop - Web APIs
if(!window.screenleft) { window.screenleft = window.screenx; window.screentop = window.screeny; } specifications specification status comment css object model (
cssom) view modulethe definition of 'window.screentop' in that specification.
Window.screenX - Web APIs
if(!window.screenleft) { window.screenleft = window.screenx; window.screentop = window.screeny; } specifications specification status comment css object model (
cssom) view modulethe definition of 'window.screenx' in that specification.
Window.screenY - Web APIs
if(!window.screenleft) { window.screenleft = window.screenx; window.screentop = window.screeny; } specifications specification status comment css object model (
cssom) view modulethe definition of 'window.screeny' in that specification.
Window.scroll() - Web APIs
specification specification status comment css object model (
cssom) view modulethe definition of 'window.scroll()' in that specification.
Window.scrollBy() - Web APIs
specification specification status comment css object model (
cssom) view modulethe definition of 'window.scrollby()' in that specification.
Window.scrollTo() - Web APIs
specifications specification status comment css object model (
cssom) view modulethe definition of 'window.scroll()' in that specification.
Window.scrollX - Web APIs
window.pageyoffset : (document.documentelement || document.body.parentnode || document.body).scrolltop; specification specification status comment css object model (
cssom) view modulethe definition of 'window.scrollx' in that specification.
Window.scrollY - Web APIs
document.documentelement.scrolltop : document.body.scrolltop; specification specification status comment css object model (
cssom) view modulethe definition of 'window.scrolly' in that specification.
Guide to Web APIs - Developer guides
web apis from a to z aambient light eventsbbackground tasksbattery api beaconbluetooth apibroadcast channel apiccss counter stylescss font loading api
cssomcanvas apichannel messaging apiconsole apicredential management apiddomeencoding apiencrypted media extensionsffetch apifile system api frame timing apifullscreen apiggamepad api geolocation apihhtml drag and drop apihigh resolution timehistory apiiimage capture apiindexeddbintersection observer apillong tasks api mmedia capabilities api media capture and streamsmedia session apimedia source e...
Lazy loading - Web Performance
css by default, css is treated as a render blocking resource, so the browser won't render any processed content until the
cssom is constructed.
WebAssembly Concepts - WebAssembly
a set of web apis that the web app can call to control web browser/device functionality and make things happen (dom,
cssom, webgl, indexeddb, web audio api, etc.).