Skip to content

Commit

Permalink
Rename togglepopup->popuptoggletarget, etc.
Browse files Browse the repository at this point in the history
Per the resolution [1], we are renaming:
 - togglepopup -> popuptoggletarget
 - showpopup   -> popupshowtarget
 - hidepopup   -> popuphidetarget

A subsequent CL will add IDL reflections of these attributes.

[1] openui/open-ui#382 (comment)

Bug: 1307772
Change-Id: I3cf663b50b0b0f10cbc39d723608b1dcd28662e0
Cq-Do-Not-Cancel-Tryjobs: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3764624
Auto-Submit: Mason Freed <masonf@chromium.org>
Reviewed-by: Joey Arhar <jarhar@chromium.org>
Reviewed-by: Nektarios Paisios <nektar@chromium.org>
Commit-Queue: Nektarios Paisios <nektar@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1025053}
  • Loading branch information
Mason Freed authored and chromium-wpt-export-bot committed Jul 17, 2022
1 parent bc4ffb9 commit c1a12d7
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 28 deletions.
10 changes: 5 additions & 5 deletions html/semantics/popups/popup-focus.tentative.html
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
button.remove();
});
popUp.id = popUpId;
button.setAttribute('togglepopup', popUpId);
button.setAttribute('popuptoggletarget', popUpId);
return button;
}
function addPriorFocus(t) {
Expand Down Expand Up @@ -218,7 +218,7 @@
const priorFocus = addPriorFocus(t);
assert_false(popUp.matches(':top-layer'), 'pop-up should start out hidden');
let button = addInvoker(t, popUp);
assert_equals(button.getAttribute('togglepopup'), popUp.id, 'This test assumes the button uses `togglepopup`.');
assert_equals(button.getAttribute('popuptoggletarget'), popUp.id, 'This test assumes the button uses `popuptoggletarget`.');
assert_not_equals(button, priorFocus, 'Stranger things have happened');
assert_false(popUp.contains(button), 'Start with a non-contained button');
priorFocus.focus();
Expand All @@ -231,8 +231,8 @@
await finishAnimationsAndVerifyHide(popUp);

// Same thing, but the button is contained within the pop-up
button.removeAttribute('togglepopup');
button.setAttribute('hidepopup', popUp.id);
button.removeAttribute('popuptoggletarget');
button.setAttribute('popuphidetarget', popUp.id);
popUp.appendChild(button);
priorFocus.focus();
popUp.showPopUp();
Expand All @@ -245,7 +245,7 @@
assert_equals(document.activeElement, priorFocus, 'Contained button should return focus to the previously focused element');
await finishAnimationsAndVerifyHide(popUp);

// Same thing, but the button is unrelated (no togglepopup)
// Same thing, but the button is unrelated (no popuptoggletarget)
button = document.createElement('button');
document.body.appendChild(button);
priorFocus.focus();
Expand Down
12 changes: 6 additions & 6 deletions html/semantics/popups/popup-invoking-attribute.tentative.html
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@
assert_equals(popUp2.popUp,type);
assert_not_equals(popUp1.id,popUp2.id);
const invoker = testcase.makeElement(test);
if (t) invoker.setAttribute('togglepopup',t===1 ? popUp1.id : popUp2.id);
if (s) invoker.setAttribute('showpopup',s===1 ? popUp1.id : popUp2.id);
if (h) invoker.setAttribute('hidepopup',h===1 ? popUp1.id : popUp2.id);
if (t) invoker.setAttribute('popuptoggletarget',t===1 ? popUp1.id : popUp2.id);
if (s) invoker.setAttribute('popupshowtarget',s===1 ? popUp1.id : popUp2.id);
if (h) invoker.setAttribute('popuphidetarget',h===1 ? popUp1.id : popUp2.id);
assert_true(!document.getElementById(popUp1.id));
assert_true(!document.getElementById(popUp2.id));
document.body.appendChild(popUp1);
Expand Down Expand Up @@ -184,7 +184,7 @@



<button togglepopup=p1>Toggle Popup 1</button>
<button popuptoggletarget=p1>Toggle Popup 1</button>
<div popup id=p1 style="border: 5px solid red;top: 100px;left: 100px;">This is pop-up #1</div>

<script>
Expand Down Expand Up @@ -221,7 +221,7 @@
await assertState(true,2,1);
popUp.hidePopUp();
await assertState(false,2,2);
}, "Clicking a togglepopup button opens a closed pop-up (also check event counts)");
}, "Clicking a popuptoggletarget button opens a closed pop-up (also check event counts)");

promise_test(async () => {
showCount = hideCount = 0;
Expand All @@ -230,4 +230,4 @@
await assertState(true,1,0);
await clickOn(button);
await assertState(false,1,1);
}, "Clicking a togglepopup button closes an open pop-up (also check event counts)");
}, "Clicking a popuptoggletarget button closes an open pop-up (also check event counts)");
26 changes: 13 additions & 13 deletions html/semantics/popups/popup-light-dismiss.tentative.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
<script src="/resources/testdriver-vendor.js"></script>
<script src="resources/popup-utils.js"></script>

