diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-12-12 03:25:03 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-12 03:25:03 -0800 |
commit | 1993b6e812de30de06100e7d52c1d90af929f24f (patch) | |
tree | 909da2600ac4dd9282326c6931ed6b83190750ba /components/layout/construct.rs | |
parent | 7eb7d7adb2ab10642193f013f59fa93dd042d41a (diff) | |
parent | 7bca3034b2d3d9aa2634d3ca5b7471fed254b770 (diff) | |
download | servo-1993b6e812de30de06100e7d52c1d90af929f24f.tar.gz servo-1993b6e812de30de06100e7d52c1d90af929f24f.zip |
Auto merge of #14490 - stshine:replaced-size, r=emilio
layout: Unify size calculation of replaced elements
<!-- Please describe your changes on the following line: -->
---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [ ] `./mach build -d` does not report any errors
- [ ] `./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 _____
<!-- 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/14490)
<!-- Reviewable:end -->
Diffstat (limited to 'components/layout/construct.rs')
-rw-r--r-- | components/layout/construct.rs | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/components/layout/construct.rs b/components/layout/construct.rs index f3309b97b75..b25923d19c2 100644 --- a/components/layout/construct.rs +++ b/components/layout/construct.rs @@ -346,14 +346,12 @@ impl<'a, ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode> SpecificFragmentInfo::Iframe(IframeFragmentInfo::new(node)) } Some(LayoutNodeType::Element(LayoutElementType::HTMLImageElement)) => { - let image_info = box ImageFragmentInfo::new(node, - node.image_url(), + let image_info = box ImageFragmentInfo::new(node.image_url(), &self.layout_context.shared); SpecificFragmentInfo::Image(image_info) } Some(LayoutNodeType::Element(LayoutElementType::HTMLObjectElement)) => { - let image_info = box ImageFragmentInfo::new(node, - node.object_data(), + let image_info = box ImageFragmentInfo::new(node.object_data(), &self.layout_context.shared); SpecificFragmentInfo::Image(image_info) } @@ -372,11 +370,11 @@ impl<'a, ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode> } Some(LayoutNodeType::Element(LayoutElementType::HTMLCanvasElement)) => { let data = node.canvas_data().unwrap(); - SpecificFragmentInfo::Canvas(box CanvasFragmentInfo::new(node, data, self.style_context())) + SpecificFragmentInfo::Canvas(box CanvasFragmentInfo::new(data)) } Some(LayoutNodeType::Element(LayoutElementType::SVGSVGElement)) => { let data = node.svg_data().unwrap(); - SpecificFragmentInfo::Svg(box SvgFragmentInfo::new(node, data, self.style_context())) + SpecificFragmentInfo::Svg(box SvgFragmentInfo::new(data)) } _ => { // This includes pseudo-elements. @@ -1207,8 +1205,7 @@ impl<'a, ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode> let flotation = FloatKind::from_property(flotation); let marker_fragments = match node.style(self.style_context()).get_list().list_style_image { Either::First(ref url_value) => { - let image_info = box ImageFragmentInfo::new(node, - url_value.url().map(|u| u.clone()), + let image_info = box ImageFragmentInfo::new(url_value.url().map(|u| u.clone()), &self.layout_context.shared); vec![Fragment::new(node, SpecificFragmentInfo::Image(image_info), self.layout_context)] } |