addTest(function getComputedStyle() {
const node = document.querySelector("#computed-style");
is(CssLogic.getComputedStyle(node).getPropertyValue("width"), "50px", "Computed style on a normal node works (width)");
is(CssLogic.getComputedStyle(node).getPropertyValue("height"), "10px", "Computed style on a normal node works (height)");
const firstChild = new _documentWalker(node, window).firstChild();
is(CssLogic.getComputedStyle(firstChild).getPropertyValue("content"), "\"before\"", "Computed style on a ::before node works (content)");
const lastChild = new _documentWalker(node, window).lastChild();
is(CssLogic.getComputedStyle(lastChild).getPropertyValue("content"), "\"after\"", "Computed style on a ::after node works (content)");
is(bindingElement, node, "Binding element is the node itself for a normal node");
ok(!pseudo, "Pseudo is null for a normal node");
const firstChild = new _documentWalker(node, window).firstChild();
({ bindingElement, pseudo } = CssLogic.getBindingElementAndPseudo(firstChild));
is(bindingElement, node, "Binding element is the parent for a pseudo node");
is(pseudo, "::before", "Pseudo is correct for a ::before node");
const lastChild = new _documentWalker(node, window).lastChild();
({ bindingElement, pseudo } = CssLogic.getBindingElementAndPseudo(lastChild));
is(bindingElement, node, "Binding element is the parent for a pseudo node");
is(pseudo, "::after", "Pseudo is correct for a ::after node");
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.