diff options
author | bors-servo <metajack+bors@gmail.com> | 2015-05-08 15:45:52 -0500 |
---|---|---|
committer | bors-servo <metajack+bors@gmail.com> | 2015-05-08 15:45:52 -0500 |
commit | 49b73c0bfe50366e767525f9f90c5aa348f68f18 (patch) | |
tree | f8aea9aa0abd714afbac2efd592b3b0cc6d01f14 /components | |
parent | 892a7404266983c6d51218bc18b8aa878d9a7a3e (diff) | |
parent | 7b92b99c6d480b5faf3a7aa0749e86ee6edc872a (diff) | |
download | servo-49b73c0bfe50366e767525f9f90c5aa348f68f18.tar.gz servo-49b73c0bfe50366e767525f9f90c5aa348f68f18.zip |
Auto merge of #5990 - pcwalton:img-width-attribute-intrinsic-width, r=glennw
Fixes sites that use spacer gifs for table layout, such as the comments
page on Hacker News.
r? @glennw
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/5990)
<!-- Reviewable:end -->
Diffstat (limited to 'components')
-rw-r--r-- | components/layout/fragment.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/components/layout/fragment.rs b/components/layout/fragment.rs index 7085ca307ab..e52c5373cae 100644 --- a/components/layout/fragment.rs +++ b/components/layout/fragment.rs @@ -1248,11 +1248,15 @@ impl Fragment { result.union_block(&block_flow.base.intrinsic_inline_sizes) } SpecificFragmentInfo::Image(ref mut image_fragment_info) => { - let image_inline_size = image_fragment_info.image_inline_size(); + let image_inline_size = match image_fragment_info.replaced_image_fragment_info + .dom_inline_size { + None => image_fragment_info.image_inline_size(), + Some(dom_inline_size) => dom_inline_size, + }; result.union_block(&IntrinsicISizes { minimum_inline_size: image_inline_size, preferred_inline_size: image_inline_size, - }) + }); } SpecificFragmentInfo::Canvas(ref mut canvas_fragment_info) => { let canvas_inline_size = canvas_fragment_info.canvas_inline_size(); |