mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
style: Fix the serialization of the computed value of background-size.
This patch produces the following serialization: ``` input | computed value ------------------------------ 1. "auto" "auto" 2. "auto auto" "auto" 3. "15px auto" "15px" 4. "15px" "15px" ``` i.e. If the second value is 'auto', then it's omitted from our serialization, because it's implied. Besides, we update the wpt to address this spec issue: https://github.com/w3c/csswg-drafts/issues/2574 Differential Revision: https://phabricator.services.mozilla.com/D35510
This commit is contained in:
parent
c87da27bca
commit
815d189228
1 changed files with 1 additions and 11 deletions
|
@ -6,13 +6,6 @@
|
||||||
|
|
||||||
use crate::values::generics::length::{GenericLengthPercentageOrAuto, LengthPercentageOrAuto};
|
use crate::values::generics::length::{GenericLengthPercentageOrAuto, LengthPercentageOrAuto};
|
||||||
|
|
||||||
fn width_and_height_are_auto<L>(
|
|
||||||
width: &LengthPercentageOrAuto<L>,
|
|
||||||
height: &LengthPercentageOrAuto<L>,
|
|
||||||
) -> bool {
|
|
||||||
width.is_auto() && height.is_auto()
|
|
||||||
}
|
|
||||||
|
|
||||||
/// A generic value for the `background-size` property.
|
/// A generic value for the `background-size` property.
|
||||||
#[derive(
|
#[derive(
|
||||||
Animate,
|
Animate,
|
||||||
|
@ -37,10 +30,7 @@ pub enum GenericBackgroundSize<LengthPercent> {
|
||||||
/// Explicit width.
|
/// Explicit width.
|
||||||
width: GenericLengthPercentageOrAuto<LengthPercent>,
|
width: GenericLengthPercentageOrAuto<LengthPercent>,
|
||||||
/// Explicit height.
|
/// Explicit height.
|
||||||
/// NOTE(emilio): We should probably simplify all these in case `width`
|
#[css(skip_if = "GenericLengthPercentageOrAuto::is_auto")]
|
||||||
/// and `height` are the same, but all other browsers agree on only
|
|
||||||
/// special-casing `auto`.
|
|
||||||
#[css(contextual_skip_if = "width_and_height_are_auto")]
|
|
||||||
height: GenericLengthPercentageOrAuto<LengthPercent>,
|
height: GenericLengthPercentageOrAuto<LengthPercent>,
|
||||||
},
|
},
|
||||||
/// `cover`
|
/// `cover`
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue