User scripts injected at start are not run for plugin and media documents
authorbweinstein@apple.com <bweinstein@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Aug 2010 20:20:16 +0000 (20:20 +0000)
committerbweinstein@apple.com <bweinstein@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Aug 2010 20:20:16 +0000 (20:20 +0000)
<https://bugs.webkit.org/show_bug.cgi?id=44711>
<rdar://problem/8359288>

Reviewed by Adam Roben.

http://trac.webkit.org/changeset/61271 made scripts injected at start run on ImageDocuments,
but didn't implement this behavior for MediaDocuments and PluginDocuments.

* loader/MediaDocument.cpp:
(WebCore::MediaDocumentParser::createDocumentStructure): Make sure we fire dispatchDocumentElementAvailable.
* loader/PluginDocument.cpp:
(WebCore::PluginDocumentParser::createDocumentStructure): Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@66129 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/loader/MediaDocument.cpp
WebCore/loader/PluginDocument.cpp

index 8453751..755ae2d 100644 (file)
@@ -1,3 +1,19 @@
+2010-08-26  Brian Weinstein  <bweinstein@apple.com>
+
+        Reviewed by Adam Roben.
+
+        User scripts injected at start are not run for plugin and media documents
+        <https://bugs.webkit.org/show_bug.cgi?id=44711>
+        <rdar://problem/8359288>
+        
+        http://trac.webkit.org/changeset/61271 made scripts injected at start run on ImageDocuments,
+        but didn't implement this behavior for MediaDocuments and PluginDocuments.
+
+        * loader/MediaDocument.cpp:
+        (WebCore::MediaDocumentParser::createDocumentStructure): Make sure we fire dispatchDocumentElementAvailable.
+        * loader/PluginDocument.cpp:
+        (WebCore::PluginDocumentParser::createDocumentStructure): Ditto.
+
 2010-08-26  Peter Kasting  <pkasting@google.com>
 
         Reviewed by Dimitri Glazkov.
index 7e28d02..dd58581 100644 (file)
@@ -71,6 +71,9 @@ void MediaDocumentParser::createDocumentStructure()
     ExceptionCode ec;
     RefPtr<Element> rootElement = document()->createElement(htmlTag, false);
     document()->appendChild(rootElement, ec);
+
+    if (document()->frame() && document()->frame()->loader())
+        document()->frame()->loader()->dispatchDocumentElementAvailable();
         
     RefPtr<Element> body = document()->createElement(bodyTag, false);
     body->setAttribute(styleAttr, "background-color: rgb(38,38,38);");
index 54e686c..ae036d3 100644 (file)
@@ -84,6 +84,9 @@ void PluginDocumentParser::createDocumentStructure()
     RefPtr<Element> rootElement = document()->createElement(htmlTag, false);
     document()->appendChild(rootElement, ec);
 
+    if (document()->frame() && document()->frame()->loader())
+        document()->frame()->loader()->dispatchDocumentElementAvailable();
+
     RefPtr<Element> body = document()->createElement(bodyTag, false);
     body->setAttribute(marginwidthAttr, "0");
     body->setAttribute(marginheightAttr, "0");