Skip to content

Commit

Permalink
Support oncontentvisibilityautostatechange event handler
Browse files Browse the repository at this point in the history
Spec PR: whatwg/html#10364

Differential Revision: https://phabricator.services.mozilla.com/D217187

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1898833
gecko-commit: d583d9d438eafe5bec7db0a922ef416dae1bdb79
gecko-reviewers: emilio, smaug
  • Loading branch information
gregorypappas authored and moz-wptsync-bot committed Jul 21, 2024
1 parent 5af3e9c commit a46ce5f
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,22 @@

<script>
let contentattrfired = false;
let contentattrfiredonsvg = false;

function contentattrDidFire() {
contentattrfired = true;
}

function contentattrDidFireOnSvg() {
contentattrfiredonsvg = true;
}

</script>

<div id=upper></div>
<div id=attrtest></div>
<div id=contentattrtest oncontentvisibilityautostatechange="contentattrDidFire()" class=auto></div>
<svg id="svgcontentattrtest" oncontentvisibilityautostatechange="contentattrDidFireOnSvg()" class="auto"></svg>
<div class=spacer></div>
<div id=middle></div>
<div class=spacer></div>
Expand Down Expand Up @@ -83,6 +89,12 @@
assert_true(contentattrfired, "contentattrfired");
}, "ContentVisibilityAutoStateChange content attribute test");


promise_test(async t => {
await waitForAtLeastOneFrame();
assert_true(contentattrfiredonsvg, "contentattrfiredonsvg");
}, "ContentVisibilityAutoStateChange content attribute test on svg");

promise_test(t => new Promise(async (resolve, reject) => {
await new Promise((waited, _) => {
requestAnimationFrame(() => requestAnimationFrame(waited));
Expand Down

0 comments on commit a46ce5f

Please sign in to comment.