mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
style: Make appearance: button
behave like auto on various elements.
Differential Revision: https://phabricator.services.mozilla.com/D83434
This commit is contained in:
parent
f03883774b
commit
862b7d1249
6 changed files with 49 additions and 4 deletions
|
@ -334,6 +334,7 @@ class Longhand(object):
|
||||||
"BackgroundRepeat",
|
"BackgroundRepeat",
|
||||||
"BorderImageRepeat",
|
"BorderImageRepeat",
|
||||||
"BorderStyle",
|
"BorderStyle",
|
||||||
|
"ButtonAppearance",
|
||||||
"Clear",
|
"Clear",
|
||||||
"ColumnCount",
|
"ColumnCount",
|
||||||
"Contain",
|
"Contain",
|
||||||
|
|
|
@ -639,6 +639,25 @@ ${helpers.predefined_type(
|
||||||
gecko_ffi_name="mDefaultAppearance",
|
gecko_ffi_name="mDefaultAppearance",
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
// A UA-sheet only property that controls the effect of `appearance: button`
|
||||||
|
// on the element: `-moz-button-appearance: allow` means the element is rendered
|
||||||
|
// with button appearance, and `-moz-button-appearance: disallow` is treated
|
||||||
|
// like `appearance: auto`.
|
||||||
|
//
|
||||||
|
// https://github.com/w3c/csswg-drafts/issues/5174 proposes to simplify `button`
|
||||||
|
// to mean `auto` unconditionally, at which point this property can be removed.
|
||||||
|
${helpers.predefined_type(
|
||||||
|
"-moz-button-appearance",
|
||||||
|
"ButtonAppearance",
|
||||||
|
"computed::ButtonAppearance::Allow",
|
||||||
|
engines="gecko",
|
||||||
|
animation_value_type="none",
|
||||||
|
needs_context=False,
|
||||||
|
spec="Internal (not web-exposed)",
|
||||||
|
enabled_in="ua",
|
||||||
|
gecko_ffi_name="mButtonAppearance",
|
||||||
|
)}
|
||||||
|
|
||||||
${helpers.single_keyword(
|
${helpers.single_keyword(
|
||||||
"-moz-orient",
|
"-moz-orient",
|
||||||
"inline block horizontal vertical",
|
"inline block horizontal vertical",
|
||||||
|
|
|
@ -12,8 +12,8 @@ use crate::values::generics::box_::VerticalAlign as GenericVerticalAlign;
|
||||||
use crate::values::specified::box_ as specified;
|
use crate::values::specified::box_ as specified;
|
||||||
|
|
||||||
pub use crate::values::specified::box_::{AnimationName, Appearance, BreakBetween, BreakWithin};
|
pub use crate::values::specified::box_::{AnimationName, Appearance, BreakBetween, BreakWithin};
|
||||||
pub use crate::values::specified::box_::{Clear as SpecifiedClear, Float as SpecifiedFloat};
|
pub use crate::values::specified::box_::{ButtonAppearance, Clear as SpecifiedClear};
|
||||||
pub use crate::values::specified::box_::{Contain, Display, Overflow};
|
pub use crate::values::specified::box_::{Float as SpecifiedFloat, Contain, Display, Overflow};
|
||||||
pub use crate::values::specified::box_::{OverflowAnchor, OverflowClipBox, OverscrollBehavior};
|
pub use crate::values::specified::box_::{OverflowAnchor, OverflowClipBox, OverscrollBehavior};
|
||||||
pub use crate::values::specified::box_::{
|
pub use crate::values::specified::box_::{
|
||||||
ScrollSnapAlign, ScrollSnapAxis, ScrollSnapStrictness, ScrollSnapType,
|
ScrollSnapAlign, ScrollSnapAxis, ScrollSnapStrictness, ScrollSnapType,
|
||||||
|
|
|
@ -43,7 +43,7 @@ pub use self::border::{BorderCornerRadius, BorderRadius, BorderSpacing};
|
||||||
pub use self::border::{BorderImageRepeat, BorderImageSideWidth};
|
pub use self::border::{BorderImageRepeat, BorderImageSideWidth};
|
||||||
pub use self::border::{BorderImageSlice, BorderImageWidth};
|
pub use self::border::{BorderImageSlice, BorderImageWidth};
|
||||||
pub use self::box_::{AnimationIterationCount, AnimationName, Contain};
|
pub use self::box_::{AnimationIterationCount, AnimationName, Contain};
|
||||||
pub use self::box_::{Appearance, BreakBetween, BreakWithin, Clear, Float};
|
pub use self::box_::{Appearance, BreakBetween, BreakWithin, ButtonAppearance, Clear, Float};
|
||||||
pub use self::box_::{Display, Overflow, OverflowAnchor, TransitionProperty};
|
pub use self::box_::{Display, Overflow, OverflowAnchor, TransitionProperty};
|
||||||
pub use self::box_::{OverflowClipBox, OverscrollBehavior, Perspective, Resize};
|
pub use self::box_::{OverflowClipBox, OverscrollBehavior, Perspective, Resize};
|
||||||
pub use self::box_::{ScrollSnapAlign, ScrollSnapAxis, ScrollSnapStrictness, ScrollSnapType};
|
pub use self::box_::{ScrollSnapAlign, ScrollSnapAxis, ScrollSnapStrictness, ScrollSnapType};
|
||||||
|
|
|
@ -1842,6 +1842,31 @@ pub enum Appearance {
|
||||||
Count,
|
Count,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// The effect of `appearance: button` on an element.
|
||||||
|
#[derive(
|
||||||
|
Clone,
|
||||||
|
Copy,
|
||||||
|
Debug,
|
||||||
|
Eq,
|
||||||
|
Hash,
|
||||||
|
MallocSizeOf,
|
||||||
|
Parse,
|
||||||
|
PartialEq,
|
||||||
|
SpecifiedValueInfo,
|
||||||
|
ToCss,
|
||||||
|
ToComputedValue,
|
||||||
|
ToResolvedValue,
|
||||||
|
ToShmem,
|
||||||
|
)]
|
||||||
|
#[repr(u8)]
|
||||||
|
pub enum ButtonAppearance {
|
||||||
|
/// `appearance: button` means the element is rendered with button
|
||||||
|
/// appearance.
|
||||||
|
Allow,
|
||||||
|
/// `appearance: button` is treated like `appearance: auto`.
|
||||||
|
Disallow,
|
||||||
|
}
|
||||||
|
|
||||||
/// A kind of break between two boxes.
|
/// A kind of break between two boxes.
|
||||||
///
|
///
|
||||||
/// https://drafts.csswg.org/css-break/#break-between
|
/// https://drafts.csswg.org/css-break/#break-between
|
||||||
|
|
|
@ -37,7 +37,7 @@ pub use self::border::{BorderCornerRadius, BorderImageSlice, BorderImageWidth};
|
||||||
pub use self::border::{BorderImageRepeat, BorderImageSideWidth};
|
pub use self::border::{BorderImageRepeat, BorderImageSideWidth};
|
||||||
pub use self::border::{BorderRadius, BorderSideWidth, BorderSpacing, BorderStyle};
|
pub use self::border::{BorderRadius, BorderSideWidth, BorderSpacing, BorderStyle};
|
||||||
pub use self::box_::{AnimationIterationCount, AnimationName, Contain, Display};
|
pub use self::box_::{AnimationIterationCount, AnimationName, Contain, Display};
|
||||||
pub use self::box_::{Appearance, BreakBetween, BreakWithin};
|
pub use self::box_::{Appearance, BreakBetween, BreakWithin, ButtonAppearance};
|
||||||
pub use self::box_::{Clear, Float, Overflow, OverflowAnchor};
|
pub use self::box_::{Clear, Float, Overflow, OverflowAnchor};
|
||||||
pub use self::box_::{OverflowClipBox, OverscrollBehavior, Perspective, Resize};
|
pub use self::box_::{OverflowClipBox, OverscrollBehavior, Perspective, Resize};
|
||||||
pub use self::box_::{ScrollSnapAlign, ScrollSnapAxis, ScrollSnapStrictness, ScrollSnapType};
|
pub use self::box_::{ScrollSnapAlign, ScrollSnapAxis, ScrollSnapStrictness, ScrollSnapType};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue