Changeset 214810 in webkit


Ignore:
Timestamp:
Apr 3, 2017 10:12:27 AM (7 years ago)
Author:
Carlos Garcia Campos
Message:

Merge r214599 - Disconnecting a HTMLObjectElement does not always unload its content document
https://bugs.webkit.org/show_bug.cgi?id=169606

Reviewed by Andy Estes.

Source/WebCore:

When removing a node, we first disconnect all subframes then update the focused element as we remove each child.
However, when the removed element is a focused object element with a content document, removeFocusedNodeOfSubtree
can update the style tree synchronously inside Document::setFocusedElement, and reload the document.

Avoid this by instantiating a SubframeLoadingDisabler on the parent of the focused element.

Test: fast/dom/removing-focused-object-element.html

  • dom/Document.cpp:

(WebCore::Document::removeFocusedNodeOfSubtree):

LayoutTests:

Add a regression test.

  • fast/dom/removing-focused-object-element-expected.txt: Added.
  • fast/dom/removing-focused-object-element.html: Added.
Location:
releases/WebKitGTK/webkit-2.16
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • releases/WebKitGTK/webkit-2.16/LayoutTests/ChangeLog

    r214809 r214810  
     12017-03-29  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        Disconnecting a HTMLObjectElement does not always unload its content document
     4        https://bugs.webkit.org/show_bug.cgi?id=169606
     5
     6        Reviewed by Andy Estes.
     7
     8        Add a regression test.
     9
     10        * fast/dom/removing-focused-object-element-expected.txt: Added.
     11        * fast/dom/removing-focused-object-element.html: Added.
     12
    1132017-03-29  Zalan Bujtas  <zalan@apple.com>
    214
  • releases/WebKitGTK/webkit-2.16/Source/WebCore/ChangeLog

    r214809 r214810  
     12017-03-29  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        Disconnecting a HTMLObjectElement does not always unload its content document
     4        https://bugs.webkit.org/show_bug.cgi?id=169606
     5
     6        Reviewed by Andy Estes.
     7
     8        When removing a node, we first disconnect all subframes then update the focused element as we remove each child.
     9        However, when the removed element is a focused object element with a content document, removeFocusedNodeOfSubtree
     10        can update the style tree synchronously inside Document::setFocusedElement, and reload the document.
     11
     12        Avoid this by instantiating a SubframeLoadingDisabler on the parent of the focused element.
     13
     14        Test: fast/dom/removing-focused-object-element.html
     15
     16        * dom/Document.cpp:
     17        (WebCore::Document::removeFocusedNodeOfSubtree):
     18
    1192017-03-29  Zalan Bujtas  <zalan@apple.com>
    220
  • releases/WebKitGTK/webkit-2.16/Source/WebCore/dom/Document.cpp

    r214798 r214810  
    35633563   
    35643564    if (isNodeInSubtree(*focusedElement, node, amongChildrenOnly)) {
     3565        // FIXME: We should avoid synchronously updating the style inside setFocusedElement.
     3566        // FIXME: Object elements should avoid loading a frame synchronously in a post style recalc callback.
     3567        SubframeLoadingDisabler disabler(is<ContainerNode>(node) ? &downcast<ContainerNode>(node) : nullptr);
    35653568        setFocusedElement(nullptr, FocusDirectionNone, FocusRemovalEventsMode::DoNotDispatch);
    35663569        // Set the focus navigation starting node to the previous focused element so that
Note: See TracChangeset for help on using the changeset viewer.