mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
style: Drop the manually implementation of ToCSS for BasicShape::Polygon.
The implementation of ToCSS for Polygon has some rule, and we could use skip_if to handle and serialization of fill-rule. However, we should derive ToCSS for the pair of LengthOrPercentages, so define a new type for it. Differential Revision: https://phabricator.services.mozilla.com/D4153
This commit is contained in:
parent
c587fa3586
commit
e46daa09ea
3 changed files with 27 additions and 37 deletions
|
@ -14,7 +14,7 @@ use std::fmt::{self, Write};
|
|||
use style_traits::{CssWriter, ParseError, StyleParseErrorKind, ToCss};
|
||||
use values::computed::Percentage;
|
||||
use values::generics::basic_shape as generic;
|
||||
use values::generics::basic_shape::{FillRule, GeometryBox, ShapeBox, ShapeSource};
|
||||
use values::generics::basic_shape::{FillRule, GeometryBox, PolygonCoord, ShapeBox, ShapeSource};
|
||||
use values::generics::rect::Rect;
|
||||
use values::specified::LengthOrPercentage;
|
||||
use values::specified::border::BorderRadius;
|
||||
|
@ -381,7 +381,7 @@ impl Polygon {
|
|||
.unwrap_or_default();
|
||||
|
||||
let buf = input.parse_comma_separated(|i| {
|
||||
Ok((
|
||||
Ok(PolygonCoord(
|
||||
LengthOrPercentage::parse(context, i)?,
|
||||
LengthOrPercentage::parse(context, i)?,
|
||||
))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue