-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Change exception thrown when popover attribute is not present #8891
Conversation
We discussed these exceptions as part of the popover PR pretty explicitly. I think the status quo is fine here. cc @nt1m |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I missed that you had coordinated this with @nt1m already. As I don't feel strongly I've done a quick editorial pass.
@annevk I'd like us to go with whatever exception is more consistent with prior art, whichever that is. |
@nt1m I'm afraid exceptions are all over the map. |
Just to add my logic for why they're the way they're currently implemented in Chromium (and described in this spec PR):
I'm ok either way really, this just made semantic sense to me. |
As discussed in web-platform-tests/wpt#38512. (Those test changes will be reverted.)
fa6d04d
to
efa7d47
Compare
I pushed some nits. Let me know what you think. @mfreed7 did you create a PR to revert the test changes? |
It looks like the changes were already reverted here: web-platform-tests/wpt#38392 |
Yep that’s right - I reverted the exception changes as part of that larger PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to assume my nits are okay.
@nt1m do we have a bug to track this or do I/you need to file something? |
This patch changes the exception thrown from InvalidStateError to NotSupportedError when showPopover or hidePopover is called on elements which don't have a popover attribute.
Chrome's implementation does this and I missed it when I initially wrote the spec. The reason that NotSupportedError is thrown instead is that elements wich don't have a popover attribute don't support showPopover and hidePopover, and in the other cases showPopover and hidePopover are supported but something else is in the wrong state, such as the popover already showing when showPopover is called.
This was raised here:
web-platform-tests/wpt#38512
(See WHATWG Working Mode: Changes for more details.)
/popover.html ( diff )