Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests for the messageerror IDL and content attributes #5567

Merged
merged 1 commit into from Apr 24, 2017

Conversation

domenic
Copy link
Member

@domenic domenic commented Apr 14, 2017

Follows whatwg/html#2530. As explained there, the circumstances in which this would actually be fired by the UA are not tested in this PR, waiting instead for #5003.

As a side effect this syncs various IDL snippets with the HTML Standard.

FYI @binji @mtrofin on the Blink side, @lars-t-hansen on the Gecko side.


This change is Reviewable

Follows whatwg/html#2530. As explained there, the circumstances in which this would actually be fired by the UA are not tested in this PR, waiting instead for #5003.

As a side effect this syncs various IDL snippets with the HTML Standard.
@domenic domenic requested a review from annevk April 14, 2017 20:57
@wpt-pr-bot
Copy link
Collaborator

@w3c-bots
Copy link

View the complete job log.

Lint

Passed

@w3c-bots
Copy link

*This report has been truncated because the total content is 2989260 characters in length, which is in excess of GitHub.com's limit for comments (65536 characters).

View the complete job log.

Firefox (nightly channel)

Testing web-platform-tests at revision de241dd
Using browser at version BuildID 20170414100243; SourceStamp cda24082bff8864a6e53726feeae33cae9e17309
Starting 10 test iterations
All results were stable

All results

3 tests ran
/html/dom/interfaces.html
Subtest Results Messages
OK
Test driver PASS
NodeList must be primary interface of document.getElementsByName("name") PASS
Stringification of document.getElementsByName("name") PASS
NodeList interface: document.getElementsByName("name") must inherit property "item" with the proper type (0) PASS
NodeList interface: calling item(unsigned long) on document.getElementsByName("name") with too few arguments must throw TypeError PASS
NodeList interface: document.getElementsByName("name") must inherit property "length" with the proper type (1) PASS
Document interface: attribute domain FAIL assert_true: The prototype object must have a property "domain" expected true got false
Document interface: attribute referrer PASS
Document interface: attribute cookie FAIL assert_true: The prototype object must have a property "cookie" expected true got false
Document interface: attribute lastModified PASS
Document interface: attribute readyState PASS
Document interface: attribute title PASS
Document interface: attribute dir PASS
Document interface: attribute body FAIL assert_true: The prototype object must have a property "body" expected true got false
Document interface: attribute head FAIL assert_true: The prototype object must have a property "head" expected true got false
Document interface: attribute images FAIL assert_true: The prototype object must have a property "images" expected true got false
Document interface: attribute embeds FAIL assert_true: The prototype object must have a property "embeds" expected true got false
Document interface: attribute plugins FAIL assert_true: The prototype object must have a property "plugins" expected true got false
Document interface: attribute links FAIL assert_true: The prototype object must have a property "links" expected true got false
Document interface: attribute forms FAIL assert_true: The prototype object must have a property "forms" expected true got false
Document interface: attribute scripts FAIL assert_true: The prototype object must have a property "scripts" expected true got false
Document interface: operation getElementsByName(DOMString) FAIL assert_own_property: interface prototype object missing non-static operation expected property "getElementsByName" missing
Document interface: attribute currentScript PASS
Document interface: operation open(DOMString,DOMString) FAIL assert_own_property: interface prototype object missing non-static operation expected property "open" missing
Document interface: operation open(USVString,DOMString,DOMString) FAIL assert_own_property: interface prototype object missing non-static operation expected property "open" missing
Document interface: operation close() FAIL assert_own_property: interface prototype object missing non-static operation expected property "close" missing
Document interface: operation write(DOMString) FAIL assert_own_property: interface prototype object missing non-static operation expected property "write" missing
Document interface: operation writeln(DOMString) FAIL assert_own_property: interface prototype object missing non-static operation expected property "writeln" missing
Document interface: attribute defaultView PASS
Document interface: attribute activeElement PASS
Document interface: operation hasFocus() PASS
Document interface: attribute designMode FAIL assert_true: The prototype object must have a property "designMode" expected true got false
Document interface: operation execCommand(DOMString,boolean,DOMString) FAIL assert_own_property: interface prototype object missing non-static operation expected property "execCommand" missing
Document interface: operation queryCommandEnabled(DOMString) FAIL assert_own_property: interface prototype object missing non-static operation expected property "queryCommandEnabled" missing
Document interface: operation queryCommandIndeterm(DOMString) FAIL assert_own_property: interface prototype object missing non-static operation expected property "queryCommandIndeterm" missing
Document interface: operation queryCommandState(DOMString) FAIL assert_own_property: interface prototype object missing non-static operation expected property "queryCommandState" missing
Document interface: operation queryCommandSupported(DOMString) FAIL assert_own_property: interface prototype object missing non-static operation expected property "queryCommandSupported" missing
Document interface: operation queryCommandValue(DOMString) FAIL assert_own_property: interface prototype object missing non-static operation expected property "queryCommandValue" missing
Document interface: attribute onreadystatechange PASS
Document interface: attribute fgColor FAIL assert_true: The prototype object must have a property "fgColor" expected true got false
Document interface: attribute linkColor FAIL assert_true: The prototype object must have a property "linkColor" expected true got false
Document interface: attribute vlinkColor FAIL assert_true: The prototype object must have a property "vlinkColor" expected true got false
Document interface: attribute alinkColor FAIL assert_true: The prototype object must have a property "alinkColor" expected true got false
Document interface: attribute bgColor FAIL assert_true: The prototype object must have a property "bgColor" expected true got false
Document interface: attribute anchors FAIL assert_true: The prototype object must have a property "anchors" expected true got false
Document interface: attribute applets FAIL assert_true: The prototype object must have a property "applets" expected true got false
Document interface: operation clear() FAIL assert_own_property: interface prototype object missing non-static operation expected property "clear" missing
Document interface: operation captureEvents() FAIL assert_own_property: interface prototype object missing non-static operation expected property "captureEvents" missing
Document interface: operation releaseEvents() FAIL assert_own_property: interface prototype object missing non-static operation expected property "releaseEvents" missing
Document interface: attribute all FAIL assert_true: The prototype object must have a property "all" expected true got false
Document interface: attribute onabort PASS
Document interface: attribute onauxclick PASS
Document interface: attribute onblur PASS
Document interface: attribute oncancel FAIL assert_true: The prototype object must have a property "oncancel" expected true got false
Document interface: attribute oncanplay PASS
Document interface: attribute oncanplaythrough PASS
Document interface: attribute onchange PASS
Document interface: attribute onclick PASS
Document interface: attribute onclose PASS
Document interface: attribute oncontextmenu PASS
Document interface: attribute oncuechange FAIL assert_true: The prototype object must have a property "oncuechange" expected true got false
Document interface: attribute ondblclick PASS
Document interface: attribute ondrag PASS
Document interface: attribute ondragend PASS
Document interface: attribute ondragenter PASS
Document interface: attribute ondragexit PASS
Document interface: attribute ondragleave PASS
Document interface: attribute ondragover PASS
Document interface: attribute ondragstart PASS
Document interface: attribute ondrop PASS
Document interface: attribute ondurationchange PASS
Document interface: attribute onemptied PASS
Document interface: attribute onended PASS
Document interface: attribute onerror PASS
Document interface: attribute onfocus PASS
Document interface: attribute oninput PASS
Document interface: attribute oninvalid PASS
Document interface: attribute onkeydown PASS
Document interface: attribute onkeypress PASS
Document interface: attribute onkeyup PASS
Document interface: attribute onload PASS
Document interface: attribute onloadeddata PASS
Document interface: attribute onloadedmetadata PASS
Document interface: attribute onloadstart PASS
Document interface: attribute onmousedown PASS
Document interface: attribute onmouseenter PASS
Document interface: attribute onmouseleave PASS
Document interface: attribute onmousemove PASS
Document interface: attribute onmouseout PASS
Document interface: attribute onmouseover PASS
Document interface: attribute onmouseup PASS
Document interface: attribute onmousewheel FAIL assert_true: The prototype object must have a property "onmousewheel" expected true got false
Document interface: attribute onpause PASS
Document interface: attribute onplay PASS
Document interface: attribute onplaying PASS
Document interface: attribute onprogress PASS
Document interface: attribute onratechange PASS
Document interface: attribute onreset PASS
Document interface: attribute onresize PASS
Document interface: attribute onscroll PASS
Document interface: attribute onseeked PASS
Document interface: attribute onseeking PASS
Document interface: attribute onselect PASS
Document interface: attribute onshow PASS
Document interface: attribute onstalled PASS
Document interface: attribute onsubmit PASS
Document interface: attribute onsuspend PASS
Document interface: attribute ontimeupdate PASS
Document interface: attribute ontoggle PASS
Document interface: attribute onvolumechange PASS
Document interface: attribute onwaiting PASS
Document interface: attribute oncopy PASS
Document interface: attribute oncut PASS
Document interface: attribute onpaste PASS
Stringification of iframe.contentDocument FAIL assert_equals: class string of iframe.contentDocument expected "[object Document]" but got "[object HTMLDocument]"
Document interface: iframe.contentDocument must inherit property "implementation" with the proper type (0) PASS
Document interface: iframe.contentDocument must inherit property "URL" with the proper type (1) PASS
Document interface: iframe.contentDocument must inherit property "documentURI" with the proper type (2) PASS
Document interface: iframe.contentDocument must inherit property "origin" with the proper type (3) FAIL assert_inherits: property "origin" not found in prototype chain
Document interface: iframe.contentDocument must inherit property "compatMode" with the proper type (4) PASS
Document interface: iframe.contentDocument must inherit property "characterSet" with the proper type (5) PASS
`Document interface: iframe.contentDocument must inherit property "charset" with the proper

@w3c-bots
Copy link

*This report has been truncated because the total content is 3016726 characters in length, which is in excess of GitHub.com's limit for comments (65536 characters).

View the complete job log.

Chrome (unstable channel)

Testing web-platform-tests at revision de241dd
Using browser at version 59.0.3067.0 dev
Starting 10 test iterations
All results were stable

All results

3 tests ran
/html/dom/interfaces.html
Subtest Results Messages
OK
Test driver PASS
NodeList must be primary interface of document.getElementsByName("name") PASS
Stringification of document.getElementsByName("name") PASS
NodeList interface: document.getElementsByName("name") must inherit property "item" with the proper type (0) PASS
NodeList interface: calling item(unsigned long) on document.getElementsByName("name") with too few arguments must throw TypeError PASS
NodeList interface: document.getElementsByName("name") must inherit property "length" with the proper type (1) PASS
Document interface: attribute domain PASS
Document interface: attribute referrer PASS
Document interface: attribute cookie PASS
Document interface: attribute lastModified PASS
Document interface: attribute readyState PASS
Document interface: attribute title PASS
Document interface: attribute dir PASS
Document interface: attribute body PASS
Document interface: attribute head PASS
Document interface: attribute images PASS
Document interface: attribute embeds PASS
Document interface: attribute plugins PASS
Document interface: attribute links PASS
Document interface: attribute forms PASS
Document interface: attribute scripts PASS
Document interface: operation getElementsByName(DOMString) PASS
Document interface: attribute currentScript PASS
Document interface: operation open(DOMString,DOMString) PASS
Document interface: operation open(USVString,DOMString,DOMString) PASS
Document interface: operation close() PASS
Document interface: operation write(DOMString) PASS
Document interface: operation writeln(DOMString) PASS
Document interface: attribute defaultView PASS
Document interface: attribute activeElement PASS
Document interface: operation hasFocus() PASS
Document interface: attribute designMode PASS
Document interface: operation execCommand(DOMString,boolean,DOMString) PASS
Document interface: operation queryCommandEnabled(DOMString) PASS
Document interface: operation queryCommandIndeterm(DOMString) PASS
Document interface: operation queryCommandState(DOMString) PASS
Document interface: operation queryCommandSupported(DOMString) PASS
Document interface: operation queryCommandValue(DOMString) PASS
Document interface: attribute onreadystatechange PASS
Document interface: attribute fgColor FAIL assert_true: The prototype object must have a property "fgColor" expected true got false
Document interface: attribute linkColor FAIL assert_true: The prototype object must have a property "linkColor" expected true got false
Document interface: attribute vlinkColor FAIL assert_true: The prototype object must have a property "vlinkColor" expected true got false
Document interface: attribute alinkColor FAIL assert_true: The prototype object must have a property "alinkColor" expected true got false
Document interface: attribute bgColor FAIL assert_true: The prototype object must have a property "bgColor" expected true got false
Document interface: attribute anchors PASS
Document interface: attribute applets PASS
Document interface: operation clear() FAIL assert_own_property: interface prototype object missing non-static operation expected property "clear" missing
Document interface: operation captureEvents() FAIL assert_own_property: interface prototype object missing non-static operation expected property "captureEvents" missing
Document interface: operation releaseEvents() FAIL assert_own_property: interface prototype object missing non-static operation expected property "releaseEvents" missing
Document interface: attribute all FAIL assert_true: The prototype object must have a property "all" expected true got false
Document interface: attribute onabort PASS
Document interface: attribute onauxclick PASS
Document interface: attribute onblur PASS
Document interface: attribute oncancel PASS
Document interface: attribute oncanplay PASS
Document interface: attribute oncanplaythrough PASS
Document interface: attribute onchange PASS
Document interface: attribute onclick PASS
Document interface: attribute onclose PASS
Document interface: attribute oncontextmenu PASS
Document interface: attribute oncuechange PASS
Document interface: attribute ondblclick PASS
Document interface: attribute ondrag PASS
Document interface: attribute ondragend PASS
Document interface: attribute ondragenter PASS
Document interface: attribute ondragexit FAIL assert_true: The prototype object must have a property "ondragexit" expected true got false
Document interface: attribute ondragleave PASS
Document interface: attribute ondragover PASS
Document interface: attribute ondragstart PASS
Document interface: attribute ondrop PASS
Document interface: attribute ondurationchange PASS
Document interface: attribute onemptied PASS
Document interface: attribute onended PASS
Document interface: attribute onerror PASS
Document interface: attribute onfocus PASS
Document interface: attribute oninput PASS
Document interface: attribute oninvalid PASS
Document interface: attribute onkeydown PASS
Document interface: attribute onkeypress PASS
Document interface: attribute onkeyup PASS
Document interface: attribute onload PASS
Document interface: attribute onloadeddata PASS
Document interface: attribute onloadedmetadata PASS
Document interface: attribute onloadstart PASS
Document interface: attribute onmousedown PASS
Document interface: attribute onmouseenter PASS
Document interface: attribute onmouseleave PASS
Document interface: attribute onmousemove PASS
Document interface: attribute onmouseout PASS
Document interface: attribute onmouseover PASS
Document interface: attribute onmouseup PASS
Document interface: attribute onmousewheel PASS
Document interface: attribute onpause PASS
Document interface: attribute onplay PASS
Document interface: attribute onplaying PASS
Document interface: attribute onprogress PASS
Document interface: attribute onratechange PASS
Document interface: attribute onreset PASS
Document interface: attribute onresize PASS
Document interface: attribute onscroll PASS
Document interface: attribute onseeked PASS
Document interface: attribute onseeking PASS
Document interface: attribute onselect PASS
Document interface: attribute onshow PASS
Document interface: attribute onstalled PASS
Document interface: attribute onsubmit PASS
Document interface: attribute onsuspend PASS
Document interface: attribute ontimeupdate PASS
Document interface: attribute ontoggle PASS
Document interface: attribute onvolumechange PASS
Document interface: attribute onwaiting PASS
Document interface: attribute oncopy PASS
Document interface: attribute oncut PASS
Document interface: attribute onpaste PASS
Stringification of iframe.contentDocument FAIL assert_equals: class string of iframe.contentDocument expected "[object Document]" but got "[object HTMLDocument]"
Document interface: iframe.contentDocument must inherit property "implementation" with the proper type (0) PASS
Document interface: iframe.contentDocument must inherit property "URL" with the proper type (1) PASS
Document interface: iframe.contentDocument must inherit property "documentURI" with the proper type (2) PASS
Document interface: iframe.contentDocument must inherit property "origin" with the proper type (3) PASS
Document interface: iframe.contentDocument must inherit property "compatMode" with the proper type (4) PASS
Document interface: iframe.contentDocument must inherit property "characterSet" with the proper type (5) PASS
Document interface: iframe.contentDocument must inherit property "charset" with the proper type (6) PASS

Copy link
Member

@annevk annevk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also adds onrejectionhandled and onunhandledrejection and aligns IDL around transferable changes, but that all looks reasonable.

annevk added a commit to whatwg/html that referenced this pull request Apr 24, 2017
The messageerror event is used when deserialization fails. E.g., when
an ArrayBuffer object cannot be allocated.

This also removes StructuredCloneWithTransfer as deserializing errors
now need to be handled on their own.

Tests: web-platform-tests/wpt#5567.

Service workers follow-up:
w3c/ServiceWorker#1116.

Fixes part of #2260 and fixes #935.
domenic pushed a commit to whatwg/html that referenced this pull request Apr 24, 2017
The messageerror event is used when deserialization fails. E.g., when
an ArrayBuffer object cannot be allocated.

This also removes StructuredCloneWithTransfer as deserializing errors
now need to be handled on their own.

Tests: web-platform-tests/wpt#5567.

Service workers follow-up:
w3c/ServiceWorker#1116.

Fixes part of #2260 and fixes #935.
@domenic domenic merged commit e1dcc27 into master Apr 24, 2017
@domenic domenic deleted the messageerror branch April 24, 2017 22:30

document.body.setAttribute("onmessageerror", "window.messageErrorHappened = true;")

document.body.dispatchEvent(new Event("messageerror"));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious about this test -- if I try the same thing with onmessage and message instead, it doesn't fire on Chrome or Firefox. Is there something special about the messageerror event here? Or am I missing something?

(BTW, it works fine if the event is dispatched on window instead of document.body)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it doesn't work with message, that's likely a sign this test is bad. I'll look into it first thing on Monday. The fix might indeed just be dispatching on window.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, cool. Thanks!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test appears to be just invalid, yeah. I'll submit a PR removing it.

domenic added a commit that referenced this pull request May 1, 2017
This is a follow-up to #5567. As pointed out in https://github.com/w3c/web-platform-tests/pull/5567/files#r114040410, this test is invalid. messageerror (and message) have their corresponding event handler content attributes on document.body, but with the actual event handler belonging to Window.
domenic added a commit that referenced this pull request May 1, 2017
This is a follow-up to #5567. As pointed out in https://github.com/w3c/web-platform-tests/pull/5567/files#r114040410, this test is invalid. messageerror (and message) have their corresponding event handler content attributes on document.body, but with the actual event handler belonging to Window.
inikulin pushed a commit to HTMLParseErrorWG/html that referenced this pull request May 9, 2017
The messageerror event is used when deserialization fails. E.g., when
an ArrayBuffer object cannot be allocated.

This also removes StructuredCloneWithTransfer as deserializing errors
now need to be handled on their own.

Tests: web-platform-tests/wpt#5567.

Service workers follow-up:
w3c/ServiceWorker#1116.

Fixes part of whatwg#2260 and fixes whatwg#935.
inikulin pushed a commit to HTMLParseErrorWG/html that referenced this pull request May 9, 2017
The messageerror event is used when deserialization fails. E.g., when
an ArrayBuffer object cannot be allocated.

This also removes StructuredCloneWithTransfer as deserializing errors
now need to be handled on their own.

Tests: web-platform-tests/wpt#5567.

Service workers follow-up:
w3c/ServiceWorker#1116.

Fixes part of whatwg#2260 and fixes whatwg#935.
scheib pushed a commit to scheib/chromium that referenced this pull request May 13, 2017
This event is not currently wired up anywhere, but will be used in a
subsequent CL. The idea is that when posting a message that cannot be
decoded by the receiver, the receiver will dispatch a messageerror event
instead of a message event.

Spec changes: whatwg/html#2530
web platform tests: web-platform-tests/wpt#5567
Intent-to-implement: https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/Z_XzejHJTrs

BUG=chromium:714842

Review-Url: https://codereview.chromium.org/2860483002
Cr-Commit-Position: refs/heads/master@{#471491}
alice pushed a commit to alice/html that referenced this pull request Jan 8, 2019
The messageerror event is used when deserialization fails. E.g., when
an ArrayBuffer object cannot be allocated.

This also removes StructuredCloneWithTransfer as deserializing errors
now need to be handled on their own.

Tests: web-platform-tests/wpt#5567.

Service workers follow-up:
w3c/ServiceWorker#1116.

Fixes part of whatwg#2260 and fixes whatwg#935.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants