Bug 1620467 - Part 10: Make remaining appearance values behave like auto. r=emilio

This includes all of the <compat-auto> values, plus menulist-button,
which doesn't behave any differently from menulist currently.

Differential Revision: https://phabricator.services.mozilla.com/D83436
This commit is contained in:
Cameron McCormack 2020-07-16 22:04:28 +00:00
Родитель 9f7843cb34
Коммит f2744d489b
23 изменённых файлов: 41 добавлений и 27 удалений

Просмотреть файл

@ -1334,6 +1334,15 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleDisplay {
mozilla::StyleAppearance EffectiveAppearance() const { mozilla::StyleAppearance EffectiveAppearance() const {
switch (mAppearance) { switch (mAppearance) {
case mozilla::StyleAppearance::Auto: case mozilla::StyleAppearance::Auto:
case mozilla::StyleAppearance::Searchfield:
case mozilla::StyleAppearance::Textarea:
case mozilla::StyleAppearance::Checkbox:
case mozilla::StyleAppearance::Radio:
case mozilla::StyleAppearance::Menulist:
case mozilla::StyleAppearance::Listbox:
case mozilla::StyleAppearance::Meter:
case mozilla::StyleAppearance::ProgressBar:
// These are all the values that behave like `auto`.
return mDefaultAppearance; return mDefaultAppearance;
case mozilla::StyleAppearance::Textfield: case mozilla::StyleAppearance::Textfield:
// `appearance: textfield` should behave like `auto` on all elements // `appearance: textfield` should behave like `auto` on all elements
@ -1351,6 +1360,12 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleDisplay {
return mAppearance; return mAppearance;
} }
return mDefaultAppearance; return mDefaultAppearance;
case mozilla::StyleAppearance::MenulistButton:
// `appearance: menulist-button` should behave like `auto` on all
// elements except for drop down selects, but since we have very little
// difference between menulist and menulist-button handling, we don't
// bother.
return mDefaultAppearance;
case mozilla::StyleAppearance::Button: case mozilla::StyleAppearance::Button:
// `appearance: button` should behave like `auto` for a specific list // `appearance: button` should behave like `auto` for a specific list
// of widget elements, and we encode that using the internal // of widget elements, and we encode that using the internal

Просмотреть файл

@ -1,4 +1,3 @@
[appearance-checkbox-001.html] [appearance-checkbox-001.html]
disabled: disabled:
if os == "win": https://bugzilla.mozilla.org/show_bug.cgi?id=1562932 if os == "win": https://bugzilla.mozilla.org/show_bug.cgi?id=1562932
expected: FAIL

Просмотреть файл

@ -1,4 +1,3 @@
[appearance-listbox-001.html] [appearance-listbox-001.html]
disabled: disabled:
if os == "win": https://bugzilla.mozilla.org/show_bug.cgi?id=1562932 if os == "win": https://bugzilla.mozilla.org/show_bug.cgi?id=1562932
expected: FAIL

Просмотреть файл

@ -1,4 +1,3 @@
[appearance-menulist-001.html] [appearance-menulist-001.html]
disabled: disabled:
if os == "win": https://bugzilla.mozilla.org/show_bug.cgi?id=1562932 if os == "win": https://bugzilla.mozilla.org/show_bug.cgi?id=1562932
expected: FAIL

Просмотреть файл

@ -1,4 +1,3 @@
[appearance-menulist-button-001.html] [appearance-menulist-button-001.html]
disabled: disabled:
if os == "win": https://bugzilla.mozilla.org/show_bug.cgi?id=1562932 if os == "win": https://bugzilla.mozilla.org/show_bug.cgi?id=1562932
expected: FAIL

Просмотреть файл

@ -1,4 +1,4 @@
[appearance-menulist-button-002.html] [appearance-menulist-button-002.tentative.html]
disabled: disabled:
if os == "win": https://bugzilla.mozilla.org/show_bug.cgi?id=1562932 if os == "win": https://bugzilla.mozilla.org/show_bug.cgi?id=1562932
expected: FAIL expected: FAIL

Просмотреть файл

@ -1,5 +1,3 @@
[appearance-meter-001.html] [appearance-meter-001.html]
disabled: disabled:
if os == "win": https://bugzilla.mozilla.org/show_bug.cgi?id=1562932 if os == "win": https://bugzilla.mozilla.org/show_bug.cgi?id=1562932
expected:
FAIL

Просмотреть файл

@ -1,6 +1,3 @@
[appearance-progress-bar-001.html] [appearance-progress-bar-001.html]
disabled: disabled:
if os == "win": https://bugzilla.mozilla.org/show_bug.cgi?id=1562932 if os == "win": https://bugzilla.mozilla.org/show_bug.cgi?id=1562932
expected:
if os == "android": PASS
FAIL

Просмотреть файл

@ -1,4 +1,3 @@
[appearance-radio-001.html] [appearance-radio-001.html]
disabled: disabled:
if os == "win": https://bugzilla.mozilla.org/show_bug.cgi?id=1562932 if os == "win": https://bugzilla.mozilla.org/show_bug.cgi?id=1562932
expected: FAIL

Просмотреть файл

@ -1,4 +1,3 @@
[appearance-searchfield-001.html] [appearance-searchfield-001.html]
disabled: disabled:
if os == "win": https://bugzilla.mozilla.org/show_bug.cgi?id=1562932 if os == "win": https://bugzilla.mozilla.org/show_bug.cgi?id=1562932
expected: FAIL

Просмотреть файл

@ -1,4 +1,3 @@
[appearance-textarea-001.html] [appearance-textarea-001.html]
disabled: disabled:
if os == "win": https://bugzilla.mozilla.org/show_bug.cgi?id=1562932 if os == "win": https://bugzilla.mozilla.org/show_bug.cgi?id=1562932
expected: FAIL

Просмотреть файл

@ -1,4 +1,3 @@
[webkit-appearance-checkbox-001.html] [webkit-appearance-checkbox-001.html]
disabled: disabled:
if os == "win": https://bugzilla.mozilla.org/show_bug.cgi?id=1562932 if os == "win": https://bugzilla.mozilla.org/show_bug.cgi?id=1562932
expected: FAIL

Просмотреть файл

@ -1,4 +1,3 @@
[webkit-appearance-listbox-001.html] [webkit-appearance-listbox-001.html]
disabled: disabled:
if os == "win": https://bugzilla.mozilla.org/show_bug.cgi?id=1562932 if os == "win": https://bugzilla.mozilla.org/show_bug.cgi?id=1562932
expected: FAIL

Просмотреть файл

@ -1,4 +1,3 @@
[webkit-appearance-menulist-001.html] [webkit-appearance-menulist-001.html]
disabled: disabled:
if os == "win": https://bugzilla.mozilla.org/show_bug.cgi?id=1562932 if os == "win": https://bugzilla.mozilla.org/show_bug.cgi?id=1562932
expected: FAIL

Просмотреть файл

@ -1,4 +1,3 @@
[webkit-appearance-menulist-button-001.html] [webkit-appearance-menulist-button-001.html]
disabled: disabled:
if os == "win": https://bugzilla.mozilla.org/show_bug.cgi?id=1562932 if os == "win": https://bugzilla.mozilla.org/show_bug.cgi?id=1562932
expected: FAIL

Просмотреть файл

@ -1,4 +1,4 @@
[webkit-appearance-menulist-button-002.html] [webkit-appearance-menulist-button-002.tentative.html]
disabled: disabled:
if os == "win": https://bugzilla.mozilla.org/show_bug.cgi?id=1562932 if os == "win": https://bugzilla.mozilla.org/show_bug.cgi?id=1562932
expected: FAIL expected: FAIL

Просмотреть файл

@ -1,5 +1,3 @@
[webkit-appearance-meter-001.html] [webkit-appearance-meter-001.html]
disabled: disabled:
if os == "win": https://bugzilla.mozilla.org/show_bug.cgi?id=1562932 if os == "win": https://bugzilla.mozilla.org/show_bug.cgi?id=1562932
expected:
if os == "mac": FAIL

Просмотреть файл

@ -1,6 +1,3 @@
[webkit-appearance-progress-bar-001.html] [webkit-appearance-progress-bar-001.html]
disabled: disabled:
if os == "win": https://bugzilla.mozilla.org/show_bug.cgi?id=1562932 if os == "win": https://bugzilla.mozilla.org/show_bug.cgi?id=1562932
expected:
if os == "android": PASS
FAIL

Просмотреть файл

@ -1,4 +1,3 @@
[webkit-appearance-radio-001.html] [webkit-appearance-radio-001.html]
disabled: disabled:
if os == "win": https://bugzilla.mozilla.org/show_bug.cgi?id=1562932 if os == "win": https://bugzilla.mozilla.org/show_bug.cgi?id=1562932
expected: FAIL

Просмотреть файл

@ -1,5 +1,3 @@
[webkit-appearance-searchfield-001.html] [webkit-appearance-searchfield-001.html]
disabled: disabled:
if os == "win": https://bugzilla.mozilla.org/show_bug.cgi?id=1562932 if os == "win": https://bugzilla.mozilla.org/show_bug.cgi?id=1562932
expected:
if os == "mac": FAIL

Просмотреть файл

@ -1,4 +1,3 @@
[webkit-appearance-textarea-001.html] [webkit-appearance-textarea-001.html]
disabled: disabled:
if os == "win": https://bugzilla.mozilla.org/show_bug.cgi?id=1562932 if os == "win": https://bugzilla.mozilla.org/show_bug.cgi?id=1562932
expected: FAIL

Просмотреть файл

@ -8,6 +8,18 @@
#container { width: 500px; } #container { width: 500px; }
#container > #drop-down-select { appearance: none; appearance: menulist-button; } #container > #drop-down-select { appearance: none; appearance: menulist-button; }
</style> </style>
<!--
Test marked as tentative since although css-ui says:
For drop-down box select elements, the element is rendered as a drop-down
box, including a "drop-down button", but not necessarily using a native
control of the host operating system. For such elements, CSS properties
such as color, background-color, and border (that can be disregarded for
auto) should not be disregarded.
there is no requirement that this rendering is any different from the
automatic widget appearance of a drop-down select.
-->
<div id="container"> <div id="container">
<a>a</a> <a>a</a>
<button>button</button> <button>button</button>

Просмотреть файл

@ -12,6 +12,18 @@ Edit the appearance-* file instead and then run:
#container { width: 500px; } #container { width: 500px; }
#container > #drop-down-select { -webkit-appearance: none; -webkit-appearance: menulist-button; } #container > #drop-down-select { -webkit-appearance: none; -webkit-appearance: menulist-button; }
</style> </style>
<!--
Test marked as tentative since although css-ui says:
For drop-down box select elements, the element is rendered as a drop-down
box, including a "drop-down button", but not necessarily using a native
control of the host operating system. For such elements, CSS properties
such as color, background-color, and border (that can be disregarded for
auto) should not be disregarded.
there is no requirement that this rendering is any different from the
automatic widget appearance of a drop-down select.
-->
<div id="container"> <div id="container">
<a>a</a> <a>a</a>
<button>button</button> <button>button</button>