Changeset 75293 in webkit


Ignore:
Timestamp:
Jan 7, 2011 4:49:52 PM (13 years ago)
Author:
rniwa@webkit.org
Message:

2011-01-07 Ryosuke Niwa <rniwa@webkit.org>

Reviewed by Ojan Vafai.

Adopting an iframe to a child frame results in stack overflow
https://bugs.webkit.org/show_bug.cgi?id=52018

Throws an exception when a document adopts an iframe that is an ancestor
of the document in the frame hierarchy. New behavior matches that of Firefox.

Test: fast/html/adopt-parent-frame.html

  • dom/Document.cpp: (WebCore::Document::adoptNode):

2011-01-07 Ryosuke Niwa <rniwa@webkit.org>

Reviewed by Ojan Vafai.

Adopting an iframe to a child frame results in stack overflow
https://bugs.webkit.org/show_bug.cgi?id=52018

Added a test to ensure calling adoptNode with an iframe throws an exception
if the adoptee is an ancestor of the document adopting the node in the frame hierarchy.

  • fast/html/adopt-parent-frame-expected.txt: Added.
  • fast/html/adopt-parent-frame.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r75286 r75293  
     12011-01-07  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        Reviewed by Ojan Vafai.
     4
     5        Adopting an iframe to a child frame results in stack overflow
     6        https://bugs.webkit.org/show_bug.cgi?id=52018
     7
     8        Added a test to ensure calling adoptNode with an iframe throws an exception
     9        if the adoptee is an ancestor of the document adopting the node in the frame hierarchy.
     10
     11        * fast/html/adopt-parent-frame-expected.txt: Added.
     12        * fast/html/adopt-parent-frame.html: Added.
     13
    1142011-01-07  Martin Robinson  <mrobinson@igalia.com>
    215
  • trunk/WebCore/ChangeLog

    r75292 r75293  
     12011-01-07  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        Reviewed by Ojan Vafai.
     4
     5        Adopting an iframe to a child frame results in stack overflow
     6        https://bugs.webkit.org/show_bug.cgi?id=52018
     7
     8        Throws an exception when a document adopts an iframe that is an ancestor
     9        of the document in the frame hierarchy. New behavior matches that of Firefox.
     10
     11        Test: fast/html/adopt-parent-frame.html
     12
     13        * dom/Document.cpp:
     14        (WebCore::Document::adoptNode):
     15
    1162011-01-07  Mihai Parparita  <mihaip@chromium.org>
    217
  • trunk/WebCore/dom/Document.cpp

    r75281 r75293  
    898898    }       
    899899    default:
    900         if (source->hasTagName(iframeTag))
    901             static_cast<HTMLIFrameElement*>(source.get())->setRemainsAliveOnRemovalFromTree(attached() && source->attached());
     900        if (source->hasTagName(iframeTag)) {
     901            HTMLIFrameElement* iframe = static_cast<HTMLIFrameElement*>(source.get());
     902            if (frame()->tree()->isDescendantOf(iframe->contentFrame())) {
     903                ec = HIERARCHY_REQUEST_ERR;
     904                return 0;
     905            }
     906            iframe->setRemainsAliveOnRemovalFromTree(attached() && source->attached());
     907        }
    902908
    903909        if (source->parentNode())
Note: See TracChangeset for help on using the changeset viewer.