Changeset 172275 in webkit


Ignore:
Timestamp:
Aug 7, 2014 2:39:19 PM (10 years ago)
Author:
dbates@webkit.org
Message:

Sometimes Gmail cannot load messages, particularly on refresh ("...the application ran into an unexpected error...")
https://bugs.webkit.org/show_bug.cgi?id=135688
<rdar://problem/17886686>

Reviewed by Alexey Proskuryakov.

Fixes an issue where gmail.com may fail to load the list of messages. In particular, a SQLTransactionCallback
function may not be executed and hence Gmail will not display the list of messages and
will subsequently display an error message.

When a WebKit client defers loading of a page (e.g. -[WebView setDefersCallbacks:YES]), WebCore
may still load the main resource, say if substitute data is available for it, and defer executing
tasks, such as a SQLTransactionCallback function, by appending such tasks to the end of the list
of pending tasks for the associated Document. This list of pending tasks is never processed when
a client subsequently allows loading (e.g. -[WebView setDefersCallbacks:NO])). Therefore, we never
execute a SQLTransactionCallback function that was deferred.

Ideally WebCore would defer loading of substitute data when a WebKit client requests that loading
be deferred and hence a SQLTransactionCallback function would be deferred as a consequence of the
lack of JavaScript script execution (since substitute data wasn't loaded and hence any JavaScript
script contained in the substitute data that initiates a SQL transaction isn't executed). For now,
it's sufficient to only defer executing tasks when either there are existing pending tasks or the
page defers loading and active DOM objects in the document are suspended (e.g. Document::suspendActiveDOMObjects() was called).

  • dom/Document.cpp:

(WebCore::Document::postTask):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r172259 r172275  
     12014-08-07  Daniel Bates  <dabates@apple.com>
     2
     3        Sometimes Gmail cannot load messages, particularly on refresh ("...the application ran into an unexpected error...")
     4        https://bugs.webkit.org/show_bug.cgi?id=135688
     5        <rdar://problem/17886686>
     6
     7        Reviewed by Alexey Proskuryakov.
     8
     9        Fixes an issue where gmail.com may fail to load the list of messages. In particular, a SQLTransactionCallback
     10        function may not be executed and hence Gmail will not display the list of messages and
     11        will subsequently display an error message.
     12
     13        When a WebKit client defers loading of a page (e.g. -[WebView setDefersCallbacks:YES]), WebCore
     14        may still load the main resource, say if substitute data is available for it, and defer executing
     15        tasks, such as a SQLTransactionCallback function, by appending such tasks to the end of the list
     16        of pending tasks for the associated Document. This list of pending tasks is never processed when
     17        a client subsequently allows loading (e.g. -[WebView setDefersCallbacks:NO])). Therefore, we never
     18        execute a SQLTransactionCallback function that was deferred.
     19
     20        Ideally WebCore would defer loading of substitute data when a WebKit client requests that loading
     21        be deferred and hence a SQLTransactionCallback function would be deferred as a consequence of the
     22        lack of JavaScript script execution (since substitute data wasn't loaded and hence any JavaScript
     23        script contained in the substitute data that initiates a SQL transaction isn't executed). For now,
     24        it's sufficient to only defer executing tasks when either there are existing pending tasks or the
     25        page defers loading and active DOM objects in the document are suspended (e.g. Document::suspendActiveDOMObjects() was called).
     26
     27        * dom/Document.cpp:
     28        (WebCore::Document::postTask):
     29
    1302014-08-07  Benjamin Poulain  <bpoulain@apple.com>
    231
  • trunk/Source/WebCore/dom/Document.cpp

    r172225 r172275  
    49174917
    49184918        Page* page = document->page();
    4919         if ((page && page->defersLoading()) || !document->m_pendingTasks.isEmpty())
     4919        if ((page && page->defersLoading() && document->activeDOMObjectsAreSuspended()) || !document->m_pendingTasks.isEmpty())
    49204920            document->m_pendingTasks.append(WTF::move(*task.release()));
    49214921        else
Note: See TracChangeset for help on using the changeset viewer.