mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Auto merge of #13122 - Manishearth:basic-shape-position-redux, r=SimonSapin
Handle specialized serialization of <position> in basic shapes Fixes #13083 We temporarily broke basic-shape serialization in #13042 when 4-value positions were implemented, since I didn't want to increase the scope of that PR too much. This fixes it. r? @SimonSapin cc @canaltinova <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13122) <!-- Reviewable:end -->
This commit is contained in:
commit
6c68680581
2 changed files with 99 additions and 8 deletions
|
@ -77,7 +77,6 @@ fn test_border_radius() {
|
|||
|
||||
#[test]
|
||||
fn test_circle() {
|
||||
/*
|
||||
assert_roundtrip_basicshape!(Circle::parse, "circle(at center)", "circle(at 50% 50%)");
|
||||
assert_roundtrip_basicshape!(Circle::parse, "circle()", "circle(at 50% 50%)");
|
||||
assert_roundtrip_basicshape!(Circle::parse, "circle(at left bottom)", "circle(at 0% 100%)");
|
||||
|
@ -97,14 +96,24 @@ fn test_circle() {
|
|||
assert_roundtrip_basicshape!(Circle::parse, "circle(calc(1px + 50%) at center)",
|
||||
"circle(calc(1px + 50%) at 50% 50%)");
|
||||
|
||||
assert!(parse(Circle::parse, "circle(at top 40%)").is_err());
|
||||
*/
|
||||
assert_roundtrip_basicshape!(Circle::parse, "circle(at right 5px bottom 10px)",
|
||||
"circle(at right 5px bottom 10px)");
|
||||
assert_roundtrip_basicshape!(Circle::parse, "circle(at bottom 5px right 10px)",
|
||||
"circle(at right 10px bottom 5px)");
|
||||
assert_roundtrip_basicshape!(Circle::parse, "circle(at right 5% top 0px)",
|
||||
"circle(at 95% 0%)");
|
||||
assert_roundtrip_basicshape!(Circle::parse, "circle(at right 5% bottom 0px)",
|
||||
"circle(at 95% 100%)");
|
||||
assert_roundtrip_basicshape!(Circle::parse, "circle(at right 5% bottom 1px)",
|
||||
"circle(at right 5% bottom 1px)");
|
||||
assert_roundtrip_basicshape!(Circle::parse, "circle(at 5% bottom 1px)",
|
||||
"circle(at left 5% bottom 1px)");
|
||||
|
||||
assert!(parse(Circle::parse, "circle(at top 40%)").is_err());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_ellipse() {
|
||||
/*
|
||||
assert_roundtrip_basicshape!(Ellipse::parse, "ellipse(at center)", "ellipse(at 50% 50%)");
|
||||
assert_roundtrip_basicshape!(Ellipse::parse, "ellipse()", "ellipse(at 50% 50%)");
|
||||
assert_roundtrip_basicshape!(Ellipse::parse, "ellipse(at left bottom)", "ellipse(at 0% 100%)");
|
||||
|
@ -118,7 +127,6 @@ fn test_ellipse() {
|
|||
assert_roundtrip_basicshape!(Ellipse::parse, "ellipse(20px 10% at center)", "ellipse(20px 10% at 50% 50%)");
|
||||
assert_roundtrip_basicshape!(Ellipse::parse, "ellipse(calc(1px + 50%) 10px at center)",
|
||||
"ellipse(calc(1px + 50%) 10px at 50% 50%)");
|
||||
*/
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue