[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

commit-queue at webkit.org commit-queue at webkit.org
Wed Dec 22 14:33:42 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit fd59b6e511c752febb87db485d79f71899192af1
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Oct 13 09:03:44 2010 +0000

    2010-10-13  Jenn Braithwaite  <jennb at chromium.org>
    
            Reviewed by Dmitry Titov.
    
            Make resource identifiers unique across pages
            https://bugs.webkit.org/show_bug.cgi?id=47002
    
            * http/tests/misc/iframe-reparenting-id-collision-expected.txt: Added.
            * http/tests/misc/iframe-reparenting-id-collision.html: Added.
            * http/tests/misc/resources/iframe-reparenting-id-collision-page.html: Added.
            * http/tests/misc/resources/send-async-xhr.html: Added.
    2010-10-13  Jenn Braithwaite  <jennb at chromium.org>
    
            Reviewed by Dmitry Titov.
    
            Make resource identifiers unique across pages
            https://bugs.webkit.org/show_bug.cgi?id=47002
    
            Test: http/tests/misc/iframe-reparenting-id-collision.html
    
            * loader/ProgressTracker.cpp:
            (WebCore::ProgressTracker::ProgressTracker):
            (WebCore::ProgressTracker::createUniqueIdentifier):
            * loader/ProgressTracker.h:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@69643 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index ae90849..0990a6e 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,15 @@
+2010-10-13  Jenn Braithwaite  <jennb at chromium.org>
+
+        Reviewed by Dmitry Titov.
+
+        Make resource identifiers unique across pages
+        https://bugs.webkit.org/show_bug.cgi?id=47002
+
+        * http/tests/misc/iframe-reparenting-id-collision-expected.txt: Added.
+        * http/tests/misc/iframe-reparenting-id-collision.html: Added.
+        * http/tests/misc/resources/iframe-reparenting-id-collision-page.html: Added.
+        * http/tests/misc/resources/send-async-xhr.html: Added.
+
 2010-10-12  Roland Steiner  <rolandsteiner at chromium.org>
 
         Reviewed by Davit Hyatt.
diff --git a/LayoutTests/http/tests/misc/iframe-reparenting-id-collision-expected.txt b/LayoutTests/http/tests/misc/iframe-reparenting-id-collision-expected.txt
new file mode 100644
index 0000000..d0cd191
--- /dev/null
+++ b/LayoutTests/http/tests/misc/iframe-reparenting-id-collision-expected.txt
@@ -0,0 +1,8 @@
+This test checks that resource ids are unique across pages by opening two pages that both contain an iframe that loads the same number of resources, then adopting the iframe from one page to the other. If resource ids are not unique across pages, these pages will have the same resource ids and the adoptNode will fail due to an id collision. The iframe is then adopted back into its original page to check for id collision from failure to properly remove its resource id from the original page.
+
+Started loading iframe XHR request.
+Started loading iframe XHR request.
+Beginning adoption sequence.
+PASS: adopted node without id collision
+PASS: adopted back to original page without id collision
+
diff --git a/LayoutTests/http/tests/misc/iframe-reparenting-id-collision.html b/LayoutTests/http/tests/misc/iframe-reparenting-id-collision.html
new file mode 100644
index 0000000..3eecc15
--- /dev/null
+++ b/LayoutTests/http/tests/misc/iframe-reparenting-id-collision.html
@@ -0,0 +1,78 @@
+<html>
+<script>
+
+var w1, w2;
+var iframeXHRCount = 0;
+
+if (window.layoutTestController) {
+    layoutTestController.dumpAsText();
+    layoutTestController.waitUntilDone();
+    layoutTestController.setCanOpenWindows(true);
+}
+
+function log(message)
+{
+    document.getElementById("log").innerText += message + "\n";
+}
+
+iframeXHRFinished = function()
+{
+    log("FAIL: Iframe XHR request should never finish loading!");
+    notifyDone();
+}
+
+iframeXHRStarted = function()
+{
+    log("Started loading iframe XHR request.");
+    ++iframeXHRCount;
+
+    if (iframeXHRCount < 2)
+        return;
+
+    log("Beginning adoption sequence.");
+
+    // First adoptNode will have an id collision if resource ids are not
+    // unique across pages.
+    var f = w1.document.getElementsByTagName("iframe")[0];
+    w2.document.adoptNode(f);
+    w2.document.body.appendChild(f);
+
+    log("PASS: adopted node without id collision");
+
+    // Adopt node back to its original page to verify that the resource id
+    // for the iframe was properly removed from its original page.
+    w1.document.adoptNode(f);
+    w1.document.body.appendChild(f);
+
+    log("PASS: adopted back to original page without id collision");
+
+    notifyDone();
+}
+
+function notifyDone()
+{
+    w1.close();
+    w2.close();
+
+    if (window.layoutTestController)
+        layoutTestController.notifyDone();
+}
+
+function test()
+{
+    w1 = window.open("resources/iframe-reparenting-id-collision-page.html");
+    w2 = window.open("resources/iframe-reparenting-id-collision-page.html");
+}
+
+</script>
+<body onload="test()">
+<p>This test checks that resource ids are unique across pages by opening
+two pages that both contain an iframe that loads the same number of
+resources, then adopting the iframe from one page to the other. If resource
+ids are not unique across pages, these pages will have the same resource ids 
+and the adoptNode will fail due to an id collision. The iframe is then 
+adopted back into its original page to check for id collision from failure
+to properly remove its resource id from the original page. </p>
+<pre id=log></pre>
+</body>
+</html>
diff --git a/LayoutTests/http/tests/misc/resources/iframe-reparenting-id-collision-page.html b/LayoutTests/http/tests/misc/resources/iframe-reparenting-id-collision-page.html
new file mode 100644
index 0000000..d22ef93
--- /dev/null
+++ b/LayoutTests/http/tests/misc/resources/iframe-reparenting-id-collision-page.html
@@ -0,0 +1,16 @@
+<html>
+<script>
+requestSent = function()
+{
+    opener.iframeXHRStarted();
+}
+
+requestLoaded = function()
+{
+    opener.iframeXHRFinished();
+}
+</script>
+<body>
+<iframe src="send-async-xhr.html"></iframe>
+</body>
+</html>
diff --git a/LayoutTests/http/tests/misc/resources/send-async-xhr.html b/LayoutTests/http/tests/misc/resources/send-async-xhr.html
new file mode 100644
index 0000000..2821a8f
--- /dev/null
+++ b/LayoutTests/http/tests/misc/resources/send-async-xhr.html
@@ -0,0 +1,7 @@
+<script>
+var req = new XMLHttpRequest();
+req.open("GET", "hang-connection.php", true);
+req.onload = parent.requestLoaded;
+req.send(null);
+parent.requestSent();
+</script>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 79ebec1..130bde4 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,17 @@
+2010-10-13  Jenn Braithwaite  <jennb at chromium.org>
+
+        Reviewed by Dmitry Titov.
+
+        Make resource identifiers unique across pages
+        https://bugs.webkit.org/show_bug.cgi?id=47002
+
+        Test: http/tests/misc/iframe-reparenting-id-collision.html
+
+        * loader/ProgressTracker.cpp:
+        (WebCore::ProgressTracker::ProgressTracker):
+        (WebCore::ProgressTracker::createUniqueIdentifier):
+        * loader/ProgressTracker.h:
+
 2010-10-12  Roland Steiner  <rolandsteiner at chromium.org>
 
         Reviewed by David Hyatt.
diff --git a/WebCore/loader/ProgressTracker.cpp b/WebCore/loader/ProgressTracker.cpp
index 7f61cd1..561e6bc 100644
--- a/WebCore/loader/ProgressTracker.cpp
+++ b/WebCore/loader/ProgressTracker.cpp
@@ -59,9 +59,10 @@ struct ProgressItem : Noncopyable {
     long long estimatedLength;
 };
 
+unsigned long ProgressTracker::s_uniqueIdentifier = 0;
+
 ProgressTracker::ProgressTracker()
-    : m_uniqueIdentifier(0)
-    , m_totalPageAndResourceBytesToLoad(0)
+    : m_totalPageAndResourceBytesToLoad(0)
     , m_totalBytesReceived(0)
     , m_lastNotifiedProgressValue(0)
     , m_lastNotifiedProgressTime(0)
@@ -255,7 +256,7 @@ void ProgressTracker::completeProgress(unsigned long identifier)
 
 unsigned long ProgressTracker::createUniqueIdentifier()
 {
-    return ++m_uniqueIdentifier;
+    return ++s_uniqueIdentifier;
 }
 
 
diff --git a/WebCore/loader/ProgressTracker.h b/WebCore/loader/ProgressTracker.h
index 744e101..5d5b6b2 100644
--- a/WebCore/loader/ProgressTracker.h
+++ b/WebCore/loader/ProgressTracker.h
@@ -41,7 +41,7 @@ public:
     ProgressTracker();
     ~ProgressTracker();
     
-    unsigned long createUniqueIdentifier();
+    static unsigned long createUniqueIdentifier();
 
     double estimatedProgress() const;
 
@@ -59,7 +59,7 @@ private:
     void reset();
     void finalProgressComplete();
     
-    unsigned long m_uniqueIdentifier;
+    static unsigned long s_uniqueIdentifier;
     
     long long m_totalPageAndResourceBytesToLoad;
     long long m_totalBytesReceived;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list