style: Add unprefixed appearance property and make -moz-appearance and -webkit-appearance be aliases.

Differential Revision: https://phabricator.services.mozilla.com/D83428
This commit is contained in:
Cameron McCormack 2020-07-16 22:04:11 +00:00 committed by Emilio Cobos Álvarez
parent 9d3876bda0
commit 01efe3a459
3 changed files with 12 additions and 10 deletions

View file

@ -615,22 +615,19 @@ ${helpers.predefined_type(
spec="https://drafts.csswg.org/css-contain/#contain-property",
)}
// Non-standard
${helpers.predefined_type(
"-moz-appearance",
"appearance",
"Appearance",
"computed::Appearance::None",
engines="gecko",
alias="-webkit-appearance",
spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-appearance)",
alias="-moz-appearance -webkit-appearance",
spec="https://drafts.csswg.org/css-ui-4/#propdef-appearance",
animation_value_type="discrete",
gecko_ffi_name="mAppearance",
)}
// A UA-sheet only property that is always set to the same value as
// -moz-appearance. Used to record telemetry for when author sheets
// override the value of -moz-appearance; see
// nsIFrame::RecordAppearanceTelemetry.
// The inherent widget type of an element, selected by specifying
// `appearance: auto`.
${helpers.predefined_type(
"-moz-default-appearance",
"Appearance",

View file

@ -763,10 +763,10 @@ impl<'a, 'b: 'a> StyleAdjuster<'a, 'b> {
where
E: TElement,
{
use crate::properties::longhands::_moz_appearance::computed_value::T as Appearance;
use crate::properties::longhands::appearance::computed_value::T as Appearance;
use crate::properties::longhands::line_height::computed_value::T as LineHeight;
if self.style.get_box().clone__moz_appearance() == Appearance::Menulist {
if self.style.get_box().clone_appearance() == Appearance::Menulist {
if self.style.get_inherited_text().clone_line_height() == LineHeight::normal() {
return;
}

View file

@ -1525,6 +1525,11 @@ pub enum Resize {
pub enum Appearance {
/// No appearance at all.
None,
/// Default appearance for the element.
///
/// This value doesn't make sense for -moz-default-appearance, but we don't bother to guard
/// against parsing it.
Auto,
/// A typical dialog button.
Button,
/// Various arrows that go in buttons