haikuwebkit/LayoutTests/fast/custom-elements/defined-rule-expected.html

8 lines
193 B
HTML
Raw Permalink Normal View History

Add :defined support https://bugs.webkit.org/show_bug.cgi?id=155108 Reviewed by Antti Koivisto. Source/WebCore: Added :defined pseudo class which applies to a successfully instantiated custom element or a builtin element. A new node flag, isUnresolvedCustomElement, which was added in r197917 tracks un-upgraded / unresolved custom elements for which :defined should not apply. Tests: fast/custom-elements/defined-pseudo-class.html fast/custom-elements/defined-rule.html * bindings/js/JSCustomElementInterface.cpp: (WebCore::JSCustomElementInterface::constructElement): Unset isUnresolvedCustomElement now that HTMLElement's constructor sets isUnresolvedCustomElement. * bindings/js/JSHTMLElementCustom.cpp: (WebCore::constructJSHTMLElement): Set isUnresolvedCustomElement to true since :defined should never apply to a custom element inside its constructor as HTMLElement constructor does not set the defined flag: https://w3c.github.io/webcomponents/spec/custom/#htmlelement-constructor * css/CSSSelector.cpp: (WebCore::CSSSelector::selectorText): Added the support for serializing :defined. * css/CSSSelector.h: (PseudoClassType): Added PseudoClassDefined for :defined. * css/SelectorChecker.cpp: (WebCore::SelectorChecker::checkOne): Added the support for :defined. * css/SelectorCheckerTestFunctions.h: (WebCore::isDefinedElement): Added. Returns true for any builtin element and a custom element after a successful construction / upgrades. * css/SelectorPseudoClassAndCompatibilityElementMap.in: Added :defined. * cssjit/SelectorCompiler.cpp: (WebCore::SelectorCompiler::addPseudoClassType): Added the support for :defined. LayoutTests: Added W3C style testharness.js tests and ref tests for :defined pseudo class. * fast/custom-elements/defined-pseudo-class-expected.txt: Added. * fast/custom-elements/defined-pseudo-class.html: Added. * fast/custom-elements/defined-rule-expected.html: Added. * fast/custom-elements/defined-rule.html: Added. Canonical link: https://commits.webkit.org/173419@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@197952 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-10 21:11:33 +00:00
<!DOCTYPE html>
<html>
<body>
<p>Test passes if you see a single 100px by 100px green box below.</p>
<div style="width: 100px; height: 100px; background: green;"></div>
</body>
</html>