Bug 1496720 - [css-compat] Unship most of the -moz-appearance values that aren't supported by -webkit-appearance in other UAs. r=emilio
authorMats Palmgren <mats@mozilla.com>
Fri, 12 Oct 2018 21:36:02 +0200
changeset 489309 de1a5f51757856ff727f2e08aad9563593f0a1e0
parent 489308 9a4b8f268757c4ea57a7cc490a1585e7e5816811
child 489310 8f7a45eb3e5116e2ff06d867a14a2464f0bab306
push id247
push userfmarier@mozilla.com
push dateSat, 27 Oct 2018 01:06:44 +0000
reviewersemilio
bugs1496720
milestone64.0a1
Bug 1496720 - [css-compat] Unship most of the -moz-appearance values that aren't supported by -webkit-appearance in other UAs. r=emilio
layout/reftests/native-theme/403458-winmenu-ltr.xul
layout/reftests/native-theme/403458-winmenu-rtl.xul
layout/reftests/native-theme/reftest.list
layout/style/test/test_non_content_accessible_values.html
servo/components/style/values/specified/box.rs
widget/reftests/507947.html
widget/reftests/reftest.list
deleted file mode 100644
--- a/layout/reftests/native-theme/403458-winmenu-ltr.xul
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-
-<window id="window403458"
-        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-  <hbox style="-moz-appearance: menuarrow; direction: ltr" />
-</window>
deleted file mode 100644
--- a/layout/reftests/native-theme/403458-winmenu-rtl.xul
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-
-<window id="window403458"
-        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-  <hbox style="-moz-appearance: menuarrow; direction: rtl" />
-</window>
--- a/layout/reftests/native-theme/reftest.list
+++ b/layout/reftests/native-theme/reftest.list
@@ -24,19 +24,16 @@ needs-focus == listbox-nonnative-when-st
 fails-if(!nativeThemePref) != radio-native.html radio-nonnative.html
 == radio-still-native-when-styled.html radio-still-native-when-styled-ref.html
 fails-if(!nativeThemePref) != checkbox-native.html checkbox-nonnative.html
 == checkbox-still-native-when-styled.html checkbox-still-native-when-styled-ref.html
 == native-theme-disabled-cascade-levels.html native-theme-disabled-cascade-levels-ref.html
 
 != 427122-1.html 427122-1-ref.html
 
-# 403458 is a Windows-only bug
-skip-if(!winWidget) != 403458-winmenu-ltr.xul 403458-winmenu-rtl.xul
-
 == 470711-1.xul 470711-1-ref.xul
 
 == 482955-1.xul 482955-1-ref.xul
 
 == 492155-1.html about:blank
 == 492155-2.html about:blank
 == 492155-3.html about:blank
 fails-if(Android&&!asyncPan) != 492155-4.html about:blank
--- a/layout/style/test/test_non_content_accessible_values.html
+++ b/layout/style/test/test_non_content_accessible_values.html
@@ -12,17 +12,108 @@ const NON_CONTENT_ACCESSIBLE_VALUES = {
     "-moz-grid-line",
     "-moz-stack",
     "-moz-inline-stack",
     "-moz-deck",
     "-moz-popup",
     "-moz-groupbox",
   ],
   "-moz-appearance": [
+    "button-arrow-down",
+    "button-arrow-next",
+    "button-arrow-previous",
+    "button-arrow-up",
+    "button-focus",
+    "dualbutton",
+    "groupbox",
+    "menubar",
+    "menuitem",
+    "checkmenuitem",
+    "radiomenuitem",
+    "menuitemtext",
+    "menupopup",
+    "menucheckbox",
+    "menuradio",
+    "menuseparator",
+    "menuarrow",
+    "menuimage",
     "-moz-menulist-button",
+    "checkbox-container",
+    "radio-container",
+    "checkbox-label",
+    "radio-label",
+    "resizerpanel",
+    "resizer",
+    "scrollbar",
+    "scrollbar-small",
+    "scrollbar-horizontal",
+    "scrollbar-vertical",
+    "scrollbarbutton-up",
+    "scrollbarbutton-down",
+    "scrollbarbutton-left",
+    "scrollbarbutton-right",
+    "scrollcorner",
+    "separator",
+    "spinner",
+    "spinner-upbutton",
+    "spinner-downbutton",
+    "spinner-textfield",
+    "splitter",
+    "statusbar",
+    "statusbarpanel",
+    "tab",
+    "tabpanel",
+    "tabpanels",
+    "tab-scroll-arrow-back",
+    "tab-scroll-arrow-forward",
+    "toolbar",
+    "toolbarbutton",
+    "toolbarbutton-dropdown",
+    "toolbargripper",
+    "toolbox",
+    "tooltip",
+    "treeheader",
+    "treeheadercell",
+    "treeheadersortarrow",
+    "treeitem",
+    "treeline",
+    "treetwisty",
+    "treetwistyopen",
+    "treeview",
+    "window",
+    "dialog",
+    "-moz-win-communications-toolbox",
+    "-moz-win-media-toolbox",
+    "-moz-win-browsertabbar-toolbox",
+    "-moz-win-glass",
+    "-moz-win-borderless-glass",
+    "-moz-win-exclude-glass",
+    "-moz-mac-fullscreen-button",
+    "-moz-mac-help-button",
+    "-moz-window-button-box",
+    "-moz-window-button-box-maximized",
+    "-moz-window-button-close",
+    "-moz-window-button-maximize",
+    "-moz-window-button-minimize",
+    "-moz-window-button-restore",
+    "-moz-window-frame-bottom",
+    "-moz-window-frame-left",
+    "-moz-window-frame-right",
+    "-moz-window-titlebar",
+    "-moz-window-titlebar-maximized",
+    "-moz-gtk-info-bar",
+    "-moz-mac-active-source-list-selection",
+    "-moz-mac-disclosure-button-closed",
+    "-moz-mac-disclosure-button-open",
+    "-moz-mac-source-list",
+    "-moz-mac-source-list-selection",
+    "-moz-mac-vibrancy-dark",
+    "-moz-mac-vibrancy-light",
+    "-moz-mac-vibrant-titlebar-dark",
+    "-moz-mac-vibrant-titlebar-light",
   ],
 };
 
 if (!SpecialPowers.getBoolPref("layout.css.xul-box-display-values.content.enabled")) {
   NON_CONTENT_ACCESSIBLE_VALUES.display.push("-moz-box", "-moz-inline-box");
 }
 
 const sheet = document.getElementById("sheet");
