Changeset 143664 in webkit


Ignore:
Timestamp:
Feb 21, 2013 4:39:36 PM (11 years ago)
Author:
eric@webkit.org
Message:

LayoutTests/fast/encoding/parser-tests-*.html timeout with threaded HTML parser
https://bugs.webkit.org/show_bug.cgi?id=109995

Reviewed by Adam Barth.

Source/WebCore:

In the case where during main document onload, we
load a new iframe, and then from within that iframe
we run script to remove the iframe and call testRunner.notifyDone()
the notifyDone() will not correctly dump because
the testRunner does not yet realize that the main resource
has completed loading.

In the main-thread parser, the testRunner does correctly know
that the main thread has completed, because removing the iframe
causes a didFailLoad callback to the embedder, because when
the iframe is being removed, the DocumentLoader for that iframe
is still on the stack and believe's its loading
(because it has a MainResourceLoader which is also on the stack
delivering us the bytes which contain this inline script).

In the threaded-parser case, the DocumentLoader and MainResourceLoader
are no longer on the stack, as we are parsing the iframe asynchronously
after all the bytes have been delivered, and the MainResourceLoader destroyed.
Thus when DocumentLoader::stopLoading() is called, loading() returns
false, and it returns early. One might argue that we should remove that
early return entirely, but it seemed safer to extend the idea of
when we're loading to include the time when the parser is active.

This patch solves this by teaching the DocumentLoader that it is still
"loading" so long as the parser is still active.

Also added a call to DocumentLoader::checkLoadComplete from
Document::decrementActiveParserCount which seemed to cause
http/tests/multipart/policy-ignore-crash.php to pass.

