diff options
author | bors-servo <metajack+bors@gmail.com> | 2015-09-04 19:59:11 -0600 |
---|---|---|
committer | bors-servo <metajack+bors@gmail.com> | 2015-09-04 19:59:11 -0600 |
commit | aeb8dce2d914808e4cdb8589d19ee9968897ed94 (patch) | |
tree | bc5858527d9c106b662371c1da914e0d4806ee72 /components/layout/inline.rs | |
parent | 5bad6b1b6e149246e8949fd42059e777d1cbd9e3 (diff) | |
parent | dba3e41a63506842e84e43451d6f41156c672321 (diff) | |
download | servo-aeb8dce2d914808e4cdb8589d19ee9968897ed94.tar.gz servo-aeb8dce2d914808e4cdb8589d19ee9968897ed94.zip |
Auto merge of #7534 - pcwalton:inline-absolute-out-of-flow, r=mbrubeck
layout: Lay absolutely-positioned blocks with inline containing blocks out of flow.
Removes the long space before the site-specific drop-down in the Google SERPs.
r? @glennw
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7534)
<!-- Reviewable:end -->
Diffstat (limited to 'components/layout/inline.rs')
-rw-r--r-- | components/layout/inline.rs | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/components/layout/inline.rs b/components/layout/inline.rs index 22fe3054b63..5b137ceade2 100644 --- a/components/layout/inline.rs +++ b/components/layout/inline.rs @@ -738,13 +738,17 @@ impl LineBreaker { layout_context: &LayoutContext) { let indentation = self.indentation_for_pending_fragment(); self.pending_line.range.extend_by(FragmentIndex(1)); - self.pending_line.bounds.size.inline = self.pending_line.bounds.size.inline + - fragment.margin_box_inline_size() + - indentation; - self.pending_line.inline_metrics = - self.new_inline_metrics_for_line(&fragment, layout_context); - self.pending_line.bounds.size.block = - self.new_block_size_for_line(&fragment, layout_context); + + if !fragment.is_inline_absolute() { + self.pending_line.bounds.size.inline = self.pending_line.bounds.size.inline + + fragment.margin_box_inline_size() + + indentation; + self.pending_line.inline_metrics = + self.new_inline_metrics_for_line(&fragment, layout_context); + self.pending_line.bounds.size.block = + self.new_block_size_for_line(&fragment, layout_context); + } + self.new_fragments.push(fragment); } @@ -1079,8 +1083,11 @@ impl InlineFlow { fragment.border_box.size.inline, fragment.border_box.size.block); fragment.update_late_computed_inline_position_if_necessary(); - inline_start_position_for_fragment = inline_start_position_for_fragment + - fragment.border_box.size.inline + fragment.margin.inline_end; + + if !fragment.is_inline_absolute() { + inline_start_position_for_fragment = inline_start_position_for_fragment + + fragment.border_box.size.inline + fragment.margin.inline_end; + } } } } |