Skip to content

Commit

Permalink
Re-align HTMLElement with the HTML spec
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=217202

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

* web-platform-tests/html/dom/idlharness.https-expected.txt:
* web-platform-tests/svg/types/scripted/event-handler-all-document-element-events-expected.txt:
Update more now passing results.

Source/WebCore:

- Stops including DocumentAndElementEventHandlers in Element, and instead matches spec
  and other browsers by having HTMLElement, SVGElement and MathMLElement include it.
- Splits out ElementContentEditable from HTMLElement and has HTMLElement include it.
- Splits CSSOM View parts of HTMLElement out into HTMLElement+CSSOMView.idl
- Re-orders includes to more closely match spec'd order. Has no real effect but made
  me happy.

Updates results to existing tests that are now passing, all due to the change to
include DocumentAndElementEventHandlers in the Element subclasses, not Element itself.

* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* dom/Element.idl:
* dom/ElementContentEditable.idl: Added.
* html/HTMLBodyElement.idl:
* html/HTMLElement+CSSOMView.idl: Added.
* html/HTMLElement.idl:
* html/HTMLFrameSetElement.idl:
* html/HTMLMediaElement+AudioOutput.idl: Added.
* html/HTMLMediaElementAudioOutput.idl: Removed.
* mathml/MathMLElement.idl:
* svg/SVGElement.idl:

LayoutTests:

* fast/events/DocumentAndElementEventHandlers-expected.txt:
* fast/events/DocumentAndElementEventHandlers.html:
Update test to match spec by checking on the HTMLElement prototype, not the
Element prototype.

* fast/dom/event-handler-attributes-expected.txt:
* platform/gtk/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt:
* platform/ios-wk2/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt:
* platform/mac-wk1/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt:
* platform/mac-wk2/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt:
Update more now passing results.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@267893 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
[email protected] committed Oct 2, 2020
1 parent c5ae9dc commit b5b1109
Show file tree
Hide file tree
Showing 26 changed files with 216 additions and 84 deletions.
20 changes: 20 additions & 0 deletions LayoutTests/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
2020-10-02 Sam Weinig <[email protected]>

Re-align HTMLElement with the HTML spec
https://bugs.webkit.org/show_bug.cgi?id=217202

Reviewed by Darin Adler.

* fast/events/DocumentAndElementEventHandlers-expected.txt:
* fast/events/DocumentAndElementEventHandlers.html:
Update test to match spec by checking on the HTMLElement prototype, not the
Element prototype.

* fast/dom/event-handler-attributes-expected.txt:
* platform/gtk/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt:
* platform/ios-wk2/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt:
* platform/mac-wk1/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt:
* platform/mac-wk2/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt:
Update more now passing results.

2020-09-30 Antoine Quint <[email protected]>

Add non-animated support for the CSS translate property
Expand Down
12 changes: 6 additions & 6 deletions LayoutTests/fast/dom/event-handler-attributes-expected.txt
Original file line number Diff line number Diff line change
Expand Up @@ -858,19 +858,19 @@ PASS testElementAttribute(nonHTMLElement, "abort") is "none"
PASS testElementAttribute(nonHTMLElement, "animationend") is "none"
PASS testElementAttribute(nonHTMLElement, "animationiteration") is "none"
PASS testElementAttribute(nonHTMLElement, "animationstart") is "none"
FAIL testElementAttribute(nonHTMLElement, "beforecopy") should be none. Was script: target; content: none.
FAIL testElementAttribute(nonHTMLElement, "beforecut") should be none. Was script: target; content: none.
PASS testElementAttribute(nonHTMLElement, "beforecopy") is "none"
PASS testElementAttribute(nonHTMLElement, "beforecut") is "none"
FAIL testElementAttribute(nonHTMLElement, "beforeload") should be none. Was script: target; content: none.
FAIL testElementAttribute(nonHTMLElement, "beforepaste") should be none. Was script: target; content: none.
PASS testElementAttribute(nonHTMLElement, "beforepaste") is "none"
PASS testElementAttribute(nonHTMLElement, "beforeunload") is "none"
PASS testElementAttribute(nonHTMLElement, "blur") is "none"
PASS testElementAttribute(nonHTMLElement, "canplay") is "none"
PASS testElementAttribute(nonHTMLElement, "canplaythrough") is "none"
PASS testElementAttribute(nonHTMLElement, "change") is "none"
PASS testElementAttribute(nonHTMLElement, "click") is "none"
PASS testElementAttribute(nonHTMLElement, "contextmenu") is "none"
FAIL testElementAttribute(nonHTMLElement, "copy") should be none. Was script: target; content: none.
FAIL testElementAttribute(nonHTMLElement, "cut") should be none. Was script: target; content: none.
PASS testElementAttribute(nonHTMLElement, "copy") is "none"
PASS testElementAttribute(nonHTMLElement, "cut") is "none"
PASS testElementAttribute(nonHTMLElement, "dblclick") is "none"
PASS testElementAttribute(nonHTMLElement, "drag") is "none"
PASS testElementAttribute(nonHTMLElement, "dragend") is "none"
Expand Down Expand Up @@ -910,7 +910,7 @@ PASS testElementAttribute(nonHTMLElement, "offline") is "none"
PASS testElementAttribute(nonHTMLElement, "online") is "none"
PASS testElementAttribute(nonHTMLElement, "pagehide") is "none"
PASS testElementAttribute(nonHTMLElement, "pageshow") is "none"
FAIL testElementAttribute(nonHTMLElement, "paste") should be none. Was script: target; content: none.
PASS testElementAttribute(nonHTMLElement, "paste") is "none"
PASS testElementAttribute(nonHTMLElement, "pause") is "none"
PASS testElementAttribute(nonHTMLElement, "play") is "none"
PASS testElementAttribute(nonHTMLElement, "playing") is "none"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

