Title: [281698] trunk/LayoutTests
- Revision
- 281698
- Author
- [email protected]
- Date
- 2021-08-27 09:50:45 -0700 (Fri, 27 Aug 2021)
Log Message
[css-position-sticky] createIndicatorForStickyElements testing function races with font loading
https://bugs.webkit.org/show_bug.cgi?id=229602
Reviewed by Žan Doberšek.
LayoutTests/imported/w3c:
* web-platform-tests/css/css-position/resources/ref-rectangle.js:
(createIndicatorForStickyElements): Wait to read the size of the target div until
all web fonts have loaded. This ensures that this executes after Ahem has loaded
for the failing test.
LayoutTests:
* TestExpectations: Mark a test as newly passing.
Modified Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (281697 => 281698)
--- trunk/LayoutTests/ChangeLog 2021-08-27 16:30:45 UTC (rev 281697)
+++ trunk/LayoutTests/ChangeLog 2021-08-27 16:50:45 UTC (rev 281698)
@@ -1,3 +1,12 @@
+2021-08-27 Martin Robinson <[email protected]>
+
+ [css-position-sticky] createIndicatorForStickyElements testing function races with font loading
+ https://bugs.webkit.org/show_bug.cgi?id=229602
+
+ Reviewed by Žan Doberšek.
+
+ * TestExpectations: Mark a test as newly passing.
+
2021-08-27 Ayumi Kojima <[email protected]>
[Mac wk2] http/tests/media/hls/hls-webvtt-seek-backwards.html is a flaky timeout.
Modified: trunk/LayoutTests/TestExpectations (281697 => 281698)
--- trunk/LayoutTests/TestExpectations 2021-08-27 16:30:45 UTC (rev 281697)
+++ trunk/LayoutTests/TestExpectations 2021-08-27 16:50:45 UTC (rev 281698)
@@ -3473,7 +3473,6 @@
webkit.org/b/228993 imported/w3c/web-platform-tests/css/css-position/multicol/static-position/vrl-ltr-rtl-in-multicol.tentative.html [ ImageOnlyFailure ]
webkit.org/b/228993 imported/w3c/web-platform-tests/css/css-position/multicol/static-position/vrl-rtl-ltr-in-multicol.tentative.html [ ImageOnlyFailure ]
webkit.org/b/228993 imported/w3c/web-platform-tests/css/css-position/multicol/static-position/vrl-rtl-rtl-in-multicol.html [ ImageOnlyFailure ]
-webkit.org/b/203450 imported/w3c/web-platform-tests/css/css-position/sticky/position-sticky-inline.html [ ImageOnlyFailure ]
webkit.org/b/203450 imported/w3c/web-platform-tests/css/css-position/sticky/position-sticky-writing-modes.html [ ImageOnlyFailure ]
webkit.org/b/203450 imported/w3c/web-platform-tests/css/css-position/sticky/position-sticky-large-top-2.tentative.html [ ImageOnlyFailure ]
webkit.org/b/203450 imported/w3c/web-platform-tests/css/css-position/sticky/position-sticky-large-top.tentative.html [ ImageOnlyFailure ]
Modified: trunk/LayoutTests/imported/w3c/ChangeLog (281697 => 281698)
--- trunk/LayoutTests/imported/w3c/ChangeLog 2021-08-27 16:30:45 UTC (rev 281697)
+++ trunk/LayoutTests/imported/w3c/ChangeLog 2021-08-27 16:50:45 UTC (rev 281698)
@@ -1,3 +1,15 @@
+2021-08-27 Martin Robinson <[email protected]>
+
+ [css-position-sticky] createIndicatorForStickyElements testing function races with font loading
+ https://bugs.webkit.org/show_bug.cgi?id=229602
+
+ Reviewed by Žan Doberšek.
+
+ * web-platform-tests/css/css-position/resources/ref-rectangle.js:
+ (createIndicatorForStickyElements): Wait to read the size of the target div until
+ all web fonts have loaded. This ensures that this executes after Ahem has loaded
+ for the failing test.
+
2021-08-27 Emilio Cobos Álvarez <[email protected]>
Don't forget about the outer selector when matching ::slotted().
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-position/resources/ref-rectangle.js (281697 => 281698)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-position/resources/ref-rectangle.js 2021-08-27 16:30:45 UTC (rev 281697)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-position/resources/ref-rectangle.js 2021-08-27 16:50:45 UTC (rev 281698)
@@ -7,23 +7,28 @@
throw "No sticky div was found in the test case.";
sticky_divs.forEach((sticky_div) => {
- // The relative position indicator will be able to share the same containing
- // block to match the position with the same offset from in flow position
- // (offsetTop/offsetLeft)
if (getComputedStyle(sticky_div).position != "sticky")
throw "Provided sticky element does not have position: sticky";
- var position_div = document.createElement("div");
- position_div.style.left = sticky_div.offsetLeft + "px";
- position_div.style.top = sticky_div.offsetTop + "px";
- // The absolute position is to ensure that the position_div adds zero size
- // to in flow layout
- position_div.style.position = "absolute"
- var indicator_div = document.createElement("div");
- indicator_div.style.width = sticky_div.offsetWidth + "px";
- indicator_div.style.height = sticky_div.offsetHeight + "px";
- indicator_div.style.backgroundColor = "blue";
- indicator_div.style.position = "relative";
- position_div.appendChild(indicator_div);
- sticky_div.parentNode.insertBefore(position_div, sticky_div);
});
+
+ document.fonts.ready.then(() => {
+ sticky_divs.forEach((sticky_div) => {
+ // The relative position indicator will be able to share the same containing
+ // block to match the position with the same offset from in flow position
+ // (offsetTop/offsetLeft)
+ let position_div = document.createElement("div");
+ position_div.style.left = sticky_div.offsetLeft + "px";
+ position_div.style.top = sticky_div.offsetTop + "px";
+ // The absolute position is to ensure that the position_div adds zero size
+ // to in flow layout
+ position_div.style.position = "absolute"
+ let indicator_div = document.createElement("div");
+ indicator_div.style.width = sticky_div.offsetWidth + "px";
+ indicator_div.style.height = sticky_div.offsetHeight + "px";
+ indicator_div.style.backgroundColor = "blue";
+ indicator_div.style.position = "relative";
+ position_div.appendChild(indicator_div);
+ sticky_div.parentNode.insertBefore(position_div, sticky_div);
+ });
+ });
}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes