Title: [279408] trunk
Revision
279408
Author
[email protected]
Date
2021-06-30 05:53:29 -0700 (Wed, 30 Jun 2021)

Log Message

Support -internal- prefix for pseudo classes and rename :-webkit-direct-focus to :-internal-direct-focus
https://bugs.webkit.org/show_bug.cgi?id=227522

Reviewed by Antti Koivisto.

:-webkit-direct-focus was already UA-sheet only, so I took an opportunity to rename it here, also just to
test that the script is working. Test updated accordingly.

Source/WebCore:

* css/CSSSelector.cpp:
(WebCore::CSSSelector::selectorText const):
* css/SelectorPseudoClassAndCompatibilityElementMap.in:
* css/html.css:
(:-internal-direct-focus):
(:-webkit-direct-focus): Deleted.
* css/makeSelectorPseudoClassAndCompatibilityElementMap.py:
(enumerablePseudoType):

LayoutTests:

* fast/shadow-dom/direct-focus-pseudo-does-not-match-in-author-stylesheet.html:
* fast/shadow-dom/direct-focus-pseudo-does-not-match-in-author-stylesheet-expected.txt:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (279407 => 279408)


--- trunk/LayoutTests/ChangeLog	2021-06-30 10:19:03 UTC (rev 279407)
+++ trunk/LayoutTests/ChangeLog	2021-06-30 12:53:29 UTC (rev 279408)
@@ -1,5 +1,18 @@
 2021-06-30  Tim Nguyen  <[email protected]>
 
+        Support -internal- prefix for pseudo classes and rename :-webkit-direct-focus to :-internal-direct-focus
+        https://bugs.webkit.org/show_bug.cgi?id=227522
+
+        Reviewed by Antti Koivisto.
+
+        :-webkit-direct-focus was already UA-sheet only, so I took an opportunity to rename it here, also just to
+        test that the script is working. Test updated accordingly.
+
+        * fast/shadow-dom/direct-focus-pseudo-does-not-match-in-author-stylesheet.html:
+        * fast/shadow-dom/direct-focus-pseudo-does-not-match-in-author-stylesheet-expected.txt:
+
+2021-06-30  Tim Nguyen  <[email protected]>
+
         Implement support for <dialog> element close event
         https://bugs.webkit.org/show_bug.cgi?id=227493
 

Modified: trunk/LayoutTests/fast/shadow-dom/direct-focus-pseudo-does-not-match-in-author-stylesheet-expected.txt (279407 => 279408)


--- trunk/LayoutTests/fast/shadow-dom/direct-focus-pseudo-does-not-match-in-author-stylesheet-expected.txt	2021-06-30 10:19:03 UTC (rev 279407)
+++ trunk/LayoutTests/fast/shadow-dom/direct-focus-pseudo-does-not-match-in-author-stylesheet-expected.txt	2021-06-30 12:53:29 UTC (rev 279408)
@@ -1,12 +1,12 @@
-This tests that -webkit-direct-focus is not recognized in author stylesheets
+This tests that -internal-direct-focus is not recognized in author stylesheets
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
 PASS defaultFocus.matches(":focus") is true
-PASS defaultFocus.matches(":-webkit-direct-focus") threw exception SyntaxError: The string did not match the expected pattern..
+PASS defaultFocus.matches(":-internal-direct-focus") threw exception SyntaxError: The string did not match the expected pattern..
 PASS inputInShadowRoot.matches(":focus") is true
-PASS inputInShadowRoot.matches(":-webkit-direct-focus") threw exception SyntaxError: The string did not match the expected pattern..
+PASS inputInShadowRoot.matches(":-internal-direct-focus") threw exception SyntaxError: The string did not match the expected pattern..
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/fast/shadow-dom/direct-focus-pseudo-does-not-match-in-author-stylesheet.html (279407 => 279408)


--- trunk/LayoutTests/fast/shadow-dom/direct-focus-pseudo-does-not-match-in-author-stylesheet.html	2021-06-30 10:19:03 UTC (rev 279407)
+++ trunk/LayoutTests/fast/shadow-dom/direct-focus-pseudo-does-not-match-in-author-stylesheet.html	2021-06-30 12:53:29 UTC (rev 279408)
@@ -7,7 +7,7 @@
 
 jsTestIsAsync = true;
 
-description('This tests that -webkit-direct-focus is not recognized in author stylesheets');
+description('This tests that -internal-direct-focus is not recognized in author stylesheets');
 
 let focusedDefault = false;
 function didFocusDefault() { }
@@ -34,7 +34,7 @@
     await waitForFrameToBeFocused();
 
     shouldBeTrue('defaultFocus.matches(":focus")');
-    shouldThrowErrorName('defaultFocus.matches(":-webkit-direct-focus")', 'SyntaxError');
+    shouldThrowErrorName('defaultFocus.matches(":-internal-direct-focus")', 'SyntaxError');
 
     const host = document.body.appendChild(document.createElement('div'));
     const shadowRoot = host.attachShadow({mode: 'closed'});
