This extension allows scripts to efficently react on style changes, which may be important for any functionality incooperating style.
For instance, oberserving style changes is of importance for (forward) polyfills that need to consider the style when rendering declarative content.
For Declarative 3D for the Web this extension allows for using CSS properties for instance as shader attributes or geometry transformations via CSS3 3D Transforms
The observe(target, options) method of MutiationObserver must run these steps:
childList, attributes, cssProperties, nor characterData is true, throw a "SyntaxError" and terminate these steps.attributeOldValue is true and attributes is not true, throw a "SyntaxError" and terminate these steps.attributeFilter is a non-empty array and attributes is not true, throw a "SyntaxError" and terminate these steps.characterDataOldValue is true and characterData is not true, throw a "SyntaxError" and terminate these steps.cssPropertyOldValue is true and cssProperties is not true, throw a "SyntaxError" and terminate these steps.cssPropertyFilter is a non-empty array and cssProperties is not true, throw a "SyntaxError" and terminate these steps.We extend MutationRecord interface with cssPropertyName and pseudoElem attributes. Existing type attribute returns "cssProperties" value when CSS properties of the tree of nodes were mutated.
attributes", "characterData", and "childList" values we return "cssProperties" if it was a mutation to the CSS properties of the tree of nodes.To queue an "cssProperties" record with target target, pseudo element pseudoElem css property name propertyName, and oldValue oldValue, run these steps:
MutationRecord object with its type set to "cssProperties", target set to target, pseudoElem set to pseudoElem, and cssPropertyName set to propertyName.oldValue set to oldValue.cssProperties is not true, terminate these substeps (and run them for the next registered observer).attributeFilter is non-empty, and name is not in it, terminate these substeps (and run them for the next registered observer).cssPropertyOldValue is true, append recordWithOldValue to observer's observer record queue.subtree is not true, terminate these substeps (and run them for the next registered observer).cssProperties is not true, terminate these substeps (and run them for the next registered observer).attributeFilter is non-empty, and name is not in it, terminate these substeps (and run them for the next registered observer).cssPropertyOldValue is true, append recordWithOldValue to observer's observer record queue.Many thanks to Robin Berjon for making our lives so much easier with his cool tool.