Auto merge of #12680 - Manishearth:basic-shape, r=SimonSapin

style: Add support for parsing and serialization of <basic-shape>s

Still WIP: I still need to use this somewhere and make serialization minimal. I'm not sure if I should do either in this PR.
The only other browser that handles basic shapes doesn't serialize correctly either (https://bugzilla.mozilla.org/show_bug.cgi?id=1290864), so that's not something we need to get done now.

As far as using this somewhere, I have the following options:

 - Merge this now, work on using it in stylo in a followup.
 - Just write extensive unit tests for parsing/serialization for now (stylo in a followup)
 - Use this for clip-path in stylo only (which I intend to do anyway, just not sure if I should do it in this PR)
 - Use this for clip-path in Servo (I'd rather not do this; this would be a huge change requiring a lot more layout knowledge than I currently have)

Thoughts? Review? @SimonSapin @bholley

<!-- 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/12680)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-08-05 06:27:24 -05:00 committed by GitHub
commit 0fc0db67c6
16 changed files with 1188 additions and 181 deletions

View file

@ -520,9 +520,9 @@ impl FragmentDisplayListBuilding for Fragment {
};
// Use `background-position` to get the offset.
let horizontal_position = model::specified(background.background_position.horizontal,
let horizontal_position = model::specified(background.background_position.0.horizontal,
bounds.size.width - image_size.width);
let vertical_position = model::specified(background.background_position.vertical,
let vertical_position = model::specified(background.background_position.0.vertical,
bounds.size.height - image_size.height);
let abs_x = border.left + virtual_origin_x + horizontal_position + origin_x;