WebCore:
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Nov 2007 06:04:36 +0000 (06:04 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Nov 2007 06:04:36 +0000 (06:04 +0000)
commit5e7f89d8b19d87c99ff46f0989328b268709e00b
tree0eeb1e6d2e0a73ea5e45fb02c5203ed23b0321fa
parent2b89d4a8db51d72fa99875a7c5d1307621441c93
WebCore:

        Reviewed by Antti Koivisto.

        - fix http://bugs.webkit.org/show_bug.cgi?id=15811
          WebKit plug-ins can re-enter WebKit under attach()
          <rdar://problem/5577978>

        Defer plug-in loading until after attach and recalcStyle using the
        post-attach callback mechanism. Netscape plug-ins are still loaded only
        after layout.

        * dom/ContainerNode.cpp:
        Made NodeCallbackQueue elements retain the Node because callbacks might
        delete nodes that are in the callback queue.
        (WebCore::ContainerNode::suspendPostAttachCallbacks): Added. Needed to
        prevent post-attach callbacks from being dispatched under recalcStyle().
        (WebCore::ContainerNode::resumePostAttachCallbacks): Ditto.
        (WebCore::ContainerNode::dispatchPostAttachCallbacks): Factored out from
        attach().
        (WebCore::ContainerNode::attach):
        * dom/ContainerNode.h:
        * dom/Document.cpp:
        (WebCore::Document::recalcStyle): Added calls to
        suspendPostAttachCallbacks() and resumePostAttachCallbacks().
        * html/HTMLEmbedElement.cpp:
        (WebCore::HTMLEmbedElement::HTMLEmbedElement):
        (WebCore::HTMLEmbedElement::attach): Changed to queue the widget update
        for post-attach.
        (WebCore::HTMLEmbedElement::updateWidget): Added. Called by the
        post-attach callback.
        * html/HTMLEmbedElement.h: Added an m_needWidgetUpdate member needed to
        prevent a double update if another plug-in's post-attach updateWidget()
        triggers a layout which updates the widget before this plug-in's
        post-attach callback is invoked.
        (WebCore::HTMLEmbedElement::setNeedWidgetUpdate): Added a setter for
        m_needWidgetUpdate.
        * html/HTMLObjectElement.cpp:
        (WebCore::HTMLObjectElement::attach): Changed to queue the widget update
        for post-attach.
        (WebCore::HTMLObjectElement::updateWidget): Added. Called by the
        post-attach callback.
        * html/HTMLObjectElement.h:
        (WebCore::HTMLObjectElement::setNeedWidgetUpdate): Added a setter for
        m_needWidgetUpdate.
        * html/HTMLPlugInElement.cpp:
        (WebCore::HTMLPlugInElement::updateWidgetCallback): Added.
        * html/HTMLPlugInElement.h:
        (WebCore::HTMLPlugInElement::updateWidget):
        * rendering/RenderPartObject.cpp:
        (WebCore::RenderPartObject::updateWidget): Added calls to
        setNeedWidgetUpdate(false) so that if this method is called from
        FrameView::layout() during post-attach dispatch of another plug-in,
        it will not be called again when this plug-in's post-attach callback
        is dispatched.
        * rendering/RenderPartObject.h:
        (WebCore::RenderPartObject::updateWidget) Renamed argument to match
        the method definition.

WebKit/mac:

        Reviewed by Antti Koivisto.

        - http://bugs.webkit.org/show_bug.cgi?id=15811
          WebKit plug-ins can re-enter WebKit under attach()
          <rdar://problem/5577978>

        * Plugins/WebNullPluginView.mm:
        (-[WebNullPluginView viewDidMoveToWindow]): Removed workaround for the
        above bug that added as part of fixing
        <http://bugs.webkit.org/show_bug.cgi?id=15804>.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@27982 268f45cc-cd09-0410-ab3c-d52691b4dbfc
14 files changed:
WebCore/ChangeLog
WebCore/dom/ContainerNode.cpp
WebCore/dom/ContainerNode.h
WebCore/dom/Document.cpp
WebCore/html/HTMLEmbedElement.cpp
WebCore/html/HTMLEmbedElement.h
WebCore/html/HTMLObjectElement.cpp
WebCore/html/HTMLObjectElement.h
WebCore/html/HTMLPlugInElement.cpp
WebCore/html/HTMLPlugInElement.h
WebCore/rendering/RenderPartObject.cpp
WebCore/rendering/RenderPartObject.h
WebKit/mac/ChangeLog
WebKit/mac/Plugins/WebNullPluginView.mm