forked from web-platform-tests/wpt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deal with remaining <selectlist> tests
select-keyboard.tentative.html was replaced with select-keyboard-behavior.tentative.html, select-disabled.tentative.html, and select-synthetic-events.tentative.html. select-option-label-rendering.tentative.html is a duplicate of select-appearance-option-with-label.tentative.html. Fixed: 366394195 Bug: 40884429 Change-Id: Iff4a462005fbed73d0bb0478a9cf598db9ed5ff5 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6092351 Commit-Queue: Joey Arhar <[email protected]> Reviewed-by: Traian Captan <[email protected]> Cr-Commit-Position: refs/heads/main@{#1402729}
- Loading branch information
1 parent
9ff4054
commit f10fb64
Showing
15 changed files
with
190 additions
and
295 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 3 additions & 7 deletions
10
...tics/forms/the-select-element/customizable-select/select-explicit-size-ref.tentative.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 2 additions & 4 deletions
6
...emantics/forms/the-select-element/customizable-select/select-font-size-ref.tentative.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,11 @@ | ||
<!DOCTYPE html> | ||
<link rel=stylesheet href="resources/customizable-select-styles.css"> | ||
<div class="customizable-select-button open" style="anchor-name:--button" popovertarget=popover id=button> | ||
<div class=customizable-select-button popovertarget=popover id=button> | ||
<span class=customizable-select-selectedcontent>option</span> | ||
</div> | ||
<div id=popover popover=auto style="position-anchor:--button" class=customizable-select-popover> | ||
</div> | ||
|
||
<style> | ||
select { | ||
div { | ||
font-size: 48px; | ||
} | ||
</style> |
1 change: 1 addition & 0 deletions
1
html/semantics/forms/the-select-element/customizable-select/select-font-size.tentative.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
<!DOCTYPE html> | ||
<!-- Tests that select respects explicit size --> | ||
<meta name=fuzzy content="maxDifference=0-55;totalPixels=0-32"> | ||
<link rel=author href="mailto:[email protected]"> | ||
<link rel="match" href="select-font-size-ref.tentative.html"> | ||
|
||
|
4 changes: 1 addition & 3 deletions
4
...tics/forms/the-select-element/customizable-select/select-selected-value-behavior-ref.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 4 additions & 1 deletion
5
...orms/the-select-element/customizable-select/select-selected-value-behavior.tentative.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
<!DOCTYPE html> | ||
<meta name=fuzzy content="maxDifference=0-41;totalPixels=0-1"> | ||
<link rel=author href="mailto:[email protected]"> | ||
<link rel=match href="select-selected-value-behavior-ref.html"> | ||
|
||
<select> | ||
<selectedcontent style="color:blue"></selectedcontent> | ||
<button> | ||
<selectedcontent style="color:blue"></selectedcontent> | ||
</button> | ||
<option>option</option> | ||
</select> | ||
|
||
|
102 changes: 102 additions & 0 deletions
102
...ntics/forms/the-select-element/customizable-select/select-synthetic-events.tentative.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
<!DOCTYPE html> | ||
<link rel=author href="mailto:[email protected]"> | ||
<link rel=help href="https://github.com/whatwg/html/issues/10762"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="/resources/testdriver.js"></script> | ||
<script src="/resources/testdriver-vendor.js"></script> | ||
|
||
<style> | ||
select, ::picker(select) { | ||
appearance: base-select; | ||
} | ||
</style> | ||
|
||
<select id=defaultbutton> | ||
<option class=one>one</option> | ||
<option class=two>two</option> | ||
</select> | ||
|
||
<select id=custombutton> | ||
<button>button</button> | ||
<option class=one>one</option> | ||
<option class=two>two</option> | ||
</select> | ||
|
||
<script> | ||
const keyCodes = ['Enter', 'Space', 'ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight']; | ||
|
||
function dispatchKeyboardEvents(element, code) { | ||
const key = code == 'Space' ? ' ' : code; | ||
element.dispatchEvent(new KeyboardEvent('keydown', {key, code})); | ||
element.dispatchEvent(new KeyboardEvent('keypress', {key, code})); | ||
element.dispatchEvent(new KeyboardEvent('keyup', {key, code})); | ||
} | ||
|
||
function dispatchMouseEvents(element) { | ||
element.dispatchEvent(new MouseEvent('pointerdown')); | ||
element.dispatchEvent(new MouseEvent('mousedown')); | ||
element.dispatchEvent(new MouseEvent('pointerup')); | ||
element.dispatchEvent(new MouseEvent('mouseup')); | ||
element.dispatchEvent(new MouseEvent('click')); | ||
} | ||
|
||
['defaultbutton', 'custombutton'].forEach(id => { | ||
promise_test(async () => { | ||
assert_true(CSS.supports('appearance', 'base-select'), | ||
'This test requires appearance:base-select in order to run.'); | ||
|
||
const select = document.getElementById(id); | ||
const firstOption = select.querySelector('option.one'); | ||
const secondOption = select.querySelector('option.two'); | ||
|
||
select.click(); | ||
assert_false(select.matches(':open'), | ||
'select.click() should not open the picker.'); | ||
|
||
dispatchMouseEvents(select); | ||
assert_false(select.matches(':open'), | ||
'Synthetic mouse/pointer events should not open the picker.'); | ||
|
||
for (const keyCode of keyCodes) { | ||
dispatchKeyboardEvents(select, keyCode); | ||
assert_false(select.matches(':open'), | ||
`Synthetic ${keyCode} events should not open the picker.`); | ||
assert_equals(select.value, 'one', | ||
`Synthetic ${keyCode} events should not change the selects value.`); | ||
} | ||
|
||
await test_driver.click(select); | ||
assert_true(select.matches(':open'), | ||
'Select should open after a real click occurs.'); | ||
assert_equals(document.activeElement, firstOption, | ||
'Selected <option> should be focused after opening the picker.'); | ||
|
||
secondOption.click(); | ||
assert_true(select.matches(':open'), | ||
'option.click() should not close the picker.'); | ||
assert_equals(select.value, 'one', | ||
'option.click() should not change select.value.'); | ||
|
||
dispatchMouseEvents(secondOption); | ||
assert_true(select.matches(':open'), | ||
'Synthetic mouse/pointer events should not close the picker.'); | ||
assert_equals(select.value, 'one', | ||
'Synthetic mouse/pointer events should not change select.value.'); | ||
|
||
for (const keyCode of keyCodes) { | ||
dispatchKeyboardEvents(firstOption, keyCode); | ||
assert_true(select.matches(':open'), | ||
`Synthetic ${keyCode} events on selected <option> should not close the picker.`); | ||
assert_equals(select.value, 'one', | ||
`Synthetic ${keyCode} events on selected <option> should not change select.value.`); | ||
|
||
dispatchKeyboardEvents(secondOption, keyCode); | ||
assert_true(select.matches(':open'), | ||
`Synthetic ${keyCode} events on non-selected <option> should not close the picker.`); | ||
assert_equals(select.value, 'one', | ||
`Synthetic ${keyCode} events on non-selected <option> should not change select.value.`); | ||
} | ||
}, `${id}: Synthetic events should not trigger behaviors of select element.`); | ||
}); | ||
</script> |
1 change: 1 addition & 0 deletions
1
html/semantics/forms/the-select-element/customizable-select/select-text-only.tentative.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
<!DOCTYPE html> | ||
<meta name=fuzzy content="maxDifference=0-41;totalPixels=0-1"> | ||
<link rel=author href="mailto:[email protected]"> | ||
<link rel=help href="https://github.com/openui/open-ui/issues/702"> | ||
<link rel=match href="select-text-only-ref.html"> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.