Title: [118086] trunk/Source
Revision
118086
Author
[email protected]
Date
2012-05-22 17:21:25 -0700 (Tue, 22 May 2012)

Log Message

Add a quirk for applications that depend on the relative ordering of progressCompleted/didFinishLoad
https://bugs.webkit.org/show_bug.cgi?id=87178
<rdar://problem/11468434>

Reviewed by Maciej Stachowiak.

Some applications depend on the relative ordering of progressCompleted/didFinishLoad, which was changed
to be more correct in http://trac.webkit.org/changeset/94105. For applications built before 94105, we can
provide the old behavior. For the time being, this will only apply to Mail.app.

No new tests, will not affect behavior for any application except Mail.

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::checkLoadCompleteForThisFrame):
* page/Settings.cpp:
(WebCore::Settings::Settings):
* page/Settings.h:
(WebCore::Settings::setNeedsDidFinishLoadOrderQuirk):
(WebCore::Settings::needsDidFinishLoadOrderQuirk):

Add plumbing for the quirk to flip the relative ordering of progressCompleted/didFinishLoad back
to the behavior before http://trac.webkit.org/changeset/94105. Make it apply to any Mail.app linked
against WebKit before that revision.

* Misc/WebKitVersionChecks.h:
* WebView/WebView.mm:
(-[WebView _needsDidFinishLoadOrderQuirk]):
(-[WebView _preferencesChanged:]):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (118085 => 118086)


--- trunk/Source/WebCore/ChangeLog	2012-05-23 00:21:07 UTC (rev 118085)
+++ trunk/Source/WebCore/ChangeLog	2012-05-23 00:21:25 UTC (rev 118086)
@@ -1,3 +1,25 @@
+2012-05-22  Tim Horton  <[email protected]>
+
+        Add a quirk for applications that depend on the relative ordering of progressCompleted/didFinishLoad
+        https://bugs.webkit.org/show_bug.cgi?id=87178
+        <rdar://problem/11468434>
+
+        Reviewed by Maciej Stachowiak.
+
+        Some applications depend on the relative ordering of progressCompleted/didFinishLoad, which was changed
+        to be more correct in http://trac.webkit.org/changeset/94105. For applications built before 94105, we can
+        provide the old behavior. For the time being, this will only apply to Mail.app.
+
+        No new tests, will not affect behavior for any application except Mail.
+
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::checkLoadCompleteForThisFrame):
+        * page/Settings.cpp:
+        (WebCore::Settings::Settings):
+        * page/Settings.h:
+        (WebCore::Settings::setNeedsDidFinishLoadOrderQuirk):
+        (WebCore::Settings::needsDidFinishLoadOrderQuirk):
+
 2012-05-22  Alexis Menard  <[email protected]>
 
         Move some CSS regions properties to CSSParser::isValidKeywordPropertyAndValue.

Modified: trunk/Source/WebCore/loader/FrameLoader.cpp (118085 => 118086)


