Title: [209670] trunk/Source/WebCore
Revision
209670
Author
[email protected]
Date
2016-12-10 12:22:37 -0800 (Sat, 10 Dec 2016)

Log Message

[CSS Parser] Remove the pseudoclass/element hacks
https://bugs.webkit.org/show_bug.cgi?id=165729

Reviewed by Sam Weinig.

* css/SelectorPseudoClassAndCompatibilityElementMap.in:
* css/SelectorPseudoElementTypeMap.in:
* css/parser/CSSSelectorParser.cpp:
(WebCore::CSSSelectorParser::consumePseudo):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (209669 => 209670)


--- trunk/Source/WebCore/ChangeLog	2016-12-10 19:36:08 UTC (rev 209669)
+++ trunk/Source/WebCore/ChangeLog	2016-12-10 20:22:37 UTC (rev 209670)
@@ -1,3 +1,15 @@
+2016-12-10  Dave Hyatt  <[email protected]>
+
+        [CSS Parser] Remove the pseudoclass/element hacks
+        https://bugs.webkit.org/show_bug.cgi?id=165729
+
+        Reviewed by Sam Weinig.
+
+        * css/SelectorPseudoClassAndCompatibilityElementMap.in:
+        * css/SelectorPseudoElementTypeMap.in:
+        * css/parser/CSSSelectorParser.cpp:
+        (WebCore::CSSSelectorParser::consumePseudo):
+
 2016-12-09  Sam Weinig  <[email protected]>
 
         [WebIDL] Remove custom bindings for Geolocation

Modified: trunk/Source/WebCore/css/SelectorPseudoClassAndCompatibilityElementMap.in (209669 => 209670)


--- trunk/Source/WebCore/css/SelectorPseudoClassAndCompatibilityElementMap.in	2016-12-10 19:36:08 UTC (rev 209669)
+++ trunk/Source/WebCore/css/SelectorPseudoClassAndCompatibilityElementMap.in	2016-12-10 20:22:37 UTC (rev 209670)
@@ -1,5 +1,5 @@
 -khtml-drag
--webkit-any(
+-webkit-any
 -webkit-any-link, PseudoClassAnyLinkDeprecated, PseudoElementUnknown
 -webkit-autofill
 -webkit-drag
@@ -14,7 +14,7 @@
 default
 defined
 #if ENABLE(CSS_SELECTORS_LEVEL4)
-dir(
+dir
 #endif
 disabled
 double-button
@@ -34,17 +34,17 @@
 increment
 indeterminate
 invalid
-lang(
+lang
 last-child
 last-of-type
 link
-matches(
+matches
 no-button
-not(
-nth-child(
-nth-last-child(
-nth-last-of-type(
-nth-of-type(
+not
+nth-child
+nth-last-child
+nth-last-of-type
+nth-of-type
 only-child
 only-of-type
 optional
@@ -54,7 +54,7 @@
 read-write
 required
 #if ENABLE(CSS_SELECTORS_LEVEL4)
-role(
+role
 #endif
 root
 scope

Modified: trunk/Source/WebCore/css/SelectorPseudoElementTypeMap.in (209669 => 209670)


--- trunk/Source/WebCore/css/SelectorPseudoElementTypeMap.in	2016-12-10 19:36:08 UTC (rev 209669)
+++ trunk/Source/WebCore/css/SelectorPseudoElementTypeMap.in	2016-12-10 20:22:37 UTC (rev 209670)
@@ -1,7 +1,7 @@
 after
 before
 #if ENABLE(VIDEO_TRACK)
-cue, PseudoElementWebKitCustom
+cue
 #endif
 first-letter
 first-line

Modified: trunk/Source/WebCore/css/parser/CSSSelectorParser.cpp (209669 => 209670)


--- trunk/Source/WebCore/css/parser/CSSSelectorParser.cpp	2016-12-10 19:36:08 UTC (rev 209669)
+++ trunk/Source/WebCore/css/parser/CSSSelectorParser.cpp	2016-12-10 20:22:37 UTC (rev 209670)
@@ -501,18 +501,6 @@
     
     auto lowercasedValue = token.value().toString().convertToASCIILowercase();
     auto value = StringView { lowercasedValue };
-    
-    // FIXME-NEWPARSER: We can't change the pseudoclass/element maps that the old parser
-    // uses without breaking it; this hack allows function selectors to work. When the new
-    // parser turns on, we can patch the map and remove this code.
-    String newValue;
-    if (token.type() == FunctionToken && colons == 1) {
-        auto tokenString = value.toString();
-        if (!value.startsWithIgnoringASCIICase(StringView { "host" })) {
-            newValue = makeString(value, '(');
-            value = newValue;
-        }
-    }
 
     if (colons == 1)
         selector = std::unique_ptr<CSSParserSelector>(CSSParserSelector::parsePseudoClassSelectorFromStringView(value));
@@ -519,19 +507,9 @@
     else {
         selector = std::unique_ptr<CSSParserSelector>(CSSParserSelector::parsePseudoElementSelectorFromStringView(value));
 #if ENABLE(VIDEO_TRACK)
-        if (selector && selector->match() == CSSSelector::PseudoElement && selector->pseudoElementType() == CSSSelector::PseudoElementWebKitCustom) {
-            // FIXME-NEWPARSER: The old parser treats cue as two pseudo-element types, because it
-            // is unable to handle a dual pseudo-element (one that can be both an ident or a
-            // function) without splitting them up.
-            //
-            // This means that "cue" is being parsed as PseudoElementWebkitCustom when used as an
-            // identifier, and it's being parsed as PseudoElementCue when used as a function.
-            //
-            // We have to mimic this behavior until the old parser is gone, at which point we can
-            // make all code use PseudoElementCue.
-            if (token.type() == FunctionToken && value.startsWithIgnoringASCIICase("cue"))
-                selector->setPseudoElementType(CSSSelector::PseudoElementCue);
-        }
+        // Treat the ident version of cue as PseudoElementWebkitCustom.
+        if (token.type() == IdentToken && selector && selector->match() == CSSSelector::PseudoElement && selector->pseudoElementType() == CSSSelector::PseudoElementCue)
+            selector->setPseudoElementType(CSSSelector::PseudoElementWebKitCustom);
 #endif
     }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to