-
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
togglePopover() algorithm does not check popover validity when force == false and when the popover visibility state is hidden #8999
Comments
Probably doesn't matter too much fwiw. |
Seems like an oversight to me also, but I'll let @josepharhar comment. |
togglePopover just calls "hide a popover" or "show popover", and each of those algorithms check popover validity as their first step. Are you saying that when togglePopover decides not to do anything, we should still call check popover validity...? I don't see why we should. |
There is this slight oddity when you call |
What if we make the logic:
|
@annevk Do you think it's still worth changing the spec given the recent changes to not throw? The implication of this change is that the other "check popover validity" checks (dialog, fullscreen, disconnected) would run in the cases I mentioned in the title: https://html.spec.whatwg.org/multipage/popover.html#check-popover-validity |
We decided to not throw in certain cases. Did we decide to not throw for cases where state does not match up? It looks to me like |
So the following code would result in a call to check popover validity and possibly throw exceptions? const div = document.createElement('div');
div.setAttribute('popover', 'auto');
// don't connect to document or show
div.togglePopover(/*force=*/false); // try to force close
So the above code I wrote should throw an exception then? |
@josepharhar Since hidePopover() wouldn't throw in this case, I would say it shouldn't (and in fact it wouldn't with the suggested change, since the But: const div = document.createElement('div');
// don't set popover attribute
// don't connect to document or show
div.togglePopover(/*force=*/false); // try to force close would start throwing, unlike the current algorithm. Stuff in step 3. of the check popover validity would also start throwing. |
This PR makes sure that togglePopover will throw exceptions when it is disconnected from the document or doesn't have a popover attribute. Fixes whatwg#8999
This patch makes sure that togglePopover will throw exceptions when it is disconnected from the document or doesn't have a popover attribute. This is being discussed here: whatwg/html#8999 Change-Id: Iac7a486cd64b09b5657a157dbf3e9e54c1be2a27
This PR makes sure that togglePopover will throw exceptions when it is disconnected from the document or doesn't have a popover attribute. Fixes whatwg#8999
Ok, I created a PR to implement this: #9451 |
I have a similar PR for WebKit: |
This makes sure that togglePopover() will throw exceptions when it is disconnected from the document or doesn't have a popover attribute. Fixes #8999.
https://bugs.webkit.org/show_bug.cgi?id=258574 Reviewed by Tim Nguyen. Throw exceptions in togglePopover in case of a disconnected node or the popover attribute not being set anymore, see whatwg/html#8999. * LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/togglePopover-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/togglePopover.html: * Source/WebCore/html/HTMLElement.cpp: (WebCore::HTMLElement::togglePopover): Canonical link: https://commits.webkit.org/265589@main
This patch makes sure that togglePopover will throw exceptions when it is disconnected from the document or doesn't have a popover attribute. This is being discussed here: whatwg/html#8999 Change-Id: Iac7a486cd64b09b5657a157dbf3e9e54c1be2a27
This patch makes sure that togglePopover will throw exceptions when it is disconnected from the document or doesn't have a popover attribute. This is being discussed here: whatwg/html#8999 Change-Id: Iac7a486cd64b09b5657a157dbf3e9e54c1be2a27 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4634324 Auto-Submit: Joey Arhar <jarhar@chromium.org> Reviewed-by: Mason Freed <masonf@chromium.org> Commit-Queue: Joey Arhar <jarhar@chromium.org> Cr-Commit-Position: refs/heads/main@{#1166059}
This patch makes sure that togglePopover will throw exceptions when it is disconnected from the document or doesn't have a popover attribute. This is being discussed here: whatwg/html#8999 Change-Id: Iac7a486cd64b09b5657a157dbf3e9e54c1be2a27 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4634324 Auto-Submit: Joey Arhar <jarhar@chromium.org> Reviewed-by: Mason Freed <masonf@chromium.org> Commit-Queue: Joey Arhar <jarhar@chromium.org> Cr-Commit-Position: refs/heads/main@{#1166059}
…, a=testonly Automatic update from web-platform-tests Make togglePopover throw more exceptions This patch makes sure that togglePopover will throw exceptions when it is disconnected from the document or doesn't have a popover attribute. This is being discussed here: whatwg/html#8999 Change-Id: Iac7a486cd64b09b5657a157dbf3e9e54c1be2a27 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4634324 Auto-Submit: Joey Arhar <jarhar@chromium.org> Reviewed-by: Mason Freed <masonf@chromium.org> Commit-Queue: Joey Arhar <jarhar@chromium.org> Cr-Commit-Position: refs/heads/main@{#1166059} -- wpt-commits: 12aef06b95b80e9d489c123a235a2c1cdc85a838 wpt-pr: 40682
…, a=testonly Automatic update from web-platform-tests Make togglePopover throw more exceptions This patch makes sure that togglePopover will throw exceptions when it is disconnected from the document or doesn't have a popover attribute. This is being discussed here: whatwg/html#8999 Change-Id: Iac7a486cd64b09b5657a157dbf3e9e54c1be2a27 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4634324 Auto-Submit: Joey Arhar <jarharchromium.org> Reviewed-by: Mason Freed <masonfchromium.org> Commit-Queue: Joey Arhar <jarharchromium.org> Cr-Commit-Position: refs/heads/main{#1166059} -- wpt-commits: 12aef06b95b80e9d489c123a235a2c1cdc85a838 wpt-pr: 40682 UltraBlame original commit: a30b08c8c590ed2562eb20a222a5a4714bd93936
…, a=testonly Automatic update from web-platform-tests Make togglePopover throw more exceptions This patch makes sure that togglePopover will throw exceptions when it is disconnected from the document or doesn't have a popover attribute. This is being discussed here: whatwg/html#8999 Change-Id: Iac7a486cd64b09b5657a157dbf3e9e54c1be2a27 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4634324 Auto-Submit: Joey Arhar <jarharchromium.org> Reviewed-by: Mason Freed <masonfchromium.org> Commit-Queue: Joey Arhar <jarharchromium.org> Cr-Commit-Position: refs/heads/main{#1166059} -- wpt-commits: 12aef06b95b80e9d489c123a235a2c1cdc85a838 wpt-pr: 40682 UltraBlame original commit: a30b08c8c590ed2562eb20a222a5a4714bd93936
…, a=testonly Automatic update from web-platform-tests Make togglePopover throw more exceptions This patch makes sure that togglePopover will throw exceptions when it is disconnected from the document or doesn't have a popover attribute. This is being discussed here: whatwg/html#8999 Change-Id: Iac7a486cd64b09b5657a157dbf3e9e54c1be2a27 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4634324 Auto-Submit: Joey Arhar <jarharchromium.org> Reviewed-by: Mason Freed <masonfchromium.org> Commit-Queue: Joey Arhar <jarharchromium.org> Cr-Commit-Position: refs/heads/main{#1166059} -- wpt-commits: 12aef06b95b80e9d489c123a235a2c1cdc85a838 wpt-pr: 40682 UltraBlame original commit: a30b08c8c590ed2562eb20a222a5a4714bd93936
…, a=testonly Automatic update from web-platform-tests Make togglePopover throw more exceptions This patch makes sure that togglePopover will throw exceptions when it is disconnected from the document or doesn't have a popover attribute. This is being discussed here: whatwg/html#8999 Change-Id: Iac7a486cd64b09b5657a157dbf3e9e54c1be2a27 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4634324 Auto-Submit: Joey Arhar <jarhar@chromium.org> Reviewed-by: Mason Freed <masonf@chromium.org> Commit-Queue: Joey Arhar <jarhar@chromium.org> Cr-Commit-Position: refs/heads/main@{#1166059} -- wpt-commits: 12aef06b95b80e9d489c123a235a2c1cdc85a838 wpt-pr: 40682
https://bugs.webkit.org/show_bug.cgi?id=258574 Reviewed by Tim Nguyen. Throw exceptions in togglePopover in case of a disconnected node or the popover attribute not being set anymore, see whatwg/html#8999. * LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/togglePopover-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/togglePopover.html: * Source/WebCore/html/HTMLElement.cpp: (WebCore::HTMLElement::togglePopover): Canonical link: https://commits.webkit.org/265589@main
This makes sure that togglePopover() will throw exceptions when it is disconnected from the document or doesn't have a popover attribute. Fixes whatwg#8999.
This makes sure that togglePopover() will throw exceptions when it is disconnected from the document or doesn't have a popover attribute. Fixes whatwg#8999.
Seems like an oversight to me.
cc @josepharhar @mfreed7 @annevk
The text was updated successfully, but these errors were encountered: