Update web-platform-tests to revision b'b728032f59a396243864b0f8584e7211e3632005'

This commit is contained in:
WPT Sync Bot 2022-11-10 01:22:36 +00:00
parent ace9b32b1c
commit df68c4e5d1
15632 changed files with 514865 additions and 155000 deletions

View file

@ -0,0 +1,16 @@
<!DOCTYPE html>
<title>The 'load' event on the style element should still fire after mutation</title>
<link rel="help" href="https://crbug.com/1323319">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
promise_test(async () => {
const style = document.createElement('style');
document.head.appendChild(style);
style.appendChild(document.createTextNode('@import url(/support/css-red.txt);'));
style.appendChild(document.createTextNode('body {color: green; }'));
// The 'load' event should fire.
await new Promise(resolve => style.onload = resolve);
});
</script>

View file

@ -5,29 +5,24 @@
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style id=target onload="load()">
.box { color:red; }
</style>
<div class='box'></div>
<div id="log"></div>
<script>
var loadCount = 0;
function load() { loadCount++; }
</script>
function styleLoad() {
return new Promise((resolve) => {
document.getElementById('target').addEventListener('load', () => {
resolve();
});
});
}
<style id=target onload="load()">
.box { color:red; }
</style>
<div class='box'>Box</div>
<script>
window.onload = () => {
const target = document.getElementById('target');
promise_test(async t => {
await styleLoad();
assert_equals(loadCount,1,"Style element should have loaded once by now");
target.textContent = `.box { color: green; }`;
await styleLoad();
await new Promise(resolve => target.addEventListener('load', resolve));
assert_equals(loadCount,2,"Style element should fire the load event when textContent changes");
},"style load event should fire when textContent changed");
};
</script>