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: 5d51dcf32767e574e601fca39239fb7c98ff1758
gecko-reviewers: emilio, smaug
  • Loading branch information
gregorypappas authored and moz-wptsync-bot committed Jul 20, 2024
1 parent 7a1c8e0 commit c890d1d
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 c890d1d

Please sign in to comment.