From 2810181ce4aac7f75a39ab98064711777d0e7f9b Mon Sep 17 00:00:00 2001 From: Noam Rosenthal Date: Tue, 12 Mar 2024 22:27:50 +0000 Subject: [PATCH] Bug 1883023 [wpt PR 44879] - Avoid forced layout when finished parsing an empty subframe, a=testonly Automatic update from web-platform-tests Avoid forced layout when finished parsing an empty subframe The exiting check for empty document doesn't take into account that we force-load an empty document, which doesn't change the flag. Added a more appropriate check, initially behind the existing kAvoidForcedLayoutOnInitialEmptyDocumentInSubframe flag, which would allow us to finch-test this together with the previous change. These two changes together should prevent jank on many sites that use empty iframes, e.g. sites that use GTM. This forced layout was overlooked by the previous test because it doesn't use the proper code path for forcing layout. Updated the test to ensure that added nodes don't have their styled clean (they still need a style recalc) after adding the iframe to the DOM. Also two existing tests rely on the current behavior to pass: 1) third_party/blink/web_tests/fast/frames/avoid-forced-layout-on-empty-subframe.html The extra layout was masking another bug, where an extra layout is needed to correctly layout a select box with content-visibility:hidden. (crbug.com/327723279) 2) chrome/test/data/webui/new_tab_page/logo_test.ts This tests that doodles in the "new tab page" respond to resize requests by animating the width/height of an empty iframe. Added a wait of one animation frame to ensure the initial state of the iframe is rendered rather than rely on that coincidental forced layout. Bug: 324572951 Change-Id: Ib3b50e330e9a72c83b29d1e47f256b7ce33ae8ad Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5335144 Commit-Queue: Noam Rosenthal Reviewed-by: Stefan Zager Reviewed-by: Tibor Goldschwendt Cr-Commit-Position: refs/heads/main@{#1268096} -- wpt-commits: 11c2ded178a8f34d968041a7a4a2493b57d30ed3 wpt-pr: 44879 --- .../css-sizing/contain-intrinsic-size/contain-intrinsic-size-033.html | 1 + 1 file changed, 1 insertion(+) diff --git a/testing/web-platform/tests/css/css-sizing/contain-intrinsic-size/contain-intrinsic-size-033.html b/testing/web-platform/tests/css/css-sizing/contain-intrinsic-size/contain-intrinsic-size-033.html index f98a48a0a973..c40b9cdc8e5c 100644 --- a/testing/web-platform/tests/css/css-sizing/contain-intrinsic-size/contain-intrinsic-size-033.html +++ b/testing/web-platform/tests/css/css-sizing/contain-intrinsic-size/contain-intrinsic-size-033.html @@ -105,6 +105,7 @@ addEventListener("load", async function() { wrapper.appendChild(tests); wrapper.classList.add("skip-contents"); + await new Promise(requestAnimationFrame); checkLayout(".test"); }); -- 2.11.4.GIT