REGRESSION (r102983): ClicktoFlash drawing of old style youtube embeds missing until...
authoraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 Feb 2012 20:20:41 +0000 (20:20 +0000)
committeraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 Feb 2012 20:20:41 +0000 (20:20 +0000)
commit87b89d153cd7357d3c90f713230b97bc610e4129
tree3f2954e09dd0ebacb0c24bb89921a30fe8d1af39
parent2f0ff69258e2c6a8e2ecdb5f209de3b8232620ff
REGRESSION (r102983): ClicktoFlash drawing of old style youtube embeds missing until resize
https://bugs.webkit.org/show_bug.cgi?id=77167

Reviewed by Eric Seidel.

Source/WebCore:

Test: plugins/layout-in-beforeload-listener-affects-plugin-loading.html

r102983 made FrameView::updateWidgets() check if the DOM node actually
needs a widget update before calling updateWidget(). Due to historical
reasons, however, updateWidget() can be legitimately called twice: once
at attach time for non-Netscape plug-ins and once at layout time for
Netscape plug-ins.

If the widget represents a Netscape plug-in, but updateWidget() is
called for the CreateOnlyNonNetscapePlugins case after the DOM node was
marked as needing an update, updateWidget() will clear the update flag
and prevent a second call to updateWidget() at layout time for the
CreateAnyWidgetType case.

As much as I loathe adding to the code duplication between
HTMLEmbedElement::updateWidget() and HTMLObjectElement::updateWidget(),
the simplest solution seems to be marking the DOM node as needing
update in the case where we are calling updateWidget() for the
CreateOnlyNonNetscapePlugins case and we know we will be loading a
Netscape plug-in.

* html/HTMLEmbedElement.cpp:
(WebCore::HTMLEmbedElement::updateWidget): Call
setNeedsWidgetUpdate(true) if pluginCreationOption is
CreateOnlyNonNetscapePlugins but we will load a Netscape plug-in.
* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::updateWidget): Ditto.
* html/HTMLPlugInElement.cpp:
(WebCore::HTMLPlugInElement::guardedDispatchBeforeLoadEvent): Remove an
invalid assertion that prevents the layout test from running in a Debug
configuration.

LayoutTests:

* plugins/layout-in-beforeload-listener-affects-plugin-loading-expected.txt: Added.
* plugins/layout-in-beforeload-listener-affects-plugin-loading.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@107118 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/plugins/layout-in-beforeload-listener-affects-plugin-loading-expected.txt [new file with mode: 0644]
LayoutTests/plugins/layout-in-beforeload-listener-affects-plugin-loading.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLEmbedElement.cpp
Source/WebCore/html/HTMLObjectElement.cpp
Source/WebCore/html/HTMLPlugInElement.cpp