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 more test cases for document.all #7254

Merged
merged 3 commits into from
Sep 8, 2017
Merged

Add more test cases for document.all #7254

merged 3 commits into from
Sep 8, 2017

Conversation

TimothyGu
Copy link
Member

@TimothyGu TimothyGu commented Sep 5, 2017

@ghost
Copy link

ghost commented Sep 5, 2017

Build PASSED

Started: 2017-09-07 22:54:21
Finished: 2017-09-07 23:09:18

View more information about this build on:

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.

Looks great, two minor nits.

assert_equals(document.all(), null);
}, "legacy caller with no argument");

test(function() {
if (typeof Proxy !== "undefined") {
Copy link
Member

Choose a reason for hiding this comment

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

This should be removed I think. Otherwise you can pass the test by not implementing proxies.

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Sure, but why would we guard this one?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, guards in tests skew results and create weird incentives. Let's not go there?


test(function() {
assert_equals(Function.prototype.call.call(document.all, {}, "043"), spans[1]);
}, "legacy caller with arbitrary this value");
Copy link
Member

Choose a reason for hiding this comment

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

Can you add one where the this value is a platform object? E.g., 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.

Sure.

@TimothyGu
Copy link
Member Author

@annevk @tobie Fixed.

@annevk
Copy link
Member

annevk commented Sep 5, 2017

Thanks, these look good to me. I haven't run them in browsers yet. Are there many failures? We should probably file bugs, if any.

@TimothyGu
Copy link
Member Author

@annevk I only tested Chrome and Firefox. Firefox passed all the new tests (but fails some of the old ones). Chrome fails the constructor test but passes all the other new tests (but also fails some of the old tests). I don't have access to either Safari or Edge right now.

@annevk
Copy link
Member

annevk commented Sep 5, 2017

w3c-test:mirror

@annevk
Copy link
Member

annevk commented Sep 5, 2017

Safari TP fails these tests:

  • legacy caller with undefined: assert_equals: expected Element node
    but got null
  • item method with undefined: assert_equals: expected Element node
    but got null
  • collections are new live HTMLCollection instances: assert_not_equals: got disallowed value object "[object HTMLCollection]"

@TimothyGu
Copy link
Member Author

@annevk The first two are the results of WebKit implementing the spec that no one else follows. The third is probably failing even before this change.

@annevk
Copy link
Member

annevk commented Sep 5, 2017

Edge (sorry for the screenshot, browserstack makes copy-and-pasting suck):
screen shot 2017-09-05 at 12 28 16

It would probably be good to file bugs on all browsers then?

@tobie
Copy link
Contributor

tobie commented Sep 5, 2017

It would probably be good to file bugs on all browsers then?

Created whatwg/webidl#434 for issue tracking purposes.

@TimothyGu TimothyGu mentioned this pull request Sep 5, 2017
7 tasks
Copy link
Member

@domenic domenic left a comment

Choose a reason for hiding this comment

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

Revised to match my changes to whatwg/html#2932 ; checking my work appreciated. I confirmed Safari TP does pass all of them now though, except the preexisting problem "collections are new live HTMLCollection instances".

@TimothyGu
Copy link
Member Author

@domenic I can't approve my own PR but your changes LGTM.

@domenic domenic merged commit b6d42d0 into master Sep 8, 2017
@domenic domenic deleted the document-all-revision branch September 8, 2017 21:21
new document.all("picture");
}, "New should not work on document.all()");

// https://esdiscuss.org/topic/isconstructor#content-11
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for adding this test! I tried to pass the above test by adding custom bindings that would throw TypeError when document.all() was invoked as a constructor, but this one still failed. So I had to go fix it in V8 which seems like the right place:
https://chromium-review.googlesource.com/c/v8/v8/+/882642

Copy link
Member Author

Choose a reason for hiding this comment

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

Looks right to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants