Title: [231662] trunk/LayoutTests
Revision
231662
Author
[email protected]
Date
2018-05-10 14:56:58 -0700 (Thu, 10 May 2018)

Log Message

[Extra zoom mode] fast/visual-viewport/extrazoom/layout-viewport-after-scrolling-and-resizing.html sometimes fails
https://bugs.webkit.org/show_bug.cgi?id=185517
<rdar://problem/40112983>

Reviewed by Tim Horton.

Adjusts some existing layout tests — see below for more detail.

* fast/css/extrazoom/viewport-units-shrink-to-fit.html:

Remove calls to wait for the next presentation update which are no longer necessary after r231606.

* fast/viewport/extrazoom/viewport-change-min-device-width.html:

Wait for the next visible content rect update, when the unobscured content rect is guaranteed to be up to date.

* fast/visual-viewport/extrazoom/layout-viewport-after-scrolling-and-resizing.html:

Wait for the next visible content rect update rather than the next presentation update (i.e. remote layer tree
commit). This is because the layout viewport's custom fixed position rect is propagated in the visible content
rect update flow, and ensuring a presentation update is insufficient to guarantee that the layout viewport is up
to date.

* resources/ui-helper.js:
(window.UIHelper.ensureVisibleContentRectUpdate):

Add a new test helper to wait for the next presentation update.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (231661 => 231662)


--- trunk/LayoutTests/ChangeLog	2018-05-10 21:46:52 UTC (rev 231661)
+++ trunk/LayoutTests/ChangeLog	2018-05-10 21:56:58 UTC (rev 231662)
@@ -1,3 +1,33 @@
+2018-05-10  Wenson Hsieh  <[email protected]>
+
+        [Extra zoom mode] fast/visual-viewport/extrazoom/layout-viewport-after-scrolling-and-resizing.html sometimes fails
+        https://bugs.webkit.org/show_bug.cgi?id=185517
+        <rdar://problem/40112983>
+
+        Reviewed by Tim Horton.
+
+        Adjusts some existing layout tests — see below for more detail.
+
+        * fast/css/extrazoom/viewport-units-shrink-to-fit.html:
+
+        Remove calls to wait for the next presentation update which are no longer necessary after r231606.
+
+        * fast/viewport/extrazoom/viewport-change-min-device-width.html:
+
+        Wait for the next visible content rect update, when the unobscured content rect is guaranteed to be up to date.
+
+        * fast/visual-viewport/extrazoom/layout-viewport-after-scrolling-and-resizing.html:
+
+        Wait for the next visible content rect update rather than the next presentation update (i.e. remote layer tree
+        commit). This is because the layout viewport's custom fixed position rect is propagated in the visible content
+        rect update flow, and ensuring a presentation update is insufficient to guarantee that the layout viewport is up
+        to date.
+
+        * resources/ui-helper.js:
+        (window.UIHelper.ensureVisibleContentRectUpdate):
+
+        Add a new test helper to wait for the next presentation update.
+
 2018-05-10  Matt Baker  <[email protected]>
 
         Web Inspector: ASSERT_NOT_REACHED in PageDebuggerAgent::didAddEventListener when page adds attribute event listener

Modified: trunk/LayoutTests/fast/css/extrazoom/viewport-units-shrink-to-fit.html (231661 => 231662)


