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

Introduce IdlInterface#should_have_interface_object() method #23104

Merged

Conversation

shvaikalesh
Copy link
Member

Resolves #18827.

@LukeZielinski
Copy link
Contributor

Closing/reopening since TaskCluster didn't run here.

@shvaikalesh
Copy link
Member Author

@foolip Would you please take a look?

With this change, a few XPathNSResolver incompatibilities are exposed: WebKit doesn't require the prefix argument, while Firefox has wrong result for Object.prototype.toString().

/webgl/idlharness.any.worker.html seems to rarely timeout on wpt-firefox-nightly-stability, yet I don't think it is related to the change.

Copy link
Member

@foolip foolip left a comment

Choose a reason for hiding this comment

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

Excellent cleanup, thank you! I have doubts about just one of the changes, can you take a look?

@@ -2596,6 +2603,12 @@ IdlInterface.prototype.test_member_iterable = function(member)
{
subsetTestByKey(this.name, test, function()
{
if (!this.should_have_interface_object()) {
return;
Copy link
Member

Choose a reason for hiding this comment

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

Is this early return hit in any test? It looks a bit suspect to create and pass these tests without testing anything, and that we'd need to especially care about this.should_have_interface_object() for testing iterator<T> but not async iterable, for example.

In other words, does anything bad happen if these additions are not made, or is there possible Web IDL where we'd assert the wrong this without these changes, even if no spec currently does that?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, it doesn't.

I've added this check & assert because a) test_member_stringifier() has it and b) WebIDL spec does not forbid iterable<> on interfaces with [LegacyNoInterfaceObject] extended attribute or callback interfaces.

However, I didn't find such iterable<> occurrence among WebKit's *.idl files (there is stringifier with [NoInterfaceObject] though), and both [LegacyNoInterfaceObject] and callback interfaces are legacy, so we are safe to remove it.

@shvaikalesh shvaikalesh force-pushed the should-have-interface-object branch from 8f80e0a to 2455ba2 Compare July 3, 2020 09:35
@foolip foolip merged commit 2979a22 into web-platform-tests:master Jul 3, 2020
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.

Testing XPathNSResolver object incorrectly does assert_interface_object_exists
5 participants