Changeset 288420 in webkit


Ignore:
Timestamp:
Jan 23, 2022 8:59:15 AM (6 months ago)
Author:
Ziran Sun
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):

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r288402 r288420  
     12022-01-23  Ziran Sun  <zsun@igalia.com>
     2
     3        [forms] Prevent contenteditable anchors from being stuck
     4        https://bugs.webkit.org/show_bug.cgi?id=235438
     5
     6        Reviewed by Darin Adler.
     7
     8        Update 1 WPT test expectation file as the test is now passing.
     9        * web-platform-tests/html/semantics/forms/the-input-element/anchor-active-contenteditable-expected.txt:
     10
    1112022-01-21  Antoine Quint  <graouts@webkit.org>
    212
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/anchor-active-contenteditable-expected.txt

    r279427 r288420  
    11anchor
    22
    3 FAIL Anchor elements should not stay :active when contentEditable is enabled. assert_equals: expected null but got Element node <a id="anchorid" href="nonexistant" contenteditable="true...
     3PASS Anchor elements should not stay :active when contentEditable is enabled.
    44
  • trunk/Source/WebCore/ChangeLog

    r288419 r288420  
     12022-01-23  Ziran Sun  <zsun@igalia.com>
     2
     3        [forms] Prevent contenteditable anchors from being stuck
     4        https://bugs.webkit.org/show_bug.cgi?id=235438
     5
     6        Reviewed by Darin Adler.
     7
     8        Anchors can be stuck in the :active state if contenteditable is enabled before
     9        :active is removed. With this patch setActive() can remove :active during
     10        contenteditable in order to prevent anchors from navigating during contenteditable.
     11
     12        This is an import of Chromium CL at
     13        https://chromium-review.googlesource.com/c/chromium/src/+/2595978       
     14
     15        * html/HTMLAnchorElement.cpp:
     16        (WebCore::HTMLAnchorElement::setActive):
     17
    1182022-01-23  Tyler Wilcock  <tyler_w@apple.com>
    219
  • trunk/Source/WebCore/html/HTMLAnchorElement.cpp

    r287731 r288420  
    214214void HTMLAnchorElement::setActive(bool down, bool pause, Style::InvalidationScope invalidationScope)
    215215{
    216     if (hasEditableStyle()) {
     216    if (down && hasEditableStyle()) {
    217217        switch (document().settings().editableLinkBehavior()) {
    218218        case EditableLinkBehavior::Default:
Note: See TracChangeset for help on using the changeset viewer.