Skip to content

Commit

Permalink
Rename popover=hint WPTs to remove .tentative
Browse files Browse the repository at this point in the history
The spec landed:

  whatwg/html#9778

I also found one more that was just a general popover test that
likely should have been renamed a while ago.

Bug: 40256776
Change-Id: I57f0fb9f25b2e1d8b2b9509bb3c97786c6ac59ac
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6168803
Auto-Submit: Mason Freed <[email protected]>
Reviewed-by: Di Zhang <[email protected]>
Commit-Queue: Di Zhang <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1406978}
  • Loading branch information
mfreed7 authored and chromium-wpt-export-bot committed Jan 15, 2025
1 parent e25c879 commit f681fe2
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 20 deletions.
18 changes: 7 additions & 11 deletions html/semantics/popovers/popover-attribute-basic.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,8 @@
assert_equals(popover.popover,'manual','Invalid values should reflect as "manual"');
popover.removeAttribute('popover');
assert_equals(popover.popover,null,'No value should reflect as null');
if (popoverHintSupported()) {
popover.popover='hint';
assert_equals(popover.getAttribute('popover'),'hint');
}
popover.popover='hint';
assert_equals(popover.getAttribute('popover'),'hint');
popover.popover='auto';
assert_equals(popover.getAttribute('popover'),'auto');
popover.popover='';
Expand Down Expand Up @@ -156,12 +154,10 @@
const popover = createPopover(t);
popover.showPopover();
assert_true(popover.matches(':popover-open'));
if (popoverHintSupported()) {
popover.setAttribute('popover','hint'); // Change popover type
assert_false(popover.matches(':popover-open'));
popover.showPopover();
assert_true(popover.matches(':popover-open'));
}
popover.setAttribute('popover','hint'); // Change popover type
assert_false(popover.matches(':popover-open'));
popover.showPopover();
assert_true(popover.matches(':popover-open'));
popover.setAttribute('popover','manual');
assert_false(popover.matches(':popover-open'));
popover.showPopover();
Expand All @@ -176,7 +172,7 @@
assert_false(popover.matches(':popover-open'),'From "auto" to "invalid" (which is interpreted as "manual") should close the popover');
},'Changing attribute values should close open popovers');

const validTypes = popoverHintSupported() ? ["auto","hint","manual"] : ["auto","manual"];
const validTypes = ["auto","hint","manual"];
validTypes.forEach(type => {
test((t) => {
const popover = createPopover(t);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function runTopLayerTests(testCases, testAnchorAttribute) {
// Add another popover within the top layer element and make sure entire stack stays open.
const newPopover = document.createElement('div');
t.add_cleanup(() => newPopover.remove());
newPopover.popover = popoverHintSupported() ? 'hint' : 'auto';
newPopover.popover = 'hint';
element.appendChild(newPopover);
popovers.forEach(popover => assert_equals(popover.matches(':popover-open'),popover.dataset.stayOpen==='true','Adding another popover shouldn\'t change anything'));
assert_true(showing(),'top layer element should still be top layer');
Expand All @@ -60,7 +60,7 @@ function runTopLayerTests(testCases, testAnchorAttribute) {

promise_test(async t => {
const {element,show,showing} = createTopLayerElement(t,topLayerType);
element.popover = popoverHintSupported() ? 'hint' : 'auto';
element.popover = 'hint';
target.appendChild(element);

// Show the popovers.
Expand Down
7 changes: 0 additions & 7 deletions html/semantics/popovers/resources/popover-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,6 @@ function showDefaultopenPopoversOnLoad() {
window.addEventListener('load',show,{once:true});
}
}
function popoverHintSupported() {
// TODO(crbug.com/1416284): This function should be removed, and
// any calls replaced with `true`, once popover=hint ships.
const testElement = document.createElement('div');
testElement.popover = 'hint';
return testElement.popover === 'hint';
}

function assertPopoverVisibility(popover, isPopover, expectedVisibility, message) {
const isVisible = isElementVisible(popover);
Expand Down

0 comments on commit f681fe2

Please sign in to comment.