Skip to content

Commit

Permalink
Implement appearance:bikeshed for StylableSelect
Browse files Browse the repository at this point in the history
This patch gates all the new rendering and interaction behavior for
StylableSelect behind a new "bikeshed" value for the appearance
property. No name has been decided for this property yet, hence the
"bikeshed" name.

The UA stylesheet will still only look at whether there is a slotted
button or datalist present rather than the appearance property because
looking at the appearance property to determine whether to apply UA
style rules or not would cause circular style and would at least require
two style updates in order to work, which is not acceptable.

Bug: 1511354
Change-Id: I5f476f9a912aee7391dc4409473676de48c4028c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5315083
Reviewed-by: Mason Freed <masonf@chromium.org>
Commit-Queue: Joey Arhar <jarhar@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1269013}
  • Loading branch information
josepharhar authored and BruceDai committed Mar 25, 2024
1 parent be51ffc commit d18acb6
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!DOCTYPE html>
<html class=reftest-wait>
<link rel=author href="mailto:jarhar@chromium.org">
<link rel=help href="https://github.com/whatwg/html/issues/9799">
<link rel=match href="select-child-button-and-datalist-ref.html">
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-vendor.js"></script>

<select>
<button type=popover>button</button>
<datalist>
<option>one</option>
<option>two</option>
</datalist>
</select>

<script>
requestAnimationFrame(() => {
document.querySelector('select').style = 'appearance:bikeshed';
document.querySelector('button').click();
document.documentElement.classList.remove('reftest-wait');
});
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-vendor.js"></script>

<select>
<select style="appearance:bikeshed">
<button type=popover>button</button>
<datalist>
<option>one</option>
Expand Down

0 comments on commit d18acb6

Please sign in to comment.