--- trunk/Source/WebCore/loader/FrameLoader.cpp	2012-05-23 00:21:07 UTC (rev 118085)
+++ trunk/Source/WebCore/loader/FrameLoader.cpp	2012-05-23 00:21:25 UTC (rev 118086)
@@ -2017,6 +2017,8 @@
 {
     ASSERT(m_client->hasWebView());
 
+    Settings* settings = m_frame->settings();
+
     switch (m_state) {
         case FrameStateProvisional: {
             if (m_delegateIsHandlingProvisionalLoadError)
@@ -2091,11 +2093,13 @@
             if (m_stateMachine.creatingInitialEmptyDocument() || !m_stateMachine.committedFirstRealDocumentLoad())
                 return;
 
-            if (Page* page = m_frame->page()) {
-                page->progress()->progressCompleted(m_frame);
+            if (!settings->needsDidFinishLoadOrderQuirk()) {
+                if (Page* page = m_frame->page()) {
+                    page->progress()->progressCompleted(m_frame);
 
-                if (m_frame == page->mainFrame())
-                    page->resetRelevantPaintedObjectCounter();
+                    if (m_frame == page->mainFrame())
+                        page->resetRelevantPaintedObjectCounter();
+                }
             }
 
             const ResourceError& error = dl->mainDocumentError();
@@ -2109,6 +2113,15 @@
                 loadingEvent = AXObjectCache::AXLoadingFinished;
             }
 
+            if (settings->needsDidFinishLoadOrderQuirk()) {
+                if (Page* page = m_frame->page()) {
+                    page->progress()->progressCompleted(m_frame);
+
+                    if (m_frame == page->mainFrame())
+                        page->resetRelevantPaintedObjectCounter();
+                }
+            }
+
             // Notify accessibility.
             if (AXObjectCache::accessibilityEnabled())
                 m_frame->document()->axObjectCache()->frameLoadingEventNotification(m_frame, loadingEvent);

Modified: trunk/Source/WebCore/page/Settings.cpp (118085 => 118086)


--- trunk/Source/WebCore/page/Settings.cpp	2012-05-23 00:21:07 UTC (rev 118085)
+++ trunk/Source/WebCore/page/Settings.cpp	2012-05-23 00:21:25 UTC (rev 118086)
@@ -267,6 +267,7 @@
     , m_shouldRespectImageOrientation(false)
     , m_wantsBalancedSetDefersLoadingBehavior(false)
     , m_requestAnimationFrameEnabled(true)
+    , m_needsDidFinishLoadOrderQuirk(false)
     , m_loadsImagesAutomaticallyTimer(this, &Settings::loadsImagesAutomaticallyTimerFired)
     , m_incrementalRenderingSuppressionTimeoutInSeconds(defaultIncrementalRenderingSuppressionTimeoutInSeconds)
 {

Modified: trunk/Source/WebCore/page/Settings.h (118085 => 118086)


--- trunk/Source/WebCore/page/Settings.h	2012-05-23 00:21:07 UTC (rev 118085)
+++ trunk/Source/WebCore/page/Settings.h	2012-05-23 00:21:25 UTC (rev 118086)
@@ -567,6 +567,9 @@
         void setRequestAnimationFrameEnabled(bool enabled) { m_requestAnimationFrameEnabled = enabled; }
         bool requestAnimationFrameEnabled() const { return m_requestAnimationFrameEnabled; }
 
+        void setNeedsDidFinishLoadOrderQuirk(bool needsQuirk) { m_needsDidFinishLoadOrderQuirk = needsQuirk; }
+        bool needsDidFinishLoadOrderQuirk() const { return m_needsDidFinishLoadOrderQuirk; }
+
 #if USE(JSC)
         static void setShouldRespectPriorityInCSSAttributeSetters(bool);
         static bool shouldRespectPriorityInCSSAttributeSetters();
@@ -733,6 +736,7 @@
         bool m_shouldRespectImageOrientation : 1;
         bool m_wantsBalancedSetDefersLoadingBehavior : 1;
         bool m_requestAnimationFrameEnabled : 1;
+        bool m_needsDidFinishLoadOrderQuirk : 1;
 
         Timer<Settings> m_loadsImagesAutomaticallyTimer;
         void loadsImagesAutomaticallyTimerFired(Timer<Settings>*);

Modified: trunk/Source/WebKit/mac/ChangeLog (118085 => 118086)


--- trunk/Source/WebKit/mac/ChangeLog	2012-05-23 00:21:07 UTC (rev 118085)
+++ trunk/Source/WebKit/mac/ChangeLog	2012-05-23 00:21:25 UTC (rev 118086)
@@ -1,3 +1,20 @@
+2012-05-22  Tim Horton  <[email protected]>
+
+        Add a quirk for applications that depend on the relative ordering of progressCompleted/didFinishLoad
+        https://bugs.webkit.org/show_bug.cgi?id=87178
+        <rdar://problem/11468434>
+
+        Reviewed by Maciej Stachowiak.
+
+        Add plumbing for the quirk to flip the relative ordering of progressCompleted/didFinishLoad back
+        to the behavior before http://trac.webkit.org/changeset/94105. Make it apply to any Mail.app linked
+        against WebKit before that revision.
+
+        * Misc/WebKitVersionChecks.h:
+        * WebView/WebView.mm:
+        (-[WebView _needsDidFinishLoadOrderQuirk]):
+        (-[WebView _preferencesChanged:]):
+
 2012-05-21  Gavin Barraclough  <[email protected]>
 
         Disable private names by default in WebCore

Modified: trunk/Source/WebKit/mac/Misc/WebKitVersionChecks.h (118085 => 118086)


--- trunk/Source/WebKit/mac/Misc/WebKitVersionChecks.h	2012-05-23 00:21:07 UTC (rev 118085)
+++ trunk/Source/WebKit/mac/Misc/WebKitVersionChecks.h	2012-05-23 00:21:25 UTC (rev 118086)
@@ -56,6 +56,7 @@
 #define WEBKIT_FIRST_VERSION_WITHOUT_LINK_ELEMENT_TEXT_CSS_QUIRK 0x02130200 // 531.2.0
 #define WEBKIT_FIRST_VERSION_WITH_HTML5_PARSER 0x02160900 // 534.9.0
 #define WEBKIT_FIRST_VERSION_WITH_GET_MATCHED_CSS_RULES_RESTRICTIONS 0x02160B00 // 534.11.0
+#define WEBKIT_FIRST_VERSION_WITH_CORRECT_DID_FINISH_LOAD_ORDER 0x02170304 // 535.3.4
 #define WEBKIT_FIRST_VERSION_WITH_CSS_ATTRIBUTE_SETTERS_IGNORING_PRIORITY 0x02170D00 // 535.13.0
 
 #ifdef __cplusplus

Modified: trunk/Source/WebKit/mac/WebView/WebView.mm (118085 => 118086)


--- trunk/Source/WebKit/mac/WebView/WebView.mm	2012-05-23 00:21:07 UTC (rev 118085)
+++ trunk/Source/WebKit/mac/WebView/WebView.mm	2012-05-23 00:21:25 UTC (rev 118086)
@@ -1354,6 +1354,12 @@
     return needsQuirk;
 }
 
+static bool needsDidFinishLoadOrderQuirk()
+{
+    static bool needsQuirk = !WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_CORRECT_DID_FINISH_LOAD_ORDER) && applicationIsAppleMail();
+    return needsQuirk;
+}
+
 static bool needsSelfRetainWhileLoadingQuirk()
 {
     static bool needsQuirk = applicationIsAperture();
@@ -1536,6 +1542,7 @@
     settings->setShouldRespectImageOrientation([preferences shouldRespectImageOrientation]);
     settings->setNeedsIsLoadingInAPISenseQuirk([self _needsIsLoadingInAPISenseQuirk]);
     settings->setRequestAnimationFrameEnabled([preferences requestAnimationFrameEnabled]);
+    settings->setNeedsDidFinishLoadOrderQuirk(needsDidFinishLoadOrderQuirk());
     
     NSTimeInterval timeout = [preferences incrementalRenderingSuppressionTimeoutInSeconds];
     if (timeout > 0)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to