gecko-dev/testing/web-platform/tests/loading/preloader-css-import-no-semicolon.tentative.html
Yoav Weiss 430600b35b Bug 1509790 [wpt PR 14230] - Fix CSSPreloadScanner to avoid missing rules (reland), a=testonly
Automatic update from web-platform-tests
Fix CSSPreloadScanner to avoid missing rules (reland)

This fixes a couple of bugs with the CSSPReloadScanner that made it miss
rules in which the URL wasn't quoted or the rule didn't end with a
semicolon. It also adds tentative WPT tests for that functionality, as
the tests are also relevant for WebKit.

This is a reland of
https://chromium-review.googlesource.com/c/chromium/src/+/1331042

Bug: 903785
Change-Id: I401c252a42fbb96dee9c7942e0a4f8d5b6850244
TBR: kouhei
Reviewed-on: https://chromium-review.googlesource.com/c/1349980
Reviewed-by: Yoav Weiss <yoav@yoav.ws>
Commit-Queue: Yoav Weiss <yoav@yoav.ws>
Cr-Commit-Position: refs/heads/master@{#610796}

--

wpt-commits: f54784f108778b4d73d8806774521b30da7b4651
wpt-pr: 14230
2018-12-11 15:49:49 +00:00

30 lines
1 KiB
HTML

<!DOCTYPE html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
var t = async_test('Imported inline CSS with no semicolon is not blocked on pending CSS');
</script>
<link rel=stylesheet href="resources/dummy.css?first&pipe=trickle(d1)">
<script>
var this_script_is_neccessary_to_block_the_inline_style_processing = true;
</script>
<style>
@import url("resources/dummy.css?second")
</style>
<script>
window.addEventListener("load", t.step_func_done(() => {
let entries = performance.getEntriesByType('resource');
let first;
let second;
for (entry of entries) {
if (entry.name.includes("first")) {
first = entry;
}
if (entry.name.includes("second")) {
second = entry;
}
}
assert_true(first.responseEnd > second.startTime, "The second resource start time should not be blocked on the first resource response");
}));
</script>