Title: [288420] trunk
Revision
288420
Author
[email protected]
Date
2022-01-23 08:59:15 -0800 (Sun, 23 Jan 2022)

Log Message

[forms] Prevent contenteditable anchors from being stuck
https://bugs.webkit.org/show_bug.cgi?id=235438

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Update 1 WPT test expectation file as the test is now passing.
* web-platform-tests/html/semantics/forms/the-input-element/anchor-active-contenteditable-expected.txt:

Source/WebCore:

Anchors can be stuck in the :active state if contenteditable is enabled before
:active is removed. With this patch setActive() can remove :active during
contenteditable in order to prevent anchors from navigating during contenteditable.

This is an import of Chromium CL at
https://chromium-review.googlesource.com/c/chromium/src/+/2595978

* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::setActive):

Modified Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (288419 => 288420)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2022-01-23 16:50:20 UTC (rev 288419)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2022-01-23 16:59:15 UTC (rev 288420)
@@ -1,3 +1,13 @@
+2022-01-23  Ziran Sun  <[email protected]>
+
+        [forms] Prevent contenteditable anchors from being stuck
+        https://bugs.webkit.org/show_bug.cgi?id=235438
+
+        Reviewed by Darin Adler.
+
+        Update 1 WPT test expectation file as the test is now passing.
+        * web-platform-tests/html/semantics/forms/the-input-element/anchor-active-contenteditable-expected.txt:
+
 2022-01-21  Antoine Quint  <[email protected]>
 
         Update css/css-animation WPT following animation-composition testing updates

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/anchor-active-contenteditable-expected.txt (288419 => 288420)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/anchor-active-contenteditable-expected.txt	2022-01-23 16:50:20 UTC (rev 288419)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/anchor-active-contenteditable-expected.txt	2022-01-23 16:59:15 UTC (rev 288420)
@@ -1,4 +1,4 @@
 anchor
 
-FAIL Anchor elements should not stay :active when contentEditable is enabled. assert_equals: expected null but got Element node <a id="anchorid" href="" contenteditable="true...
+PASS Anchor elements should not stay :active when contentEditable is enabled.
 

Modified: trunk/Source/WebCore/ChangeLog (288419 => 288420)


--- trunk/Source/WebCore/ChangeLog	2022-01-23 16:50:20 UTC (rev 288419)
+++ trunk/Source/WebCore/ChangeLog	2022-01-23 16:59:15 UTC (rev 288420)
@@ -1,3 +1,20 @@
+2022-01-23  Ziran Sun  <[email protected]>
+
+        [forms] Prevent contenteditable anchors from being stuck
+        https://bugs.webkit.org/show_bug.cgi?id=235438
+
+        Reviewed by Darin Adler.
+
+        Anchors can be stuck in the :active state if contenteditable is enabled before
+        :active is removed. With this patch setActive() can remove :active during
+        contenteditable in order to prevent anchors from navigating during contenteditable.
+
+        This is an import of Chromium CL at
+        https://chromium-review.googlesource.com/c/chromium/src/+/2595978        
+
+        * html/HTMLAnchorElement.cpp:
+        (WebCore::HTMLAnchorElement::setActive):
+
 2022-01-23  Tyler Wilcock  <[email protected]>
 
         AX: Refactor near-duplicate AXObjectCache::updateIsolatedTree implementations

Modified: trunk/Source/WebCore/html/HTMLAnchorElement.cpp (288419 => 288420)


--- trunk/Source/WebCore/html/HTMLAnchorElement.cpp	2022-01-23 16:50:20 UTC (rev 288419)
+++ trunk/Source/WebCore/html/HTMLAnchorElement.cpp	2022-01-23 16:59:15 UTC (rev 288420)
@@ -213,7 +213,7 @@
 
 void HTMLAnchorElement::setActive(bool down, bool pause, Style::InvalidationScope invalidationScope)
 {
-    if (hasEditableStyle()) {
+    if (down && hasEditableStyle()) {
         switch (document().settings().editableLinkBehavior()) {
         case EditableLinkBehavior::Default:
         case EditableLinkBehavior::AlwaysLive:
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to