--- trunk/LayoutTests/fast/css/extrazoom/viewport-units-shrink-to-fit.html	2018-05-10 21:46:52 UTC (rev 231661)
+++ trunk/LayoutTests/fast/css/extrazoom/viewport-units-shrink-to-fit.html	2018-05-10 21:56:58 UTC (rev 231662)
@@ -21,8 +21,6 @@
         jsTestIsAsync = true;
 
         async function runTest() {
-            await UIHelper.ensurePresentationUpdate();
-
             largeElementRectBeforeRemoval = large.getBoundingClientRect();
             mediumElementRectBeforeRemoval = medium.getBoundingClientRect();
             innerWidthBeforeRemoval = innerWidth;
@@ -29,7 +27,6 @@
             innerHeightBeforeRemoval = innerHeight;
 
             large.remove();
-            await UIHelper.ensurePresentationUpdate();
 
             mediumElementRectAfterRemoval = medium.getBoundingClientRect();
             innerWidthAfterRemoval = innerWidth;

Modified: trunk/LayoutTests/fast/viewport/extrazoom/viewport-change-min-device-width.html (231661 => 231662)


--- trunk/LayoutTests/fast/viewport/extrazoom/viewport-change-min-device-width.html	2018-05-10 21:46:52 UTC (rev 231661)
+++ trunk/LayoutTests/fast/viewport/extrazoom/viewport-change-min-device-width.html	2018-05-10 21:56:58 UTC (rev 231662)
@@ -17,7 +17,7 @@
         function logWindowDimensionsAfterSettingViewportContent(content) {
             return new Promise(async resolve => {
                 meta.setAttribute("content", content);
-                await UIHelper.ensurePresentationUpdate();
+                await UIHelper.ensureVisibleContentRectUpdate();
                 debug(`[${meta.getAttribute("content")}] (${innerWidth}, ${innerHeight})`);
                 resolve();
             });

Modified: trunk/LayoutTests/fast/visual-viewport/extrazoom/layout-viewport-after-scrolling-and-resizing.html (231661 => 231662)


--- trunk/LayoutTests/fast/visual-viewport/extrazoom/layout-viewport-after-scrolling-and-resizing.html	2018-05-10 21:46:52 UTC (rev 231661)
+++ trunk/LayoutTests/fast/visual-viewport/extrazoom/layout-viewport-after-scrolling-and-resizing.html	2018-05-10 21:56:58 UTC (rev 231662)
@@ -36,9 +36,7 @@
         async function runTest() {
             jsTestIsAsync = true;
 
-            // FIXME: This works around innerWidth and innerHeight being incorrect (i.e. unadjusted for shrink-to-fit
-            // behavior) in the load event listener of the body. See: https://bugs.webkit.org/show_bug.cgi?id=184788.
-            await UIHelper.ensurePresentationUpdate();
+            await UIHelper.ensureVisibleContentRectUpdate();
 
             topRectBeforeScrolling = document.getElementById("top").getBoundingClientRect();
             bottomRectBeforeScrolling = document.getElementById("bottom").getBoundingClientRect();
@@ -52,7 +50,7 @@
             layoutViewportAfterScrolling = internals.layoutViewportRect();
 
             document.body.style.height = "100px";
-            await UIHelper.ensurePresentationUpdate();
+            await UIHelper.ensureVisibleContentRectUpdate();
 
             topRectAfterShorteningBody = document.getElementById("top").getBoundingClientRect();
             bottomRectAfterShorteningBody = document.getElementById("bottom").getBoundingClientRect();
@@ -60,7 +58,7 @@
 
             finalDocumentHeight = Math.round(innerHeight * 1.5);
             document.body.style.height = `${finalDocumentHeight}px`;
-            await UIHelper.ensurePresentationUpdate();
+            await UIHelper.ensureVisibleContentRectUpdate();
 
             topRectAfterExtendingBody = document.getElementById("top").getBoundingClientRect();
             bottomRectAfterExtendingBody = document.getElementById("bottom").getBoundingClientRect();

Modified: trunk/LayoutTests/resources/ui-helper.js (231661 => 231662)


--- trunk/LayoutTests/resources/ui-helper.js	2018-05-10 21:46:52 UTC (rev 231661)
+++ trunk/LayoutTests/resources/ui-helper.js	2018-05-10 21:56:58 UTC (rev 231662)
@@ -84,6 +84,17 @@
         });
     }
 
+    static ensureVisibleContentRectUpdate()
+    {
+        if (!this.isWebKit2())
+            return Promise.resolve();
+
+        return new Promise(resolve => {
+            const visibleContentRectUpdateScript = "uiController.doAfterVisibleContentRectUpdate(() => uiController.uiScriptComplete())";
+            testRunner.runUIScript(visibleContentRectUpdateScript, resolve);
+        });
+    }
+
     static activateAndWaitForInputSessionAt(x, y)
     {
         if (!this.isWebKit2() || !this.isIOS())
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to