Skip to content

Commit 574f5c5

Browse files
Add optional force parameter to togglePopover
This was suggested by domenic here: whatwg/html#8221 (comment) Bug: 1307772 Change-Id: Ie371028dd41601f445b7590d0769e6bf101f6072 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4070786 Commit-Queue: Mason Freed <[email protected]> Reviewed-by: Mason Freed <[email protected]> Commit-Queue: Joey Arhar <[email protected]> Auto-Submit: Joey Arhar <[email protected]> Cr-Commit-Position: refs/heads/main@{#1081666}
1 parent e0177c5 commit 574f5c5

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

html/semantics/popovers/popover-attribute-basic.tentative.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,14 @@
8484
assertPopoverVisibility(popover, /*isPopover*/true, /*expectedVisibility*/true, 'After togglePopover() on hidden popover, it should be visible');
8585
popover.togglePopover();
8686
assertPopoverVisibility(popover, /*isPopover*/true, /*expectedVisibility*/false, 'After togglePopover() on visible popover, it should be hidden');
87+
popover.togglePopover(/*force=*/true);
88+
assertPopoverVisibility(popover, /*isPopover*/true, /*expectedVisibility*/true, 'After togglePopover(true) on hidden popover, it should be visible');
89+
popover.togglePopover(/*force=*/true);
90+
assertPopoverVisibility(popover, /*isPopover*/true, /*expectedVisibility*/true, 'After togglePopover(true) on visible popover, it should be visible');
91+
popover.togglePopover(/*force=*/false);
92+
assertPopoverVisibility(popover, /*isPopover*/true, /*expectedVisibility*/false, 'After togglePopover(false) on visible popover, it should be hidden');
93+
popover.togglePopover(/*force=*/false);
94+
assertPopoverVisibility(popover, /*isPopover*/true, /*expectedVisibility*/false, 'After togglePopover(false) on hidden popover, it should be hidden');
8795
const parent = popover.parentElement;
8896
popover.remove();
8997
assert_throws_dom("InvalidStateError",() => popover.showPopover(),'Calling showPopover on a disconnected popover should throw InvalidStateError');

0 commit comments

Comments
 (0)