Skip to content

Commit

Permalink
Move onbeforeinput to GlobalEventHandlers
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=278794

Reviewed by Tim Nguyen.

Aligns with the HTML Standard and results in mostly identical behavior.
Also make note of some other event handler attributes we still need to
add.

For testing purposes we manually synchronize part of html.idl with
upstream to avoid breaking everything.

* LayoutTests/imported/w3c/web-platform-tests/html/dom/idlharness.https_exclude=(Document_Window_HTML._)-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/dom/idlharness.https_include=(Document_Window)-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/dom/idlharness.https_include=HTML._-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/webappapis/scripting/events/event-handler-all-global-events-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/webappapis/scripting/events/event-handler-attributes-body-window-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/webappapis/scripting/events/event-handler-attributes-windowless-body-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/interfaces/html.idl:
* LayoutTests/imported/w3c/web-platform-tests/mathml/relations/html5-tree/math-global-event-handlers.tentative-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/trusted-types-event-handlers-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/websockets/idlharness.any-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/websockets/idlharness.any.worker-expected.txt:
* LayoutTests/platform/glib/imported/w3c/web-platform-tests/html/dom/idlharness.https_exclude=(Document_Window_HTML._)-expected.txt:
* LayoutTests/platform/glib/imported/w3c/web-platform-tests/html/dom/idlharness.https_include=(Document_Window)-expected.txt:
* LayoutTests/platform/glib/imported/w3c/web-platform-tests/html/dom/idlharness.https_include=HTML._-expected.txt:
* LayoutTests/platform/glib/imported/w3c/web-platform-tests/mathml/relations/html5-tree/math-global-event-handlers.tentative-expected.txt:
* LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt: Removed.
* LayoutTests/platform/ios/imported/w3c/web-platform-tests/html/dom/idlharness.https_include=HTML._-expected.txt:
* LayoutTests/platform/ios/imported/w3c/web-platform-tests/mathml/relations/html5-tree/math-global-event-handlers.tentative-expected.txt:
* LayoutTests/platform/ipad/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt: Removed.
* LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/html/dom/idlharness.https_include=HTML._-expected.txt:
* LayoutTests/platform/mac/imported/w3c/web-platform-tests/mathml/relations/html5-tree/math-global-event-handlers.tentative-expected.txt:
* LayoutTests/platform/wpe/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt: Removed.
* Source/WebCore/dom/DocumentAndElementEventHandlers.idl:
* Source/WebCore/dom/GlobalEventHandlers.idl:

Canonical link: https://commits.webkit.org/282912@main
  • Loading branch information
