Revert "Don't dispatch 'beforeload' event inside FrameView::layout()",
authorjhoneycutt@apple.com <jhoneycutt@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 May 2014 17:24:47 +0000 (17:24 +0000)
committerjhoneycutt@apple.com <jhoneycutt@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 May 2014 17:24:47 +0000 (17:24 +0000)
commit 84fe8cf6fbe8b5de9a06300ca3ef6d0ffc96948c, and associated
follow-up fixes:

    "platform/mac/plugins/testplugin-onnew-onpaint.html failing after
        r168668", commit c17be3bf5127baf94310af4b4b9bf5a57d29aaf4
    "[Win] Unreviewed build fix after r168668.", commit
        4fa470ad12c38ee7d4c114541b6dd321181a8bc9

The original merged patch appears to have caused a regression in
fast/dom/HTMLObjectElement/object-as-frame.html.

<https://bugs.webkit.org/show_bug.cgi?id=132886>

Reviewed by Alexey Proskuryakov.

Source/WebCore:
* WebCore.exp.in:
* dom/Document.cpp:
(WebCore::Document::updateLayoutIgnorePendingStylesheets):
* dom/Document.h:
* html/HTMLAppletElement.cpp:
(WebCore::HTMLAppletElement::renderWidgetForJSBindings):
* html/HTMLEmbedElement.cpp:
(WebCore::HTMLEmbedElement::renderWidgetForJSBindings):
* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::renderWidgetForJSBindings):
* page/FrameView.cpp:
(WebCore::FrameView::FrameView):
(WebCore::FrameView::reset):
(WebCore::FrameView::flushAnyPendingPostLayoutTasks):
(WebCore::FrameView::performPostLayoutTasks):
(WebCore::FrameView::updateEmbeddedObjectsTimerFired): Deleted.
* page/FrameView.h:
* testing/Internals.cpp:
(WebCore::Internals::updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks): Deleted.
* testing/Internals.h:
* testing/Internals.idl:

Source/WebKit:
* WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in:

LayoutTests:
* compositing/plugins/composited-plugin.html:
* compositing/plugins/no-backing-store.html:
* fast/dom/beforeload/flash-before-load.html:
* fast/events/beforeload-assertion-expected.txt: Removed.
* fast/events/beforeload-assertion.html: Removed.
* fast/events/beforeload-iframe-crash-expected.txt: Removed.
* fast/events/beforeload-iframe-crash.html: Removed.
* fast/events/beforeload-input-time-crash-expected.txt: Removed.
* fast/events/beforeload-input-time-crash.html: Removed.
* http/tests/security/contentSecurityPolicy/1.1/plugintypes-notype-data.html:
* http/tests/security/contentSecurityPolicy/1.1/plugintypes-nourl-blocked.html:
* http/tests/security/contentSecurityPolicy/object-src-no-url-allowed.html:
* http/tests/security/contentSecurityPolicy/object-src-no-url-blocked.html:
* http/tests/security/contentSecurityPolicy/object-src-none-allowed.html:
* http/tests/security/contentSecurityPolicy/object-src-none-blocked.html:
* http/tests/security/contentSecurityPolicy/resources/multiple-iframe-plugin-test.js:
(testImpl.iframe.onload):
(testImpl):
* http/tests/security/mixedContent/insecure-plugin-in-iframe.html:
* platform/mac/plugins/supports-carbon-event-model.html:
* platform/mac/plugins/testplugin-onnew-onpaint.html:
* plugins/get-user-agent-with-null-npp-from-npp-new.html:
* plugins/mouse-click-plugin-clears-selection.html:
* plugins/netscape-plugin-map-data-to-src.html:
* plugins/no-mime-with-valid-extension.html:
* plugins/plugin-initiate-popup-window.html:
* plugins/windowless_plugin_paint_test.html:
* resources/plugin.js: Removed.

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

41 files changed:
LayoutTests/ChangeLog
LayoutTests/compositing/plugins/composited-plugin.html
LayoutTests/compositing/plugins/no-backing-store.html
LayoutTests/fast/dom/beforeload/flash-before-load.html
LayoutTests/fast/events/beforeload-assertion-expected.txt [deleted file]
LayoutTests/fast/events/beforeload-assertion.html [deleted file]
LayoutTests/fast/events/beforeload-iframe-crash-expected.txt [deleted file]
LayoutTests/fast/events/beforeload-iframe-crash.html [deleted file]
LayoutTests/fast/events/beforeload-input-time-crash-expected.txt [deleted file]
LayoutTests/fast/events/beforeload-input-time-crash.html [deleted file]
LayoutTests/http/tests/security/contentSecurityPolicy/1.1/plugintypes-notype-data.html
LayoutTests/http/tests/security/contentSecurityPolicy/1.1/plugintypes-nourl-blocked.html
LayoutTests/http/tests/security/contentSecurityPolicy/object-src-no-url-allowed.html
LayoutTests/http/tests/security/contentSecurityPolicy/object-src-no-url-blocked.html
LayoutTests/http/tests/security/contentSecurityPolicy/object-src-none-allowed.html
LayoutTests/http/tests/security/contentSecurityPolicy/object-src-none-blocked.html
LayoutTests/http/tests/security/contentSecurityPolicy/resources/multiple-iframe-plugin-test.js
LayoutTests/http/tests/security/mixedContent/insecure-plugin-in-iframe.html
LayoutTests/platform/mac/plugins/supports-carbon-event-model.html
LayoutTests/platform/mac/plugins/testplugin-onnew-onpaint.html
LayoutTests/plugins/get-user-agent-with-null-npp-from-npp-new.html
LayoutTests/plugins/mouse-click-plugin-clears-selection.html
LayoutTests/plugins/netscape-plugin-map-data-to-src.html
LayoutTests/plugins/no-mime-with-valid-extension.html
LayoutTests/plugins/plugin-initiate-popup-window.html
LayoutTests/plugins/windowless_plugin_paint_test.html
LayoutTests/resources/plugin.js [deleted file]
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/Document.h
Source/WebCore/html/HTMLAppletElement.cpp
Source/WebCore/html/HTMLEmbedElement.cpp
Source/WebCore/html/HTMLObjectElement.cpp
Source/WebCore/page/FrameView.cpp
Source/WebCore/page/FrameView.h
Source/WebCore/testing/Internals.cpp
Source/WebCore/testing/Internals.h
Source/WebCore/testing/Internals.idl
Source/WebKit/ChangeLog
Source/WebKit/WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in

