⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 185403 in webkit


Ignore:
Timestamp:
Jun 9, 2015, 10:59:54 PM (11 years ago)
Author:
Alan Bujtas
Message:

Protect FrameView from being destroyed in Document::recalcStyle()
​https://bugs.webkit.org/show_bug.cgi?id=143033
rdar://problem/20326871

Reviewed by Andreas Kling.

This patch ensures that FrameView stays valid in Document::recalcStyle().
It follows the defensive pattern we use to deal with the refcounted FrameView (see EventDispatcher::dispatchEvent)

When the iframe destroys itself in the onBeforeLoad callback (as the result of
PostResolutionCallbackDisabler -> HTMLObjectElement::updateWidget -> guardedDispatchBeforeLoadEvent),
we detach the frame and release the FrameView. However Document::recalcStyle() expects
the FrameView to stay valid.

Covered by fast/frames/flattening/crash-remove-iframe-during-object-beforeload.html.

  • dom/Document.cpp:

(WebCore::Document::recalcStyle):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r185402 r185403  
     12015-06-09  Zalan Bujtas  <zalan@apple.com>
     2
     3        Protect FrameView from being destroyed in Document::recalcStyle()
     4        https://bugs.webkit.org/show_bug.cgi?id=143033
     5        rdar://problem/20326871
     6
     7        Reviewed by Andreas Kling.
     8
     9        This patch ensures that FrameView stays valid in Document::recalcStyle().
     10        It follows the defensive pattern we use to deal with the refcounted FrameView (see EventDispatcher::dispatchEvent)
     11
     12        When the iframe destroys itself in the onBeforeLoad callback (as the result of
     13        PostResolutionCallbackDisabler -> HTMLObjectElement::updateWidget -> guardedDispatchBeforeLoadEvent),
     14        we detach the frame and release the FrameView. However Document::recalcStyle() expects
     15        the FrameView to stay valid.
     16
     17        Covered by fast/frames/flattening/crash-remove-iframe-during-object-beforeload.html.
     18
     19        * dom/Document.cpp:
     20        (WebCore::Document::recalcStyle):
     21
    1222015-06-09  Daegyu Lee  <daegyu.lee@navercorp.com>
    223
  • trunk/Source/WebCore/dom/Document.cpp

    r185398 r185403  
    17391739
    17401740    FrameView& frameView = m_renderView->frameView();
     1741    Ref<FrameView> protect(frameView);
    17411742    if (frameView.isPainting())
    17421743        return;
Note: See TracChangeset for help on using the changeset viewer.