Skip to content
Browse files

layout: Stop in-order on children of InlineFlow

No need to do in-order traversal for children of InlineFlow, since
they are either inline-block or absolutely positioned elements, which
are guaranteed to be block formatting context.
  • Loading branch information
stshine committed Jul 13, 2017
1 parent 2a575ac commit 71fcdf683a0f55608d6e113a3b17b234199f91b9
Showing with 2 additions and 13 deletions.
  1. +2 −13 components/layout/
@@ -1420,6 +1420,8 @@ impl Flow for InlineFlow {

/// Calculate and set the block-size of this flow. See CSS 2.1 § 10.6.1.
/// Note that we do not need to do in-order traversal becase the children
/// are always block formatting context.
fn assign_block_size(&mut self, layout_context: &LayoutContext) {
let _scope = layout_debug_scope!("inline::assign_block_size {:x}",
@@ -1484,19 +1486,6 @@ impl Flow for InlineFlow {
indentation = Au(0)

// Assign block sizes for any inline-block descendants.
let thread_id = self.base.thread_id;
for kid in self.base.child_iter_mut() {
if flow::base(kid).flags.contains(IS_ABSOLUTELY_POSITIONED) ||
flow::base(kid).flags.is_float() {
let content_box = flow::base(kid).position;

if self.contains_positioned_fragments() {
// Assign block-sizes for all flows in this absolute flow tree.
// This is preorder because the block-size of an absolute flow may depend on

0 comments on commit 71fcdf6

Please sign in to comment.
You can’t perform that action at this time.