diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-06-16 03:57:38 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-06-16 03:57:38 -0500 |
commit | d2db39634e6e39f4cb054e0b443339409ae69350 (patch) | |
tree | b12e3df3d7af93a2226194bd1ed2cd70c50e9354 /components/layout/fragment.rs | |
parent | c164a2e41ce7649da570be127b9b148fcb0f78f4 (diff) | |
parent | 4a4be1d7e5b7edee8debc38cf35236d7e91eec35 (diff) | |
download | servo-d2db39634e6e39f4cb054e0b443339409ae69350.tar.gz servo-d2db39634e6e39f4cb054e0b443339409ae69350.zip |
Auto merge of #11746 - DarinM223:master, r=mbrubeck
Image with height defined in % resizes properly
<!-- Please describe your changes on the following line: -->
Checked the html in the github issue and the image looks like it is resized properly in Servo.
Fixed image resizing when height is specified in percentages.
---
<!-- 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
- [X] These changes fix #11723 (github issue number if applicable).
<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because this issue is marked with has-test?
<!-- 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="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11746)
<!-- Reviewable:end -->
Diffstat (limited to 'components/layout/fragment.rs')
-rw-r--r-- | components/layout/fragment.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/components/layout/fragment.rs b/components/layout/fragment.rs index 640b7acce1a..27f08dfd5e5 100644 --- a/components/layout/fragment.rs +++ b/components/layout/fragment.rs @@ -488,6 +488,7 @@ impl ReplacedImageFragmentInfo { style: &ServoComputedValues, noncontent_inline_size: Au, container_inline_size: Au, + container_block_size: Option<Au>, fragment_inline_size: Au, fragment_block_size: Au) -> Au { @@ -515,7 +516,7 @@ impl ReplacedImageFragmentInfo { let specified_height = ReplacedImageFragmentInfo::style_length( style_block_size, - None); + container_block_size); let specified_height = match specified_height { MaybeAuto::Auto => intrinsic_height, MaybeAuto::Specified(h) => h, @@ -1767,7 +1768,9 @@ impl Fragment { /// Assigns replaced inline-size, padding, and margins for this fragment only if it is replaced /// content per CSS 2.1 § 10.3.2. - pub fn assign_replaced_inline_size_if_necessary(&mut self, container_inline_size: Au) { + pub fn assign_replaced_inline_size_if_necessary(&mut self, + container_inline_size: Au, + container_block_size: Option<Au>) { match self.specific { SpecificFragmentInfo::Generic | SpecificFragmentInfo::GeneratedContent(_) | @@ -1833,6 +1836,7 @@ impl Fragment { .calculate_replaced_inline_size(style, noncontent_inline_size, container_inline_size, + container_block_size, fragment_inline_size, fragment_block_size); } @@ -1844,6 +1848,7 @@ impl Fragment { .calculate_replaced_inline_size(style, noncontent_inline_size, container_inline_size, + container_block_size, fragment_inline_size, fragment_block_size); } |