mirror of
https://github.com/servo/servo.git
synced 2025-08-12 00:45:33 +01:00
style: Serialize background-size: auto auto
as "auto".
With this change, all of Chrome, Edge, Firefox, and Safari serialize background-size by omitting the second "auto" if the value is "auto auto". Other keywords are still repeated. Differential Revision: https://phabricator.services.mozilla.com/D10446
This commit is contained in:
parent
68f4ad9557
commit
56fd3b786f
4 changed files with 53 additions and 3 deletions
|
@ -20,7 +20,7 @@ use values::computed::{self, CSSPixelLength, Context, ExtremumLength};
|
|||
use values::generics::length::{MaxLength as GenericMaxLength, MozLength as GenericMozLength};
|
||||
use values::generics::NonNegative;
|
||||
use values::specified::calc::CalcNode;
|
||||
use values::{Auto, CSSFloat, Either, Normal};
|
||||
use values::{Auto, CSSFloat, Either, Normal, IsAuto};
|
||||
|
||||
pub use super::image::{ColorStop, EndingShape as GradientEndingShape, Gradient};
|
||||
pub use super::image::{GradientKind, Image};
|
||||
|
@ -980,6 +980,13 @@ impl Parse for LengthOrPercentageOrAuto {
|
|||
/// A wrapper of LengthOrPercentageOrAuto, whose value must be >= 0.
|
||||
pub type NonNegativeLengthOrPercentageOrAuto = NonNegative<LengthOrPercentageOrAuto>;
|
||||
|
||||
impl IsAuto for NonNegativeLengthOrPercentageOrAuto {
|
||||
#[inline]
|
||||
fn is_auto(&self) -> bool {
|
||||
*self == Self::auto()
|
||||
}
|
||||
}
|
||||
|
||||
impl NonNegativeLengthOrPercentageOrAuto {
|
||||
/// 0
|
||||
#[inline]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue