Commit 85c09dce authored by Stephen McGruer's avatar Stephen McGruer Committed by Commit Bot

Move on{animation,transition}XX event handlers to GlobalEventHandlers

The spec defines these on GlobalEventHandlers, not on Window:
https://drafts.csswg.org/css-animations-1/#interface-globaleventhandlers-idl
https://drafts.csswg.org/css-transitions-1/#interface-globaleventhandlers-idl

Bug: 999894
Change-Id: Idf3d5f9ba44a5cc8045315baa8c204fdc326d5db
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1783058Reviewed-by: default avatarYi Gu <yigu@chromium.org>
Reviewed-by: default avatarPhilip Jägenstedt <foolip@chromium.org>
Commit-Queue: Stephen McGruer <smcgruer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#696040}
parent 6eaf2c7f
......@@ -40,6 +40,10 @@ class GlobalEventHandlers {
public:
DEFINE_STATIC_ATTRIBUTE_EVENT_LISTENER(abort, kAbort)
DEFINE_STATIC_ATTRIBUTE_EVENT_LISTENER(animationend, kAnimationend)
DEFINE_STATIC_ATTRIBUTE_EVENT_LISTENER(animationiteration,
kAnimationiteration)
DEFINE_STATIC_ATTRIBUTE_EVENT_LISTENER(animationstart, kAnimationstart)
DEFINE_STATIC_ATTRIBUTE_EVENT_LISTENER(activateinvisible, kActivateinvisible)
DEFINE_STATIC_ATTRIBUTE_EVENT_LISTENER(auxclick, kAuxclick)
DEFINE_STATIC_ATTRIBUTE_EVENT_LISTENER(blur, kBlur)
......@@ -113,6 +117,7 @@ class GlobalEventHandlers {
DEFINE_STATIC_ATTRIBUTE_EVENT_LISTENER(stalled, kStalled)
DEFINE_STATIC_ATTRIBUTE_EVENT_LISTENER(submit, kSubmit)
DEFINE_STATIC_ATTRIBUTE_EVENT_LISTENER(suspend, kSuspend)
DEFINE_STATIC_ATTRIBUTE_EVENT_LISTENER(transitionend, kTransitionend)
DEFINE_STATIC_ATTRIBUTE_EVENT_LISTENER(timeupdate, kTimeupdate)
DEFINE_STATIC_ATTRIBUTE_EVENT_LISTENER(toggle, kToggle)
DEFINE_STATIC_ATTRIBUTE_EVENT_LISTENER(touchcancel, kTouchcancel)
......
......@@ -129,4 +129,14 @@
// https://w3c.github.io/selection-api/#extensions-to-globaleventhandlers
attribute EventHandler onselectstart;
attribute EventHandler onselectionchange;
// CSS Animations
// https://drafts.csswg.org/css-animations/#interface-globaleventhandlers-idl
attribute EventHandler onanimationend;
attribute EventHandler onanimationiteration;
attribute EventHandler onanimationstart;
// CSS Transitions
// https://drafts.csswg.org/css-transitions/#interface-globaleventhandlers-idl
attribute EventHandler ontransitionend;
};
......@@ -247,11 +247,7 @@ class CORE_EXPORT LocalDOMWindow final : public DOMWindow,
bool isSecureContext() const;
DEFINE_ATTRIBUTE_EVENT_LISTENER(animationend, kAnimationend)
DEFINE_ATTRIBUTE_EVENT_LISTENER(animationiteration, kAnimationiteration)
DEFINE_ATTRIBUTE_EVENT_LISTENER(animationstart, kAnimationstart)
DEFINE_ATTRIBUTE_EVENT_LISTENER(search, kSearch)
DEFINE_ATTRIBUTE_EVENT_LISTENER(transitionend, kTransitionend)
DEFINE_ATTRIBUTE_EVENT_LISTENER(webkitanimationstart, kWebkitAnimationStart)
DEFINE_ATTRIBUTE_EVENT_LISTENER(webkitanimationiteration,
......
......@@ -199,11 +199,9 @@
[MeasureAs=PrefixedMutationObserverConstructor] attribute MutationObserverConstructor WebKitMutationObserver;
// Event handler attributes
attribute EventHandler onanimationend;
attribute EventHandler onanimationiteration;
attribute EventHandler onanimationstart;
attribute EventHandler onsearch;
attribute EventHandler ontransitionend;
// TODO(crbug.com/999895): Move to global_event_handlers.idl
attribute EventHandler onwebkitanimationend;
attribute EventHandler onwebkitanimationiteration;
attribute EventHandler onwebkitanimationstart;
......
This is a testharness.js-based test.
FAIL Same events are ordered by elements assert_equals: Number of events received (0) should match expected number (2) (expected: animationstart, animationstart, actual: ) expected 2 but got 0
FAIL Same events on pseudo-elements follow the prescribed order assert_equals: Number of events received (0) should match expected number (4) (expected: animationstart, animationstart, animationstart, animationstart, actual: ) expected 4 but got 0
FAIL Start and iteration events are ordered by time assert_equals: Number of events received (0) should match expected number (2) (expected: animationiteration, animationstart, actual: ) expected 2 but got 0
FAIL Iteration and end events are ordered by time assert_equals: Number of events received (0) should match expected number (2) (expected: animationiteration, animationend, actual: ) expected 2 but got 0
FAIL Start and end events are sorted correctly when fired simultaneously assert_equals: Number of events received (0) should match expected number (4) (expected: animationstart, animationstart, animationend, animationend, actual: ) expected 4 but got 0
PASS Same events are ordered by elements
FAIL Same events on pseudo-elements follow the prescribed order assert_equals: Event #3 targets should match expected Element node <div style="animation: anim 100s" id="parent-div"><div st... but got Element node <div style="animation: anim 100s"></div>
FAIL Start and iteration events are ordered by time assert_equals: Event #1 types should match (expected: animationiteration, animationstart, actual: animationstart, animationiteration) expected "animationiteration" but got "animationstart"
FAIL Iteration and end events are ordered by time assert_equals: Event #1 types should match (expected: animationiteration, animationend, actual: animationend, animationiteration) expected "animationiteration" but got "animationend"
FAIL Start and end events are sorted correctly when fired simultaneously assert_equals: Event #1 targets should match expected Element node <div style="animation: anim 100s 2"></div> but got Element node <div style="animation: anim 100s 100s"></div>
Harness: the test ran to completion.
This is a testharness.js-based test.
Found 70 tests; 61 PASS, 9 FAIL, 0 TIMEOUT, 0 NOTRUN.
Found 70 tests; 67 PASS, 3 FAIL, 0 TIMEOUT, 0 NOTRUN.
PASS idl_test setup
PASS Partial interface CSSRule: original interface defined
PASS Partial interface mixin GlobalEventHandlers: original interface mixin defined
......@@ -54,17 +54,17 @@ PASS CSSKeyframesRule interface: keyframes must inherit property "findRule(CSSOM
PASS CSSKeyframesRule interface: calling findRule(CSSOMString) on keyframes with too few arguments must throw TypeError
PASS CSSRule interface: keyframes must inherit property "KEYFRAMES_RULE" with the proper type
PASS CSSRule interface: keyframes must inherit property "KEYFRAME_RULE" with the proper type
FAIL HTMLElement interface: attribute onanimationstart assert_true: The prototype object must have a property "onanimationstart" expected true got false
FAIL HTMLElement interface: attribute onanimationiteration assert_true: The prototype object must have a property "onanimationiteration" expected true got false
FAIL HTMLElement interface: attribute onanimationend assert_true: The prototype object must have a property "onanimationend" expected true got false
PASS HTMLElement interface: attribute onanimationstart
PASS HTMLElement interface: attribute onanimationiteration
PASS HTMLElement interface: attribute onanimationend
FAIL HTMLElement interface: attribute onanimationcancel assert_true: The prototype object must have a property "onanimationcancel" expected true got false
PASS Window interface: attribute onanimationstart
PASS Window interface: attribute onanimationiteration
PASS Window interface: attribute onanimationend
FAIL Window interface: attribute onanimationcancel assert_own_property: The global object must have a property "onanimationcancel" expected property "onanimationcancel" missing
FAIL Document interface: attribute onanimationstart assert_true: The prototype object must have a property "onanimationstart" expected true got false
FAIL Document interface: attribute onanimationiteration assert_true: The prototype object must have a property "onanimationiteration" expected true got false
FAIL Document interface: attribute onanimationend assert_true: The prototype object must have a property "onanimationend" expected true got false
PASS Document interface: attribute onanimationstart
PASS Document interface: attribute onanimationiteration
PASS Document interface: attribute onanimationend
FAIL Document interface: attribute onanimationcancel assert_true: The prototype object must have a property "onanimationcancel" expected true got false
PASS CSSRule interface: constant KEYFRAMES_RULE on interface object
PASS CSSRule interface: constant KEYFRAMES_RULE on interface prototype object
......
......@@ -17,11 +17,11 @@ PASS TransitionEvent interface: new TransitionEvent("transitionend") must inheri
PASS TransitionEvent interface: new TransitionEvent("transitionend") must inherit property "pseudoElement" with the proper type
FAIL HTMLElement interface: attribute ontransitionrun assert_true: The prototype object must have a property "ontransitionrun" expected true got false
FAIL HTMLElement interface: attribute ontransitionstart assert_true: The prototype object must have a property "ontransitionstart" expected true got false
FAIL HTMLElement interface: attribute ontransitionend assert_true: The prototype object must have a property "ontransitionend" expected true got false
PASS HTMLElement interface: attribute ontransitionend
FAIL HTMLElement interface: attribute ontransitioncancel assert_true: The prototype object must have a property "ontransitioncancel" expected true got false
FAIL HTMLElement interface: document must inherit property "ontransitionrun" with the proper type assert_inherits: property "ontransitionrun" not found in prototype chain
FAIL HTMLElement interface: document must inherit property "ontransitionstart" with the proper type assert_inherits: property "ontransitionstart" not found in prototype chain
FAIL HTMLElement interface: document must inherit property "ontransitionend" with the proper type assert_inherits: property "ontransitionend" not found in prototype chain
PASS HTMLElement interface: document must inherit property "ontransitionend" with the proper type
FAIL HTMLElement interface: document must inherit property "ontransitioncancel" with the proper type assert_inherits: property "ontransitioncancel" not found in prototype chain
FAIL Window interface: attribute ontransitionrun assert_own_property: The global object must have a property "ontransitionrun" expected property "ontransitionrun" missing
FAIL Window interface: attribute ontransitionstart assert_own_property: The global object must have a property "ontransitionstart" expected property "ontransitionstart" missing
......@@ -33,11 +33,11 @@ PASS Window interface: window must inherit property "ontransitionend" with the p
FAIL Window interface: window must inherit property "ontransitioncancel" with the proper type assert_own_property: expected property "ontransitioncancel" missing
FAIL Document interface: attribute ontransitionrun assert_true: The prototype object must have a property "ontransitionrun" expected true got false
FAIL Document interface: attribute ontransitionstart assert_true: The prototype object must have a property "ontransitionstart" expected true got false
FAIL Document interface: attribute ontransitionend assert_true: The prototype object must have a property "ontransitionend" expected true got false
PASS Document interface: attribute ontransitionend
FAIL Document interface: attribute ontransitioncancel assert_true: The prototype object must have a property "ontransitioncancel" expected true got false
FAIL Document interface: document must inherit property "ontransitionrun" with the proper type assert_inherits: property "ontransitionrun" not found in prototype chain
FAIL Document interface: document must inherit property "ontransitionstart" with the proper type assert_inherits: property "ontransitionstart" not found in prototype chain
FAIL Document interface: document must inherit property "ontransitionend" with the proper type assert_inherits: property "ontransitionend" not found in prototype chain
PASS Document interface: document must inherit property "ontransitionend" with the proper type
FAIL Document interface: document must inherit property "ontransitioncancel" with the proper type assert_inherits: property "ontransitioncancel" not found in prototype chain
Harness: the test ran to completion.
......@@ -116,6 +116,9 @@ namespace http://www.w3.org/1999/xhtml
property offsetTop
property offsetWidth
property onabort
property onanimationend
property onanimationiteration
property onanimationstart
property onauxclick
property onbeforecopy
property onbeforecut
......@@ -199,6 +202,7 @@ namespace http://www.w3.org/1999/xhtml
property ontouchend
property ontouchmove
property ontouchstart
property ontransitionend
property onvolumechange
property onwaiting
property onwebkitfullscreenchange
......@@ -1214,6 +1218,9 @@ namespace http://www.w3.org/2000/svg
property nonce
property normalize
property onabort
property onanimationend
property onanimationiteration
property onanimationstart
property onauxclick
property onbeforecopy
property onbeforecut
......@@ -1297,6 +1304,7 @@ namespace http://www.w3.org/2000/svg
property ontouchend
property ontouchmove
property ontouchstart
property ontransitionend
property onvolumechange
property onwaiting
property onwebkitfullscreenchange
......
......@@ -1279,6 +1279,9 @@ interface Document : Node
getter linkColor
getter links
getter onabort
getter onanimationend
getter onanimationiteration
getter onanimationstart
getter onauxclick
getter onbeforecopy
getter onbeforecut
......@@ -1368,6 +1371,7 @@ interface Document : Node
getter ontouchend
getter ontouchmove
getter ontouchstart
getter ontransitionend
getter onvisibilitychange
getter onvolumechange
getter onwaiting
......@@ -1463,6 +1467,9 @@ interface Document : Node
setter fullscreenEnabled
setter linkColor
setter onabort
setter onanimationend
setter onanimationiteration
setter onanimationstart
setter onauxclick
setter onbeforecopy
setter onbeforecut
......@@ -1552,6 +1559,7 @@ interface Document : Node
setter ontouchend
setter ontouchmove
setter ontouchstart
setter ontransitionend
setter onvisibilitychange
setter onvolumechange
setter onwaiting
......@@ -2247,6 +2255,9 @@ interface HTMLElement : Element
getter offsetTop
getter offsetWidth
getter onabort
getter onanimationend
getter onanimationiteration
getter onanimationstart
getter onauxclick
getter onblur
getter oncancel
......@@ -2324,6 +2335,7 @@ interface HTMLElement : Element
getter ontouchend
getter ontouchmove
getter ontouchstart
getter ontransitionend
getter onvolumechange
getter onwaiting
getter onwheel
......@@ -2350,6 +2362,9 @@ interface HTMLElement : Element
setter lang
setter nonce
setter onabort
setter onanimationend
setter onanimationiteration
setter onanimationstart
setter onauxclick
setter onblur
setter oncancel
......@@ -2427,6 +2442,7 @@ interface HTMLElement : Element
setter ontouchend
setter ontouchmove
setter ontouchstart
setter ontransitionend
setter onvolumechange
setter onwaiting
setter onwheel
......@@ -5560,6 +5576,9 @@ interface SVGElement : Element
getter dataset
getter nonce
getter onabort
getter onanimationend
getter onanimationiteration
getter onanimationstart
getter onauxclick
getter onblur
getter oncancel
......@@ -5637,6 +5656,7 @@ interface SVGElement : Element
getter ontouchend
getter ontouchmove
getter ontouchstart
getter ontransitionend
getter onvolumechange
getter onwaiting
getter onwheel
......@@ -5649,6 +5669,9 @@ interface SVGElement : Element
method focus
setter nonce
setter onabort
setter onanimationend
setter onanimationiteration
setter onanimationstart
setter onauxclick
setter onblur
setter oncancel
......@@ -5726,6 +5749,7 @@ interface SVGElement : Element
setter ontouchend
setter ontouchmove
setter ontouchstart
setter ontransitionend
setter onvolumechange
setter onwaiting
setter onwheel
......
......@@ -171,6 +171,9 @@ namespace http://www.w3.org/1999/xhtml
property offsetWidth
property onabort
property onactivateinvisible
property onanimationend
property onanimationiteration
property onanimationstart
property onauxclick
property onbeforeactivate
property onbeforecopy
......@@ -257,6 +260,7 @@ namespace http://www.w3.org/1999/xhtml
property ontouchend
property ontouchmove
property ontouchstart
property ontransitionend
property onvolumechange
property onwaiting
property onwebkitfullscreenchange
......@@ -1349,6 +1353,9 @@ namespace http://www.w3.org/2000/svg
property normalize
property onabort
property onactivateinvisible
property onanimationend
property onanimationiteration
property onanimationstart
property onauxclick
property onbeforeactivate
property onbeforecopy
......@@ -1435,6 +1442,7 @@ namespace http://www.w3.org/2000/svg
property ontouchend
property ontouchmove
property ontouchstart
property ontransitionend
property onvolumechange
property onwaiting
property onwebkitfullscreenchange
......
......@@ -1603,6 +1603,9 @@ interface Document : Node
getter links
getter onabort
getter onactivateinvisible
getter onanimationend
getter onanimationiteration
getter onanimationstart
getter onauxclick
getter onbeforeactivate
getter onbeforecopy
......@@ -1695,6 +1698,7 @@ interface Document : Node
getter ontouchend
getter ontouchmove
getter ontouchstart
getter ontransitionend
getter onvisibilitychange
getter onvolumechange
getter onwaiting
......@@ -1794,6 +1798,9 @@ interface Document : Node
setter linkColor
setter onabort
setter onactivateinvisible
setter onanimationend
setter onanimationiteration
setter onanimationstart
setter onauxclick
setter onbeforeactivate
setter onbeforecopy
......@@ -1886,6 +1893,7 @@ interface Document : Node
setter ontouchend
setter ontouchmove
setter ontouchstart
setter ontransitionend
setter onvisibilitychange
setter onvolumechange
setter onwaiting
......@@ -2926,6 +2934,9 @@ interface HTMLElement : Element
getter offsetWidth
getter onabort
getter onactivateinvisible
getter onanimationend
getter onanimationiteration
getter onanimationstart
getter onauxclick
getter onbeforeactivate
getter onblur
......@@ -3006,6 +3017,7 @@ interface HTMLElement : Element
getter ontouchend
getter ontouchmove
getter ontouchstart
getter ontransitionend
getter onvolumechange
getter onwaiting
getter onwheel
......@@ -3034,6 +3046,9 @@ interface HTMLElement : Element
setter nonce
setter onabort
setter onactivateinvisible
setter onanimationend
setter onanimationiteration
setter onanimationstart
setter onauxclick
setter onbeforeactivate
setter onblur
......@@ -3114,6 +3129,7 @@ interface HTMLElement : Element
setter ontouchend
setter ontouchmove
setter ontouchstart
setter ontransitionend
setter onvolumechange
setter onwaiting
setter onwheel
......@@ -6527,6 +6543,9 @@ interface SVGElement : Element
getter nonce
getter onabort
getter onactivateinvisible
getter onanimationend
getter onanimationiteration
getter onanimationstart
getter onauxclick
getter onbeforeactivate
getter onblur
......@@ -6607,6 +6626,7 @@ interface SVGElement : Element
getter ontouchend
getter ontouchmove
getter ontouchstart
getter ontransitionend
getter onvolumechange
getter onwaiting
getter onwheel
......@@ -6620,6 +6640,9 @@ interface SVGElement : Element
setter nonce
setter onabort
setter onactivateinvisible
setter onanimationend
setter onanimationiteration
setter onanimationstart
setter onauxclick
setter onbeforeactivate
setter onblur
......@@ -6700,6 +6723,7 @@ interface SVGElement : Element
setter ontouchend
setter ontouchmove
setter ontouchstart
setter ontransitionend
setter onvolumechange
setter onwaiting
setter onwheel
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment