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

abarth at webkit.org abarth at webkit.org
Wed Dec 22 18:26:51 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 905a949243f815ca6f2eda980a4d19c5554aecaa
Author: abarth at webkit.org <abarth at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sat Dec 11 00:12:35 2010 +0000

    2010-12-10  Adam Barth  <abarth at webkit.org>
    
            Reviewed by Eric Seidel.
    
            REGRESSION: Infinite redirect on developer.apple.com
            https://bugs.webkit.org/show_bug.cgi?id=45627
    
            Tests: fast/loader/form-submit-aborts-parsing.html
                   fast/loader/location-change-aborts-parsing.html
    
            This patch is not pretty, but it fixes the bug.  I stole this approach
            from the old HTML parser (as suggested by Eric Seidel).  The other
            approaches that folks tried for this bug are better, but it's inclear
            how to get them to work correctly.  I've added a large FIXME comment.
    
            * html/parser/HTMLDocumentParser.cpp:
            (WebCore::HTMLDocumentParser::pumpTokenizer):
            * html/parser/HTMLTreeBuilder.h:
            (WebCore::HTMLTreeBuilder::isParsingFragment):
    2010-12-10  Adam Barth  <abarth at webkit.org>
    
            Reviewed by Eric Seidel.
    
            REGRESSION: Infinite redirect on developer.apple.com
            https://bugs.webkit.org/show_bug.cgi?id=45627
    
            Tests originally by Tony Gentilcore.
    
            * fast/loader/form-submit-aborts-parsing-expected.txt: Added.
            * fast/loader/form-submit-aborts-parsing.html: Added.
            * fast/loader/location-change-aborts-parsing-expected.txt: Added.
            * fast/loader/location-change-aborts-parsing.html: Added.
            * fast/loader/resources/location-change-aborts-parsing-fail.html: Added.
            * fast/loader/resources/location-change-aborts-parsing-pass.html: Added.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73817 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index c38463c..0d0048b 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,19 @@
+2010-12-10  Adam Barth  <abarth at webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        REGRESSION: Infinite redirect on developer.apple.com
+        https://bugs.webkit.org/show_bug.cgi?id=45627
+
+        Tests originally by Tony Gentilcore.
+
+        * fast/loader/form-submit-aborts-parsing-expected.txt: Added.
+        * fast/loader/form-submit-aborts-parsing.html: Added.
+        * fast/loader/location-change-aborts-parsing-expected.txt: Added.
+        * fast/loader/location-change-aborts-parsing.html: Added.
+        * fast/loader/resources/location-change-aborts-parsing-fail.html: Added.
+        * fast/loader/resources/location-change-aborts-parsing-pass.html: Added.
+
 2010-12-10  Kenneth Russell  <kbr at google.com>
 
         Reviewed by James Robinson.
