Auto merge of #16862 - CJKu:bug-1310885-part-6, r=heycam

stylo: Pass Cached ImageValue from stylo back to gecko

<!-- Please describe your changes on the following line: -->
This is  part 6 ~ part 9 patch in bug 1310885

gecko bug link:
https://bugzilla.mozilla.org/show_bug.cgi?id=1310885
---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- 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/16862)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-05-15 18:04:59 -05:00 committed by GitHub
commit 5bd6b92494
14 changed files with 148 additions and 38 deletions

View file

@ -493,6 +493,7 @@ mod shorthand_serialization {
}
mod list_style {
use style::properties::longhands::list_style_image::SpecifiedValue as ListStyleImage;
use style::properties::longhands::list_style_position::SpecifiedValue as ListStylePosition;
use style::properties::longhands::list_style_type::SpecifiedValue as ListStyleType;
use style::values::Either;
@ -503,12 +504,17 @@ mod shorthand_serialization {
let mut properties = Vec::new();
let position = ListStylePosition::inside;
let image = Either::First(
SpecifiedUrl::new_for_testing("http://servo/test.png"));
let image =
ListStyleImage(Either::First(SpecifiedUrl::new_for_testing("http://servo/test.png")));
let style_type = ListStyleType::disc;
properties.push(PropertyDeclaration::ListStylePosition(position));
#[cfg(feature = "gecko")]
properties.push(PropertyDeclaration::ListStyleImage(Box::new(image)));
#[cfg(not(feature = "gecko"))]
properties.push(PropertyDeclaration::ListStyleImage(image));
properties.push(PropertyDeclaration::ListStyleType(style_type));
let serialization = shorthand_properties_to_string(properties);