PASS oncopy EventHandler on Document
PASS oncopy EventHander on Element
PASS oncopy EventHander on HTMLElement
PASS oncut EventHandler on Document
PASS oncut EventHander on Element
PASS oncut EventHander on HTMLElement
PASS onpaste EventHandler on Document
PASS onpaste EventHander on Element
PASS onpaste EventHander on HTMLElement

8 changes: 4 additions & 4 deletions LayoutTests/fast/events/DocumentAndElementEventHandlers.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@
}, description);
}

function testOnElement(eventHandler, description)
function testOnHTMLElement(eventHandler, description)
{
test(function() {
assert_idl_attribute(document.body, eventHandler, "element has " + eventHandler + " IDL attribute");
assert_own_property(Element.prototype, eventHandler, eventHandler + " on Element prototype");
assert_own_property(HTMLElement.prototype, eventHandler, eventHandler + " on HTMLElement prototype");
assert_true(eventHandler in document.body, eventHandler + " in element is true");
assert_true(Object.getOwnPropertyDescriptor(Element.prototype, eventHandler).enumerable, "element." + eventHandler + " is enumerable");
assert_true(Object.getOwnPropertyDescriptor(HTMLElement.prototype, eventHandler).enumerable, "element." + eventHandler + " is enumerable");
}, description);
}

for (let eventHandler of ["oncopy", "oncut", "onpaste"]) {
testOnDocument(eventHandler, eventHandler + " EventHandler on Document");
testOnElement(eventHandler, eventHandler + " EventHander on Element");
testOnHTMLElement(eventHandler, eventHandler + " EventHander on HTMLElement");
}
</script>
</body>
Expand Down
11 changes: 11 additions & 0 deletions LayoutTests/imported/w3c/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
2020-10-02 Sam Weinig <[email protected]>

Re-align HTMLElement with the HTML spec
https://bugs.webkit.org/show_bug.cgi?id=217202

Reviewed by Darin Adler.

* web-platform-tests/html/dom/idlharness.https-expected.txt:
* web-platform-tests/svg/types/scripted/event-handler-all-document-element-events-expected.txt:
Update more now passing results.

2020-09-30 Antoine Quint <[email protected]>

Add non-animated support for the CSS translate property
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,9 @@ PASS HTMLElement interface: attribute ontimeupdate
PASS HTMLElement interface: attribute ontoggle
PASS HTMLElement interface: attribute onvolumechange
PASS HTMLElement interface: attribute onwaiting
FAIL HTMLElement interface: attribute oncopy assert_own_property: expected property "oncopy" missing
FAIL HTMLElement interface: attribute oncut assert_own_property: expected property "oncut" missing
FAIL HTMLElement interface: attribute onpaste assert_own_property: expected property "onpaste" missing
PASS HTMLElement interface: attribute oncopy
PASS HTMLElement interface: attribute oncut
PASS HTMLElement interface: attribute onpaste
PASS HTMLElement interface: attribute contentEditable
FAIL HTMLElement interface: attribute enterKeyHint assert_true: The prototype object must have a property "enterKeyHint" expected true got false
PASS HTMLElement interface: attribute isContentEditable
Expand Down Expand Up @@ -5092,9 +5092,9 @@ PASS SVGElement interface: attribute ontimeupdate
PASS SVGElement interface: attribute ontoggle
PASS SVGElement interface: attribute onvolumechange
PASS SVGElement interface: attribute onwaiting
FAIL SVGElement interface: attribute oncopy assert_own_property: expected property "oncopy" missing
FAIL SVGElement interface: attribute oncut assert_own_property: expected property "oncut" missing
FAIL SVGElement interface: attribute onpaste assert_own_property: expected property "onpaste" missing
PASS SVGElement interface: attribute oncopy
PASS SVGElement interface: attribute oncut
PASS SVGElement interface: attribute onpaste
PASS SVGElement interface: attribute dataset
FAIL SVGElement interface: attribute nonce assert_true: The prototype object must have a property "nonce" expected true got false
FAIL SVGElement interface: attribute autofocus assert_true: The prototype object must have a property "autofocus" expected true got false
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@