annevk committed Aug 29, 2024
1 parent 55a33a4 commit 4c10f40
Show file tree
Hide file tree
Showing 24 changed files with 122 additions and 17,723 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1347,6 +1347,8 @@ FAIL External interface: window.external must inherit property "AddSearchProvide
FAIL External interface: window.external must inherit property "IsSearchProviderInstalled()" with the proper type assert_equals: wrong typeof object expected "object" but got "undefined"
PASS SVGElement interface: attribute onabort
PASS SVGElement interface: attribute onauxclick
PASS SVGElement interface: attribute onbeforeinput
PASS SVGElement interface: attribute onbeforetoggle
PASS SVGElement interface: attribute onblur
PASS SVGElement interface: attribute oncancel
PASS SVGElement interface: attribute oncanplay
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,8 @@ PASS Window interface: operation releaseEvents()
FAIL Window interface: attribute external assert_own_property: The global object must have a property "external" expected property "external" missing
PASS Window interface: attribute onabort
PASS Window interface: attribute onauxclick
PASS Window interface: attribute onbeforeinput
PASS Window interface: attribute onbeforetoggle
PASS Window interface: attribute onblur
PASS Window interface: attribute oncancel
PASS Window interface: attribute oncanplay
Expand Down Expand Up @@ -382,6 +384,8 @@ PASS Window interface: window must inherit property "releaseEvents()" with the p
FAIL Window interface: window must inherit property "external" with the proper type assert_own_property: expected property "external" missing
PASS Window interface: window must inherit property "onabort" with the proper type
PASS Window interface: window must inherit property "onauxclick" with the proper type
PASS Window interface: window must inherit property "onbeforeinput" with the proper type
PASS Window interface: window must inherit property "onbeforetoggle" with the proper type
PASS Window interface: window must inherit property "onblur" with the proper type
PASS Window interface: window must inherit property "oncancel" with the proper type
PASS Window interface: window must inherit property "oncanplay" with the proper type
Expand Down Expand Up @@ -543,6 +547,8 @@ PASS Document interface: operation releaseEvents()
PASS Document interface: attribute all
PASS Document interface: attribute onabort
PASS Document interface: attribute onauxclick
PASS Document interface: attribute onbeforeinput
PASS Document interface: attribute onbeforetoggle
PASS Document interface: attribute onblur
PASS Document interface: attribute oncancel
PASS Document interface: attribute oncanplay
Expand Down Expand Up @@ -673,6 +679,8 @@ PASS Document interface: iframe.contentDocument must inherit property "releaseEv
FAIL Document interface: iframe.contentDocument must inherit property "all" with the proper type assert_equals: expected "undefined" but got "function"
PASS Document interface: iframe.contentDocument must inherit property "onabort" with the proper type
PASS Document interface: iframe.contentDocument must inherit property "onauxclick" with the proper type
PASS Document interface: iframe.contentDocument must inherit property "onbeforeinput" with the proper type
PASS Document interface: iframe.contentDocument must inherit property "onbeforetoggle" with the proper type
PASS Document interface: iframe.contentDocument must inherit property "onblur" with the proper type
PASS Document interface: iframe.contentDocument must inherit property "oncancel" with the proper type
PASS Document interface: iframe.contentDocument must inherit property "oncanplay" with the proper type
Expand Down Expand Up @@ -803,6 +811,8 @@ PASS Document interface: new Document() must inherit property "releaseEvents()"
PASS Document interface: new Document() must inherit property "all" with the proper type
PASS Document interface: new Document() must inherit property "onabort" with the proper type
PASS Document interface: new Document() must inherit property "onauxclick" with the proper type
PASS Document interface: new Document() must inherit property "onbeforeinput" with the proper type
PASS Document interface: new Document() must inherit property "onbeforetoggle" with the proper type
PASS Document interface: new Document() must inherit property "onblur" with the proper type
PASS Document interface: new Document() must inherit property "oncancel" with the proper type
PASS Document interface: new Document() must inherit property "oncanplay" with the proper type
Expand Down Expand Up @@ -933,6 +943,8 @@ PASS Document interface: documentWithHandlers must inherit property "releaseEven
PASS Document interface: documentWithHandlers must inherit property "all" with the proper type
PASS Document interface: documentWithHandlers must inherit property "onabort" with the proper type
PASS Document interface: documentWithHandlers must inherit property "onauxclick" with the proper type
PASS Document interface: documentWithHandlers must inherit property "onbeforeinput" with the proper type
PASS Document interface: documentWithHandlers must inherit property "onbeforetoggle" with the proper type
PASS Document interface: documentWithHandlers must inherit property "onblur" with the proper type
PASS Document interface: documentWithHandlers must inherit property "oncancel" with the proper type
PASS Document interface: documentWithHandlers must inherit property "oncanplay" with the proper type
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,8 @@ PASS HTMLElement interface: attribute outerText
PASS HTMLElement interface: operation attachInternals()
PASS HTMLElement interface: attribute onabort
PASS HTMLElement interface: attribute onauxclick
PASS HTMLElement interface: attribute onbeforeinput
PASS HTMLElement interface: attribute onbeforetoggle
PASS HTMLElement interface: attribute onblur
PASS HTMLElement interface: attribute oncancel
PASS HTMLElement interface: attribute oncanplay
Expand Down Expand Up @@ -340,6 +342,8 @@ PASS HTMLElement interface: document.createElement("noscript") must inherit prop
PASS HTMLElement interface: document.createElement("noscript") must inherit property "attachInternals()" with the proper type
PASS HTMLElement interface: document.createElement("noscript") must inherit property "onabort" with the proper type
PASS HTMLElement interface: document.createElement("noscript") must inherit property "onauxclick" with the proper type
PASS HTMLElement interface: document.createElement("noscript") must inherit property "onbeforeinput" with the proper type
PASS HTMLElement interface: document.createElement("noscript") must inherit property "onbeforetoggle" with the proper type
PASS HTMLElement interface: document.createElement("noscript") must inherit property "onblur" with the proper type
PASS HTMLElement interface: document.createElement("noscript") must inherit property "oncancel" with the proper type
PASS HTMLElement interface: document.createElement("noscript") must inherit property "oncanplay" with the proper type
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@ PASS onauxclick: the default value must be null
PASS onauxclick: the content attribute must be compiled into a function as the corresponding property
PASS onauxclick: the content attribute must execute when an event is dispatched
PASS onauxclick: dispatching an Event at a <meta> element must trigger element.onauxclick
PASS onbeforeinput: must be on the appropriate locations for GlobalEventHandlers
PASS onbeforeinput: the default value must be null
PASS onbeforeinput: the content attribute must be compiled into a function as the corresponding property
PASS onbeforeinput: the content attribute must execute when an event is dispatched
PASS onbeforeinput: dispatching an Event at a <meta> element must trigger element.onbeforeinput
PASS onbeforetoggle: must be on the appropriate locations for GlobalEventHandlers
PASS onbeforetoggle: the default value must be null
PASS onbeforetoggle: the content attribute must be compiled into a function as the corresponding property
PASS onbeforetoggle: the content attribute must execute when an event is dispatched
PASS onbeforetoggle: dispatching an Event at a <meta> element must trigger element.onbeforetoggle
PASS onblur: must be on the appropriate locations for GlobalEventHandlers
PASS onblur: the default value must be null
PASS onblur: the content attribute must be compiled into a function as the corresponding property
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ PASS shadowed unhandledrejection (document.body)
PASS shadowed unload (document.body)
PASS not shadowed abort (document.body)
PASS not shadowed auxclick (document.body)
PASS not shadowed beforeinput (document.body)
PASS not shadowed beforetoggle (document.body)
PASS not shadowed cancel (document.body)
PASS not shadowed canplay (document.body)
PASS not shadowed canplaythrough (document.body)
Expand Down Expand Up @@ -132,6 +134,8 @@ PASS shadowed unhandledrejection (document.createElement("body"))
PASS shadowed unload (document.createElement("body"))
PASS not shadowed abort (document.createElement("body"))
PASS not shadowed auxclick (document.createElement("body"))
PASS not shadowed beforeinput (document.createElement("body"))
PASS not shadowed beforetoggle (document.createElement("body"))
PASS not shadowed cancel (document.createElement("body"))
PASS not shadowed canplay (document.createElement("body"))
PASS not shadowed canplaythrough (document.createElement("body"))
Expand Down Expand Up @@ -241,6 +245,8 @@ PASS shadowed unhandledrejection (window)
PASS shadowed unload (window)
PASS not shadowed abort (window)
PASS not shadowed auxclick (window)
PASS not shadowed beforeinput (window)
PASS not shadowed beforetoggle (window)
PASS not shadowed cancel (window)
PASS not shadowed canplay (window)
PASS not shadowed canplaythrough (window)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ PASS Return null when getting the unload event handler of a windowless body
PASS Ignore setting of unload window event handlers on windowless body
PASS abort is unaffected on a windowless body
PASS auxclick is unaffected on a windowless body
PASS beforeinput is unaffected on a windowless body
PASS beforetoggle is unaffected on a windowless body
PASS cancel is unaffected on a windowless body
PASS canplay is unaffected on a windowless body
PASS canplaythrough is unaffected on a windowless body
Expand Down Expand Up @@ -154,6 +156,8 @@ PASS Return null when getting the unload event handler of a windowless frameset
PASS Ignore setting of unload window event handlers on windowless frameset
PASS abort is unaffected on a windowless frameset
PASS auxclick is unaffected on a windowless frameset
PASS beforeinput is unaffected on a windowless frameset
PASS beforetoggle is unaffected on a windowless frameset
PASS cancel is unaffected on a windowless frameset
PASS canplay is unaffected on a windowless frameset
PASS canplaythrough is unaffected on a windowless frameset
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1894,6 +1894,8 @@ typedef OnBeforeUnloadEventHandlerNonNull? OnBeforeUnloadEventHandler;
interface mixin GlobalEventHandlers {
attribute EventHandler onabort;
attribute EventHandler onauxclick;
attribute EventHandler onbeforeinput;
attribute EventHandler onbeforetoggle;
attribute EventHandler onblur;
attribute EventHandler oncancel;
attribute EventHandler oncanplay;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@ FAIL onauxclick: the default value must be null assert_equals: The default value
FAIL onauxclick: the content attribute must be compiled into a function as the corresponding property assert_equals: The onauxclick property must be a function expected "function" but got "undefined"
FAIL onauxclick: dynamic changes on the attribute assert_equals: The onauxclick property must be null (no attribute) expected (object) null but got (undefined) undefined
FAIL onauxclick: dispatching an Event at a <math> element must trigger element.onauxclick assert_equals: The event must be fired at the <math> element expected (object) Element node <math></math> but got (undefined) undefined
PASS onbeforeinput: must be on the appropriate locations for GlobalEventHandlers
PASS onbeforeinput: the default value must be null
PASS onbeforeinput: the content attribute must be compiled into a function as the corresponding property
PASS onbeforeinput: dynamic changes on the attribute
PASS onbeforeinput: dispatching an Event at a <math> element must trigger element.onbeforeinput
PASS onbeforetoggle: must be on the appropriate locations for GlobalEventHandlers
PASS onbeforetoggle: the default value must be null
PASS onbeforetoggle: the content attribute must be compiled into a function as the corresponding property
PASS onbeforetoggle: dynamic changes on the attribute
PASS onbeforetoggle: dispatching an Event at a <math> element must trigger element.onbeforetoggle
PASS onblur: must be on the appropriate locations for GlobalEventHandlers
PASS onblur: the default value must be null
PASS onblur: the content attribute must be compiled into a function as the corresponding property
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ CONSOLE MESSAGE: This requires a TrustedScript value else it violates the follow
CONSOLE MESSAGE: This requires a TrustedScript value else it violates the following Content Security Policy directive: "require-trusted-types-for 'script'"
CONSOLE MESSAGE: This requires a TrustedScript value else it violates the following Content Security Policy directive: "require-trusted-types-for 'script'"
CONSOLE MESSAGE: This requires a TrustedScript value else it violates the following Content Security Policy directive: "require-trusted-types-for 'script'"
CONSOLE MESSAGE: This requires a TrustedScript value else it violates the following Content Security Policy directive: "require-trusted-types-for 'script'"

PASS Event handler onclick should be blocked.
PASS Event handler onchange should be blocked.
Expand All @@ -111,6 +112,7 @@ PASS Non-event handler div.draggable should not be blocked.
PASS Non-event handler div.inert should not be blocked.
PASS Event handler div.onabort should be blocked.
PASS Event handler div.onauxclick should be blocked.
PASS Event handler div.onbeforeinput should be blocked.
PASS Event handler div.onbeforetoggle should be blocked.
PASS Event handler div.onblur should be blocked.
PASS Event handler div.oncancel should be blocked.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@

PASS idl_test setup
FAIL idl_test validation Validation error at line 2208 in html, inside `enum BinaryType`:
FAIL idl_test validation Validation error at line 2210 in html, inside `enum BinaryType`:
enum BinaryType { "blob", "arraybuffer"
^ The name "BinaryType" of type "enum" was already seen

Validation error at line 2210 in html, inside `interface WebSocket`:
Validation error at line 2212 in html, inside `interface WebSocket`:
interface WebSocket : EventTarget {
^ The name "WebSocket" of type "interface" was already seen

Validation error at line 2241 in html, inside `interface CloseEvent`:
Validation error at line 2243 in html, inside `interface CloseEvent`:
interface CloseEvent : Event {
^ The name "CloseEvent" of type "interface" was already seen

Validation error at line 2249 in html, inside `dictionary CloseEventInit`:
Validation error at line 2251 in html, inside `dictionary CloseEventInit`:
dictionary CloseEventInit : EventInit {
^ The name "CloseEventInit" of type "dictionary" was already seen
PASS WebSocket interface: existence and properties of interface object
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@

PASS idl_test setup
FAIL idl_test validation Validation error at line 2208 in html, inside `enum BinaryType`:
FAIL idl_test validation Validation error at line 2210 in html, inside `enum BinaryType`:
enum BinaryType { "blob", "arraybuffer"
^ The name "BinaryType" of type "enum" was already seen

Validation error at line 2210 in html, inside `interface WebSocket`:
Validation error at line 2212 in html, inside `interface WebSocket`:
interface WebSocket : EventTarget {
^ The name "WebSocket" of type "interface" was already seen

Validation error at line 2241 in html, inside `interface CloseEvent`:
Validation error at line 2243 in html, inside `interface CloseEvent`:
interface CloseEvent : Event {
^ The name "CloseEvent" of type "interface" was already seen

Validation error at line 2249 in html, inside `dictionary CloseEventInit`:
Validation error at line 2251 in html, inside `dictionary CloseEventInit`:
dictionary CloseEventInit : EventInit {
^ The name "CloseEventInit" of type "dictionary" was already seen
PASS WebSocket interface: existence and properties of interface object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1347,6 +1347,8 @@ FAIL External interface: window.external must inherit property "AddSearchProvide
FAIL External interface: window.external must inherit property "IsSearchProviderInstalled()" with the proper type assert_equals: wrong typeof object expected "object" but got "undefined"
PASS SVGElement interface: attribute onabort
PASS SVGElement interface: attribute onauxclick
PASS SVGElement interface: attribute onbeforeinput
PASS SVGElement interface: attribute onbeforetoggle
PASS SVGElement interface: attribute onblur
PASS SVGElement interface: attribute oncancel
PASS SVGElement interface: attribute oncanplay
Expand Down
Loading

0 comments on commit 4c10f40

Please sign in to comment.