Flash of white can occur if JS forces an early layout
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 14 Feb 2020 01:31:05 +0000 (01:31 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 14 Feb 2020 01:31:05 +0000 (01:31 +0000)
https://bugs.webkit.org/show_bug.cgi?id=207516

This causes us to wait for the first non-empty layout before we paint on Mac, which we
already do on all other platforms.

Patch by Ben Nham <nham@apple.com> on 2020-02-13
Reviewed by Antti Koivisto.

Source/WebKit:

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDidReachLayoutMilestone):

LayoutTests:

* fast/scrolling/rtl-scrollbars-listbox-scroll.html: Wait for document to load before scrolling.
* platform/mac/TestExpectations: Skip before-load-001.html as we already do on iOS. This test depends on first paint timing and this patch makes the Mac behave like iOS in terms of first paint.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256577 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/scrolling/rtl-scrollbars-listbox-scroll.html
LayoutTests/platform/mac/TestExpectations
Source/WebKit/ChangeLog
Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp

index 039d931..1f09c08 100644 (file)
@@ -1,3 +1,16 @@
+2020-02-13  Ben Nham  <nham@apple.com>
+
+        Flash of white can occur if JS forces an early layout
+        https://bugs.webkit.org/show_bug.cgi?id=207516
+
+        This causes us to wait for the first non-empty layout before we paint on Mac, which we
+        already do on all other platforms.
+
+        Reviewed by Antti Koivisto.
+
+        * fast/scrolling/rtl-scrollbars-listbox-scroll.html: Wait for document to load before scrolling.
+        * platform/mac/TestExpectations: Skip before-load-001.html as we already do on iOS. This test depends on first paint timing and this patch makes the Mac behave like iOS in terms of first paint.
+
 2020-02-13  Jason Lawrence  <lawrence.j@apple.com>
 
         [ Mac wk2 ] fast/scrolling/latching/iframe_in_iframe.html is flaky failing.
index 2ec041e..b075931 100644 (file)
@@ -26,9 +26,11 @@ if (window.internals) {
 </select>
 <script>
 if (window.eventSender) {
-    eventSender.mouseMoveTo(25, 5);
-    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -20, "began", "none");
-    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, "ended", "none");
+    window.addEventListener('load', function() {
+        eventSender.mouseMoveTo(25, 5);
+        eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -20, "began", "none");
+        eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, "ended", "none");
+    });
 }
 </script>
 </body>
index 1845d54..8ca8937 100644 (file)
@@ -1883,6 +1883,8 @@ webkit.org/b/198867 [ Mojave+ ] webgl/many-contexts.html [ Skip ]
 
 webkit.org/b/203171 inspector/layers/layers-for-node.html [ Pass Failure ]
 
+webkit.org/b/203416 imported/w3c/web-platform-tests/css/css-transitions/before-load-001.html [ Failure ]
+
 webkit.org/b/203305 [ HighSierra Debug ] imported/w3c/web-platform-tests/css/css-transitions/properties-value-001.html [ Pass Failure ]
 webkit.org/b/203305 [ HighSierra Debug ] imported/w3c/web-platform-tests/css/css-transitions/properties-value-inherit-001.html [ Pass Failure ]
 webkit.org/b/203357 [ Debug ] imported/w3c/web-platform-tests/css/css-transitions/event-dispatch.tentative.html [ Pass Failure ]
index 2be6c23..40bd9a5 100644 (file)
@@ -1,3 +1,16 @@
+2020-02-13  Ben Nham  <nham@apple.com>
+
+        Flash of white can occur if JS forces an early layout
+        https://bugs.webkit.org/show_bug.cgi?id=207516
+
+        This causes us to wait for the first non-empty layout before we paint on Mac, which we
+        already do on all other platforms.
+
+        Reviewed by Antti Koivisto.
+
+        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebKit::WebFrameLoaderClient::dispatchDidReachLayoutMilestone):
+
 2020-02-13  Brent Fulgham  <bfulgham@apple.com>
 
         REGRESSION (r255961): Default state for data URL handling is incorrect
index f1bd71a..121cdca 100644 (file)
@@ -698,15 +698,6 @@ void WebFrameLoaderClient::dispatchDidReachLayoutMilestone(OptionSet<WebCore::La
         webPage->injectedBundleLoaderClient().didFirstLayoutForFrame(*webPage, *m_frame, userData);
         webPage->send(Messages::WebPageProxy::DidFirstLayoutForFrame(m_frame->frameID(), UserData(WebProcess::singleton().transformObjectsToHandles(userData.get()).get())));
 
-#if PLATFORM(MAC)
-        // FIXME: Do this on DidFirstVisuallyNonEmptyLayout when Mac Safari is able to handle it (<rdar://problem/17580021>)
-        if (m_frame->isMainFrame() && !m_didCompletePageTransition && !webPage->corePage()->settings().suppressesIncrementalRendering()) {
-            WEBFRAMELOADERCLIENT_RELEASE_LOG(Layout, "dispatchDidReachLayoutMilestone: dispatching didCompletePageTransition");
-            webPage->didCompletePageTransition();
-            m_didCompletePageTransition = true;
-        }
-#endif
-
 #if USE(COORDINATED_GRAPHICS)
         // Make sure viewport properties are dispatched on the main frame by the time the first layout happens.
         ASSERT(!webPage->useFixedLayout() || m_frame != m_frame->page()->mainWebFrame() || m_frame->coreFrame()->document()->didDispatchViewportPropertiesChanged());