mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
style: Omit center positions in conic/radial gradient serialization.
Differential Revision: https://phabricator.services.mozilla.com/D67461
This commit is contained in:
parent
414edb5a4a
commit
d17b3cc202
4 changed files with 77 additions and 12 deletions
|
@ -9,6 +9,7 @@
|
|||
|
||||
use crate::values::computed::{Integer, LengthPercentage, Percentage};
|
||||
use crate::values::generics::position::Position as GenericPosition;
|
||||
use crate::values::generics::position::PositionComponent as GenericPositionComponent;
|
||||
use crate::values::generics::position::PositionOrAuto as GenericPositionOrAuto;
|
||||
use crate::values::generics::position::ZIndex as GenericZIndex;
|
||||
pub use crate::values::specified::position::{GridAutoFlow, GridTemplateAreas};
|
||||
|
@ -56,5 +57,14 @@ impl ToCss for Position {
|
|||
}
|
||||
}
|
||||
|
||||
impl GenericPositionComponent for LengthPercentage {
|
||||
fn is_center(&self) -> bool {
|
||||
match self.to_percentage() {
|
||||
Some(Percentage(per)) => per == 0.5,
|
||||
_ => false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// A computed value for the `z-index` property.
|
||||
pub type ZIndex = GenericZIndex<Integer>;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue