Changeset 164204 in webkit


Ignore:
Timestamp:
Feb 16, 2014 7:52:02 PM (10 years ago)
Author:
akling@apple.com
Message:

Ensure that removing an iframe from the DOM tree disconnects its Frame.
<https://webkit.org/b/128889>
<rdar://problem/15671221>

Merged from Blink (patch by Adam Klein):
https://src.chromium.org/viewvc/blink?revision=156174&view=revision

Source/WebCore:

SubframeLoadingDisabler wasn't catching the case when an <iframe> was,
in its unload handler, removed and re-added to the same parent.
Fix this by using a count of SubframeLoadingDisablers that are on the
stack for a given root, rather than a simple boolean.

Test: fast/frames/reattach-in-unload.html

  • html/HTMLFrameOwnerElement.h:

(WebCore::SubframeLoadingDisabler::disabledSubtreeRoots):

LayoutTests:

  • fast/frames/reattach-in-unload-expected.txt: Added.
  • fast/frames/reattach-in-unload.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r164203 r164204  
     12014-02-16  Andreas Kling  <akling@apple.com>
     2
     3        Ensure that removing an iframe from the DOM tree disconnects its Frame.
     4        <https://webkit.org/b/128889>
     5        <rdar://problem/15671221>
     6
     7        Merged from Blink (patch by Adam Klein):
     8        https://src.chromium.org/viewvc/blink?revision=156174&view=revision
     9
     10        * fast/frames/reattach-in-unload-expected.txt: Added.
     11        * fast/frames/reattach-in-unload.html: Added.
     12
    1132014-02-16  Benjamin Poulain  <benjamin@webkit.org>
    214
  • trunk/Source/WebCore/ChangeLog

    r164203 r164204  
     12014-02-16  Andreas Kling  <akling@apple.com>
     2
     3        Ensure that removing an iframe from the DOM tree disconnects its Frame.
     4        <https://webkit.org/b/128889>
     5        <rdar://problem/15671221>
     6
     7        Merged from Blink (patch by Adam Klein):
     8        https://src.chromium.org/viewvc/blink?revision=156174&view=revision
     9
     10        SubframeLoadingDisabler wasn't catching the case when an <iframe> was,
     11        in its unload handler, removed and re-added to the same parent.
     12        Fix this by using a count of SubframeLoadingDisablers that are on the
     13        stack for a given root, rather than a simple boolean.
     14
     15        Test: fast/frames/reattach-in-unload.html
     16
     17        * html/HTMLFrameOwnerElement.h:
     18        (WebCore::SubframeLoadingDisabler::disabledSubtreeRoots):
     19
    1202014-02-16  Benjamin Poulain  <benjamin@webkit.org>
    221
  • trunk/Source/WebCore/html/HTMLFrameOwnerElement.h

    r163440 r164204  
    2323
    2424#include "HTMLElement.h"
     25#include <wtf/HashCountedSet.h>
    2526
    2627namespace WebCore {
     
    8990
    9091private:
    91     static HashSet<ContainerNode*>& disabledSubtreeRoots()
     92    static HashCountedSet<ContainerNode*>& disabledSubtreeRoots()
    9293    {
    93         DEFINE_STATIC_LOCAL(HashSet<ContainerNode*>, nodes, ());
     94        DEFINE_STATIC_LOCAL(HashCountedSet<ContainerNode*>, nodes, ());
    9495        return nodes;
    9596    }
Note: See TracChangeset for help on using the changeset viewer.