diff --git a/LayoutTests/compositing/overflow/get-transform-from-non-box-container-expected.txt b/LayoutTests/fast/loader/form-submit-aborts-parsing-expected.txt
similarity index 100%
copy from LayoutTests/compositing/overflow/get-transform-from-non-box-container-expected.txt
copy to LayoutTests/fast/loader/form-submit-aborts-parsing-expected.txt
diff --git a/LayoutTests/fast/loader/form-submit-aborts-parsing.html b/LayoutTests/fast/loader/form-submit-aborts-parsing.html
new file mode 100644
index 0000000..3abc34e
--- /dev/null
+++ b/LayoutTests/fast/loader/form-submit-aborts-parsing.html
@@ -0,0 +1,10 @@
+<form method="POST" action="resources/location-change-aborts-parsing-pass.html"></form>
+<script>
+if (window.layoutTestController) {
+    layoutTestController.dumpAsText();
+    layoutTestController.waitUntilDone();
+}
+document.forms[0].submit();
+</script>
+FAIL: Parsing did not abort on a form submit.
+<meta http-equiv="refresh" content='0,resources/location-change-aborts-parsing-fail.html'>
diff --git a/LayoutTests/compositing/overflow/get-transform-from-non-box-container-expected.txt b/LayoutTests/fast/loader/location-change-aborts-parsing-expected.txt
similarity index 100%
copy from LayoutTests/compositing/overflow/get-transform-from-non-box-container-expected.txt
copy to LayoutTests/fast/loader/location-change-aborts-parsing-expected.txt
diff --git a/LayoutTests/fast/loader/location-change-aborts-parsing.html b/LayoutTests/fast/loader/location-change-aborts-parsing.html
new file mode 100644
index 0000000..f4e6d41
--- /dev/null
+++ b/LayoutTests/fast/loader/location-change-aborts-parsing.html
@@ -0,0 +1,9 @@
+<script>
+if (window.layoutTestController) {
+    layoutTestController.dumpAsText();
+    layoutTestController.waitUntilDone();
+}
+window.location.href = 'resources/location-change-aborts-parsing-pass.html';
+</script>
+FAIL: Parsing did not abort on a location change.
+<meta http-equiv="refresh" content='0,resources/location-change-aborts-parsing-fail.html'>
diff --git a/LayoutTests/fast/loader/resources/location-change-aborts-parsing-fail.html b/LayoutTests/fast/loader/resources/location-change-aborts-parsing-fail.html
new file mode 100644
index 0000000..8935f11
--- /dev/null
+++ b/LayoutTests/fast/loader/resources/location-change-aborts-parsing-fail.html
@@ -0,0 +1,5 @@
+<script>
+if (window.layoutTestController)
+    layoutTestController.notifyDone();
+</script>
+FAIL
diff --git a/LayoutTests/fast/loader/resources/location-change-aborts-parsing-pass.html b/LayoutTests/fast/loader/resources/location-change-aborts-parsing-pass.html
new file mode 100644
index 0000000..9fcd5f7
--- /dev/null
+++ b/LayoutTests/fast/loader/resources/location-change-aborts-parsing-pass.html
@@ -0,0 +1,5 @@
+<script>
+if (window.layoutTestController)
+    layoutTestController.notifyDone();
+</script>
+PASS
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 315f2bf..1326279 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,23 @@
+2010-12-10  Adam Barth  <abarth at webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        REGRESSION: Infinite redirect on developer.apple.com
+        https://bugs.webkit.org/show_bug.cgi?id=45627
+
+        Tests: fast/loader/form-submit-aborts-parsing.html
+               fast/loader/location-change-aborts-parsing.html
+
+        This patch is not pretty, but it fixes the bug.  I stole this approach
+        from the old HTML parser (as suggested by Eric Seidel).  The other
+        approaches that folks tried for this bug are better, but it's inclear
+        how to get them to work correctly.  I've added a large FIXME comment.
+
+        * html/parser/HTMLDocumentParser.cpp:
+        (WebCore::HTMLDocumentParser::pumpTokenizer):
+        * html/parser/HTMLTreeBuilder.h:
+        (WebCore::HTMLTreeBuilder::isParsingFragment):
+
 2010-12-10  Brian Weinstein  <bweinstein at apple.com>
 
         Reviewed by Ada Chan.
diff --git a/WebCore/html/parser/HTMLDocumentParser.cpp b/WebCore/html/parser/HTMLDocumentParser.cpp
index d169417..c32f9db 100644
--- a/WebCore/html/parser/HTMLDocumentParser.cpp
+++ b/WebCore/html/parser/HTMLDocumentParser.cpp
@@ -217,6 +217,15 @@ void HTMLDocumentParser::pumpTokenizer(SynchronousMode mode)
     HTMLParserScheduler::PumpSession session;
     // FIXME: This loop body has is now too long and needs cleanup.
     while (mode == ForceSynchronous || m_parserScheduler->shouldContinueParsing(session)) {
+        // FIXME: It's wrong for the HTMLDocumentParser to reach back to the
+        //        Frame, but this approach is how the old parser handled
+        //        stopping when the page assigns window.location.  What really
+        //        should happen is that assigning window.location causes the
+        //        parser to stop parsing cleanly.  The problem is we're not
+        //        perpared to do that at every point where we run JavaScript.
+        if (!m_treeBuilder->isParsingFragment()
+            && document()->frame() && document()->frame()->navigationScheduler()->locationChangePending())
+            break;
         if (!m_tokenizer->nextToken(m_input.current(), m_token))
             break;
 
diff --git a/WebCore/html/parser/HTMLTreeBuilder.h b/WebCore/html/parser/HTMLTreeBuilder.h
index 0e7597c..ebed810 100644
--- a/WebCore/html/parser/HTMLTreeBuilder.h
+++ b/WebCore/html/parser/HTMLTreeBuilder.h
@@ -62,6 +62,8 @@ public:
     }
     ~HTMLTreeBuilder();
 
+    bool isParsingFragment() const { return !!m_fragmentContext.fragment(); }
+
     void detach();
 
     void setPaused(bool paused) { m_isPaused = paused; }
@@ -114,8 +116,6 @@ private:
     HTMLTreeBuilder(HTMLTokenizer*, HTMLDocument*, bool reportErrors, bool usePreHTML5ParserQuirks);
     HTMLTreeBuilder(HTMLTokenizer*, DocumentFragment*, Element* contextElement, FragmentScriptingPermission, bool usePreHTML5ParserQuirks);
 
-    bool isParsingFragment() const { return !!m_fragmentContext.fragment(); }
-
     void processToken(AtomicHTMLToken&);
 
     void processDoctypeToken(AtomicHTMLToken&);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list