--- a/servo/components/style/values/specified/box.rs
+++ b/servo/components/style/values/specified/box.rs
@@ -961,61 +961,79 @@ pub enum Resize {
 )]
 #[repr(u8)]
 pub enum Appearance {
     /// No appearance at all.
     None,
     /// A typical dialog button.
     Button,
     /// Various arrows that go in buttons
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     ButtonArrowDown,
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     ButtonArrowNext,
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     ButtonArrowPrevious,
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     ButtonArrowUp,
     /// A rectangular button that contains complex content
     /// like images (e.g. HTML <button> elements)
     ButtonBevel,
     /// The focus outline box inside of a button.
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     ButtonFocus,
     /// The caret of a text area
     Caret,
     /// A dual toolbar button (e.g., a Back button with a dropdown)
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     Dualbutton,
     /// A groupbox.
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     Groupbox,
     /// A inner-spin button.
     InnerSpinButton,
     /// List boxes.
     Listbox,
     /// A listbox item.
     Listitem,
     /// Menu Bar background
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     Menubar,
     /// <menu> and <menuitem> appearances
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     Menuitem,
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     Checkmenuitem,
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     Radiomenuitem,
     /// For text on non-iconic menuitems only
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     Menuitemtext,
     /// A dropdown list.
     Menulist,
     /// The dropdown button(s) that open up a dropdown list.
     MenulistButton,
     /// The text part of a dropdown list, to left of button.
     MenulistText,
     /// An editable textfield with a dropdown list (a combobox).
     MenulistTextfield,
     /// Menu Popup background.
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     Menupopup,
     /// menu checkbox/radio appearances
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     Menucheckbox,
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     Menuradio,
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     Menuseparator,
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     Menuarrow,
     /// An image in the menu gutter, like in bookmarks or history.
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     Menuimage,
     /// A horizontal meter bar.
     Meterbar,
     /// The meter bar's meter indicator.
     Meterchunk,
     /// The "arrowed" part of the dropdown button that open up a dropdown list.
     #[parse(condition = "in_ua_or_chrome_sheet")]
     MozMenulistButton,
@@ -1030,163 +1048,236 @@ pub enum Appearance {
     /// A vertical progress chunk.
     ProgresschunkVertical,
     /// A checkbox element.
     Checkbox,
     /// A radio element within a radio group.
     Radio,
     /// A generic container that always repaints on state changes. This is a
     /// hack to make XUL checkboxes and radio buttons work.
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     CheckboxContainer,
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     RadioContainer,
     /// The label part of a checkbox or radio button, used for painting a focus
     /// outline.
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     CheckboxLabel,
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     RadioLabel,
     /// nsRangeFrame and its subparts
     Range,
     RangeThumb,
     /// The resizer background area in a status bar for the resizer widget in
     /// the corner of a window.
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     Resizerpanel,
     /// The resizer itself.
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     Resizer,
     /// A slider.
     ScaleHorizontal,
     ScaleVertical,
     /// A slider's thumb.
     ScalethumbHorizontal,
     ScalethumbVertical,
     /// If the platform supports it, the left/right chunks of the slider thumb.
     Scalethumbstart,
     Scalethumbend,
     /// The ticks for a slider.
     Scalethumbtick,
     /// A scrollbar.
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     Scrollbar,
     /// A small scrollbar.
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     ScrollbarSmall,
     /// The scrollbar slider
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     ScrollbarHorizontal,
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     ScrollbarVertical,
     /// A scrollbar button (up/down/left/right).
     /// Keep these in order (some code casts these values to `int` in order to
     /// compare them against each other).
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     ScrollbarbuttonUp,
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     ScrollbarbuttonDown,
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     ScrollbarbuttonLeft,
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     ScrollbarbuttonRight,
     /// The scrollbar thumb.
     ScrollbarthumbHorizontal,
     ScrollbarthumbVertical,
     /// The scrollbar track.
     ScrollbartrackHorizontal,
     ScrollbartrackVertical,
     /// The scroll corner
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     Scrollcorner,
     /// A searchfield.
     Searchfield,
     /// A separator.  Can be horizontal or vertical.
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     Separator,
     /// A spin control (up/down control for time/date pickers).
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     Spinner,
     /// The up button of a spin control.
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     SpinnerUpbutton,
     /// The down button of a spin control.
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     SpinnerDownbutton,
     /// The textfield of a spin control
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     SpinnerTextfield,
     /// A splitter.  Can be horizontal or vertical.
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     Splitter,
     /// A status bar in a main application window.
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     Statusbar,
     /// A single pane of a status bar.
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     Statusbarpanel,
     /// A single tab in a tab widget.
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     Tab,
     /// A single pane (inside the tabpanels container).
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     Tabpanel,
     /// The tab panels container.
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     Tabpanels,
     /// The tabs scroll arrows (left/right).
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     TabScrollArrowBack,
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     TabScrollArrowForward,
     /// A textfield or text area.
     Textfield,
     /// A multiline text field.
     TextfieldMultiline,
     /// A toolbar in an application window.
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     Toolbar,
     /// A single toolbar button (with no associated dropdown).
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     Toolbarbutton,
     /// The dropdown portion of a toolbar button
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     ToolbarbuttonDropdown,
     /// The gripper for a toolbar.
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     Toolbargripper,
     /// The toolbox that contains the toolbars.
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     Toolbox,
     /// A tooltip.
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     Tooltip,
     /// A listbox or tree widget header
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     Treeheader,
     /// An individual header cell
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     Treeheadercell,
     /// The sort arrow for a header.
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     Treeheadersortarrow,
     /// A tree item.
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     Treeitem,
     /// A tree widget branch line
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     Treeline,
     /// A tree widget twisty.
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     Treetwisty,
     /// Open tree widget twisty.
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     Treetwistyopen,
     /// A tree widget.
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     Treeview,
     /// Window and dialog backgrounds.
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     Window,
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     Dialog,
 
     /// Vista Rebars.
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     MozWinCommunicationsToolbox,
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     MozWinMediaToolbox,
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     MozWinBrowsertabbarToolbox,
     /// Vista glass.
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     MozWinGlass,
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     MozWinBorderlessGlass,
     /// -moz-apperance style used in setting proper glass margins.
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     MozWinExcludeGlass,
 
     /// Titlebar elements on the Mac.
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     MozMacFullscreenButton,
     /// Mac help button.
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     MozMacHelpButton,
 
     /// Windows themed window frame elements.
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     MozWindowButtonBox,
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     MozWindowButtonBoxMaximized,
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     MozWindowButtonClose,
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     MozWindowButtonMaximize,
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     MozWindowButtonMinimize,
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     MozWindowButtonRestore,
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     MozWindowFrameBottom,
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     MozWindowFrameLeft,
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     MozWindowFrameRight,
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     MozWindowTitlebar,
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     MozWindowTitlebarMaximized,
 
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     MozGtkInfoBar,
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     MozMacActiveSourceListSelection,
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     MozMacDisclosureButtonClosed,
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     MozMacDisclosureButtonOpen,
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     MozMacSourceList,
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     MozMacSourceListSelection,
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     MozMacVibrancyDark,
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     MozMacVibrancyLight,
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     MozMacVibrantTitlebarDark,
+    #[parse(condition = "in_ua_or_chrome_sheet")]
     MozMacVibrantTitlebarLight,
 
     /// A non-disappearing scrollbar.
     #[css(skip)]
     ScrollbarNonDisappearing,
 
     /// A themed focus outline (for outline:auto).
     ///
deleted file mode 100644
--- a/widget/reftests/507947.html
+++ /dev/null
@@ -1,2 +0,0 @@
-<!DOCTYPE html>
-<div style="height: 100px; -moz-appearance: toolbar;"></div>
--- a/widget/reftests/reftest.list
+++ b/widget/reftests/reftest.list
@@ -1,6 +1,5 @@
-skip-if(!cocoaWidget) != 507947.html about:blank
 == progressbar-fallback-default-style.html progressbar-fallback-default-style-ref.html
 fuzzy-if(Android,0-17,0-1120) fuzzy-if(webrender&&winWidget,1-1,5-5) == meter-native-style.html meter-native-style-ref.html
 skip-if(!cocoaWidget) == meter-vertical-native-style.html meter-vertical-native-style-ref.html # dithering
 == meter-fallback-default-style.html meter-fallback-default-style-ref.html
 load 664925.xhtml