Remove support for "magic" iframe
authorabarth@webkit.org <abarth@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 20 Mar 2012 05:58:36 +0000 (05:58 +0000)
committerabarth@webkit.org <abarth@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 20 Mar 2012 05:58:36 +0000 (05:58 +0000)
https://bugs.webkit.org/show_bug.cgi?id=81590

Reviewed by Eric Seidel.

Source/WebCore:

This patch removes support for "magic" iframe, which previously allowed
an iframe to be transfered from one document to another without
reloading the iframe.  The idea behind this feature was to let sites
create "pop out" windows that could outlive their parents by
transfering state to these windows via these magic iframes.

Unforuntately, this feature was never implemented by other browsers and
has been the source of a series of security vulnerabilities.  Although
we have fixed each vulnerability as it has been discovered, the feature
is still a complex corner case that isn't widely exercised on the web.
For that reason, it's likely to have more vulnerabilities in the
future.

I'm not aware of any web sites that use this feature anymore.  There
were a handful of them, but we appear to have been successful in
evangalizing them to move away from "magic" iframe.

* dom/Document.cpp:
(WebCore::Document::adoptNode):
* html/HTMLFrameElementBase.cpp:
(WebCore):
(WebCore::HTMLFrameElementBase::HTMLFrameElementBase):
(WebCore::HTMLFrameElementBase::insertedIntoDocument):
* html/HTMLFrameElementBase.h:
(HTMLFrameElementBase):
* loader/DocumentLoader.cpp:
(WebCore):
* loader/DocumentLoader.h:
(DocumentLoader):
* loader/EmptyClients.h:
(WebCore::EmptyFrameLoaderClient::createFrame):
* loader/FrameLoader.cpp:
(WebCore):
* loader/FrameLoader.h:
(FrameLoader):
* loader/FrameLoaderClient.h:
(FrameLoaderClient):
* loader/ResourceLoadNotifier.cpp:
(WebCore):
* loader/ResourceLoadNotifier.h:
(ResourceLoadNotifier):
* page/Frame.cpp:
(WebCore):
* page/Frame.h:
(Frame):

Source/WebKit/blackberry:

Remove FrameLoaderClient methods that no longer exist.

* WebCoreSupport/FrameLoaderClientBlackBerry.cpp:
(WebCore):
* WebCoreSupport/FrameLoaderClientBlackBerry.h:
(FrameLoaderClientBlackBerry):
(WebCore::FrameLoaderClientBlackBerry::didDetectXSS):

Source/WebKit/chromium:

Remove FrameLoaderClient methods that no longer exist.

* public/WebFrameClient.h:
(WebFrameClient):
* src/FrameLoaderClientImpl.cpp:
(WebKit):
* src/FrameLoaderClientImpl.h:
(FrameLoaderClientImpl):

Source/WebKit/efl:

Remove FrameLoaderClient methods that no longer exist.

* WebCoreSupport/FrameLoaderClientEfl.cpp:
(WebCore):
* WebCoreSupport/FrameLoaderClientEfl.h:
(FrameLoaderClientEfl):

Source/WebKit/gtk:

Remove FrameLoaderClient methods that no longer exist.

* WebCoreSupport/FrameLoaderClientGtk.cpp:
(WebKit):
* WebCoreSupport/FrameLoaderClientGtk.h:
(FrameLoaderClient):

Source/WebKit/mac:

Remove FrameLoaderClient methods that no longer exist.

* WebCoreSupport/WebFrameLoaderClient.h:
* WebCoreSupport/WebFrameLoaderClient.mm:

Source/WebKit/qt:

Remove FrameLoaderClient methods that no longer exist.

* WebCoreSupport/FrameLoaderClientQt.cpp:
(WebCore):
* WebCoreSupport/FrameLoaderClientQt.h:
(FrameLoaderClientQt):

Source/WebKit/win:

Remove FrameLoaderClient methods that no longer exist.

* WebCoreSupport/WebFrameLoaderClient.cpp:
* WebCoreSupport/WebFrameLoaderClient.h:
(WebFrameLoaderClient):

Source/WebKit/wince:

Remove FrameLoaderClient methods that no longer exist.

* WebCoreSupport/FrameLoaderClientWinCE.cpp:
(WebKit):
* WebCoreSupport/FrameLoaderClientWinCE.h:
(FrameLoaderClientWinCE):

Source/WebKit/wx:

Remove FrameLoaderClient methods that no longer exist.

* WebKitSupport/FrameLoaderClientWx.cpp:
(WebCore):
* WebKitSupport/FrameLoaderClientWx.h:
(FrameLoaderClientWx):

Source/WebKit2:

Remove FrameLoaderClient methods that no longer exist.

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:

LayoutTests:

Remove tests of magic iframe. These tests don't reall make sense to
keep without the feature.

* fast/frames/adopt-iframe-into-itself-expected.txt: Added.
* fast/frames/adopt-iframe-into-itself.html: Added.
    - I've added a test about adopting an iframe into itself. We might
      already have a test for this, but it covers a mistake I made in
      an earlier iteration of this patch.
* fast/frames/iframe-reparenting-adopt-node-expected.txt: Removed.
* fast/frames/iframe-reparenting-adopt-node.html: Removed.
* fast/frames/iframe-reparenting-embed-elements-expected.txt: Removed.
* fast/frames/iframe-reparenting-embed-elements.html: Removed.
* fast/frames/iframe-reparenting-expected.txt: Removed.
* fast/frames/iframe-reparenting-fail-load-expected.txt: Removed.
* fast/frames/iframe-reparenting-fail-load.html: Removed.
* fast/frames/iframe-reparenting-new-page-expected.txt: Removed.
* fast/frames/iframe-reparenting-new-page.html: Removed.
* fast/frames/iframe-reparenting-plugins-expected.txt: Removed.
* fast/frames/iframe-reparenting-plugins.html: Removed.
* fast/frames/iframe-reparenting.html: Removed.
* fast/frames/resources/iframe-reparenting-adopt-node-iframe-content.html: Removed.
* fast/frames/resources/iframe-reparenting-adopt-node-new-page.html: Removed.
* fast/frames/resources/iframe-reparenting-embed-frame1.html: Removed.
* fast/frames/resources/iframe-reparenting-embed-iframe.html: Removed.
* fast/frames/resources/iframe-reparenting-frame1.html: Removed.
* fast/frames/resources/iframe-reparenting-frame2.html: Removed.
* fast/frames/resources/iframe-reparenting-iframe-content.html: Removed.
* fast/frames/resources/iframe-reparenting-new-page-1.html: Removed.
* fast/frames/resources/iframe-reparenting-new-page-2.html: Removed.
* fast/frames/resources/iframe-reparenting-new-page-iframe.html: Removed.
* fast/frames/resources/iframe-reparenting-plugins-iframe-content.html: Removed.
* fast/frames/resources/iframe-reparenting-plugins-new-page.html: Removed.
* fast/frames/script-tests/iframe-reparenting-new-page.js: Removed.

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

73 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/frames/adopt-iframe-into-itself-expected.txt [new file with mode: 0644]
LayoutTests/fast/frames/adopt-iframe-into-itself.html [new file with mode: 0644]
LayoutTests/fast/frames/iframe-reparenting-adopt-node-expected.txt [deleted file]
LayoutTests/fast/frames/iframe-reparenting-adopt-node.html [deleted file]
LayoutTests/fast/frames/iframe-reparenting-embed-elements-expected.txt [deleted file]
LayoutTests/fast/frames/iframe-reparenting-embed-elements.html [deleted file]
LayoutTests/fast/frames/iframe-reparenting-expected.txt [deleted file]
LayoutTests/fast/frames/iframe-reparenting-fail-load-expected.txt [deleted file]
LayoutTests/fast/frames/iframe-reparenting-fail-load.html [deleted file]
LayoutTests/fast/frames/iframe-reparenting-new-page-expected.txt [deleted file]
LayoutTests/fast/frames/iframe-reparenting-new-page.html [deleted file]
LayoutTests/fast/frames/iframe-reparenting-plugins-expected.txt [deleted file]
LayoutTests/fast/frames/iframe-reparenting-plugins.html [deleted file]
LayoutTests/fast/frames/iframe-reparenting.html [deleted file]
LayoutTests/fast/frames/resources/iframe-reparenting-adopt-node-iframe-content.html [deleted file]
LayoutTests/fast/frames/resources/iframe-reparenting-adopt-node-new-page.html [deleted file]
LayoutTests/fast/frames/resources/iframe-reparenting-embed-frame1.html [deleted file]
LayoutTests/fast/frames/resources/iframe-reparenting-embed-iframe.html [deleted file]
LayoutTests/fast/frames/resources/iframe-reparenting-frame1.html [deleted file]
LayoutTests/fast/frames/resources/iframe-reparenting-frame2.html [deleted file]
LayoutTests/fast/frames/resources/iframe-reparenting-iframe-content.html [deleted file]
LayoutTests/fast/frames/resources/iframe-reparenting-new-page-1.html [deleted file]
LayoutTests/fast/frames/resources/iframe-reparenting-new-page-2.html [deleted file]
LayoutTests/fast/frames/resources/iframe-reparenting-new-page-iframe.html [deleted file]
LayoutTests/fast/frames/resources/iframe-reparenting-plugins-iframe-content.html [deleted file]
LayoutTests/fast/frames/resources/iframe-reparenting-plugins-new-page.html [deleted file]
LayoutTests/fast/frames/script-tests/iframe-reparenting-new-page.js [deleted file]
Source/WebCore/ChangeLog
Source/WebCore/dom/Document.cpp
Source/WebCore/html/HTMLFrameElementBase.cpp
Source/WebCore/html/HTMLFrameElementBase.h
Source/WebCore/loader/DocumentLoader.cpp
Source/WebCore/loader/DocumentLoader.h
Source/WebCore/loader/EmptyClients.h
Source/WebCore/loader/FrameLoader.cpp
Source/WebCore/loader/FrameLoader.h
Source/WebCore/loader/FrameLoaderClient.h
Source/WebCore/loader/ResourceLoadNotifier.cpp
Source/WebCore/loader/ResourceLoadNotifier.h
Source/WebCore/page/Frame.cpp
Source/WebCore/page/Frame.h
Source/WebKit/blackberry/ChangeLog
Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.cpp
Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.h
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/public/WebFrameClient.h
Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp
Source/WebKit/chromium/src/FrameLoaderClientImpl.h
Source/WebKit/efl/ChangeLog
Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp
Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.h
Source/WebKit/gtk/ChangeLog
Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h
Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
Source/WebKit/qt/ChangeLog
Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h
Source/WebKit/win/ChangeLog
Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp
Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h
Source/WebKit/wince/ChangeLog
Source/WebKit/wince/WebCoreSupport/FrameLoaderClientWinCE.cpp
Source/WebKit/wince/WebCoreSupport/FrameLoaderClientWinCE.h
Source/WebKit/wx/ChangeLog
Source/WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp
Source/WebKit/wx/WebKitSupport/FrameLoaderClientWx.h
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.h

index 91240a3..f61878f 100644 (file)
@@ -1,3 +1,44 @@
+2012-03-19  Adam Barth  <abarth@webkit.org>
+
+        Remove support for "magic" iframe
+        https://bugs.webkit.org/show_bug.cgi?id=81590
+
+        Reviewed by Eric Seidel.
+
+        Remove tests of magic iframe. These tests don't reall make sense to
+        keep without the feature.
+
+        * fast/frames/adopt-iframe-into-itself-expected.txt: Added.
+        * fast/frames/adopt-iframe-into-itself.html: Added.
+            - I've added a test about adopting an iframe into itself. We might
+              already have a test for this, but it covers a mistake I made in
+              an earlier iteration of this patch.
+        * fast/frames/iframe-reparenting-adopt-node-expected.txt: Removed.
+        * fast/frames/iframe-reparenting-adopt-node.html: Removed.
+        * fast/frames/iframe-reparenting-embed-elements-expected.txt: Removed.
+        * fast/frames/iframe-reparenting-embed-elements.html: Removed.
+        * fast/frames/iframe-reparenting-expected.txt: Removed.
+        * fast/frames/iframe-reparenting-fail-load-expected.txt: Removed.
+        * fast/frames/iframe-reparenting-fail-load.html: Removed.
+        * fast/frames/iframe-reparenting-new-page-expected.txt: Removed.
+        * fast/frames/iframe-reparenting-new-page.html: Removed.
+        * fast/frames/iframe-reparenting-plugins-expected.txt: Removed.
+        * fast/frames/iframe-reparenting-plugins.html: Removed.
+        * fast/frames/iframe-reparenting.html: Removed.
+        * fast/frames/resources/iframe-reparenting-adopt-node-iframe-content.html: Removed.
+        * fast/frames/resources/iframe-reparenting-adopt-node-new-page.html: Removed.
+        * fast/frames/resources/iframe-reparenting-embed-frame1.html: Removed.
+        * fast/frames/resources/iframe-reparenting-embed-iframe.html: Removed.
+        * fast/frames/resources/iframe-reparenting-frame1.html: Removed.
+        * fast/frames/resources/iframe-reparenting-frame2.html: Removed.
+        * fast/frames/resources/iframe-reparenting-iframe-content.html: Removed.
+        * fast/frames/resources/iframe-reparenting-new-page-1.html: Removed.
+        * fast/frames/resources/iframe-reparenting-new-page-2.html: Removed.
+        * fast/frames/resources/iframe-reparenting-new-page-iframe.html: Removed.
+        * fast/frames/resources/iframe-reparenting-plugins-iframe-content.html: Removed.
+        * fast/frames/resources/iframe-reparenting-plugins-new-page.html: Removed.
+        * fast/frames/script-tests/iframe-reparenting-new-page.js: Removed.
+
 2012-03-19  Julien Chaffraix  <jchaffraix@webkit.org>
 
         REGRESSION(r110072): Improper repainting on table with overflow: hidden