This causes http/tests/security/feed-urls-from-remote.html to timeout
on chromium (but no other platforms that I'm aware of). I believe this
is due to a bug in our DRT implementation in the policyDelegate case
(which AFAIK is not a codepath which Chromium actually uses in the wild).
The test already times out on TOT if you remove the setCustomPolicyDelegate calls!

  • loader/DocumentLoader.cpp:

(WebCore::DocumentLoader::isLoading):
(WebCore):

  • loader/DocumentLoader.h:

(DocumentLoader):

LayoutTests:

Mark http/tests/security/feed-urls-from-remote.html as timeout on chromium.
I believe this is due to a bug in our DRT implementation in the policyDelegate case
(which AFAIK is not a codepath which Chromium actually uses in the wild).
The test already times out on TOT if you remove the setCustomPolicyDelegate calls.

  • platform/chromium/TestExpectations:
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r143663 r143664  
     12013-02-21  Eric Seidel  <eric@webkit.org>
     2
     3        LayoutTests/fast/encoding/parser-tests-*.html timeout with threaded HTML parser
     4        https://bugs.webkit.org/show_bug.cgi?id=109995
     5
     6        Reviewed by Adam Barth.
     7
     8        Mark http/tests/security/feed-urls-from-remote.html as timeout on chromium.
     9        I believe this is due to a bug in our DRT implementation in the policyDelegate case
     10        (which AFAIK is not a codepath which Chromium actually uses in the wild).
     11        The test already times out on TOT if you remove the setCustomPolicyDelegate calls.
     12
     13        * platform/chromium/TestExpectations:
     14
    1152013-02-21  Erik Arvidsson  <arv@chromium.org>
    216
  • trunk/LayoutTests/platform/chromium/TestExpectations

    r143651 r143664  
    587587storage/indexeddb/basics-shared-workers.html [ WontFix ]
    588588
     589webkit.org/b/110401 http/tests/security/feed-urls-from-remote.html [ Timeout ]
     590
    589591# test_shell does not support message ports
    590592webkit.org/b/74459 fast/workers/termination-with-port-messages.html
  • trunk/Source/WebCore/ChangeLog

    r143663 r143664  
     12013-02-21  Eric Seidel  <eric@webkit.org>
     2
     3        LayoutTests/fast/encoding/parser-tests-*.html timeout with threaded HTML parser
     4        https://bugs.webkit.org/show_bug.cgi?id=109995
     5
     6        Reviewed by Adam Barth.
     7
     8        In the case where during main document onload, we
     9        load a new iframe, and then from within that iframe
     10        we run script to remove the iframe and call testRunner.notifyDone()
     11        the notifyDone() will not correctly dump because
     12        the testRunner does not yet realize that the main resource
     13        has completed loading.
     14
     15        In the main-thread parser, the testRunner does correctly know
     16        that the main thread has completed, because removing the iframe
     17        causes a didFailLoad callback to the embedder, because when
     18        the iframe is being removed, the DocumentLoader for that iframe
     19        is still on the stack and believe's its loading
     20        (because it has a MainResourceLoader which is also on the stack
     21        delivering us the bytes which contain this inline script).
     22
     23        In the threaded-parser case, the DocumentLoader and MainResourceLoader
     24        are no longer on the stack, as we are parsing the iframe asynchronously
     25        after all the bytes have been delivered, and the MainResourceLoader destroyed.
     26        Thus when DocumentLoader::stopLoading() is called, loading() returns
     27        false, and it returns early.  One might argue that we should remove that
     28        early return entirely, but it seemed safer to extend the idea of
     29        when we're loading to include the time when the parser is active.
     30
     31        This patch solves this by teaching the DocumentLoader that it is still
     32        "loading" so long as the parser is still active.
     33
     34        Also added a call to DocumentLoader::checkLoadComplete from
     35        Document::decrementActiveParserCount which seemed to cause
     36        http/tests/multipart/policy-ignore-crash.php to pass.
     37
     38        This causes http/tests/security/feed-urls-from-remote.html to timeout
     39        on chromium (but no other platforms that I'm aware of).  I believe this
     40        is due to a bug in our DRT implementation in the policyDelegate case
     41        (which AFAIK is not a codepath which Chromium actually uses in the wild).
     42        The test already times out on TOT if you remove the setCustomPolicyDelegate calls!
     43
     44        * loader/DocumentLoader.cpp:
     45        (WebCore::DocumentLoader::isLoading):
     46        (WebCore):
     47        * loader/DocumentLoader.h:
     48        (DocumentLoader):
     49
    1502013-02-21  Erik Arvidsson  <arv@chromium.org>
    251
  • trunk/Source/WebCore/dom/Document.cpp

    r143533 r143664  
    57745774    if (!frame())
    57755775        return;
     5776    loader()->checkLoadComplete();
    57765777    frame()->loader()->checkLoadComplete();
    57775778}
  • trunk/Source/WebCore/loader/DocumentLoader.cpp

    r142555 r143664  
    279279}
    280280
     281bool DocumentLoader::isLoading() const
     282{
     283    if (m_frame->document() && m_frame->document()->hasActiveParser())
     284        return true;
     285    return isLoadingMainResource() || !m_subresourceLoaders.isEmpty() || !m_plugInStreamLoaders.isEmpty();
     286}
     287
    281288void DocumentLoader::finishedLoading()
    282289{
  • trunk/Source/WebCore/loader/DocumentLoader.h

    r141603 r143664  
    115115        void setCommitted(bool committed) { m_committed = committed; }
    116116        bool isCommitted() const { return m_committed; }
    117         bool isLoading() const { return isLoadingMainResource() || !m_subresourceLoaders.isEmpty() || !m_plugInStreamLoaders.isEmpty(); }
     117        bool isLoading() const;
    118118        void receivedData(const char*, int);
    119119        void setupForReplace();
     
    248248
    249249        virtual void reportMemoryUsage(MemoryObjectInfo*) const;
     250        void checkLoadComplete();
    250251
    251252    protected:
     
    258259        void setMainDocumentError(const ResourceError&);
    259260        void commitLoad(const char*, int);
    260         void checkLoadComplete();
    261261        void clearMainResourceLoader();
    262262       
Note: See TracChangeset for help on using the changeset viewer.