FAIL oncut: DocumentAndElementEventHandlers must be on SVGElement not Element assert_true: SVGElement has an own property named "oncut" expected true got false
PASS oncut: DocumentAndElementEventHandlers must be on SVGElement not Element
PASS oncut: the default value must be null
PASS oncut: the content attribute must be compiled into a function as the corresponding property
PASS oncut: the content attribute must execute when an event is dispatched
FAIL oncopy: DocumentAndElementEventHandlers must be on SVGElement not Element assert_true: SVGElement has an own property named "oncopy" expected true got false
PASS oncopy: DocumentAndElementEventHandlers must be on SVGElement not Element
PASS oncopy: the default value must be null
PASS oncopy: the content attribute must be compiled into a function as the corresponding property
PASS oncopy: the content attribute must execute when an event is dispatched
FAIL onpaste: DocumentAndElementEventHandlers must be on SVGElement not Element assert_true: SVGElement has an own property named "onpaste" expected true got false
PASS onpaste: DocumentAndElementEventHandlers must be on SVGElement not Element
PASS onpaste: the default value must be null
PASS onpaste: the content attribute must be compiled into a function as the corresponding property
PASS onpaste: the content attribute must execute when an event is dispatched
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -323,9 +323,9 @@ PASS HTMLElement interface: attribute onwebkitanimationiteration
PASS HTMLElement interface: attribute onwebkitanimationstart
PASS HTMLElement interface: attribute onwebkittransitionend
PASS HTMLElement interface: attribute onwheel
FAIL HTMLElement interface: attribute oncopy assert_own_property: expected property "oncopy" missing
FAIL HTMLElement interface: attribute oncut assert_own_property: expected property "oncut" missing
FAIL HTMLElement interface: attribute onpaste assert_own_property: expected property "onpaste" missing
PASS HTMLElement interface: attribute oncopy
PASS HTMLElement interface: attribute oncut
PASS HTMLElement interface: attribute onpaste
PASS HTMLElement interface: attribute contentEditable
FAIL HTMLElement interface: attribute enterKeyHint assert_true: The prototype object must have a property "enterKeyHint" expected true got false
PASS HTMLElement interface: attribute isContentEditable
Expand Down Expand Up @@ -5270,9 +5270,9 @@ PASS SVGElement interface: attribute onwebkitanimationiteration
PASS SVGElement interface: attribute onwebkitanimationstart
PASS SVGElement interface: attribute onwebkittransitionend
PASS SVGElement interface: attribute onwheel
FAIL SVGElement interface: attribute oncopy assert_own_property: expected property "oncopy" missing
FAIL SVGElement interface: attribute oncut assert_own_property: expected property "oncut" missing
FAIL SVGElement interface: attribute onpaste assert_own_property: expected property "onpaste" missing
PASS SVGElement interface: attribute oncopy
PASS SVGElement interface: attribute oncut
PASS SVGElement interface: attribute onpaste
PASS SVGElement interface: attribute dataset
FAIL SVGElement interface: attribute nonce assert_true: The prototype object must have a property "nonce" expected true got false
FAIL SVGElement interface: attribute autofocus assert_true: The prototype object must have a property "autofocus" expected true got false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -323,9 +323,9 @@ PASS HTMLElement interface: attribute onwebkitanimationiteration
PASS HTMLElement interface: attribute onwebkitanimationstart
PASS HTMLElement interface: attribute onwebkittransitionend
PASS HTMLElement interface: attribute onwheel
FAIL HTMLElement interface: attribute oncopy assert_own_property: expected property "oncopy" missing
FAIL HTMLElement interface: attribute oncut assert_own_property: expected property "oncut" missing
FAIL HTMLElement interface: attribute onpaste assert_own_property: expected property "onpaste" missing
PASS HTMLElement interface: attribute oncopy
PASS HTMLElement interface: attribute oncut
PASS HTMLElement interface: attribute onpaste
PASS HTMLElement interface: attribute contentEditable
PASS HTMLElement interface: attribute enterKeyHint
PASS HTMLElement interface: attribute isContentEditable
Expand Down Expand Up @@ -5260,9 +5260,9 @@ PASS SVGElement interface: attribute onwebkitanimationiteration
PASS SVGElement interface: attribute onwebkitanimationstart
PASS SVGElement interface: attribute onwebkittransitionend
PASS SVGElement interface: attribute onwheel
FAIL SVGElement interface: attribute oncopy assert_own_property: expected property "oncopy" missing
FAIL SVGElement interface: attribute oncut assert_own_property: expected property "oncut" missing
FAIL SVGElement interface: attribute onpaste assert_own_property: expected property "onpaste" missing
PASS SVGElement interface: attribute oncopy
PASS SVGElement interface: attribute oncut
PASS SVGElement interface: attribute onpaste
PASS SVGElement interface: attribute dataset
FAIL SVGElement interface: attribute nonce assert_true: The prototype object must have a property "nonce" expected true got false
FAIL SVGElement interface: attribute autofocus assert_true: The prototype object must have a property "autofocus" expected true got false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -323,9 +323,9 @@ PASS HTMLElement interface: attribute onwebkitanimationiteration
PASS HTMLElement interface: attribute onwebkitanimationstart
PASS HTMLElement interface: attribute onwebkittransitionend
PASS HTMLElement interface: attribute onwheel
FAIL HTMLElement interface: attribute oncopy assert_own_property: expected property "oncopy" missing
FAIL HTMLElement interface: attribute oncut assert_own_property: expected property "oncut" missing
FAIL HTMLElement interface: attribute onpaste assert_own_property: expected property "onpaste" missing
PASS HTMLElement interface: attribute oncopy
PASS HTMLElement interface: attribute oncut
PASS HTMLElement interface: attribute onpaste
PASS HTMLElement interface: attribute contentEditable
FAIL HTMLElement interface: attribute enterKeyHint assert_true: The prototype object must have a property "enterKeyHint" expected true got false
PASS HTMLElement interface: attribute isContentEditable
Expand Down Expand Up @@ -5270,9 +5270,9 @@ PASS SVGElement interface: attribute onwebkitanimationiteration
PASS SVGElement interface: attribute onwebkitanimationstart
PASS SVGElement interface: attribute onwebkittransitionend
PASS SVGElement interface: attribute onwheel
FAIL SVGElement interface: attribute oncopy assert_own_property: expected property "oncopy" missing
FAIL SVGElement interface: attribute oncut assert_own_property: expected property "oncut" missing
FAIL SVGElement interface: attribute onpaste assert_own_property: expected property "onpaste" missing
PASS SVGElement interface: attribute oncopy
PASS SVGElement interface: attribute oncut
PASS SVGElement interface: attribute onpaste
PASS SVGElement interface: attribute dataset
FAIL SVGElement interface: attribute nonce assert_true: The prototype object must have a property "nonce" expected true got false
FAIL SVGElement interface: attribute autofocus assert_true: The prototype object must have a property "autofocus" expected true got false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -323,9 +323,9 @@ PASS HTMLElement interface: attribute onwebkitanimationiteration
PASS HTMLElement interface: attribute onwebkitanimationstart
PASS HTMLElement interface: attribute onwebkittransitionend
PASS HTMLElement interface: attribute onwheel
FAIL HTMLElement interface: attribute oncopy assert_own_property: expected property "oncopy" missing
FAIL HTMLElement interface: attribute oncut assert_own_property: expected property "oncut" missing
FAIL HTMLElement interface: attribute onpaste assert_own_property: expected property "onpaste" missing
PASS HTMLElement interface: attribute oncopy
PASS HTMLElement interface: attribute oncut
PASS HTMLElement interface: attribute onpaste
PASS HTMLElement interface: attribute contentEditable
PASS HTMLElement interface: attribute enterKeyHint
PASS HTMLElement interface: attribute isContentEditable
Expand Down Expand Up @@ -5270,9 +5270,9 @@ PASS SVGElement interface: attribute onwebkitanimationiteration
PASS SVGElement interface: attribute onwebkitanimationstart
PASS SVGElement interface: attribute onwebkittransitionend
PASS SVGElement interface: attribute onwheel
FAIL SVGElement interface: attribute oncopy assert_own_property: expected property "oncopy" missing
FAIL SVGElement interface: attribute oncut assert_own_property: expected property "oncut" missing
FAIL SVGElement interface: attribute onpaste assert_own_property: expected property "onpaste" missing
PASS SVGElement interface: attribute oncopy
PASS SVGElement interface: attribute oncut
PASS SVGElement interface: attribute onpaste
PASS SVGElement interface: attribute dataset
FAIL SVGElement interface: attribute nonce assert_true: The prototype object must have a property "nonce" expected true got false
FAIL SVGElement interface: attribute autofocus assert_true: The prototype object must have a property "autofocus" expected true got false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -323,9 +323,9 @@ PASS HTMLElement interface: attribute onwebkitanimationiteration
PASS HTMLElement interface: attribute onwebkitanimationstart
PASS HTMLElement interface: attribute onwebkittransitionend
PASS HTMLElement interface: attribute onwheel
FAIL HTMLElement interface: attribute oncopy assert_own_property: expected property "oncopy" missing
FAIL HTMLElement interface: attribute oncut assert_own_property: expected property "oncut" missing
FAIL HTMLElement interface: attribute onpaste assert_own_property: expected property "onpaste" missing
PASS HTMLElement interface: attribute oncopy
PASS HTMLElement interface: attribute oncut
PASS HTMLElement interface: attribute onpaste
PASS HTMLElement interface: attribute contentEditable
FAIL HTMLElement interface: attribute enterKeyHint assert_true: The prototype object must have a property "enterKeyHint" expected true got false
PASS HTMLElement interface: attribute isContentEditable
Expand Down Expand Up @@ -5270,9 +5270,9 @@ PASS SVGElement interface: attribute onwebkitanimationiteration
PASS SVGElement interface: attribute onwebkitanimationstart
PASS SVGElement interface: attribute onwebkittransitionend
PASS SVGElement interface: attribute onwheel
FAIL SVGElement interface: attribute oncopy assert_own_property: expected property "oncopy" missing
FAIL SVGElement interface: attribute oncut assert_own_property: expected property "oncut" missing
FAIL SVGElement interface: attribute onpaste assert_own_property: expected property "onpaste" missing
PASS SVGElement interface: attribute oncopy
PASS SVGElement interface: attribute oncut
PASS SVGElement interface: attribute onpaste
PASS SVGElement interface: attribute dataset
FAIL SVGElement interface: attribute nonce assert_true: The prototype object must have a property "nonce" expected true got false
FAIL SVGElement interface: attribute autofocus assert_true: The prototype object must have a property "autofocus" expected true got false
Expand Down
2 changes: 2 additions & 0 deletions Source/WebCore/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -795,6 +795,7 @@ set(WebCore_NON_SVG_IDL_FILES
dom/DragEvent.idl
dom/Element+DOMParsing.idl
dom/Element.idl
dom/ElementContentEditable.idl
dom/ErrorEvent.idl
dom/Event.idl
dom/EventInit.idl
Expand Down Expand Up @@ -896,6 +897,7 @@ set(WebCore_NON_SVG_IDL_FILES
html/HTMLDirectoryElement.idl
html/HTMLDivElement.idl
html/HTMLDocument.idl
html/HTMLElement+CSSOMView.idl
html/HTMLElement.idl
html/HTMLEmbedElement.idl
html/HTMLFieldSetElement.idl
Expand Down
Loading

0 comments on commit b5b1109

Please sign in to comment.