diff --git a/LayoutTests/fast/frames/adopt-iframe-into-itself-expected.txt b/LayoutTests/fast/frames/adopt-iframe-into-itself-expected.txt
new file mode 100644 (file)
index 0000000..3fb03c8
--- /dev/null
@@ -0,0 +1,2 @@
+ALERT: Error: HIERARCHY_REQUEST_ERR: DOM Exception 3
+
diff --git a/LayoutTests/fast/frames/adopt-iframe-into-itself.html b/LayoutTests/fast/frames/adopt-iframe-into-itself.html
new file mode 100644 (file)
index 0000000..f387c81
--- /dev/null
@@ -0,0 +1,14 @@
+<script>
+if (window.layoutTestController)
+    layoutTestController.dumpAsText();
+
+function test() {
+    try {
+        var frame = document.getElementById("f");
+        var childNode = frame.contentDocument.adoptNode(frame);
+    } catch(ex) {
+        alert(ex);
+    }
+}
+</script>
+<iframe id="f" onload="test();" src="data:text/html,<body></body>"></iframe>
diff --git a/LayoutTests/fast/frames/iframe-reparenting-adopt-node-expected.txt b/LayoutTests/fast/frames/iframe-reparenting-adopt-node-expected.txt
deleted file mode 100644 (file)
index d23268c..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-This test adopts an iframe from a different page into this one, closes the page that originally contained the iframe, then reloads the iframe to verify that there are no remaining dependencies on the closed page.
-
-Loaded window 2.
-Adopted iframe to first page.
-Closing window 2.
-Window 2 closed.
-PASS: iframe reloaded.
-
diff --git a/LayoutTests/fast/frames/iframe-reparenting-adopt-node.html b/LayoutTests/fast/frames/iframe-reparenting-adopt-node.html
deleted file mode 100644 (file)
index 6995e2d..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<html>
-<script>
-var window2, iframe;
-
-function log(message)
-{
-    document.getElementById("log").innerText += message + "\n";
-}
-
-function reallyFinish()
-{
-    log("PASS: iframe reloaded.");
-    if (window.layoutTestController)
-        layoutTestController.notifyDone();
-}
-
-function window2Unloaded()
-{
-    log("Window 2 closed.");
-
-    // Reload the iframe to demonstrate that it no longer
-    // depends on its original window.
-    iframe.onload = reallyFinish;
-    iframe.contentDocument.location.reload(true);
-}
-
-function finish()
-{
-    log("Closing window 2.");
-    window2.onunload = window2Unloaded;
-    window2.close();
-}
-
-function window2Loaded()
-{
-    log("Loaded window 2.");
-    iframe = window2.document.getElementById("iframe");
-    window.document.adoptNode(iframe);
-    window.document.body.appendChild(iframe);
-    log("Adopted iframe to first page.");
-
-    // Start the iframe's timer to call finish() to end the test.
-    iframe.contentWindow.startFinishTimer();
-}
-
-function test()
-{
-    if (window.layoutTestController) {
-        layoutTestController.dumpAsText();
-        layoutTestController.waitUntilDone();
-        layoutTestController.setCanOpenWindows();
-    }
-
-    window2 = window.open("resources/iframe-reparenting-adopt-node-new-page.html");
-    window2.addEventListener("load", window2Loaded, false);
-}
-</script>
-<body onload="test()">
-<p>This test adopts an iframe from a different page into this one,
-closes the page that originally contained the iframe, then reloads
-the iframe to verify that there are no remaining dependencies
-on the closed page.</p>
-<pre id=log></pre>
-</body>
-</html>
diff --git a/LayoutTests/fast/frames/iframe-reparenting-embed-elements-expected.txt b/LayoutTests/fast/frames/iframe-reparenting-embed-elements-expected.txt
deleted file mode 100644 (file)
index 185bd65..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-This test moves an iframe between two documents 3 times: without plugins, with <embed> tag and then with <object> tag.
-
-Only the attempt without plugin elements should succeed. The presence of plugin elements should prevent the document.adoptNode() method from triggering live transfer - in which case the iframe will be reloaded.
-
-Test succeeds if there are 'PASS' messages below and no 'FAIL' messages.
-
-PASS: Test without plugins
-PASS: Test with <embed>
-PASS: Test with <object>
-Test Finished.
-
diff --git a/LayoutTests/fast/frames/iframe-reparenting-embed-elements.html b/LayoutTests/fast/frames/iframe-reparenting-embed-elements.html
deleted file mode 100644 (file)
index 3837fb6..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-<html>
-<script>
-function log(message) {
-  document.getElementById("log").innerText += message + "\n";
-}
-
-function verifyResult(message, actualToken, expectedToReload) {
-  var success = (expectedToReload != (actualToken == "modified"));
-  log((success ? "PASS" : "FAIL") + ": " + message);
-}
-
-function transferIframe(testStepDescription, expectedToReload, nextTest)
-{
-  var iframe = frame1.contentDocument.getElementsByTagName("iframe")[0];
-  if (iframe.contentWindow.token != "loaded")
-    log("FAIL: invalid initial state of test iframe");
-
-  iframe.contentWindow.token = "modified";
-
-  frame1.contentDocument.adoptNode(iframe);
-  frame2.contentDocument.body.appendChild(iframe);
-  verifyResult(testStepDescription, iframe.contentWindow.token, expectedToReload);
-
-  frame1.onload = nextTest;
-  frame1.contentWindow.location.reload();
-}
-
-function finish()
-{
-  log("Test Finished.");
-  if (window.layoutTestController)
-      layoutTestController.notifyDone();
-}
-
-function test() {
-  if (window.layoutTestController) {
-    layoutTestController.dumpAsText();
-    layoutTestController.waitUntilDone();
-  }
-
-  frame1 = document.getElementById("frame1");
-  frame2 = document.getElementById("frame2");
-
-  transferIframe("Test without plugins", false, test1);
-}
-
-function test1() {
-  var iframe = frame1.contentDocument.getElementsByTagName("iframe")[0];
-  iframe.contentDocument.body.appendChild(iframe.contentDocument.createElement("embed"));
-  transferIframe("Test with <embed>", true, test2);
-}
-
-function test2() {
-  var iframe = frame1.contentDocument.getElementsByTagName("iframe")[0];
-  iframe.contentDocument.body.appendChild(iframe.contentDocument.createElement("object"));
-  transferIframe("Test with <object>", true, finish);
-}
-
-</script>
-<body onload=test()>
-<p>This test moves an iframe between two documents 3 times: without plugins, with &lt;embed&gt; tag and then with &lt;object&gt; tag.</p>
-<p>Only the attempt without plugin elements should succeed. The presence of plugin elements should prevent the document.adoptNode() method from 
-triggering live transfer - in which case the iframe will be reloaded.</p>
-<p>Test succeeds if there are 'PASS' messages below and no 'FAIL' messages.</p>
-<iframe id=frame1 src="resources/iframe-reparenting-embed-frame1.html"></iframe>
-<iframe id=frame2 src="resources/iframe-reparenting-frame2.html"></iframe>
-<pre id=log></pre>
-</body>
-</html>
diff --git a/LayoutTests/fast/frames/iframe-reparenting-expected.txt b/LayoutTests/fast/frames/iframe-reparenting-expected.txt
deleted file mode 100644 (file)
index 400a98b..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-This test moves the iframe between two documents - once using this sequence:
-
-    document1.body.removeChild(iframe);
-    document2.body.appendChild(iframe);
-
-and then using 'adoptNode':
-
-    document2.adoptNode(iframe);
-    document2.body.appendChild(iframe);
-
-In the second case, the content of iframe should not be re-loaded and 'load' event should not be fired. Also, the timer started before reparenting should survive transition and fire.
-
-Test also verifies that document.adoptNode() in case of not-rendered document (loaded by XMLHttpRequest) does not preserve the content of iframe.
-
-Test succeeds if there are 'PASS' messages below and no 'FAIL' messages.
-
-PASS: Iframe loaded, verify token, expected: loaded, actual: loaded
-PASS: Iframe token modified, expected: modified-1, actual: modified-1
-Reparent iframe - the content should re-load.
-PASS: iframe is unloaded.
-PASS: Iframe re-loaded, verify token, expected: loaded, actual: loaded
-PASS: Iframe token modified, expected: modified-2, actual: modified-2
-Reparent iframe using adoptNode - the content should not unload.
-PASS: iframe is NOT unloaded.
-PASS: Iframe token should be the same as before reparenting, expected: modified-2, actual: modified-2
-PASS: XHR-loaded Document is correct.
-PASS: iframe is unloaded.
-Test Finished.
-
diff --git a/LayoutTests/fast/frames/iframe-reparenting-fail-load-expected.txt b/LayoutTests/fast/frames/iframe-reparenting-fail-load-expected.txt
deleted file mode 100644 (file)
index 2e1cee0..0000000
+++ /dev/null
@@ -1 +0,0 @@
-This test adopts an iframe into a second page, then closes that page, cancelling that iframe load. The cancelled load is treated as a failed load. This test will crash if resource tracking has not been updated after the iframe has been adopted to a different page because the failed load will be reported to the wrong place.
diff --git a/LayoutTests/fast/frames/iframe-reparenting-fail-load.html b/LayoutTests/fast/frames/iframe-reparenting-fail-load.html
deleted file mode 100644 (file)
index d66c4da..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-<html>
-<script>
-if (window.layoutTestController) {
-    layoutTestController.dumpAsText();
-    layoutTestController.waitUntilDone();
-    layoutTestController.setCanOpenWindows(true);
-}
-
-function test()
-{
-    var w = window.open("about:blank");
-    var f = w.document.adoptNode(document.getElementsByTagName("iframe")[0]);
-    w.document.body.appendChild(f);
-    w.close();
-    if (window.layoutTestController)
-        layoutTestController.notifyDone();
-}
-</script>
-<body onload="test()">
-<iframe src="data:text/html,foo"></iframe>
-<p>This test adopts an iframe into a second page, then closes that page, cancelling that iframe load. The cancelled load is treated as a failed load. This test will crash if resource tracking has not been updated after the iframe has been adopted to a different page because the failed load will be reported to the wrong place.</p>
-</body>
diff --git a/LayoutTests/fast/frames/iframe-reparenting-new-page-expected.txt b/LayoutTests/fast/frames/iframe-reparenting-new-page-expected.txt
deleted file mode 100644 (file)
index 630eff4..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-The test verifies that the timer in iframe continues firing after iframe is adopted into a new window and the original window was closed.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS Loaded iframe in window 1.
-PASS iframe.contentWindow.counter is 1
-PASS Loaded page 2.
-PASS Page 2 adopted the iframe.
-PASS Iframe transferred.
-PASS iframe.contentWindow.counter is 2
-PASS window2.location.href is iframe.contentWindow.parent.location.href
-PASS Page 1 is closed.
-PASS Received the timer beat from the adopted iframe - exiting.
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
diff --git a/LayoutTests/fast/frames/iframe-reparenting-new-page.html b/LayoutTests/fast/frames/iframe-reparenting-new-page.html
deleted file mode 100644 (file)
index 281cb13..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<html>
-<head>
-<script src="../js/resources/js-test-pre.js"></script>
-</head>
-<body>
-<script src="script-tests/iframe-reparenting-new-page.js"></script>
-<script src="../js/resources/js-test-post.js"></script>
-</body>
-</html>
diff --git a/LayoutTests/fast/frames/iframe-reparenting-plugins-expected.txt b/LayoutTests/fast/frames/iframe-reparenting-plugins-expected.txt
deleted file mode 100644 (file)
index 956b659..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-This test verifies that plugin and mimetype in an iframe that is reparented to a different page continue to behave correctly.
-
-Loaded window 2.
-PASS: plugin OK.
-PASS: mimetype OK.
-
-Adopted iframe to first page.
-Window 2 unloaded.
-PASS: plugin OK.
-PASS: mimetype OK.
-
-
diff --git a/LayoutTests/fast/frames/iframe-reparenting-plugins.html b/LayoutTests/fast/frames/iframe-reparenting-plugins.html
deleted file mode 100644 (file)
index cdba41b..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<html>
-<script>
-var window2, iframe;
-
-function log(message)
-{
-    document.getElementById("log").innerText += message + "\n";
-}
-
-function finish()
-{
-    var message = iframe.contentWindow.checkPlugins();
-    log(message);
-
-    if (window.layoutTestController)
-        layoutTestController.notifyDone();
-}
-
-function window2Unloaded()
-{
-    log("Window 2 unloaded.");
-    setTimeout(finish, 0); // Let window close finish completely.
-}
-
-function window2Loaded()
-{
-    log("Loaded window 2.");
-    iframe = window2.document.getElementById("iframe");
-
-    var message = iframe.contentWindow.checkPlugins();
-    log(message);
-
-    window.document.adoptNode(iframe);
-    window.document.body.appendChild(iframe);
-    log("Adopted iframe to first page.");
-
-    window2.onunload = window2Unloaded;
-    window2.close();
-}
-
-function test()
-{
-    if (window.layoutTestController) {
-        layoutTestController.dumpAsText();
-        layoutTestController.waitUntilDone();
-        layoutTestController.setCanOpenWindows();
-    }
-
-    window2 = window.open("resources/iframe-reparenting-plugins-new-page.html");
-    window2.addEventListener("load", window2Loaded, false);
-}
-
-</script>
-<body onload="test()">
-<p>This test verifies that plugin and mimetype in an iframe that is
-reparented to a different page continue to behave correctly.
-<pre id=log></pre>
-</body>
-</html>
diff --git a/LayoutTests/fast/frames/iframe-reparenting.html b/LayoutTests/fast/frames/iframe-reparenting.html
deleted file mode 100644 (file)
index b71a5bd..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-<html>
-<script>
-function log(message)
-{
-    document.getElementById("log").innerText += message + "\n";
-}
-
-function verifyToken(message, expectedToken)
-{
-    var actualToken = iframe.contentWindow.token;
-    log((expectedToken == actualToken ? "PASS" : "FAIL") + ": " + message + ", expected: " + expectedToken + ", actual: " + actualToken);
-}
-
-function test()
-{
-    if (window.layoutTestController) {
-        layoutTestController.dumpAsText();
-        layoutTestController.waitUntilDone();
-    }
-
-    frame1 = document.getElementById("frame1");
-    frame2 = document.getElementById("frame2");
-    iframe = frame1.contentDocument.getElementsByTagName("iframe")[0];
-
-    verifyToken("Iframe loaded, verify token", "loaded");
-    iframe.contentWindow.token = "modified-1";
-    verifyToken("Iframe token modified", "modified-1");
-
-    // Start timeout in iframe - it should not survive reparenting.
-    iframe.contentWindow.startDoomedTimer();
-    log("Reparent iframe - the content should re-load.")
-    frame1.contentDocument.body.removeChild(iframe);
-    // contentWindow should not be available, the iframe is unloaded.
-    log(iframe.contentWindow ? "FAIL: iframe is not unloaded." : "PASS: iframe is unloaded.");
-    frame2.contentDocument.body.appendChild(iframe);
-    iframe.onload = test2;
-}
-
-function test2()
-{
-    verifyToken("Iframe re-loaded, verify token", "loaded");
-    iframe.contentWindow.token = "modified-2";
-    verifyToken("Iframe token modified", "modified-2");
-
-    // Start timeout in iframe - it should survive reparenting and call finish() to end the test.
-    iframe.contentWindow.startFinishTimer();
-    log("Reparent iframe using adoptNode - the content should not unload.")
-    frame1.contentDocument.adoptNode(iframe);
-    frame1.contentDocument.body.appendChild(iframe);
-    // contentWindow should be available, the iframe is not unloaded.
-    log(iframe.contentWindow ? "PASS: iframe is NOT unloaded." : "FAIL: iframe is unloaded.");
-    iframe.onload = notReached;
-}
-
-notReached = function()
-{
-    log("FAIL: iframe should not fire 'load' event when reparented using 'adoptNode'");
-}
-
-finish = function()
-{
-    verifyToken("Iframe token should be the same as before reparenting", "modified-2");
-
-    // Last test - verify that non-attached document does not keep iframe alive even if adoptNode() is used.
-    var xhr = new XMLHttpRequest();
-    xhr.open("GET","data:application/xhtml+xml,<html xmlns='http://www.w3.org/1999/xhtml'><body id='body'>Hello</body></html>", false);
-    xhr.send(null);
-    var doc = xhr.responseXML;
-    log(doc.getElementById("body").innerText == "Hello" ? "PASS: XHR-loaded Document is correct." : "FAIL: XHR-loaded document is not correct.");
-
-    doc.adoptNode(iframe);
-    // contentWindow should not be available, the iframe is unloaded.
-    log(iframe.contentWindow ? "FAIL: iframe is not unloaded." : "PASS: iframe is unloaded.");
-
-    log("Test Finished.");
-
-    if (window.layoutTestController)
-        layoutTestController.notifyDone();
-
-}
-
-</script>
-<body onload=test()>
-<p>This test moves the iframe between two documents - once using this sequence:</p>
-<pre>
-    document1.body.removeChild(iframe);
-    document2.body.appendChild(iframe);
-
-</pre>
-<p>and then using 'adoptNode':</p>
-<pre>
-    document2.adoptNode(iframe);
-    document2.body.appendChild(iframe);
-
-</pre>
-<p>In the second case, the content of iframe should not be re-loaded and 'load' event should not be fired. Also, the timer started before reparenting should survive transition and fire.</p>
-<p>Test also verifies that document.adoptNode() in case of not-rendered document (loaded by XMLHttpRequest) does not preserve the content of iframe.</p>
-<p>Test succeeds if there are 'PASS' messages below and no 'FAIL' messages.</p>
-<iframe id=frame1 src=resources/iframe-reparenting-frame1.html></iframe>
-<iframe id=frame2 src=resources/iframe-reparenting-frame2.html></iframe>
-<pre id=log></pre>
-</body>
-</html>
diff --git a/LayoutTests/fast/frames/resources/iframe-reparenting-adopt-node-iframe-content.html b/LayoutTests/fast/frames/resources/iframe-reparenting-adopt-node-iframe-content.html
deleted file mode 100644 (file)
index af073ca..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<script>
-startFinishTimer = function()
-{
-    setTimeout(parent.parent.finish, 0);
-}
-</script>
-<body>
diff --git a/LayoutTests/fast/frames/resources/iframe-reparenting-adopt-node-new-page.html b/LayoutTests/fast/frames/resources/iframe-reparenting-adopt-node-new-page.html
deleted file mode 100644 (file)
index dc8c0f0..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-<html>
-<body>
-A New Page<br>
-<iframe id="iframe" src="iframe-reparenting-adopt-node-iframe-content.html"></iframe>
-</body>
-</html>
diff --git a/LayoutTests/fast/frames/resources/iframe-reparenting-embed-frame1.html b/LayoutTests/fast/frames/resources/iframe-reparenting-embed-frame1.html
deleted file mode 100644 (file)
index 97e0ab3..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-<body>
-<iframe src=iframe-reparenting-embed-iframe.html></iframe>
diff --git a/LayoutTests/fast/frames/resources/iframe-reparenting-embed-iframe.html b/LayoutTests/fast/frames/resources/iframe-reparenting-embed-iframe.html
deleted file mode 100644 (file)
index 2a1c9ce..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-<script>
-token = "loading";
-
-function init()
-{
-    token = "loaded";
-}
-
-</script>
-<body onload=init()>
diff --git a/LayoutTests/fast/frames/resources/iframe-reparenting-frame1.html b/LayoutTests/fast/frames/resources/iframe-reparenting-frame1.html
deleted file mode 100644 (file)
index 6cc81ef..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-<body>
-<iframe src=iframe-reparenting-iframe-content.html></iframe>
diff --git a/LayoutTests/fast/frames/resources/iframe-reparenting-frame2.html b/LayoutTests/fast/frames/resources/iframe-reparenting-frame2.html
deleted file mode 100644 (file)
index 335eec5..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<body>
diff --git a/LayoutTests/fast/frames/resources/iframe-reparenting-iframe-content.html b/LayoutTests/fast/frames/resources/iframe-reparenting-iframe-content.html
deleted file mode 100644 (file)
index 9576789..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-<script>
-token = "loading";
-
-function init()
-{
-    token = "loaded";
-}
-
-startFinishTimer = function()
-{
-    setTimeout(parent.parent.finish, 0);
-}
-
-startDoomedTimer = function()
-{
-    setTimeout(parent.parent.notReached, 0);
-}
-
-</script>
-<body onload=init()>
diff --git a/LayoutTests/fast/frames/resources/iframe-reparenting-new-page-1.html b/LayoutTests/fast/frames/resources/iframe-reparenting-new-page-1.html
deleted file mode 100644 (file)
index 52e0005..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-<html>
-<body>
-Page 1<br>
-<iframe id="iframe" src="iframe-reparenting-new-page-iframe.html"></iframe>
-</body>
-</html>
diff --git a/LayoutTests/fast/frames/resources/iframe-reparenting-new-page-2.html b/LayoutTests/fast/frames/resources/iframe-reparenting-new-page-2.html
deleted file mode 100644 (file)
index 3f26d08..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-<html>
-<script>
-window.adoptIframe = function(iframe)
-{
-    document.adoptNode(iframe);
-    document.body.appendChild(iframe);
-    opener.testPassed("Page 2 adopted the iframe.")
-}
-</script>
-<body>
-Page 2<br>
-</body>
-</html>
diff --git a/LayoutTests/fast/frames/resources/iframe-reparenting-new-page-iframe.html b/LayoutTests/fast/frames/resources/iframe-reparenting-new-page-iframe.html
deleted file mode 100644 (file)
index 9179a90..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-<html>
-<script>
-window.counter = 0;
-
-function tick()
-{
-    if (window.finish)
-        finish();
-}
-
-function start()
-{
-    window.setInterval(tick, 50);
-}
-</script>
-<body onload="start()">
-</body>
-</html>
diff --git a/LayoutTests/fast/frames/resources/iframe-reparenting-plugins-iframe-content.html b/LayoutTests/fast/frames/resources/iframe-reparenting-plugins-iframe-content.html
deleted file mode 100644 (file)
index 3247e7b..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-<script>
-// We can only guarantee that the Test PlugIn is installed.
-var plugin = navigator.plugins.namedItem("WebKit Test PlugIn");
-var mimetype = navigator.mimeTypes[0];
-
-// Called by test page after adopting this iframe and closing the
-// page that originally held this iframe.
-checkPlugins = function()
-{
-  if (!plugin) {
-      return "FAIL: Failed to find test plugin\n";
-  }
-
-  var message = "";
-  if (plugin.item(0).enabledPlugin)
-      message += "PASS: plugin OK.\n";
-  else
-      message += "FAIL: plugin references PluginData with no page.\n";
-
-  if (mimetype.enabledPlugin)
-      message += "PASS: mimetype OK.\n";
-  else
-      message += "FAIL: mimetype references PluginData with no page.\n";
-
-  return message;
-}
-</script>
diff --git a/LayoutTests/fast/frames/resources/iframe-reparenting-plugins-new-page.html b/LayoutTests/fast/frames/resources/iframe-reparenting-plugins-new-page.html
deleted file mode 100644 (file)
index 55a3090..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-<html>
-<body>
-A New Page<br>
-<iframe id="iframe" src="iframe-reparenting-plugins-iframe-content.html"</iframe>
-</body>
-</html>
diff --git a/LayoutTests/fast/frames/script-tests/iframe-reparenting-new-page.js b/LayoutTests/fast/frames/script-tests/iframe-reparenting-new-page.js
deleted file mode 100644 (file)
index 86de774..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-description(
-"The test verifies that the timer in iframe continues firing after iframe is adopted into a new window and the original window was closed."
-);
-
-var window1, iframe, window2;
-
-function finish()
-{
-    // Timer may call this multiple times before actual shutdown, generating arbitrary number of log lines.
-    // Reset the callback to avoid this.
-    iframe.contentWindow.finish = null;
-
-    testPassed("Received the timer beat from the adopted iframe - exiting.")
-    window2.close();
-    finishJSTest();
-}
-
-function page1Unloaded()
-{
-    testPassed("Page 1 is closed.");
-    // Give the iframe a function to call from the timer.
-    iframe.contentWindow.finish = finish;
-}
-
-function transferIframe()
-{
-    testPassed("Loaded page 2.");
-    window2.adoptIframe(iframe);
-    testPassed("Iframe transferred.");
-    iframe.contentWindow.counter++;
-    shouldBe("iframe.contentWindow.counter", "2");
-    shouldBe("window2.location.href", "iframe.contentWindow.parent.location.href");
-    window1.onunload = page1Unloaded;
-    window1.close();
-}
-
-function window1Loaded()
-{
-    iframe = window1.document.getElementById("iframe");
-    testPassed("Loaded iframe in window 1.");
-    iframe.contentWindow.counter++;
-    shouldBe("iframe.contentWindow.counter", "1");
-    window2 = window.open("iframe-reparenting-new-page-2.html", "_blank");
-    window2.addEventListener("load", transferIframe, false);
-}
-
-if (window.layoutTestController) {
-    layoutTestController.waitUntilDone();
-    layoutTestController.setCanOpenWindows();
-}
-window1 = window.open("resources/iframe-reparenting-new-page-1.html", "_blank");
-window1.addEventListener("load", window1Loaded, false);
-
-var jsTestIsAsync = true;
index 771fab5..7c62494 100644 (file)
@@ -1,3 +1,56 @@
+2012-03-19  Adam Barth  <abarth@webkit.org>
+
+        Remove support for "magic" iframe
+        https://bugs.webkit.org/show_bug.cgi?id=81590
+
+        Reviewed by Eric Seidel.
+
+        This patch removes support for "magic" iframe, which previously allowed
+        an iframe to be transfered from one document to another without
+        reloading the iframe.  The idea behind this feature was to let sites
+        create "pop out" windows that could outlive their parents by
+        transfering state to these windows via these magic iframes.
+
+        Unforuntately, this feature was never implemented by other browsers and
+        has been the source of a series of security vulnerabilities.  Although
+        we have fixed each vulnerability as it has been discovered, the feature
+        is still a complex corner case that isn't widely exercised on the web.
+        For that reason, it's likely to have more vulnerabilities in the
+        future.
+
+        I'm not aware of any web sites that use this feature anymore.  There
+        were a handful of them, but we appear to have been successful in
+        evangalizing them to move away from "magic" iframe.
+
+        * dom/Document.cpp:
+        (WebCore::Document::adoptNode):
+        * html/HTMLFrameElementBase.cpp:
+        (WebCore):
+        (WebCore::HTMLFrameElementBase::HTMLFrameElementBase):
+        (WebCore::HTMLFrameElementBase::insertedIntoDocument):
+        * html/HTMLFrameElementBase.h:
+        (HTMLFrameElementBase):
+        * loader/DocumentLoader.cpp:
+        (WebCore):
+        * loader/DocumentLoader.h:
+        (DocumentLoader):
+        * loader/EmptyClients.h:
+        (WebCore::EmptyFrameLoaderClient::createFrame):
+        * loader/FrameLoader.cpp:
+        (WebCore):
+        * loader/FrameLoader.h:
+        (FrameLoader):
+        * loader/FrameLoaderClient.h:
+        (FrameLoaderClient):
+        * loader/ResourceLoadNotifier.cpp:
+        (WebCore):
+        * loader/ResourceLoadNotifier.h:
+        (ResourceLoadNotifier):
+        * page/Frame.cpp:
+        (WebCore):
+        * page/Frame.h:
+        (Frame):
+
 2012-03-19  Julien Chaffraix  <jchaffraix@webkit.org>
 
         REGRESSION(r110072): Improper repainting on table with overflow: hidden
