-
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
Throw exception in originalType check #9058
Conversation
Since exception throwing was moved into "check popover validity," we need to explicitly throw an exception for this originalType check in order to make sure that it actually throws an exception like it is supposed to. Fixes whatwg#9037
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.
We should probably not land this until #9045 is resolved?
What would the non-throwing alternative be here? Silently abandoning the show operation is one possibility. Or allow it to complete, then run the hide operation. |
…toggle https://bugs.webkit.org/show_bug.cgi?id=254268 Reviewed by Tim Nguyen. Handle showPopover changing popover attribute during beforetoggle by throwing an exception: whatwg/html#9058 * LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/popover-attribute-basic-expected.txt: * LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/popovers/popover-attribute-basic-expected.txt: * Source/WebCore/html/HTMLElement.cpp: (WebCore::HTMLElement::showPopover): Canonical link: https://commits.webkit.org/262026@main
Correct me if I'm wrong, but #9045 doesn't specifically consider this case. This is a fairly corner case: while showing a popover, other descendant popovers are hidden, and one of the event handlers for those popovers changes the popover type of this popover.
I (still) think silently abandoning the show makes the most sense in this corner case. Remember that most of these exceptions were added because there was a feeling (during the review for the original popover PR) that exceptions needed to be thrown everywhere when possible. I suppose #9045 is providing more evidence that we should err on the side of fewer exceptions. |
Not specifically no, but if we are going to change what exceptions to throw we should consider all cases and change them all at once. |
Having a single PR for all exception changes sounds like a good idea, yes. If it's easier to update one of the existing PRs that's fine too. Just need to update the commit message and the issues it will end up closing. |
@josepharhar Is this still relevant? |
Yes, this is still relevant. Chromium has this change implemented here: https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/html/html_element.cc;l=1501-1511;drc=dcd4fe5a57e77e434ad1df6a22fb7ee013fe9ed4 |
Can you rebase this then? |
I resolved the merge conflicts |
Since exception throwing was moved into "check popover validity," we need to explicitly throw an exception for this originalType check in order to make sure that it actually throws an exception like it is supposed to.
Fixes #9037
/popover.html ( diff )