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

WebKit export of https://bugs.webkit.org/show_bug.cgi?id=252102 #38512

Merged
merged 1 commit into from
Feb 15, 2023

Conversation

nt1m
Copy link
Member

@nt1m nt1m commented Feb 15, 2023

The spec says to use InvalidStateError not NotSupportedError for popovers.

The spec says to use InvalidStateError not NotSupportedError
@nt1m
Copy link
Member Author

nt1m commented Feb 15, 2023

cc @josepharhar @mfreed7 to fix Chrome's implementation to match the spec.

@nt1m nt1m enabled auto-merge (squash) February 15, 2023 07:29
Copy link
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

Choose a reason for hiding this comment

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

The review process for this patch is being conducted in the WebKit project.

@nt1m nt1m merged commit 9da79c0 into master Feb 15, 2023
@nt1m nt1m deleted the nt1m-patch-1 branch February 15, 2023 07:42
@josepharhar
Copy link
Contributor

Ah this was actually due to me messing up the spec, it was supposed to be NotSupportedError in the spec. The reasoning is that showPopover() is not supported on elements without the popover attribute, whereas InvalidStateError is thrown when the popover attribute is present but there's something else in the wrong state, such as the popover already showing when showPopover() is called.

Are you OK with me changing the spec?

@nt1m
Copy link
Member Author

nt1m commented Feb 15, 2023

@josepharhar InvalidStateError and NotSupportedError both make sense to me, I'm fine with whatever is more consistent with prior art.

josepharhar added a commit to josepharhar/html that referenced this pull request Feb 16, 2023
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
@josepharhar
Copy link
Contributor

I opened a PR here: whatwg/html#8891

@mfreed7
Copy link
Contributor

mfreed7 commented Feb 17, 2023

This PR missed one more at line 383.

But given the discussion at whatwg/html#8891 I'm planning to revert the changes from this PR. I won't land it until we resolve that issue though. Hopefully ok!

annevk pushed a commit to josepharhar/html that referenced this pull request Feb 23, 2023
annevk added a commit to whatwg/html that referenced this pull request Feb 27, 2023
As discussed in web-platform-tests/wpt#38512. Those tests were reverted as part of web-platform-tests/wpt#38392.

Co-authored-by: Anne van Kesteren <annevk@annevk.nl>
marcoscaceres pushed a commit that referenced this pull request Mar 28, 2023
The spec says to use InvalidStateError not NotSupportedError for popovers.
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.

5 participants