index b8a79eb..fcc15fc 100644 (file)
@@ -1,3 +1,50 @@
+2014-05-13  Jon Honeycutt  <jhoneycutt@apple.com>
+
+        Revert "Don't dispatch 'beforeload' event inside FrameView::layout()",
+        commit 84fe8cf6fbe8b5de9a06300ca3ef6d0ffc96948c, and associated
+        follow-up fixes:
+
+            "platform/mac/plugins/testplugin-onnew-onpaint.html failing after
+                r168668", commit c17be3bf5127baf94310af4b4b9bf5a57d29aaf4
+            "[Win] Unreviewed build fix after r168668.", commit
+                4fa470ad12c38ee7d4c114541b6dd321181a8bc9
+
+        The original merged patch appears to have caused a regression in
+        fast/dom/HTMLObjectElement/object-as-frame.html.
+
+        <https://bugs.webkit.org/show_bug.cgi?id=132886>
+
+        Reviewed by Alexey Proskuryakov.
+
+        * compositing/plugins/composited-plugin.html:
+        * compositing/plugins/no-backing-store.html:
+        * fast/dom/beforeload/flash-before-load.html:
+        * fast/events/beforeload-assertion-expected.txt: Removed.
+        * fast/events/beforeload-assertion.html: Removed.
+        * fast/events/beforeload-iframe-crash-expected.txt: Removed.
+        * fast/events/beforeload-iframe-crash.html: Removed.
+        * fast/events/beforeload-input-time-crash-expected.txt: Removed.
+        * fast/events/beforeload-input-time-crash.html: Removed.
+        * http/tests/security/contentSecurityPolicy/1.1/plugintypes-notype-data.html:
+        * http/tests/security/contentSecurityPolicy/1.1/plugintypes-nourl-blocked.html:
+        * http/tests/security/contentSecurityPolicy/object-src-no-url-allowed.html:
+        * http/tests/security/contentSecurityPolicy/object-src-no-url-blocked.html:
+        * http/tests/security/contentSecurityPolicy/object-src-none-allowed.html:
+        * http/tests/security/contentSecurityPolicy/object-src-none-blocked.html:
+        * http/tests/security/contentSecurityPolicy/resources/multiple-iframe-plugin-test.js:
+        (testImpl.iframe.onload):
+        (testImpl):
+        * http/tests/security/mixedContent/insecure-plugin-in-iframe.html:
+        * platform/mac/plugins/supports-carbon-event-model.html:
+        * platform/mac/plugins/testplugin-onnew-onpaint.html:
+        * plugins/get-user-agent-with-null-npp-from-npp-new.html:
+        * plugins/mouse-click-plugin-clears-selection.html:
+        * plugins/netscape-plugin-map-data-to-src.html:
+        * plugins/no-mime-with-valid-extension.html:
+        * plugins/plugin-initiate-popup-window.html:
+        * plugins/windowless_plugin_paint_test.html:
+        * resources/plugin.js: Removed.
+
 2014-05-14  Kiran  <kiran.guduru@samsung.com>
 
         alidation for getUserMedia() errorCallback is missing.
index eb01953..e9099ee 100644 (file)
@@ -1,8 +1,6 @@
 <!DOCTYPE html>
 <html>
 <body>
-  <script src="../../resources/plugin.js"></script>
-  <script>runAfterPluginLoad(null, NotifyDone);</script>
   <embed type="application/x-webkit-test-netscape" drawingmodel="coreanimation">
 </body>
 </html>
index 9d58e74..8280fcc 100644 (file)
@@ -6,12 +6,11 @@
       margin: 10px;
     }
   </style>
-  <script src="../../resources/plugin.js"></script>
   <script type="text/javascript" charset="utf-8">
-    if (window.testRunner)
+    if (window.testRunner) {
         testRunner.dumpAsText();
-
-    runAfterPluginLoad(doTest, DoNotNotifyDone);
+        testRunner.waitUntilDone();
+    }
 
     function doTest()
     {
@@ -23,6 +22,7 @@
             }
         }, 0)
     }
+    window.addEventListener('load', doTest, false);
   </script>
 </head>
 <body>
index fe107b5..0f4ba30 100644 (file)
@@ -4,12 +4,9 @@
 </head>
 <body>
 <div id="console"></div>
-<script src="../../../resources/plugin.js"></script>
 <script>
-    if (window.testRunner)
-        testRunner.dumpAsText();
-
-    runAfterPluginLoad(null, NotifyDone);
+if (window.testRunner)
+    testRunner.dumpAsText();
 </script>
 
 <object id="plugin" onbeforeload="return false" type="application/x-shockwave-flash" data="../../../plugins/resources/simple_blank.swf"
diff --git a/LayoutTests/fast/events/beforeload-assertion-expected.txt b/LayoutTests/fast/events/beforeload-assertion-expected.txt
deleted file mode 100644 (file)
index 35f869b..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-
-PASS if no assertion failure.
diff --git a/LayoutTests/fast/events/beforeload-assertion.html b/LayoutTests/fast/events/beforeload-assertion.html
deleted file mode 100644 (file)
index e8cebf1..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-<div id="d1"></div>
-<script>
-if (window.testRunner)
-    testRunner.dumpAsText();
-document.addEventListener('beforeload', function(event) {
-    d1.appendChild(document.createElement('button'));
-    d1.offsetLeft;
-    d1.remove();
-}, true);
-</script>
-<embed src="data:image/png,"></embed>
-<p>PASS if no assertion failure.</p>
\ No newline at end of file
diff --git a/LayoutTests/fast/events/beforeload-iframe-crash-expected.txt b/LayoutTests/fast/events/beforeload-iframe-crash-expected.txt
deleted file mode 100644 (file)
index fbfeed9..0000000
+++ /dev/null
@@ -1 +0,0 @@
-PASS if not crashed.
diff --git a/LayoutTests/fast/events/beforeload-iframe-crash.html b/LayoutTests/fast/events/beforeload-iframe-crash.html
deleted file mode 100644 (file)
index a4dc7e6..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-<iframe></iframe><object onbeforeload="crash()">
-<script>
-if (window.testRunner) {
-    testRunner.dumpAsText();
-    testRunner.waitUntilDone();
-}
-
-function crash() {
-    document.getElementsByTagName("iframe")[0].contentWindow.scrollX;
-    document.open();
-}
-
-document.body.offsetLeft;
-setTimeout(function() {
-    document.close();
-    document.body.innerHTML = 'PASS if not crashed.';
-    testRunner.notifyDone();
-}, 1);
-</script>
\ No newline at end of file
diff --git a/LayoutTests/fast/events/beforeload-input-time-crash-expected.txt b/LayoutTests/fast/events/beforeload-input-time-crash-expected.txt
deleted file mode 100644 (file)
index fbfeed9..0000000
+++ /dev/null
@@ -1 +0,0 @@
-PASS if not crashed.
diff --git a/LayoutTests/fast/events/beforeload-input-time-crash.html b/LayoutTests/fast/events/beforeload-input-time-crash.html
deleted file mode 100644 (file)
index 6cd6855..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-<input id="t1" type="time">
-<script>
-var time1 = document.getElementById('t1');
-document.addEventListener('beforeload', function(event) {
-    time1.value = time1.value ? '' : '23:59';
-}, true);
-
-if (window.testRunner) {
-    testRunner.dumpAsText();
-    testRunner.waitUntilDone();
-}
-setTimeout(function() {
-    document.body.innerHTML = 'PASS if not crashed.';
-    testRunner.notifyDone();
-}, 100);
-time1.focus();
-</script>
-<embed src="data:text/html,PASS"></embed>
\ No newline at end of file
index 9542c47..1b41b01 100644 (file)
@@ -1,14 +1,11 @@
 <!DOCTYPE html>                                                                                                                                                                                
 <html>
 <head>
-<script src="/js-test-resources/plugin.js"></script>
 <script>
-    if (window.testRunner) {
-        testRunner.dumpAsText();
-        testRunner.dumpChildFramesAsText();
-    }
-
-    runAfterPluginLoad(null, NotifyDone);
+if (window.testRunner) {
+    testRunner.dumpAsText();
+    testRunner.dumpChildFramesAsText();
+}
 </script>
 <script src="/plugins/resources/mock-plugin-logger.js"></script>
 <meta http-equiv="X-WebKit-CSP" content="plugin-types application/x-invalid-type">
index a0b8f5b..18db2d7 100644 (file)
@@ -1,12 +1,9 @@
 <!DOCTYPE html>
 <html>
 <head>
-<script src="/js-test-resources/plugin.js"></script>
 <script>
-    if (window.testRunner)
-        testRunner.dumpAsText();
-
-    runAfterPluginLoad(null, NotifyDone);
+if (window.testRunner)
+    testRunner.dumpAsText();
 </script>
 <meta http-equiv="X-WebKit-CSP" content="plugin-types text/plain">
 </head>
index 5ae9e3c..2c06d1f 100644 (file)
@@ -1,12 +1,9 @@
 <!DOCTYPE html>
 <html>
 <head>
-<script src="/js-test-resources/plugin.js"></script>
 <script>
-    if (window.testRunner)
-        testRunner.dumpAsText();
-
-    runAfterPluginLoad(null, NotifyDone);
+if (window.testRunner)
+  testRunner.dumpAsText();
 </script>
 <meta http-equiv="Content-Security-Policy" content="object-src 'self'">
 </head>
index fc57e72..6135915 100644 (file)
@@ -1,12 +1,9 @@
 <!DOCTYPE html>
 <html>
 <head>
-<script src="/js-test-resources/plugin.js"></script>
 <script>
-    if (window.testRunner)
-        testRunner.dumpAsText();
-
-    runAfterPluginLoad(null, NotifyDone);
+if (window.testRunner)
+  testRunner.dumpAsText();
 </script>
 <meta http-equiv="Content-Security-Policy" content="object-src 'none'">
 </head>
index 72f7f95..7afb449 100644 (file)
@@ -1,17 +1,14 @@
 <!DOCTYPE html>
 <html>
 <head>
-<script src="/js-test-resources/plugin.js"></script>
+<script>
+if (window.testRunner) {
+  testRunner.dumpAsText();
+  testRunner.dumpChildFramesAsText();
+}
+</script>
 </head>
 <body>
   <iframe src="http://127.0.0.1:8000/security/contentSecurityPolicy/resources/echo-object-data.pl?plugin=data:application/x-webkit-test-netscape,logifloaded&log=PASS!&csp=img-src%20'none'"></iframe>
 </body>
-<script>
-    if (window.testRunner) {
-        testRunner.dumpAsText();
-        testRunner.dumpChildFramesAsText();
-    }
-
-    runAfterPluginLoad(null, NotifyDone, document.getElementsByTagName("iframe")[0]);
-</script>
 </html>
index ed43e20..b49f3c2 100644 (file)
@@ -1,17 +1,14 @@
 <!DOCTYPE html>
 <html>
 <head>
-<script src="/js-test-resources/plugin.js"></script>
+<script>
+if (window.testRunner) {
+  testRunner.dumpAsText();
+  testRunner.dumpChildFramesAsText();
+}
+</script>
 </head>
 <body>
   <iframe src="http://127.0.0.1:8000/security/contentSecurityPolicy/resources/echo-object-data.pl?plugin=data:application/x-webkit-test-netscape,logifloaded&log=FAIL&csp=object-src%20'none'"></iframe>
 </body>
-<script>
-    if (window.testRunner) {
-        testRunner.dumpAsText();
-        testRunner.dumpChildFramesAsText();
-    }
-
-    runAfterPluginLoad(null, NotifyDone, document.getElementsByTagName("iframe")[0]);
-</script>
 </html>
index 8cd4acf..0420b3e 100644 (file)
@@ -38,11 +38,7 @@ function testImpl(experimental) {
     else
         iframe.src += "&type=application/x-webkit-test-netscape";
 
-    iframe.onload = function() {
-        if (window.internals)
-            internals.updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks(iframe);
-        testImpl(experimental);
-    };
+    iframe.onload = function() { testImpl(experimental); };
     document.body.appendChild(iframe);
 }
 
index f7520b6..0a7bb2c 100644 (file)
@@ -3,11 +3,6 @@
 <script>
 if (window.testRunner)
     testRunner.dumpAsText();
-
-onload = function() {
-    if (window.internals)
-        internals.updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks(document.querySelector('iframe'));
-};
 </script>
 <p>This test loads a secure iframe that loads an insecure plugin.  We should
 get a mixed content callback because the insecure plug-in can script the secure
index 5456ab3..6ab09bd 100644 (file)
@@ -1,9 +1,6 @@
-<script src="../../../resources/plugin.js"></script>
 <script>
-    if (window.testRunner)
-        testRunner.dumpAsText();
-
-    runAfterPluginLoad(null, NotifyDone);
+if (window.testRunner)
+    testRunner.dumpAsText();
 </script>
 
 <embed id="testPlugin" 
index e059096..7771a7f 100644 (file)
@@ -2,7 +2,6 @@
 
 <html>
 <head>
-    <script src="../../../resources/plugin.js"></script>
     <script type="text/javascript" charset="utf-8">
         if (window.testRunner)
             testRunner.dumpAsText();
@@ -26,8 +25,6 @@
                 didPaint = true;
             }
         }
-
-        runAfterPluginLoad(null, NotifyDone);
     </script>
 </head>
 <body>
index e87f5e4..8c43f8a 100644 (file)
@@ -1,11 +1,9 @@
 <!DOCTYPE html>
 <html>
 <head>
-    <script src="../resources/plugin.js"></script>
     <script>
         if (window.testRunner)
             testRunner.dumpAsText();
-        runAfterPluginLoad(null, NotifyDone);
     </script>
 </head>
 <body>
index ffbf527..516001b 100644 (file)
@@ -1,9 +1,8 @@
 <html>
 <head>
-<script src="../resources/plugin.js"></script>
 <script>
 
-runAfterPluginLoad(function() {
+function runTest() {
     inputElement = document.getElementById('frame');
     inputElement.focus();
     inputElement.select();
@@ -15,10 +14,10 @@ runAfterPluginLoad(function() {
         eventSender.mouseDown();
         eventSender.mouseUp();
     }
-}, NotifyDone);
+}
 </script>
 </head>
-<body>
+<body onload="runTest();">
 <embed id="plg" type="application/x-webkit-test-netscape" width="100" height="100" windowedplugin="false"></embed><br>
 <input id="frame" value="hello"/>
 <div id="output"></div>
index 7d91ec0..7adaee5 100644 (file)
@@ -1,10 +1,8 @@
 <html>
 <head>
-<script src="../resources/plugin.js"></script>
 <script>
     if (window.testRunner)
         testRunner.dumpAsText();
-    runAfterPluginLoad(null, NotifyDone);
 </script>
 <body style="margin:0px;overflow:hidden">
 <object name="testPlugin" type="application/x-webkit-test-netscape" logSrc="true" data="blah">
index 032eb23..46fbce8 100644 (file)
@@ -1,8 +1,8 @@
-<script src="../resources/plugin.js"></script>
 <script>
-    if (window.testRunner)
+    if (window.testRunner) {
         testRunner.dumpAsText();
-    runAfterPluginLoad(null, NotifyDone);
+        testRunner.waitUntilDone();
+    }
 </script>
 <p>
 This test checks that <a href="https://bugs.webkit.org/show_bug.cgi?id=50657">bug 50568</a>
@@ -12,4 +12,8 @@ and nothing will be displayed on screen. Upon success, this test should display
 attribute.
 </p>
 <!-- Embed tag with missing type="" parameter -->
-<embed id="plugin" name="plugin" src="resources/test.testnetscape" logSrc="1">
\ No newline at end of file
+<embed id="plugin" name="plugin" src="resources/test.testnetscape" logSrc="1">
+<script>
+    if (window.testRunner)
+        testRunner.notifyDone();
+</script>
index 9be0f9b..8b22ca1 100644 (file)
@@ -64,7 +64,7 @@ function end_test() {
 }
 </script>
 </head>
-<body onload="internals.updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks(); test();">
+<body onload="window.setTimeout(test, 0);">
 <embed type="application/x-webkit-test-netscape" width=100 height=40 evaluatescript="mouse::popup_by_mousedown()" windowedplugin="false"></embed><br>
 <embed type="application/x-webkit-test-netscape" width=100 height=40 evaluatescript="key::popup_by_keydown()" windowedplugin="false"></embed><br>
 Specify a script and a mouse/keyboard event to the plugin. The specified script will be evaluated in the browser when the specified event is received by the plugin. The test is for bug https://bugs.webkit.org/show_bug.cgi?id=41292.<br>
index c8a9c5b..fc6432a 100644 (file)
@@ -14,8 +14,6 @@
         var pluginDiv = document.getElementById("pluginDiv");\r
         // Create the plugin in the middle of the page.\r
         pluginDiv.innerHTML = "<embed id=\"testPlugin\" type=\"application/x-webkit-test-netscape\" width=\"200\" height=\"200\" onpaintevent=\"didPaint()\" windowedPlugin=\"false\"></embed>";\r
-        if (window.internals)\r
-            internals.updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks();\r
         testRunner.displayInvalidatedRegion();\r
       }\r
 \r