index 5fbe029..7af50c0 100644 (file)
@@ -941,15 +941,14 @@ PassRefPtr<Node> Document::adoptNode(PassRefPtr<Node> source, ExceptionCode& ec)
         break;
     }       
     default:
+        // FIXME: What about <frame> and <object>?
         if (source->hasTagName(iframeTag)) {
             HTMLIFrameElement* iframe = static_cast<HTMLIFrameElement*>(source.get());
             if (frame() && frame()->tree()->isDescendantOf(iframe->contentFrame())) {
                 ec = HIERARCHY_REQUEST_ERR;
                 return 0;
             }
-            iframe->setRemainsAliveOnRemovalFromTree(attached() && source->attached() && iframe->canRemainAliveOnRemovalFromTree());
         }
-
         if (source->parentNode())
             source->parentNode()->removeChild(source.get(), ec);
     }
index a3a44ba..f439a39 100644 (file)
@@ -44,41 +44,12 @@ namespace WebCore {
 
 using namespace HTMLNames;
 
-// Helper to check if the Frame's document contains elements that can instantiate plugins.
-// Does a recursive check for nested Frames too.
-static bool hasPluginElements(Frame* frame)
-{
-    if (!frame)
-        return false;
-
-    // Search for a plugin element in this document.
-    Document* document = frame->document();
-    for (Node* node = document->firstChild(); node; node = node->traverseNextNode(document)) {
-        if (!node->isElementNode())
-            continue;
-
-        Element* element = static_cast<Element*>(node);
-        if (element->hasLocalName(embedTag) || element->hasLocalName(objectTag))
-            return true;
-    }
-
-    // Do the same for the nested frames.
-    for (Frame* child = frame->tree()->firstChild(); child; child = child->tree()->nextSibling()) {
-        if (hasPluginElements(child))
-            return true;
-    }
-
-    return false;
-}
-
 HTMLFrameElementBase::HTMLFrameElementBase(const QualifiedName& tagName, Document* document)
     : HTMLFrameOwnerElement(tagName, document)
     , m_scrolling(ScrollbarAuto)
     , m_marginWidth(-1)
     , m_marginHeight(-1)
-    , m_checkInDocumentTimer(this, &HTMLFrameElementBase::checkInDocumentTimerFired)
     , m_viewSource(false)
-    , m_remainsAliveOnRemovalFromTree(false)
 {
 }
 
@@ -180,24 +151,10 @@ void HTMLFrameElementBase::setNameAndOpenURL()
     openURL();
 }
 
-void HTMLFrameElementBase::updateOnReparenting()
-{
-    ASSERT(m_remainsAliveOnRemovalFromTree);
-
-    if (Frame* frame = contentFrame())
-        frame->transferChildFrameToNewDocument();
-}
-
 void HTMLFrameElementBase::insertedIntoDocument()
 {
     HTMLFrameOwnerElement::insertedIntoDocument();
 
-    if (m_remainsAliveOnRemovalFromTree) {
-        updateOnReparenting();
-        m_remainsAliveOnRemovalFromTree = false;
-        m_checkInDocumentTimer.stop();
-        return;
-    }
     // DocumentFragments don't kick of any loads.
     if (!document()->frame())
         return;
@@ -277,47 +234,6 @@ int HTMLFrameElementBase::height()
     return renderBox()->height();
 }
 
-// Some types of content can restrict the ability to move the iframes between pages.
-// For example, the plugin infrastructure of an embedder may associate the plugin instances
-// with the top-level Frame for tracking various resources and failure to transfer those
-// resources correctly may lead to crashes and other ill effects (https://bugs.webkit.org/show_bug.cgi?id=68267)
-bool HTMLFrameElementBase::canRemainAliveOnRemovalFromTree()
-{
-    return !hasPluginElements(contentFrame());
-}
-
-void HTMLFrameElementBase::setRemainsAliveOnRemovalFromTree(bool value)
-{
-    ASSERT(!value || canRemainAliveOnRemovalFromTree());
-    m_remainsAliveOnRemovalFromTree = value;
-
-    // There is a possibility that JS will do document.adoptNode() on this element but will not insert it into the tree.
-    // Start the async timer that is normally stopped by attach(). If it's not stopped and fires, it'll unload the frame.
-    if (value)
-        m_checkInDocumentTimer.startOneShot(0);
-    else {
-        m_checkInDocumentTimer.stop();
-        willRemove();
-    }
-}
-
-void HTMLFrameElementBase::checkInDocumentTimerFired(Timer<HTMLFrameElementBase>*)
-{
-    ASSERT(!attached());
-    ASSERT(m_remainsAliveOnRemovalFromTree);
-
-    m_remainsAliveOnRemovalFromTree = false;
-    willRemove();
-}
-
-void HTMLFrameElementBase::willRemove()
-{
-    if (m_remainsAliveOnRemovalFromTree)
-        return;
-
-    HTMLFrameOwnerElement::willRemove();
-}
-
 #if ENABLE(FULLSCREEN_API)
 bool HTMLFrameElementBase::allowFullScreen() const
 {
index 41ee2ea..be68330 100644 (file)
@@ -42,8 +42,6 @@ public:
     int width();
     int height();
 
-    bool canRemainAliveOnRemovalFromTree();
-    void setRemainsAliveOnRemovalFromTree(bool);
 #if ENABLE(FULLSCREEN_API)
     virtual bool allowFullScreen() const;
 #endif
@@ -66,10 +64,6 @@ private:
     virtual bool isURLAttribute(Attribute*) const;
     virtual bool isFrameElementBase() const { return true; }
 
-    virtual void willRemove();
-    void checkInDocumentTimerFired(Timer<HTMLFrameElementBase>*);
-    void updateOnReparenting();
-
     bool viewSourceMode() const { return m_viewSource; }
 
     void setNameAndOpenURL();
@@ -83,20 +77,7 @@ private:
     int m_marginWidth;
     int m_marginHeight;
 
-    // This is a performance optimization some call "magic iframe" which avoids
-    // tearing down the frame hierarchy when a web page calls adoptNode on a
-    // frame owning element but does not immediately insert it into the new
-    // document before JavaScript yields to WebCore.  If the element is not yet
-    // in a document by the time this timer fires, the frame hierarchy teardown
-    // will continue.  This can also be seen as implementation of:
-    // "Removing an iframe from a Document does not cause its browsing context
-    // to be discarded. Indeed, an iframe's browsing context can survive its
-    // original parent Document if its iframe is moved to another Document."
-    // From HTML5: http://www.whatwg.org/specs/web-apps/current-work/multipage/the-iframe-element.html#the-iframe-element
-    Timer<HTMLFrameElementBase> m_checkInDocumentTimer;
-
     bool m_viewSource;
-    bool m_remainsAliveOnRemovalFromTree;
 };
 
 } // namespace WebCore
index 7b0bf8b..6342c94 100644 (file)
@@ -850,24 +850,6 @@ void DocumentLoader::subresourceLoaderFinishedLoadingOnePart(ResourceLoader* loa
         frame->loader()->checkLoadComplete();    
 }
 
-void DocumentLoader::transferLoadingResourcesFromPage(Page* oldPage)
-{
-    ASSERT(oldPage != m_frame->page());
-
-    FrameLoader* loader = frameLoader();
-    ASSERT(loader);
-
-    if (isLoadingMainResource())
-        loader->dispatchTransferLoadingResourceFromPage(m_mainResourceLoader.get(), originalRequest(), oldPage);
-
-    if (isLoadingSubresources()) {
-        ResourceLoaderSet::const_iterator it = m_subresourceLoaders.begin();
-        ResourceLoaderSet::const_iterator end = m_subresourceLoaders.end();
-        for (; it != end; ++it)
-            loader->dispatchTransferLoadingResourceFromPage((*it).get(), (*it)->originalRequest(), oldPage);
-    }
-}
-
 void DocumentLoader::maybeFinishLoadingMultipartContent()
 {
     if (!doesProgressiveLoad(m_response.mimeType())) {
index e575cd6..8b6bcc5 100644 (file)
@@ -221,8 +221,6 @@ namespace WebCore {
 
         void subresourceLoaderFinishedLoadingOnePart(ResourceLoader*);
 
-        void transferLoadingResourcesFromPage(Page*);
-
         void maybeFinishLoadingMultipartContent();
 
         void setDeferMainResourceDataLoad(bool defer) { m_deferMainResourceDataLoad = defer; }
index 33c25d9..f1dfb09 100644 (file)
@@ -374,8 +374,6 @@ public:
     virtual void didRunInsecureContent(SecurityOrigin*, const KURL&) { }
     virtual void didDetectXSS(const KURL&, bool) { }
     virtual PassRefPtr<Frame> createFrame(const KURL&, const String&, HTMLFrameOwnerElement*, const String&, bool, int, int) { return 0; }
-    virtual void didTransferChildFrameToNewDocument(Page*) { }
-    virtual void transferLoadingResourceFromPage(ResourceLoader*, const ResourceRequest&, Page*) { }
     virtual PassRefPtr<Widget> createPlugin(const IntSize&, HTMLPlugInElement*, const KURL&, const Vector<String>&, const Vector<String>&, const String&, bool) { return 0; }
     virtual PassRefPtr<Widget> createJavaAppletWidget(const IntSize&, HTMLAppletElement*, const KURL&, const Vector<String>&, const Vector<String>&) { return 0; }
 #if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
index 27810aa..b04c0c2 100644 (file)
@@ -1646,22 +1646,6 @@ bool FrameLoader::frameHasLoaded() const
     return m_stateMachine.committedFirstRealDocumentLoad() || (m_provisionalDocumentLoader && !m_stateMachine.creatingInitialEmptyDocument()); 
 }
 
-void FrameLoader::transferLoadingResourcesFromPage(Page* oldPage)
-{
-    ASSERT(oldPage != m_frame->page());
-    if (isLoading()) {
-        activeDocumentLoader()->transferLoadingResourcesFromPage(oldPage);
-        oldPage->progress()->progressCompleted(m_frame);
-        if (m_frame->page())
-            m_frame->page()->progress()->progressStarted(m_frame);
-    }
-}
-
-void FrameLoader::dispatchTransferLoadingResourceFromPage(ResourceLoader* loader, const ResourceRequest& request, Page* oldPage)
-{
-    notifier()->dispatchTransferLoadingResourceFromPage(loader, request, oldPage);
-}
-
 void FrameLoader::setDocumentLoader(DocumentLoader* loader)
 {
     if (!loader && !m_documentLoader)
index df357d6..cda442e 100644 (file)
@@ -135,8 +135,6 @@ public:
     bool isLoadingMainResource() const { return m_isLoadingMainResource; }
     bool isLoading() const;
     bool frameHasLoaded() const;
-    void transferLoadingResourcesFromPage(Page*);
-    void dispatchTransferLoadingResourceFromPage(ResourceLoader*, const ResourceRequest&, Page*);
 
     int numPendingOrLoadingRequests(bool recurse) const;
     String referrer() const;
index 235c41c..0ced4fd 100644 (file)
@@ -256,10 +256,7 @@ namespace WebCore {
         virtual bool canCachePage() const = 0;
         virtual void download(ResourceHandle*, const ResourceRequest&, const ResourceResponse&) = 0;
 
-        virtual PassRefPtr<Frame> createFrame(const KURL& url, const String& name, HTMLFrameOwnerElement* ownerElement,
-                                   const String& referrer, bool allowsScrolling, int marginWidth, int marginHeight) = 0;
-        virtual void didTransferChildFrameToNewDocument(Page* oldPage) = 0;
-        virtual void transferLoadingResourceFromPage(ResourceLoader*, const ResourceRequest&, Page* oldPage) = 0;
+        virtual PassRefPtr<Frame> createFrame(const KURL& url, const String& name, HTMLFrameOwnerElement* ownerElement, const String& referrer, bool allowsScrolling, int marginWidth, int marginHeight) = 0;
         virtual PassRefPtr<Widget> createPlugin(const IntSize&, HTMLPlugInElement*, const KURL&, const Vector<String>&, const Vector<String>&, const String&, bool loadManually) = 0;
         virtual void redirectDataToPlugin(Widget* pluginWidget) = 0;
 
index 61eacf4..b7d5686 100644 (file)
@@ -144,14 +144,6 @@ void ResourceLoadNotifier::dispatchDidFinishLoading(DocumentLoader* loader, unsi
     InspectorInstrumentation::didFinishLoading(m_frame, loader, identifier, finishTime);
 }
 
-void ResourceLoadNotifier::dispatchTransferLoadingResourceFromPage(ResourceLoader* loader, const ResourceRequest& request, Page* oldPage)
-{
-    ASSERT(oldPage != m_frame->page());
-    m_frame->loader()->client()->transferLoadingResourceFromPage(loader, request, oldPage);
-
-    oldPage->progress()->completeProgress(loader->identifier());
-}
-
 void ResourceLoadNotifier::sendRemainingDelegateMessages(DocumentLoader* loader, unsigned long identifier, const ResourceResponse& response, const char* data, int dataLength, int encodedDataLength, const ResourceError& error)
 {
     if (!response.isNull())
index 5e020ec..597291f 100644 (file)
@@ -62,7 +62,6 @@ public:
     void dispatchDidReceiveResponse(DocumentLoader*, unsigned long identifier, const ResourceResponse&);
     void dispatchDidReceiveData(DocumentLoader*, unsigned long identifier, const char* data, int dataLength, int encodedDataLength);
     void dispatchDidFinishLoading(DocumentLoader*, unsigned long identifier, double finishTime);
-    void dispatchTransferLoadingResourceFromPage(ResourceLoader*, const ResourceRequest&, Page*);
 
     void sendRemainingDelegateMessages(DocumentLoader*, unsigned long identifier, const ResourceResponse&, const char* data, int dataLength, int encodedDataLength, const ResourceError&);
 
index b313649..baa072a 100644 (file)
@@ -717,62 +717,6 @@ void Frame::disconnectOwnerElement()
     m_ownerElement = 0;
 }
 
-// The frame is moved in DOM, potentially to another page.
-void Frame::transferChildFrameToNewDocument()
-{
-    ASSERT(m_ownerElement);
-    Frame* newParent = m_ownerElement->document()->frame();
-    ASSERT(newParent);
-    bool didTransfer = false;
-
-    // Switch page.
-    Page* newPage = newParent->page();
-    Page* oldPage = m_page;
-    if (m_page != newPage) {
-        if (m_page) {
-            if (m_page->focusController()->focusedFrame() == this)
-                m_page->focusController()->setFocusedFrame(0);
-
-             m_page->decrementFrameCount();
-        }
-
-        if (m_domWindow) {
-#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
-            m_domWindow->resetNotifications();
-#endif
-        }
-
-        HashSet<FrameDestructionObserver*>::iterator stop = m_destructionObservers.end();
-        for (HashSet<FrameDestructionObserver*>::iterator it = m_destructionObservers.begin(); it != stop; ++it)
-            (*it)->willDetachPage();
-
-        m_page = newPage;
-
-        if (newPage)
-            newPage->incrementFrameCount();
-
-        didTransfer = true;
-    }
-
-    // Update the frame tree.
-    didTransfer = newParent->tree()->transferChild(this) || didTransfer;
-
-    // Avoid unnecessary calls to client and frame subtree if the frame ended
-    // up on the same page and under the same parent frame.
-    if (didTransfer) {
-        // Let external clients update themselves.
-        loader()->client()->didTransferChildFrameToNewDocument(oldPage);
-
-        // Update resource tracking now that frame could be in a different page.
-        if (oldPage != newPage)
-            loader()->transferLoadingResourcesFromPage(oldPage);
-
-        // Do the same for all the children.
-        for (Frame* child = tree()->firstChild(); child; child = child->tree()->nextSibling())
-            child->transferChildFrameToNewDocument();
-    }
-}
-
 String Frame::documentTypeString() const
 {
     if (DocumentType* doctype = document()->doctype())
index e25c90f..8c56e8f 100644 (file)
@@ -113,8 +113,6 @@ namespace WebCore {
         RenderView* contentRenderer() const; // Root of the render tree for the document contained in this frame.
         RenderPart* ownerRenderer() const; // Renderer for the element that contains this frame.
 
-        void transferChildFrameToNewDocument();
-
 #if ENABLE(PAGE_VISIBILITY_API)
         void dispatchVisibilityStateChangeEvent();
 #endif
index 9849695..2740218 100644 (file)
@@ -1,3 +1,18 @@
+2012-03-19  Adam Barth  <abarth@webkit.org>
+
+        Remove support for "magic" iframe
+        https://bugs.webkit.org/show_bug.cgi?id=81590
+
+        Reviewed by Eric Seidel.
+
+        Remove FrameLoaderClient methods that no longer exist.
+
+        * WebCoreSupport/FrameLoaderClientBlackBerry.cpp:
+        (WebCore):
+        * WebCoreSupport/FrameLoaderClientBlackBerry.h:
+        (FrameLoaderClientBlackBerry):
+        (WebCore::FrameLoaderClientBlackBerry::didDetectXSS):
+
 2012-03-19  Tyler Abbott  <tabbott@rim.com>
 
         [BlackBerry] speed up text selection for large selections
index c96985b..7db35ab 100644 (file)
@@ -740,17 +740,6 @@ PassRefPtr<Frame> FrameLoaderClientBlackBerry::createFrame(const KURL& url, cons
     return childFrame.release();
 }
 
-void FrameLoaderClientBlackBerry::didTransferChildFrameToNewDocument(Page* /*oldPage*/)
-{
-    Page* newPage = m_frame->page();
-    m_webPagePrivate = static_cast<ChromeClientBlackBerry*>(newPage->chrome()->client())->webPagePrivate();
-}
-
-void FrameLoaderClientBlackBerry::transferLoadingResourceFromPage(ResourceLoader*, const ResourceRequest&, Page*)
-{
-    notImplemented();
-}
-
 ObjectContentType FrameLoaderClientBlackBerry::objectContentType(const KURL& url, const String& mimeTypeIn, bool shouldPreferPlugInsForImages)
 {
     String mimeType = mimeTypeIn;
index 2983d01..a6d701a 100644 (file)
@@ -148,7 +148,6 @@ public:
     virtual void dispatchDidBecomeFrameset(bool) { }
     virtual void download(ResourceHandle*, const ResourceRequest&, const ResourceRequest&, const ResourceResponse&);
     virtual PassRefPtr<Frame> createFrame(const KURL&, const String&, HTMLFrameOwnerElement*, const String&, bool, int, int);
-    virtual void didTransferChildFrameToNewDocument(Page*);
     virtual PassRefPtr<Widget> createPlugin(const IntSize&, HTMLPlugInElement*, const KURL&, const Vector<String>&, const Vector<String>&, const String&, bool);
     virtual void redirectDataToPlugin(Widget*);
     virtual PassRefPtr<Widget> createJavaAppletWidget(const IntSize&, HTMLAppletElement*, const KURL&, const Vector<String>&, const Vector<String>&) { notImplemented(); return 0; }
@@ -164,8 +163,6 @@ public:
     virtual void loadIconExternally(const String& originalPageUrl, const String& finalPageUrl, const String& iconUrl);
 
     virtual void didDetectXSS(const KURL&, bool) { }
-    virtual void transferLoadingResourceFromPage(ResourceLoader*, const ResourceRequest&, Page*);
-    virtual void didTransferChildFrameToNewDocument() { notImplemented(); };
     virtual void dispatchDidChangeIcons(IconType) { notImplemented(); };
     virtual void dispatchWillSendSubmitEvent(HTMLFormElement*) { notImplemented(); };
 
index 0c41bea..7eedb55 100644 (file)
@@ -1,3 +1,19 @@
+2012-03-19  Adam Barth  <abarth@webkit.org>
+
+        Remove support for "magic" iframe
+        https://bugs.webkit.org/show_bug.cgi?id=81590
+
+        Reviewed by Eric Seidel.
+
+        Remove FrameLoaderClient methods that no longer exist.
+
+        * public/WebFrameClient.h:
+        (WebFrameClient):
+        * src/FrameLoaderClientImpl.cpp:
+        (WebKit):
+        * src/FrameLoaderClientImpl.h:
+        (FrameLoaderClientImpl):
+
 2012-03-19  Charlie Reis  <creis@chromium.org>
 
         [Chromium] Add registerURLSchemeAsEmptyDocument to WebSecurityPolicy
index fa6fc7a..a8886e6 100644 (file)
@@ -284,10 +284,6 @@ public:
     // A reflected XSS was encountered in the page and suppressed.
     virtual void didDetectXSS(WebFrame*, const WebURL&, bool didBlockEntirePage) { }
 
-    // This frame adopted the resource that is being loaded. This happens when
-    // an iframe, that is loading a subresource, is transferred between windows.
-    virtual void didAdoptURLLoader(WebURLLoader*) { }
-
     // Script notifications ------------------------------------------------
 
     // Script in the page tried to allocate too much memory.
index 1f8a27c..cf2c954 100644 (file)
@@ -1460,33 +1460,6 @@ PassRefPtr<Frame> FrameLoaderClientImpl::createFrame(
     return m_webFrame->createChildFrame(frameRequest, ownerElement);
 }
 
-void FrameLoaderClientImpl::didTransferChildFrameToNewDocument(Page*)
-{
-    ASSERT(m_webFrame->frame()->ownerElement());
-
-    WebFrameImpl* newParent = static_cast<WebFrameImpl*>(m_webFrame->parent());
-    if (!newParent || !newParent->client())
-        return;
-
-    // Replace the client since the old client may be destroyed when the
-    // previous page is closed.
-    m_webFrame->setClient(newParent->client());
-}
-
-void FrameLoaderClientImpl::transferLoadingResourceFromPage(ResourceLoader* loader, const ResourceRequest& request, Page* oldPage)
-{
-    assignIdentifierToInitialRequest(loader->identifier(), loader->documentLoader(), request);
-
-    WebFrameImpl* oldWebFrame = WebFrameImpl::fromFrame(oldPage->mainFrame());
-    if (oldWebFrame && oldWebFrame->client())
-        oldWebFrame->client()->removeIdentifierForRequest(loader->identifier());
-
-    ResourceHandle* handle = loader->handle();
-    WebURLLoader* webURLLoader = ResourceHandleInternal::FromResourceHandle(handle)->loader();
-    if (webURLLoader && m_webFrame->client())
-        m_webFrame->client()->didAdoptURLLoader(webURLLoader);
-}
-
 PassRefPtr<Widget> FrameLoaderClientImpl::createPlugin(
     const IntSize& size, // FIXME: how do we use this?
     HTMLPlugInElement* element,
index 53d5997..3a9ee6e 100644 (file)
@@ -177,8 +177,6 @@ public:
         WebCore::HTMLFrameOwnerElement* ownerElement,
         const WTF::String& referrer, bool allowsScrolling,
         int marginWidth, int marginHeight);
-    virtual void didTransferChildFrameToNewDocument(WebCore::Page*);
-    virtual void transferLoadingResourceFromPage(WebCore::ResourceLoader*, const WebCore::ResourceRequest&, WebCore::Page*);
     virtual PassRefPtr<WebCore::Widget> createPlugin(
         const WebCore::IntSize&, WebCore::HTMLPlugInElement*, const WebCore::KURL&,
         const Vector<WTF::String>&, const Vector<WTF::String>&,
index 14718db..5403709 100644 (file)
@@ -1,3 +1,17 @@
+2012-03-19  Adam Barth  <abarth@webkit.org>
+
+        Remove support for "magic" iframe
+        https://bugs.webkit.org/show_bug.cgi?id=81590
+
+        Reviewed by Eric Seidel.
+
+        Remove FrameLoaderClient methods that no longer exist.
+
+        * WebCoreSupport/FrameLoaderClientEfl.cpp:
+        (WebCore):
+        * WebCoreSupport/FrameLoaderClientEfl.h:
+        (FrameLoaderClientEfl):
+
 2012-03-16  Kihong Kwon  <kihong.kwon@samsung.com>
 
         Support for Battery Status API
index 0096b88..706eff2 100644 (file)
@@ -329,30 +329,6 @@ PassRefPtr<Frame> FrameLoaderClientEfl::createFrame(const KURL& url, const Strin
     return ewk_view_frame_create(m_view, m_frame, name, ownerElement, url, referrer);
 }
 
-void FrameLoaderClientEfl::didTransferChildFrameToNewDocument(Page*)
-{
-    ASSERT(m_frame);
-
-    Frame* currentFrame = EWKPrivate::coreFrame(m_frame);
-    Evas_Object* currentView = ewk_frame_view_get(m_frame);
-    Frame* parentFrame = currentFrame->tree()->parent();
-
-    FrameLoaderClientEfl* client = static_cast<FrameLoaderClientEfl*>(parentFrame->loader()->client());
-    Evas_Object* clientFrame = client ? client->webFrame() : 0;
-    Evas_Object* clientView = ewk_frame_view_get(clientFrame);
-
-    if (currentView != clientView) {
-        ewk_frame_view_set(m_frame, clientView);
-        m_view = clientView;
-    }
-
-    ASSERT(ewk_view_core_page_get(ewk_frame_view_get(m_frame)) == currentFrame->page());
-}
-
-void FrameLoaderClientEfl::transferLoadingResourceFromPage(ResourceLoader*, const ResourceRequest&, Page*)
-{
-}
-
 void FrameLoaderClientEfl::redirectDataToPlugin(Widget* pluginWidget)
 {
     ASSERT(!m_pluginView);
index af90a6f..8cfc5ab 100644 (file)
@@ -132,8 +132,6 @@ class FrameLoaderClientEfl : public FrameLoaderClient {
 
     virtual PassRefPtr<Frame> createFrame(const KURL&, const String& name, HTMLFrameOwnerElement*,
                                const String& referrer, bool allowsScrolling, int marginWidth, int marginHeight);
-    virtual void didTransferChildFrameToNewDocument(Page*);
-    virtual void transferLoadingResourceFromPage(WebCore::ResourceLoader*, const ResourceRequest&, WebCore::Page*);
 
     virtual PassRefPtr<Widget> createPlugin(const IntSize&, HTMLPlugInElement*, const KURL&, const WTF::Vector<String>&, const WTF::Vector<String>&, const String&, bool);
     virtual void redirectDataToPlugin(Widget* pluginWidget);
index c256781..ac85a58 100644 (file)
@@ -1,3 +1,17 @@
+2012-03-19  Adam Barth  <abarth@webkit.org>
+
+        Remove support for "magic" iframe
+        https://bugs.webkit.org/show_bug.cgi?id=81590
+
+        Reviewed by Eric Seidel.
+
+        Remove FrameLoaderClient methods that no longer exist.
+
+        * WebCoreSupport/FrameLoaderClientGtk.cpp:
+        (WebKit):
+        * WebCoreSupport/FrameLoaderClientGtk.h:
+        (FrameLoaderClient):
+
 2012-03-19  Gustavo Noronha Silva  <gns@gnome.org>
 
         [GTK] libWebCore.la has become too big for make
index 489de3d..5795225 100644 (file)
@@ -532,35 +532,6 @@ PassRefPtr<Frame> FrameLoaderClient::createFrame(const KURL& url, const String&
     return childFrame.release();
 }
 
-void FrameLoaderClient::didTransferChildFrameToNewDocument(WebCore::Page*)
-{
-    ASSERT(m_frame);
-
-    // Update the frame's webview to the new parent's webview.
-    Frame* coreFrame = core(m_frame);
-    WebKitWebView* webView = getViewFromFrame(m_frame);
-
-    Frame* parentCoreFrame = coreFrame->tree()->parent();
-    WebKitWebFrame* parentKitFrame = kit(parentCoreFrame);
-    WebKitWebView* parentWebView = getViewFromFrame(parentKitFrame);
-    if (webView != parentWebView)
-        m_frame->priv->webView = parentWebView;
-
-    ASSERT(core(getViewFromFrame(m_frame)) == coreFrame->page());
-}
-
-void FrameLoaderClient::transferLoadingResourceFromPage(WebCore::ResourceLoader* loader, const WebCore::ResourceRequest& request, WebCore::Page* oldPage)
-{
-    ASSERT(oldPage != core(m_frame)->page());
-
-    GOwnPtr<gchar> identifierString(toString(loader->identifier()));
-    ASSERT(!webkit_web_view_get_resource(getViewFromFrame(m_frame), identifierString.get()));
-
-    assignIdentifierToInitialRequest(loader->identifier(), loader->documentLoader(), request);
-
-    webkit_web_view_remove_resource(kit(oldPage), identifierString.get());
-}
-
 void FrameLoaderClient::redirectDataToPlugin(Widget* pluginWidget)
 {
     ASSERT(!m_pluginView);
index a2c9076..494828d 100644 (file)
@@ -115,8 +115,6 @@ namespace WebKit {
 
         virtual PassRefPtr<WebCore::Frame> createFrame(const WebCore::KURL& url, const WTF::String& name, WebCore::HTMLFrameOwnerElement* ownerElement,
                                    const WTF::String& referrer, bool allowsScrolling, int marginWidth, int marginHeight);
-        virtual void didTransferChildFrameToNewDocument(WebCore::Page*);
-        virtual void transferLoadingResourceFromPage(WebCore::ResourceLoader*, const WebCore::ResourceRequest&, WebCore::Page*);
         virtual PassRefPtr<WebCore::Widget> createPlugin(const WebCore::IntSize&, WebCore::HTMLPlugInElement*, const WebCore::KURL&, const WTF::Vector<WTF::String>&, const WTF::Vector<WTF::String>&, const WTF::String&, bool);
         virtual void redirectDataToPlugin(WebCore::Widget* pluginWidget);
         virtual PassRefPtr<WebCore::Widget> createJavaAppletWidget(const WebCore::IntSize&, WebCore::HTMLAppletElement*, const WebCore::KURL& baseURL, const WTF::Vector<WTF::String>& paramNames, const WTF::Vector<WTF::String>& paramValues);
index 6f66a5c..18a50f5 100644 (file)
@@ -1,3 +1,15 @@
+2012-03-19  Adam Barth  <abarth@webkit.org>
+
+        Remove support for "magic" iframe
+        https://bugs.webkit.org/show_bug.cgi?id=81590
+
+        Reviewed by Eric Seidel.
+
+        Remove FrameLoaderClient methods that no longer exist.
+
+        * WebCoreSupport/WebFrameLoaderClient.h:
+        * WebCoreSupport/WebFrameLoaderClient.mm:
+
 2012-03-19  Enrica Casucci  <enrica@apple.com>
 
         WebKit2: create sandbox extensions for files that are dropped in an input control.
index 11aeabd..af279b8 100644 (file)
@@ -198,8 +198,6 @@ private:
 
     virtual PassRefPtr<WebCore::Frame> createFrame(const WebCore::KURL& url, const WTF::String& name, WebCore::HTMLFrameOwnerElement*,
                                         const WTF::String& referrer, bool allowsScrolling, int marginWidth, int marginHeight) OVERRIDE;
-    virtual void didTransferChildFrameToNewDocument(WebCore::Page* oldPage) OVERRIDE;
-    virtual void transferLoadingResourceFromPage(WebCore::ResourceLoader*, const WebCore::ResourceRequest&, WebCore::Page* oldPage);
     virtual PassRefPtr<WebCore::Widget> createPlugin(const WebCore::IntSize&, WebCore::HTMLPlugInElement*, const WebCore::KURL&, const Vector<WTF::String>&,
                                           const Vector<WTF::String>&, const WTF::String&, bool) OVERRIDE;
     virtual void redirectDataToPlugin(WebCore::Widget* pluginWidget) OVERRIDE;
index 8ff420c..412a2dc 100644 (file)
@@ -1386,22 +1386,6 @@ PassRefPtr<Frame> WebFrameLoaderClient::createFrame(const KURL& url, const Strin
     return 0;
 }
 
-void WebFrameLoaderClient::didTransferChildFrameToNewDocument(Page* oldPage)
-{
-}
-
-void WebFrameLoaderClient::transferLoadingResourceFromPage(ResourceLoader* loader, const ResourceRequest& originalRequest, Page* oldPage)
-{
-    ASSERT(oldPage != core(m_webFrame.get())->page());
-
-    unsigned long identifier = loader->identifier();
-    ASSERT(![getWebView(m_webFrame.get()) _objectForIdentifier:identifier]);
-
-    assignIdentifierToInitialRequest(identifier, loader->documentLoader(), originalRequest);
-
-    [kit(oldPage) _removeObjectForIdentifier:identifier];
-}
-
 ObjectContentType WebFrameLoaderClient::objectContentType(const KURL& url, const String& mimeType, bool shouldPreferPlugInsForImages)
 {
     BEGIN_BLOCK_OBJC_EXCEPTIONS;
index f0b5d31..921e1e6 100644 (file)
@@ -1,3 +1,17 @@
+2012-03-19  Adam Barth  <abarth@webkit.org>
+
+        Remove support for "magic" iframe
+        https://bugs.webkit.org/show_bug.cgi?id=81590
+
+        Reviewed by Eric Seidel.
+
+        Remove FrameLoaderClient methods that no longer exist.
+
+        * WebCoreSupport/FrameLoaderClientQt.cpp:
+        (WebCore):
+        * WebCoreSupport/FrameLoaderClientQt.h:
+        (FrameLoaderClientQt):
+
 2012-03-19  Emil A Eklund  <eae@chromium.org>
 
         [mac/qt/chromium] Change platform code to use pixelSnappedRect methods
index 8364219..52fee3f 100644 (file)
@@ -1366,28 +1366,6 @@ PassRefPtr<Frame> FrameLoaderClientQt::createFrame(const KURL& url, const String
     return frameData.frame.release();
 }
 
-void FrameLoaderClientQt::didTransferChildFrameToNewDocument(Page*)
-{
-    ASSERT(m_frame->ownerElement());
-
-    if (!m_webFrame)
-        return;
-
-    Frame* parentFrame = m_webFrame->d->frame->tree()->parent();
-    ASSERT(parentFrame);
-
-    if (QWebFrame* parent = QWebFramePrivate::kit(parentFrame)) {
-        m_webFrame->d->setPage(parent->page());
-
-        if (m_webFrame->parent() != qobject_cast<QObject*>(parent))
-            m_webFrame->setParent(parent);
-    }
-}
-
-void FrameLoaderClientQt::transferLoadingResourceFromPage(ResourceLoader*, const ResourceRequest&, Page*)
-{
-}
-
 ObjectContentType FrameLoaderClientQt::objectContentType(const KURL& url, const String& mimeTypeIn, bool shouldPreferPlugInsForImages)
 {
     // qDebug()<<" ++++++++++++++++ url is "<<url.string()<<", mime = "<<mimeTypeIn;
index 8c5b14d..bb7160e 100644 (file)
@@ -207,8 +207,6 @@ public:
 
     virtual PassRefPtr<Frame> createFrame(const KURL& url, const String& name, HTMLFrameOwnerElement* ownerElement,
                                const String& referrer, bool allowsScrolling, int marginWidth, int marginHeight);
-    virtual void didTransferChildFrameToNewDocument(WebCore::Page*);
-    virtual void transferLoadingResourceFromPage(WebCore::ResourceLoader*, const WebCore::ResourceRequest&, WebCore::Page*);
     virtual PassRefPtr<Widget> createPlugin(const IntSize&, HTMLPlugInElement*, const KURL&, const Vector<String>&, const Vector<String>&, const String&, bool);
     virtual void redirectDataToPlugin(Widget* pluginWidget);
 
index 7850242..7f5e491 100644 (file)
@@ -1,3 +1,16 @@
+2012-03-19  Adam Barth  <abarth@webkit.org>
+
+        Remove support for "magic" iframe
+        https://bugs.webkit.org/show_bug.cgi?id=81590
+
+        Reviewed by Eric Seidel.
+
+        Remove FrameLoaderClient methods that no longer exist.
+
+        * WebCoreSupport/WebFrameLoaderClient.cpp:
+        * WebCoreSupport/WebFrameLoaderClient.h:
+        (WebFrameLoaderClient):
+
 2012-03-19  Anders Carlsson  <andersca@apple.com>
 
         Fix Windows build.
index f2e81ac..af31475 100644 (file)
@@ -762,33 +762,6 @@ PassRefPtr<Frame> WebFrameLoaderClient::createFrame(const KURL& url, const Strin
     return result.release();
 }
 
-void WebFrameLoaderClient::didTransferChildFrameToNewDocument(Page*)
-{
-    Frame* coreFrame = core(m_webFrame);
-    ASSERT(coreFrame);
-    WebView* webView = kit(coreFrame->page());
-    if (m_webFrame->webView() != webView)
-        m_webFrame->setWebView(webView);
-}
-
-void WebFrameLoaderClient::transferLoadingResourceFromPage(ResourceLoader* loader, const ResourceRequest& request, Page* oldPage)
-{
-    assignIdentifierToInitialRequest(loader->identifier(), loader->documentLoader(), request);
-
-    WebView* oldWebView = kit(oldPage);
-    if (!oldWebView)
-        return;
-
-    COMPtr<IWebResourceLoadDelegate> oldResourceLoadDelegate;
-    if (FAILED(oldWebView->resourceLoadDelegate(&oldResourceLoadDelegate)))
-        return;
-
-    COMPtr<IWebResourceLoadDelegatePrivate2> oldResourceLoadDelegatePrivate2(Query, oldResourceLoadDelegate);
-    if (!oldResourceLoadDelegatePrivate2)
-        return;
-    oldResourceLoadDelegatePrivate2->removeIdentifierForRequest(oldWebView, loader->identifier());
-}
-
 PassRefPtr<Frame> WebFrameLoaderClient::createFrame(const KURL& URL, const String& name, HTMLFrameOwnerElement* ownerElement, const String& referrer)
 {
     Frame* coreFrame = core(m_webFrame);
index e3e8953..5827852 100644 (file)
@@ -116,8 +116,6 @@ public:
 
     virtual PassRefPtr<WebCore::Frame> createFrame(const WebCore::KURL& url, const WTF::String& name, WebCore::HTMLFrameOwnerElement* ownerElement,
                                const WTF::String& referrer, bool allowsScrolling, int marginWidth, int marginHeight);
-    virtual void didTransferChildFrameToNewDocument(WebCore::Page*);
-    virtual void transferLoadingResourceFromPage(WebCore::ResourceLoader*, const WebCore::ResourceRequest&, WebCore::Page*);
     virtual PassRefPtr<WebCore::Widget> createPlugin(const WebCore::IntSize&, WebCore::HTMLPlugInElement*, const WebCore::KURL&, const Vector<WTF::String>&, const Vector<WTF::String>&, const WTF::String&, bool loadManually);
     virtual void redirectDataToPlugin(WebCore::Widget* pluginWidget);
 
index b561606..31e09b6 100644 (file)
@@ -1,3 +1,17 @@
+2012-03-19  Adam Barth  <abarth@webkit.org>
+
+        Remove support for "magic" iframe
+        https://bugs.webkit.org/show_bug.cgi?id=81590
+
+        Reviewed by Eric Seidel.
+
+        Remove FrameLoaderClient methods that no longer exist.
+
+        * WebCoreSupport/FrameLoaderClientWinCE.cpp:
+        (WebKit):
+        * WebCoreSupport/FrameLoaderClientWinCE.h:
+        (FrameLoaderClientWinCE):
+
 2012-03-13  Jon Lee  <jonlee@apple.com>
 
         Separate NOTIFICATIONS and LEGACY_NOTIFICATIONS
index 286f8b7..ca27af8 100644 (file)
@@ -172,14 +172,6 @@ PassRefPtr<Frame> FrameLoaderClientWinCE::createFrame(const KURL& url, const Str
     return m_webView->createFrame(url, name, ownerElement, referrer, allowsScrolling, marginWidth, marginHeight);
 }
 
-void FrameLoaderClientWinCE::didTransferChildFrameToNewDocument(Page*)
-{
-}
-
-void FrameLoaderClientWinCE::transferLoadingResourceFromPage(ResourceLoader*, const WebCore::ResourceRequest&, Page*)
-{
-}
-
 void FrameLoaderClientWinCE::redirectDataToPlugin(Widget* pluginWidget)
 {
     ASSERT(!m_pluginView);
index 8c2559a..087301b 100644 (file)
@@ -109,8 +109,6 @@ public:
 
     virtual PassRefPtr<WebCore::Frame> createFrame(const WebCore::KURL& url, const WTF::String& name, WebCore::HTMLFrameOwnerElement* ownerElement,
                                const WTF::String& referrer, bool allowsScrolling, int marginWidth, int marginHeight);
-    virtual void didTransferChildFrameToNewDocument(WebCore::Page*);
-    virtual void transferLoadingResourceFromPage(WebCore::ResourceLoader*, const WebCore::ResourceRequest&, WebCore::Page*);
     virtual PassRefPtr<WebCore::Widget> createPlugin(const WebCore::IntSize&, WebCore::HTMLPlugInElement*, const WebCore::KURL&, const WTF::Vector<WTF::String>&, const WTF::Vector<WTF::String>&, const WTF::String&, bool);
     virtual void redirectDataToPlugin(WebCore::Widget* pluginWidget);
     virtual PassRefPtr<WebCore::Widget> createJavaAppletWidget(const WebCore::IntSize&, WebCore::HTMLAppletElement*, const WebCore::KURL& baseURL, const WTF::Vector<WTF::String>& paramNames, const WTF::Vector<WTF::String>& paramValues);
index 450aaa5..4344534 100644 (file)
@@ -1,3 +1,17 @@
+2012-03-19  Adam Barth  <abarth@webkit.org>
+
+        Remove support for "magic" iframe
+        https://bugs.webkit.org/show_bug.cgi?id=81590
+
+        Reviewed by Eric Seidel.
+
+        Remove FrameLoaderClient methods that no longer exist.
+
+        * WebKitSupport/FrameLoaderClientWx.cpp:
+        (WebCore):
+        * WebKitSupport/FrameLoaderClientWx.h:
+        (FrameLoaderClientWx):
+
 2012-03-15  Kevin Ollivier  <kevino@theolliviers.com>
 
         Move wx port to using export macros
index 78d56be..2f120f4 100644 (file)
@@ -900,14 +900,6 @@ PassRefPtr<Frame> FrameLoaderClientWx::createFrame(const KURL& url, const String
     return childFrame.release();
 }
 
-void FrameLoaderClientWx::didTransferChildFrameToNewDocument(Page*)
-{
-}
-
-void FrameLoaderClientWx::transferLoadingResourceFromPage(ResourceLoader*, const ResourceRequest&, Page*)
-{
-}
-
 ObjectContentType FrameLoaderClientWx::objectContentType(const KURL& url, const String& mimeType, bool shouldPreferPlugInsForImages)
 {
     notImplemented();
index 4942ae8..1495c01 100644 (file)
@@ -211,8 +211,6 @@ namespace WebCore {
 
         virtual PassRefPtr<Frame> createFrame(const KURL& url, const String& name, HTMLFrameOwnerElement* ownerElement,
                                    const String& referrer, bool allowsScrolling, int marginWidth, int marginHeight);
-        virtual void didTransferChildFrameToNewDocument(Page*);
-        virtual void transferLoadingResourceFromPage(ResourceLoader*, const ResourceRequest&, Page*);
         virtual PassRefPtr<Widget> createPlugin(const IntSize&, HTMLPlugInElement*, const KURL&, const Vector<String>&, const Vector<String>&, const String&, bool loadManually) ;
         virtual void redirectDataToPlugin(Widget* pluginWidget);
         virtual ResourceError pluginWillHandleLoadError(const ResourceResponse&);
index b925ca6..422c364 100644 (file)
@@ -1,3 +1,16 @@
+2012-03-19  Adam Barth  <abarth@webkit.org>
+
+        Remove support for "magic" iframe
+        https://bugs.webkit.org/show_bug.cgi?id=81590
+
+        Reviewed by Eric Seidel.
+
+        Remove FrameLoaderClient methods that no longer exist.
+
+        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebKit):
+        * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
+
 2012-03-19  Gustavo Noronha Silva  <gns@gnome.org>
 
         [GTK] libWebCore.la has become too big for make
index d3cc094..9973808 100644 (file)
@@ -1254,16 +1254,6 @@ PassRefPtr<Frame> WebFrameLoaderClient::createFrame(const KURL& url, const Strin
     return coreSubframe;
 }
 
-void WebFrameLoaderClient::didTransferChildFrameToNewDocument(Page*)
-{
-    notImplemented();
-}
-
-void WebFrameLoaderClient::transferLoadingResourceFromPage(ResourceLoader*, const ResourceRequest&, Page*)
-{
-    notImplemented();
-}
-
 PassRefPtr<Widget> WebFrameLoaderClient::createPlugin(const IntSize&, HTMLPlugInElement* pluginElement, const KURL& url, const Vector<String>& paramNames, const Vector<String>& paramValues, const String& mimeType, bool loadManually)
 {
     ASSERT(paramNames.size() == paramValues.size());
index a93ecee..8a50192 100644 (file)
@@ -183,8 +183,6 @@ private:
     
     virtual PassRefPtr<WebCore::Frame> createFrame(const WebCore::KURL& url, const String& name, WebCore::HTMLFrameOwnerElement* ownerElement,
                                           const String& referrer, bool allowsScrolling, int marginWidth, int marginHeight) OVERRIDE;
-    virtual void didTransferChildFrameToNewDocument(WebCore::Page*) OVERRIDE;
-    virtual void transferLoadingResourceFromPage(WebCore::ResourceLoader*, const WebCore::ResourceRequest&, WebCore::Page*) OVERRIDE;
     
     virtual PassRefPtr<WebCore::Widget> createPlugin(const WebCore::IntSize&, WebCore::HTMLPlugInElement*, const WebCore::KURL&, const Vector<String>&, const Vector<String>&, const String&, bool loadManually) OVERRIDE;
     virtual void redirectDataToPlugin(WebCore::Widget* pluginWidget) OVERRIDE;