Changeset 219296 in webkit


Ignore:
Timestamp:
Jul 10, 2017 10:03:14 AM (7 years ago)
Author:
akling@apple.com
Message:

REGRESSION(r210226): Keyboard-focused element not preserved when navigating back through page cache, causing multiple elements to have focus
https://bugs.webkit.org/show_bug.cgi?id=174302
<rdar://problem/33204273>

Reviewed by Antti Koivisto.

Source/WebCore:

Don't clear the active/hovered/focused elements when destroying the render tree,
since we might need to reconstruct it later, and would like to remember which
elements those were.

Only the focused state actually stuck when going in and out of the page cache,
but this patch removes all the element pointer clearing for consistency.

Test: fast/history/page-cache-element-state-focused.html

  • dom/Document.cpp:

(WebCore::Document::destroyRenderTree):

LayoutTests:

  • fast/history/page-cache-element-state-focused-expected.html: Added.
  • fast/history/page-cache-element-state-focused.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r219291 r219296  
     12017-07-10  Andreas Kling  <akling@apple.com>
     2
     3        REGRESSION(r210226): Keyboard-focused element not preserved when navigating back through page cache, causing multiple elements to have focus
     4        https://bugs.webkit.org/show_bug.cgi?id=174302
     5        <rdar://problem/33204273>
     6
     7        Reviewed by Antti Koivisto.
     8
     9        * fast/history/page-cache-element-state-focused-expected.html: Added.
     10        * fast/history/page-cache-element-state-focused.html: Added.
     11
    1122017-07-10  Zalan Bujtas  <zalan@apple.com>
    213
  • trunk/Source/WebCore/ChangeLog

    r219294 r219296  
     12017-07-10  Andreas Kling  <akling@apple.com>
     2
     3        REGRESSION(r210226): Keyboard-focused element not preserved when navigating back through page cache, causing multiple elements to have focus
     4        https://bugs.webkit.org/show_bug.cgi?id=174302
     5        <rdar://problem/33204273>
     6
     7        Reviewed by Antti Koivisto.
     8
     9        Don't clear the active/hovered/focused elements when destroying the render tree,
     10        since we might need to reconstruct it later, and would like to remember which
     11        elements those were.
     12
     13        Only the focused state actually stuck when going in and out of the page cache,
     14        but this patch removes all the element pointer clearing for consistency.
     15
     16        Test: fast/history/page-cache-element-state-focused.html
     17
     18        * dom/Document.cpp:
     19        (WebCore::Document::destroyRenderTree):
     20
    1212017-07-10  Daniel Bates  <dabates@apple.com>
    222
  • trunk/Source/WebCore/dom/Document.cpp

    r219237 r219296  
    22542254#endif
    22552255
    2256     m_hoveredElement = nullptr;
    2257     m_focusedElement = nullptr;
    2258     m_activeElement = nullptr;
    2259     m_focusNavigationStartingNode = nullptr;
    2260 
    22612256    if (m_documentElement)
    22622257        RenderTreeUpdater::tearDownRenderers(*m_documentElement);
Note: See TracChangeset for help on using the changeset viewer.