HTMLEmbedObject should match HTMLObjectElement by stopping any load when it is remove...
authoreric@webkit.org <eric@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Jan 2012 00:00:03 +0000 (00:00 +0000)
committereric@webkit.org <eric@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Jan 2012 00:00:03 +0000 (00:00 +0000)
commit1f8035c3dd11bc7a725364df4743d88fb4c7d84e
tree15a6345d54899dc84a797a27f13cd1fcb99b41d9
parentab14ca116092dc52f7c838b4f0e1f2a1a5185083
HTMLEmbedObject should match HTMLObjectElement by stopping any load when it is removed from beforeload
https://bugs.webkit.org/show_bug.cgi?id=74360

Reviewed by Adam Barth.

Source/WebCore:

Neither of these !renderer() checks is strictly necessary since requestObject()
makes the same check.  However requestObject() asserts before it makes that
check, so it makes sense to add the check to HTMLEmebedObject instead of
removing the check from HTMLObjectElement.
I also moved the protect RefPtr to before the beforeload dispatch since
beforeload can remove the whole DOM element (as this test does) and
thus I beleive the renderer() check could be checking free'd memory.

Updated fast/dom/beforeload/remove-flash-in-beforeload-listener.html to test
<embed> as well as <object>.

* html/HTMLEmbedElement.cpp:
(WebCore::HTMLEmbedElement::updateWidget):
* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::updateWidget):

LayoutTests:

Test <embed> as well as <object> in this test.

* fast/dom/beforeload/remove-flash-in-beforeload-listener.html:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@105938 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/dom/beforeload/remove-flash-in-beforeload-listener.html
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLEmbedElement.cpp
Source/WebCore/html/HTMLObjectElement.cpp