@@ -43,7 +43,7 @@
     inputInShadowRoot.focus();
 
     shouldBeTrue('inputInShadowRoot.matches(":focus")');
-    shouldThrowErrorName('inputInShadowRoot.matches(":-webkit-direct-focus")', 'SyntaxError');
+    shouldThrowErrorName('inputInShadowRoot.matches(":-internal-direct-focus")', 'SyntaxError');
 
     finishJSTest();
 }

Modified: trunk/Source/WebCore/ChangeLog (279407 => 279408)


--- trunk/Source/WebCore/ChangeLog	2021-06-30 10:19:03 UTC (rev 279407)
+++ trunk/Source/WebCore/ChangeLog	2021-06-30 12:53:29 UTC (rev 279408)
@@ -1,5 +1,24 @@
 2021-06-30  Tim Nguyen  <[email protected]>
 
+        Support -internal- prefix for pseudo classes and rename :-webkit-direct-focus to :-internal-direct-focus
+        https://bugs.webkit.org/show_bug.cgi?id=227522
+
+        Reviewed by Antti Koivisto.
+
+        :-webkit-direct-focus was already UA-sheet only, so I took an opportunity to rename it here, also just to
+        test that the script is working. Test updated accordingly.
+
+        * css/CSSSelector.cpp:
+        (WebCore::CSSSelector::selectorText const):
+        * css/SelectorPseudoClassAndCompatibilityElementMap.in:
+        * css/html.css:
+        (:-internal-direct-focus):
+        (:-webkit-direct-focus): Deleted.
+        * css/makeSelectorPseudoClassAndCompatibilityElementMap.py:
+        (enumerablePseudoType):
+
+2021-06-30  Tim Nguyen  <[email protected]>
+
         Implement support for <dialog> element close event
         https://bugs.webkit.org/show_bug.cgi?id=227493
 

Modified: trunk/Source/WebCore/css/CSSSelector.cpp (279407 => 279408)


--- trunk/Source/WebCore/css/CSSSelector.cpp	2021-06-30 10:19:03 UTC (rev 279407)
+++ trunk/Source/WebCore/css/CSSSelector.cpp	2021-06-30 12:53:29 UTC (rev 279408)
@@ -423,7 +423,7 @@
                 builder.append(":-webkit-autofill-strong-password-viewable");
                 break;
             case CSSSelector::PseudoClassDirectFocus:
-                builder.append(":-webkit-direct-focus");
+                builder.append(":-internal-direct-focus");
                 break;
             case CSSSelector::PseudoClassDrag:
                 builder.append(":-webkit-drag");

Modified: trunk/Source/WebCore/css/SelectorPseudoClassAndCompatibilityElementMap.in (279407 => 279408)


--- trunk/Source/WebCore/css/SelectorPseudoClassAndCompatibilityElementMap.in	2021-06-30 10:19:03 UTC (rev 279407)
+++ trunk/Source/WebCore/css/SelectorPseudoClassAndCompatibilityElementMap.in	2021-06-30 12:53:29 UTC (rev 279408)
@@ -1,3 +1,4 @@
+-internal-direct-focus
 -khtml-drag
 -webkit-any
 -webkit-any-link, PseudoClassAnyLinkDeprecated, PseudoElementUnknown
@@ -4,7 +5,6 @@
 -webkit-autofill
 -webkit-autofill-strong-password
 -webkit-autofill-strong-password-viewable
--webkit-direct-focus
 -webkit-drag
 -webkit-full-page-media
 active

Modified: trunk/Source/WebCore/css/html.css (279407 => 279408)


--- trunk/Source/WebCore/css/html.css	2021-06-30 10:19:03 UTC (rev 279407)
+++ trunk/Source/WebCore/css/html.css	2021-06-30 12:53:29 UTC (rev 279408)
@@ -1264,7 +1264,7 @@
 
 /* states */
 
-:-webkit-direct-focus {
+:-internal-direct-focus {
 #if defined(WTF_PLATFORM_IOS_FAMILY) && WTF_PLATFORM_IOS_FAMILY
     outline: auto 3px -webkit-focus-ring-color;
 #else

Modified: trunk/Source/WebCore/css/makeSelectorPseudoClassAndCompatibilityElementMap.py (279407 => 279408)


--- trunk/Source/WebCore/css/makeSelectorPseudoClassAndCompatibilityElementMap.py	2021-06-30 10:19:03 UTC (rev 279407)
+++ trunk/Source/WebCore/css/makeSelectorPseudoClassAndCompatibilityElementMap.py	2021-06-30 12:53:29 UTC (rev 279408)
@@ -34,6 +34,10 @@
     if stringPseudoType.endswith('('):
         stringPseudoType = stringPseudoType[:-1]
 
+    internalPrefix = '-internal-'
+    if (stringPseudoType.startswith(internalPrefix)):
+        stringPseudoType = stringPseudoType[len(internalPrefix):]
+
     webkitPrefix = '-webkit-'
     if (stringPseudoType.startswith(webkitPrefix)):
         stringPseudoType = stringPseudoType[len(webkitPrefix):]
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to