mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
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:
parent
9d3876bda0
commit
01efe3a459
3 changed files with 12 additions and 10 deletions
|
@ -615,22 +615,19 @@ ${helpers.predefined_type(
|
||||||
spec="https://drafts.csswg.org/css-contain/#contain-property",
|
spec="https://drafts.csswg.org/css-contain/#contain-property",
|
||||||
)}
|
)}
|
||||||
|
|
||||||
// Non-standard
|
|
||||||
${helpers.predefined_type(
|
${helpers.predefined_type(
|
||||||
"-moz-appearance",
|
"appearance",
|
||||||
"Appearance",
|
"Appearance",
|
||||||
"computed::Appearance::None",
|
"computed::Appearance::None",
|
||||||
engines="gecko",
|
engines="gecko",
|
||||||
alias="-webkit-appearance",
|
alias="-moz-appearance -webkit-appearance",
|
||||||
spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-appearance)",
|
spec="https://drafts.csswg.org/css-ui-4/#propdef-appearance",
|
||||||
animation_value_type="discrete",
|
animation_value_type="discrete",
|
||||||
gecko_ffi_name="mAppearance",
|
gecko_ffi_name="mAppearance",
|
||||||
)}
|
)}
|
||||||
|
|
||||||
// A UA-sheet only property that is always set to the same value as
|
// The inherent widget type of an element, selected by specifying
|
||||||
// -moz-appearance. Used to record telemetry for when author sheets
|
// `appearance: auto`.
|
||||||
// override the value of -moz-appearance; see
|
|
||||||
// nsIFrame::RecordAppearanceTelemetry.
|
|
||||||
${helpers.predefined_type(
|
${helpers.predefined_type(
|
||||||
"-moz-default-appearance",
|
"-moz-default-appearance",
|
||||||
"Appearance",
|
"Appearance",
|
||||||
|
|
|
@ -763,10 +763,10 @@ impl<'a, 'b: 'a> StyleAdjuster<'a, 'b> {
|
||||||
where
|
where
|
||||||
E: TElement,
|
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;
|
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() {
|
if self.style.get_inherited_text().clone_line_height() == LineHeight::normal() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1525,6 +1525,11 @@ pub enum Resize {
|
||||||
pub enum Appearance {
|
pub enum Appearance {
|
||||||
/// No appearance at all.
|
/// No appearance at all.
|
||||||
None,
|
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.
|
/// A typical dialog button.
|
||||||
Button,
|
Button,
|
||||||
/// Various arrows that go in buttons
|
/// Various arrows that go in buttons
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue