Changeset 197952 in webkit
- Timestamp:
- Mar 10, 2016 1:11:33 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r197944 r197952 1 2016-03-10 Ryosuke Niwa <rniwa@webkit.org> 2 3 Add :defined support 4 https://bugs.webkit.org/show_bug.cgi?id=155108 5 6 Reviewed by Antti Koivisto. 7 8 Added W3C style testharness.js tests and ref tests for :defined pseudo class. 9 10 * fast/custom-elements/defined-pseudo-class-expected.txt: Added. 11 * fast/custom-elements/defined-pseudo-class.html: Added. 12 * fast/custom-elements/defined-rule-expected.html: Added. 13 * fast/custom-elements/defined-rule.html: Added. 14 1 15 2016-03-10 Daniel Bates <dabates@apple.com> 2 16 -
trunk/Source/WebCore/ChangeLog
r197950 r197952 1 2016-03-10 Ryosuke Niwa <rniwa@webkit.org> 2 3 Add :defined support 4 https://bugs.webkit.org/show_bug.cgi?id=155108 5 6 Reviewed by Antti Koivisto. 7 8 Added :defined pseudo class which applies to a successfully instantiated custom element or a builtin element. 9 A new node flag, isUnresolvedCustomElement, which was added in r197917 tracks un-upgraded / unresolved custom 10 elements for which :defined should not apply. 11 12 Tests: fast/custom-elements/defined-pseudo-class.html 13 fast/custom-elements/defined-rule.html 14 15 * bindings/js/JSCustomElementInterface.cpp: 16 (WebCore::JSCustomElementInterface::constructElement): Unset isUnresolvedCustomElement now that HTMLElement's 17 constructor sets isUnresolvedCustomElement. 18 * bindings/js/JSHTMLElementCustom.cpp: 19 (WebCore::constructJSHTMLElement): Set isUnresolvedCustomElement to true since :defined should never apply to 20 a custom element inside its constructor as HTMLElement constructor does not set the defined flag: 21 https://w3c.github.io/webcomponents/spec/custom/#htmlelement-constructor 22 * css/CSSSelector.cpp: 23 (WebCore::CSSSelector::selectorText): Added the support for serializing :defined. 24 * css/CSSSelector.h: 25 (PseudoClassType): Added PseudoClassDefined for :defined. 26 * css/SelectorChecker.cpp: 27 (WebCore::SelectorChecker::checkOne): Added the support for :defined. 28 * css/SelectorCheckerTestFunctions.h: 29 (WebCore::isDefinedElement): Added. Returns true for any builtin element and a custom element after a successful 30 construction / upgrades. 31 * css/SelectorPseudoClassAndCompatibilityElementMap.in: Added :defined. 32 * cssjit/SelectorCompiler.cpp: 33 (WebCore::SelectorCompiler::addPseudoClassType): Added the support for :defined. 34 1 35 2016-03-10 Commit Queue <commit-queue@webkit.org> 2 36 -
trunk/Source/WebCore/bindings/js/JSCustomElementInterface.cpp
r197917 r197952 99 99 if (!wrappedElement) 100 100 return nullptr; 101 wrappedElement->set IsCustomElement();101 wrappedElement->setCustomElementIsResolved(); 102 102 return wrappedElement; 103 103 } -
trunk/Source/WebCore/bindings/js/JSHTMLElementCustom.cpp
r197634 r197952 67 67 68 68 Ref<HTMLElement> element = HTMLElement::create(interface->name(), document); 69 element->setIsUnresolvedCustomElement(); 69 70 auto* jsElement = JSHTMLElement::create(newElementStructure, globalObject, element.get()); 70 71 cacheWrapper(globalObject->world(), element.ptr(), jsElement); -
trunk/Source/WebCore/css/CSSSelector.cpp
r197165 r197952 644 644 break; 645 645 #endif 646 #if ENABLE(CUSTOM_ELEMENTS) 647 case CSSSelector::PseudoClassDefined: 648 str.appendLiteral(":defined"); 649 break; 650 #endif 646 651 case CSSSelector::PseudoClassUnknown: 647 652 ASSERT_NOT_REACHED(); -
trunk/Source/WebCore/css/CSSSelector.h
r197165 r197952 163 163 PseudoClassHost, 164 164 #endif 165 #if ENABLE(CUSTOM_ELEMENTS) 166 PseudoClassDefined, 167 #endif 165 168 }; 166 169 -
trunk/Source/WebCore/css/SelectorChecker.cpp
r197779 r197952 991 991 // :host matches based on context. Cases that reach selector checker don't match. 992 992 return false; 993 #endif 994 #if ENABLE(CUSTOM_ELEMENTS) 995 case CSSSelector::PseudoClassDefined: 996 return isDefinedElement(element); 993 997 #endif 994 998 case CSSSelector::PseudoClassWindowInactive: -
trunk/Source/WebCore/css/SelectorCheckerTestFunctions.h
r195311 r197952 64 64 } 65 65 66 #if ENABLE(CUSTOM_ELEMENTS) 67 ALWAYS_INLINE bool isDefinedElement(const Element& element) 68 { 69 return !element.isUnresolvedCustomElement(); 70 } 71 #endif 72 66 73 ALWAYS_INLINE bool isMediaDocument(const Element& element) 67 74 { -
trunk/Source/WebCore/css/SelectorPseudoClassAndCompatibilityElementMap.in
r190680 r197952 79 79 host 80 80 #endif 81 82 #if ENABLE(CUSTOM_ELEMENTS) 83 defined 84 #endif -
trunk/Source/WebCore/cssjit/SelectorCompiler.cpp
r197779 r197952 543 543 fragment.unoptimizedPseudoClasses.append(JSC::FunctionPtr(isEnabled)); 544 544 return FunctionType::SimpleSelectorChecker; 545 #if ENABLE(CUSTOM_ELEMENTS) 546 case CSSSelector::PseudoClassDefined: 547 fragment.unoptimizedPseudoClasses.append(JSC::FunctionPtr(isDefinedElement)); 548 return FunctionType::SimpleSelectorChecker; 549 #endif 545 550 case CSSSelector::PseudoClassFocus: 546 551 fragment.unoptimizedPseudoClasses.append(JSC::FunctionPtr(SelectorChecker::matchesFocusPseudoClass));
Note: See TracChangeset
for help on using the changeset viewer.