Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
<link> elements with media queries that do not affect the current pag…
…e can be delayed https://bugs.webkit.org/show_bug.cgi?id=39455 rdar://102178226 Reviewed by Alan Baradlay. We correctly deprioritize stylesheets with non-matching media attribute and don't make them rendering blocking. However they may still delay the visually non-empty milestone. This delay only comes into play if there is not enough visual content to trigger the milestone otherwise. This may end up delaying rendering until the non-matching stylesheets are fully loaded on simple pages. * LayoutTests/http/tests/css/link-with-non-matching-media-slow-load-expected.html: Added. * LayoutTests/http/tests/css/link-with-non-matching-media-slow-load.html: Added. * Source/WebCore/page/FrameView.cpp: (WebCore::FrameView::checkAndDispatchDidReachVisuallyNonEmptyState): Ignore "very low" priority resources when determining if everything important is loaded. * Source/WebCore/testing/Internals.cpp: (WebCore::Internals::isVisuallyNonEmpty const): * Source/WebCore/testing/Internals.h: * Source/WebCore/testing/Internals.idl: Testing support. Canonical link: https://commits.webkit.org/259963@main
- Loading branch information
Showing
6 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
LayoutTests/http/tests/css/link-with-non-matching-media-slow-load-expected.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<style> | ||
#pass { display:inline; width:200px; height:200px; background-color: green; position: absolute; } | ||
</style> | ||
<body> | ||
<div id=pass>PASS: Non-matching slow stylesheet didn't delay visually non-empty.</div> |
18 changes: 18 additions & 0 deletions
18
LayoutTests/http/tests/css/link-with-non-matching-media-slow-load.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<style> | ||
#pass { display:none; width:200px; height:200px; background-color: green; position: absolute; } | ||
#fail { display:inline; width:200px; height:200px; background-color: red; position: absolute; } | ||
</style> | ||
<body> | ||
<link rel="stylesheet" href="http://127.0.0.1:8000/local/slow-css-pass.cgi" media="not all" onload="this.media='all'"> | ||
<div id=pass></div> | ||
<div id=fail></div> | ||
<script> | ||
function test() { | ||
document.body.offsetLeft; | ||
|
||
if (window.internals) | ||
pass.textContent = internals.isVisuallyNonEmpty ? "PASS: Non-matching slow stylesheet didn't delay visually non-empty." : "FAIL: Non-matching slow media delayed visually non-empty."; | ||
} | ||
|
||
setTimeout(test); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters