aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/fragment.rs
diff options
context:
space:
mode:
authorDarin Minamoto <darinm223@gmail.com>2016-06-15 16:39:22 -0700
committerDarin Minamoto <darinm223@gmail.com>2016-06-15 16:39:22 -0700
commit4a4be1d7e5b7edee8debc38cf35236d7e91eec35 (patch)
tree12c07b110f085818b17a05cdcf983b8ad26dd189 /components/layout/fragment.rs
parent033786cd0dd0f74b5e2974aa67e000b832f17d17 (diff)
downloadservo-4a4be1d7e5b7edee8debc38cf35236d7e91eec35.tar.gz
servo-4a4be1d7e5b7edee8debc38cf35236d7e91eec35.zip
Image with height defined in % resizes properly
Diffstat (limited to 'components/layout/fragment.rs')
-rw-r--r--components/layout/fragment.rs9
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);
}