<button id=b1t togglepopup='p1'>Popup 1</button>
<button id=b1s showpopup='p1'>Popup 1</button>
<button id=b1t popuptoggletarget='p1'>Popup 1</button>
<button id=b1s popupshowtarget='p1'>Popup 1</button>
<button id=p1anchor>Popup1 anchor (no action)</button>
<span id=outside>Outside all popups</span>
<div popup id=p1 anchor=p1anchor>
<span id=inside1>Inside popup 1</span>
<button id=b2 togglepopup='p2'>Popup 2</button>
<button id=b2 popuptoggletarget='p2'>Popup 2</button>
<span id=inside1after>Inside popup 1 after button</span>
</div>
<div popup id=p2 anchor=b2>
Expand Down Expand Up @@ -145,9 +145,9 @@
await waitForRender();
p1HideCount = popup1HideCount;
await clickOn(button1toggle);
assert_false(popup1.matches(':top-layer'),'popup1 should be hidden by togglepopup');
assert_equals(popup1HideCount,p1HideCount+1,'popup1 should get hidden only once by togglepopup');
},'Clicking on togglepopup element, even if it wasn\'t used for activation, should hide it exactly once');
assert_false(popup1.matches(':top-layer'),'popup1 should be hidden by popuptoggletarget');
assert_equals(popup1HideCount,p1HideCount+1,'popup1 should get hidden only once by popuptoggletarget');
},'Clicking on popuptoggletarget element, even if it wasn\'t used for activation, should hide it exactly once');

promise_test(async () => {
popup1.showPopUp();
Expand Down Expand Up @@ -180,11 +180,11 @@
},'Dragging from an open popup outside an open popup should leave the popup open');
</script>

<button id=b3 togglepopup=p3>Popup 3 - button 3
<button id=b3 popuptoggletarget=p3>Popup 3 - button 3
<div popup id=p4>Inside popup 4</div>
</button>
<div popup id=p3>Inside popup 3</div>
<button id=b4 togglepopup=p3>Popup 3 - button 4
<button id=b4 popuptoggletarget=p3>Popup 3 - button 4
<div popup id=p5>Inside popup 5</div>
</button>
<style>
Expand Down Expand Up @@ -228,7 +228,7 @@
<div style="height:2000px;background:lightgreen"></div>
Bottom of popup6
</div>
<button togglepopup=p6>Popup 6</button>
<button popuptoggletarget=p6>Popup 6</button>
<style>
#p6 {
width: 300px;
Expand Down Expand Up @@ -308,7 +308,7 @@
<button>Button</button>
<span id=inside9after>Inside popup 9 after button</span>
</div>
<button id=b9after togglepopup='p9'>Popup 9</button>
<button id=b9after popuptoggletarget='p9'>Popup 9</button>
<script>
promise_test(async () => {
const popup9 = document.querySelector('#p9');
Expand Down Expand Up @@ -342,15 +342,15 @@
<!-- Convoluted ancestor relationship -->
<div popup id=convoluted_p1>Popup 1
<div id=convoluted_anchor>Anchor
<button togglepopup=convoluted_p2>Open Popup 2</button>
<button popuptoggletarget=convoluted_p2>Open Popup 2</button>
<div popup id=convoluted_p4><p>Popup 4</p></div>
</div>
</div>
<div popup id=convoluted_p2>Popup 2
<button togglepopup=convoluted_p3>Open Popup 3</button>
<button popuptoggletarget=convoluted_p3>Open Popup 3</button>
</div>
<div popup id=convoluted_p3 anchor=convoluted_anchor>Popup 3
<button togglepopup=convoluted_p4>Open Popup 4</button>
<button popuptoggletarget=convoluted_p4>Open Popup 4</button>
</div>
<button onclick="convoluted_p1.showPopUp()">Open convoluted popup</button>
<style>
Expand Down
8 changes: 4 additions & 4 deletions html/semantics/popups/popup-stacking.tentative.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,19 @@
</div>

<div class="example">
<p>togglepopup attribute relationship</p>
<p>popuptoggletarget attribute relationship</p>
<div popup class=ancestor><p>Ancestor popup</p>
<button togglepopup=trigger1 class=clickme>Button</button>
<button popuptoggletarget=trigger1 class=clickme>Button</button>
</div>
<div id=trigger1 popup class=child><p>Child popup</p></div>
</div>

<div class="example">
<p>nested togglepopup attribute relationship</p>
<p>nested popuptoggletarget attribute relationship</p>
<div popup class=ancestor><p>Ancestor popup</p>
<div>
<div>
<button togglepopup=trigger2 class=clickme>Button</button>
<button popuptoggletarget=trigger2 class=clickme>Button</button>
</div>
</div>
</div>
Expand Down

0 comments on commit c1a12d7

Please sign in to comment.