diff --git a/LayoutTests/resources/plugin.js b/LayoutTests/resources/plugin.js
deleted file mode 100644 (file)
index 8a03e8b..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-// Wait for the load event, run post layout tasks, run the specified function,
-// and notify the test runner that the test is done.
-
-var NotifyDone = true;
-var DoNotNotifyDone = false;
-
-function runAfterPluginLoad(func, notifyDone, node) {
-    if (window.testRunner)
-        testRunner.waitUntilDone();
-
-    window.addEventListener('load', function() {
-        if (window.internals)
-            internals.updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks(node);
-
-        if (func)
-            func();
-
-        if (notifyDone && window.testRunner)
-            testRunner.notifyDone();
-    }, false);
-}
index b1de4c5..94d0c0e 100644 (file)
@@ -1,3 +1,43 @@
+2014-05-13  Jon Honeycutt  <jhoneycutt@apple.com>
+
+        Revert "Don't dispatch 'beforeload' event inside FrameView::layout()",
+        commit 84fe8cf6fbe8b5de9a06300ca3ef6d0ffc96948c, and associated
+        follow-up fixes:
+
+            "platform/mac/plugins/testplugin-onnew-onpaint.html failing after
+                r168668", commit c17be3bf5127baf94310af4b4b9bf5a57d29aaf4
+            "[Win] Unreviewed build fix after r168668.", commit
+                4fa470ad12c38ee7d4c114541b6dd321181a8bc9
+
+        The original merged patch appears to have caused a regression in
+        fast/dom/HTMLObjectElement/object-as-frame.html.
+
+        <https://bugs.webkit.org/show_bug.cgi?id=132886>
+
+        Reviewed by Alexey Proskuryakov.
+
+        * WebCore.exp.in:
+        * dom/Document.cpp:
+        (WebCore::Document::updateLayoutIgnorePendingStylesheets):
+        * dom/Document.h:
+        * html/HTMLAppletElement.cpp:
+        (WebCore::HTMLAppletElement::renderWidgetForJSBindings):
+        * html/HTMLEmbedElement.cpp:
+        (WebCore::HTMLEmbedElement::renderWidgetForJSBindings):
+        * html/HTMLObjectElement.cpp:
+        (WebCore::HTMLObjectElement::renderWidgetForJSBindings):
+        * page/FrameView.cpp:
+        (WebCore::FrameView::FrameView):
+        (WebCore::FrameView::reset):
+        (WebCore::FrameView::flushAnyPendingPostLayoutTasks):
+        (WebCore::FrameView::performPostLayoutTasks):
+        (WebCore::FrameView::updateEmbeddedObjectsTimerFired): Deleted.
+        * page/FrameView.h:
+        * testing/Internals.cpp:
+        (WebCore::Internals::updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks): Deleted.
+        * testing/Internals.h:
+        * testing/Internals.idl:
+
 2014-05-14  Kiran  <kiran.guduru@samsung.com>
 
         alidation for getUserMedia() errorCallback is missing.
index 318b019..41a10e2 100644 (file)
@@ -1256,7 +1256,7 @@ __ZN7WebCore8Document25scheduleForcedStyleRecalcEv
 __ZN7WebCore8Document26didRemoveWheelEventHandlerEv
 __ZN7WebCore8Document26pageSizeAndMarginsInPixelsEiRNS_7IntSizeERiS3_S3_S3_
 __ZN7WebCore8Document27removeMediaCanStartListenerEPNS_21MediaCanStartListenerE
-__ZN7WebCore8Document36updateLayoutIgnorePendingStylesheetsENS0_18RunPostLayoutTasksE
+__ZN7WebCore8Document36updateLayoutIgnorePendingStylesheetsEv
 __ZN7WebCore8Document4headEv
 __ZN7WebCore8Document8iconURLsEi
 __ZN7WebCore8FormData6createEPKvm
@@ -1774,7 +1774,6 @@ __ZNK7WebCore20TransformationMatrixcv13CATransform3DEv
 __ZNK7WebCore21BackForwardController12forwardCountEv
 __ZNK7WebCore21BackForwardController18canGoBackOrForwardEi
 __ZNK7WebCore21BackForwardController9backCountEv
-__ZNK7WebCore21HTMLFrameOwnerElement15contentDocumentEv
 __ZNK7WebCore21NetworkStorageSession13cookieStorageEv
 __ZNK7WebCore21RenderLayerCompositor11scrollLayerEv
 __ZNK7WebCore21RenderLayerCompositor15rootRenderLayerEv
index 465b069..1ddbbbd 100644 (file)
@@ -1831,10 +1831,10 @@ void Document::updateLayout()
 // stylesheets are loaded. Doing a layout ignoring the pending stylesheets
 // lets us get reasonable answers. The long term solution to this problem is
 // to instead suspend JavaScript execution.
-void Document::updateLayoutIgnorePendingStylesheets(Document::RunPostLayoutTasks runPostLayoutTasks)
+void Document::updateLayoutIgnorePendingStylesheets()
 {
     bool oldIgnore = m_ignorePendingStylesheets;
-
+    
     if (!haveStylesheetsLoaded()) {
         m_ignorePendingStylesheets = true;
         // FIXME: We are willing to attempt to suppress painting with outdated style info only once.  Our assumption is that it would be
@@ -1856,9 +1856,6 @@ void Document::updateLayoutIgnorePendingStylesheets(Document::RunPostLayoutTasks
 
     updateLayout();
 
-    if (runPostLayoutTasks == RunPostLayoutTasksSynchronously && view())
-        view()->flushAnyPendingPostLayoutTasks();
-
     m_ignorePendingStylesheets = oldIgnore;
 }
 
index 7c09697..afc2aa9 100644 (file)
@@ -587,11 +587,7 @@ public:
     void updateStyleIfNeeded();
     bool updateStyleIfNeededForNode(const Node&);
     void updateLayout();
-    enum RunPostLayoutTasks {
-        RunPostLayoutTasksAsyhnchronously,
-        RunPostLayoutTasksSynchronously,
-    };
-    void updateLayoutIgnorePendingStylesheets(RunPostLayoutTasks = RunPostLayoutTasksAsyhnchronously);
+    void updateLayoutIgnorePendingStylesheets();
     PassRef<RenderStyle> styleForElementIgnoringPendingStylesheets(Element*);
 
     // Returns true if page box (margin boxes and page borders) is visible.
index 934e35b..7afabd4 100644 (file)
@@ -88,10 +88,7 @@ RenderWidget* HTMLAppletElement::renderWidgetForJSBindings() const
     if (!canEmbedJava())
         return 0;
 
-    // Needs to load the plugin immediatedly because this function is called
-    // when JavaScript code accesses the plugin.
-    // FIXME: <rdar://16893708> Check if dispatching events here is safe.
-    document().updateLayoutIgnorePendingStylesheets(Document::RunPostLayoutTasksSynchronously);
+    document().updateLayoutIgnorePendingStylesheets();
     return renderWidget();
 }
 
index 045155d..67b966e 100644 (file)
@@ -71,12 +71,8 @@ static inline RenderWidget* findWidgetRenderer(const Node* n)
 RenderWidget* HTMLEmbedElement::renderWidgetForJSBindings() const
 {
     FrameView* view = document().view();
-    if (!view || (!view->isInLayout() && !view->isPainting())) {
-        // Needs to load the plugin immediatedly because this function is called
-        // when JavaScript code accesses the plugin.
-        // FIXME: <rdar://16893708> Check if dispatching events here is safe.
-        document().updateLayoutIgnorePendingStylesheets(Document::RunPostLayoutTasksSynchronously);
-    }
+    if (!view || (!view->isInLayout() && !view->isPainting()))
+        document().updateLayoutIgnorePendingStylesheets();
     return findWidgetRenderer(this);
 }
 
index ab91bbc..a3a9996 100644 (file)
@@ -83,10 +83,7 @@ PassRefPtr<HTMLObjectElement> HTMLObjectElement::create(const QualifiedName& tag
 
 RenderWidget* HTMLObjectElement::renderWidgetForJSBindings() const
 {
-    // Needs to load the plugin immediatedly because this function is called
-    // when JavaScript code accesses the plugin.
-    // FIXME: <rdar://16893708> Check if dispatching events here is safe.
-    document().updateLayoutIgnorePendingStylesheets(Document::RunPostLayoutTasksSynchronously);
+    document().updateLayoutIgnorePendingStylesheets();
     return renderWidget(); // This will return 0 if the renderer is not a RenderWidget.
 }
 
index fa05a0c..9519bcd 100644 (file)
@@ -160,7 +160,6 @@ FrameView::FrameView(Frame& frame)
     , m_layoutPhase(OutsideLayout)
     , m_inSynchronousPostLayout(false)
     , m_postLayoutTasksTimer(this, &FrameView::postLayoutTimerFired)
-    , m_updateEmbeddedObjectsTimer(this, &FrameView::updateEmbeddedObjectsTimerFired)
     , m_isTransparent(false)
     , m_baseBackgroundColor(Color::white)
     , m_mediaType("screen")
@@ -251,7 +250,6 @@ void FrameView::reset()
     m_layoutCount = 0;
     m_nestedLayoutCount = 0;
     m_postLayoutTasksTimer.stop();
-    m_updateEmbeddedObjectsTimer.stop();
     m_firstLayout = true;
     m_firstLayoutCallbackPending = false;
     m_wasScrolledByUser = false;
@@ -2744,28 +2742,16 @@ bool FrameView::updateEmbeddedObjects()
     return m_embeddedObjectsToUpdate->isEmpty();
 }
 
-void FrameView::updateEmbeddedObjectsTimerFired(Timer<FrameView>*)
-{
-    RefPtr<FrameView> protect(this);
-    m_updateEmbeddedObjectsTimer.stop();
-    for (unsigned i = 0; i < maxUpdateEmbeddedObjectsIterations; i++) {
-        if (updateEmbeddedObjects())
-            break;
-    }
-}
-
 void FrameView::flushAnyPendingPostLayoutTasks()
 {
-    if (m_postLayoutTasksTimer.isActive())
-        performPostLayoutTasks();
-    if (m_updateEmbeddedObjectsTimer.isActive())
-        updateEmbeddedObjectsTimerFired(nullptr);
+    if (!m_postLayoutTasksTimer.isActive())
+        return;
+
+    performPostLayoutTasks();
 }
 
 void FrameView::performPostLayoutTasks()
 {
-    // FIXME: We should not run any JavaScript code in this function.
-
     m_postLayoutTasksTimer.stop();
 
     frame().selection().layoutDidChange();
@@ -2796,7 +2782,10 @@ void FrameView::performPostLayoutTasks()
     // is called through the post layout timer.
     Ref<FrameView> protect(*this);
 
-    m_updateEmbeddedObjectsTimer.startOneShot(0);
+    for (unsigned i = 0; i < maxUpdateEmbeddedObjectsIterations; i++) {
+        if (updateEmbeddedObjects())
+            break;
+    }
 
     if (auto* page = frame().page()) {
         if (auto* scrollingCoordinator = page->scrollingCoordinator())
index 9d8e5dd..284a1ef 100644 (file)
@@ -591,7 +591,6 @@ private:
     void enableSpeculativeTilingIfNeeded();
     void speculativeTilingEnableTimerFired(Timer<FrameView>&);
 
-    void updateEmbeddedObjectsTimerFired(Timer<FrameView>*);
     bool updateEmbeddedObjects();
     void updateEmbeddedObject(RenderEmbeddedObject&);
     void scrollToAnchor();
@@ -646,7 +645,6 @@ private:
     int m_layoutCount;
     unsigned m_nestedLayoutCount;
     Timer<FrameView> m_postLayoutTasksTimer;
-    Timer<FrameView> m_updateEmbeddedObjectsTimer;
     bool m_firstLayoutCallbackPending;
 
     bool m_firstLayout;
index 22eb300..e0be09c 100644 (file)
@@ -50,7 +50,6 @@
 #include "FormController.h"
 #include "FrameLoader.h"
 #include "FrameView.h"
-#include "HTMLIFrameElement.h"
 #include "HTMLInputElement.h"
 #include "HTMLNames.h"
 #include "HTMLPlugInElement.h"
@@ -1896,28 +1895,6 @@ void Internals::stopTrackingRepaints(ExceptionCode& ec)
     frameView->setTracksRepaints(false);
 }
 
-void Internals::updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks(ExceptionCode& ec)
-{
-    updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks(nullptr, ec);
-}
-
-void Internals::updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks(Node* node, ExceptionCode& ec)
-{
-    Document* document;
-    if (!node)
-        document = contextDocument();
-    else if (node->isDocumentNode())
-        document = toDocument(node);
-    else if (node->hasTagName(HTMLNames::iframeTag))
-        document = toHTMLIFrameElement(node)->contentDocument();
-    else {
-        ec = TypeError;
-        return;
-    }
-
-    document->updateLayoutIgnorePendingStylesheets(Document::RunPostLayoutTasksSynchronously);
-}
-
 #if !PLATFORM(IOS)
 static const char* cursorTypeToString(Cursor::Type cursorType)
 {
index 5f4ea88..255c4a1 100644 (file)
@@ -270,8 +270,6 @@ public:
 
     void startTrackingRepaints(ExceptionCode&);
     void stopTrackingRepaints(ExceptionCode&);
-    void updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks(ExceptionCode&);
-    void updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks(Node*, ExceptionCode&);
 
     PassRefPtr<ArrayBuffer> serializeObject(PassRefPtr<SerializedScriptValue>) const;
     PassRefPtr<SerializedScriptValue> deserializeBuffer(PassRefPtr<ArrayBuffer>) const;
index 7202b57..9562a6d 100644 (file)
     [RaisesException] void startTrackingRepaints();
     [RaisesException] void stopTrackingRepaints();
 
-    // |node| should be Document, HTMLIFrameElement, or unspecified.
-    // If |node| is an HTMLIFrameElement, it assumes node.contentDocument is
-    // specified without security checks. Unspecified means this document.
-    [RaisesException] void updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks(optional Node node);
-
     // Returns a string with information about the mouse cursor used at the specified client location.
     [RaisesException] DOMString getCurrentCursorInfo();
 
index 60ada5b..53f9d77 100644 (file)
@@ -1,3 +1,23 @@
+2014-05-13  Jon Honeycutt  <jhoneycutt@apple.com>
+
+        Revert "Don't dispatch 'beforeload' event inside FrameView::layout()",
+        commit 84fe8cf6fbe8b5de9a06300ca3ef6d0ffc96948c, and associated
+        follow-up fixes:
+
+            "platform/mac/plugins/testplugin-onnew-onpaint.html failing after
+                r168668", commit c17be3bf5127baf94310af4b4b9bf5a57d29aaf4
+            "[Win] Unreviewed build fix after r168668.", commit
+                4fa470ad12c38ee7d4c114541b6dd321181a8bc9
+
+        The original merged patch appears to have caused a regression in
+        fast/dom/HTMLObjectElement/object-as-frame.html.
+
+        <https://bugs.webkit.org/show_bug.cgi?id=132886>
+
+        Reviewed by Alexey Proskuryakov.
+
+        * WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in:
+
 2014-05-13  Dean Jackson  <dino@apple.com>
 
         Step 2 (of 2) fixing the Windows build. Add new setPageScaleFactor.
index 795e824..6d47503 100644 (file)
@@ -175,7 +175,6 @@ EXPORTS
         symbolWithPointer(?childItemWithTarget@HistoryItem@WebCore@@QBEPAV12@ABVString@WTF@@@Z, ?childItemWithTarget@HistoryItem@WebCore@@QEBAPEAV12@AEBVString@WTF@@@Z)
         symbolWithPointer(?create@Range@WebCore@@SA?AV?$PassRefPtr@VRange@WebCore@@@WTF@@AAVDocument@2@V?$PassRefPtr@VNode@WebCore@@@4@H1H@Z, ?create@Range@WebCore@@SA?AV?$PassRefPtr@VRange@WebCore@@@WTF@@AEAVDocument@2@V?$PassRefPtr@VNode@WebCore@@@4@H1H@Z)
         symbolWithPointer(?commonVM@JSDOMWindowBase@WebCore@@SAAAVVM@JSC@@XZ, ?commonVM@JSDOMWindowBase@WebCore@@SAAEAVVM@JSC@@XZ)
-               symbolWithPointer(?contentDocument@HTMLFrameOwnerElement@WebCore@@QBEPAVDocument@2@XZ, ?contentDocument@HTMLFrameOwnerElement@WebCore@@QEBAPEAVDocument@2@XZ)
         symbolWithPointer(?create@SerializedScriptValue@WebCore@@SA?AV?$PassRefPtr@VSerializedScriptValue@WebCore@@@WTF@@ABVString@4@@Z, ?create@SerializedScriptValue@WebCore@@SA?AV?$PassRefPtr@VSerializedScriptValue@WebCore@@@WTF@@AEBVString@4@@Z)
 #if USE(CF)
         symbolWithPointer(?createCFString@String@WTF@@QBE?AV?$RetainPtr@PBU__CFString@@@2@XZ, ?createCFString@String@WTF@@QEBA?AV?$RetainPtr@PEBU__CFString@@@2@XZ)
@@ -204,7 +203,6 @@ EXPORTS
                symbolWithPointer(?getOutOfLineCachedWrapper@WebCore@@YAPAVJSObject@JSC@@PAVJSDOMGlobalObject@1@PAVNode@1@@Z, ?getOutOfLineCachedWrapper@WebCore@@YAPEAVJSObject@JSC@@PEAVJSDOMGlobalObject@1@PEAVNode@1@@Z)
         symbolWithPointer(?hitTest@RenderView@WebCore@@QAE_NABVHitTestRequest@2@AAVHitTestResult@2@@Z, ?hitTest@RenderView@WebCore@@QEAA_NAEBVHitTestRequest@2@AEAVHitTestResult@2@@Z)
         ?inputTag@HTMLNames@WebCore@@3VHTMLQualifiedName@2@B
-               symbolWithPointer(?iframeTag@HTMLNames@WebCore@@3VHTMLQualifiedName@2@B,?iframeTag@HTMLNames@WebCore@@3VHTMLQualifiedName@2@B)
         symbolWithPointer(?intersects@IntRect@WebCore@@QBE_NABV12@@Z, ?intersects@IntRect@WebCore@@QEBA_NAEBV12@@Z)
         symbolWithPointer(?item@StaticNodeList@WebCore@@UBEPAVNode@2@I@Z, ?item@StaticNodeList@WebCore@@UEBAPEAVNode@2@I@Z)
         ?selectTag@HTMLNames@WebCore@@3VHTMLQualifiedName@2@B
@@ -325,7 +323,7 @@ EXPORTS
         symbolWithPointer(?toRange@WebCore@@YAPAVRange@1@VJSValue@JSC@@@Z, ?toRange@WebCore@@YAPEAVRange@1@VJSValue@JSC@@@Z)
         symbolWithPointer(?isTreeScope@Node@WebCore@@QBE_NXZ, ?isTreeScope@Node@WebCore@@QEBA_NXZ)
         symbolWithPointer(?updateEditorUINowIfScheduled@Editor@WebCore@@QAEXXZ, ?updateEditorUINowIfScheduled@Editor@WebCore@@QEAAXXZ)
-        symbolWithPointer(?updateLayoutIgnorePendingStylesheets@Document@WebCore@@QAEXW4RunPostLayoutTasks@12@@Z, ?updateLayoutIgnorePendingStylesheets@Document@WebCore@@QEAAXW4RunPostLayoutTasks@12@@Z)
+        symbolWithPointer(?updateLayoutIgnorePendingStylesheets@Document@WebCore@@QAEXXZ, ?updateLayoutIgnorePendingStylesheets@Document@WebCore@@QEAAXXZ)
         symbolWithPointer(?updateStyleIfNeeded@Document@WebCore@@QAEXXZ, ?updateStyleIfNeeded@Document@WebCore@@QEAAXXZ)
         symbolWithPointer(?view@Document@WebCore@@QBEPAVFrameView@2@XZ, ?view@Document@WebCore@@QEBAPEAVFrameView@2@XZ)
         symbolWithPointer(??1ContextDestructionObserver@WebCore@@MAE@XZ, ??1ContextDestructionObserver@WebCore@@MEAA@XZ)