diff --git a/dom/events/EventNameList.h b/dom/events/EventNameList.h index 391bf6e975113..593b6917b0358 100644 --- a/dom/events/EventNameList.h +++ b/dom/events/EventNameList.h @@ -167,6 +167,8 @@ EVENT(click, ePointerClick, EventNameType_All, ? ePointerEventClass : eMouseEventClass) EVENT(close, eClose, EventNameType_HTMLXUL, eBasicEventClass) +EVENT(contentvisibilityautostatechange, eContentVisibilityAutoStateChange, + EventNameType_All, eBasicEventClass) EVENT(contextmenu, eContextMenu, EventNameType_HTMLXUL | EventNameType_SVGGraphic, StaticPrefs::dom_w3c_pointer_events_dispatch_click_as_pointer_event() diff --git a/dom/webidl/EventHandler.webidl b/dom/webidl/EventHandler.webidl index c88e4f0422cea..fb949f5cf2e41 100644 --- a/dom/webidl/EventHandler.webidl +++ b/dom/webidl/EventHandler.webidl @@ -39,6 +39,7 @@ interface mixin GlobalEventHandlers { attribute EventHandler onchange; attribute EventHandler onclick; attribute EventHandler onclose; + attribute EventHandler oncontentvisibilityautostatechange; attribute EventHandler oncontextlost; attribute EventHandler oncontextmenu; attribute EventHandler oncontextrestored; diff --git a/testing/web-platform/meta/css/css-contain/content-visibility/content-visibility-auto-state-changed.html.ini b/testing/web-platform/meta/css/css-contain/content-visibility/content-visibility-auto-state-changed.html.ini deleted file mode 100644 index 3ae60affb1143..0000000000000 --- a/testing/web-platform/meta/css/css-contain/content-visibility/content-visibility-auto-state-changed.html.ini +++ /dev/null @@ -1,16 +0,0 @@ -[content-visibility-auto-state-changed.html] - expected: TIMEOUT - [ContentVisibilityAutoStateChange fires when relevant element gains `content-visibility:auto` (oncontentvisibilityautostatechange syntax)] - expected: TIMEOUT - - [ContentVisibilityAutoStateChange fires when not relevant element gains `content-visibility:auto`] - expected: NOTRUN - - [ContentVisibilityAutoStateChange content attribute test] - expected: NOTRUN - - [ContentVisibilityAutoStateChange fires when skipped] - expected: NOTRUN - - [ContentVisibilityAutoStateChange fires when not skipped] - expected: NOTRUN diff --git a/testing/web-platform/tests/css/css-contain/content-visibility/content-visibility-auto-state-changed.html b/testing/web-platform/tests/css/css-contain/content-visibility/content-visibility-auto-state-changed.html index 0333c052e4a2e..6a14470c0f4b1 100644 --- a/testing/web-platform/tests/css/css-contain/content-visibility/content-visibility-auto-state-changed.html +++ b/testing/web-platform/tests/css/css-contain/content-visibility/content-visibility-auto-state-changed.html @@ -24,16 +24,22 @@
+ @@ -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)); diff --git a/widget/EventMessageList.h b/widget/EventMessageList.h index 857c412bc8b38..94677ecc3919e 100644 --- a/widget/EventMessageList.h +++ b/widget/EventMessageList.h @@ -214,6 +214,9 @@ NS_EVENT_MESSAGE(ePageHide) NS_EVENT_MESSAGE(eContextLost) NS_EVENT_MESSAGE(eContextRestored) +// content-visibility events +NS_EVENT_MESSAGE(eContentVisibilityAutoStateChange) + // SVG events NS_EVENT_MESSAGE(eSVGLoad) NS_EVENT_MESSAGE(eSVGScroll) diff --git a/xpcom/ds/StaticAtoms.py b/xpcom/ds/StaticAtoms.py index 82c9e3ca64bfa..51c68a4d1a368 100644 --- a/xpcom/ds/StaticAtoms.py +++ b/xpcom/ds/StaticAtoms.py @@ -787,6 +787,7 @@ Atom("onCheckKeyPressEventModel", "onCheckKeyPressEventModel"), Atom("onclick", "onclick"), Atom("onclose", "onclose"), + Atom("oncontentvisibilityautostatechange", "oncontentvisibilityautostatechange"), Atom("oncommand", "oncommand"), Atom("oncommandupdate", "oncommandupdate"), Atom("oncomplete", "oncomplete"),