mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
parent
0d37e8f96b
commit
029af81570
7 changed files with 72 additions and 6 deletions
|
@ -40,6 +40,7 @@ use flow::{ImmutableFlowUtils, LateAbsolutePositionInfo, MutableFlowUtils, Opaqu
|
||||||
use flow::{LAYERS_NEEDED_FOR_DESCENDANTS, NEEDS_LAYER};
|
use flow::{LAYERS_NEEDED_FOR_DESCENDANTS, NEEDS_LAYER};
|
||||||
use flow::{PostorderFlowTraversal, PreorderFlowTraversal, mut_base};
|
use flow::{PostorderFlowTraversal, PreorderFlowTraversal, mut_base};
|
||||||
use flow::{self, BaseFlow, EarlyAbsolutePositionInfo, ForceNonfloatedFlag, FlowClass, Flow};
|
use flow::{self, BaseFlow, EarlyAbsolutePositionInfo, ForceNonfloatedFlag, FlowClass, Flow};
|
||||||
|
use flow_ref;
|
||||||
use fragment::{CoordinateSystem, Fragment, FragmentBorderBoxIterator, HAS_LAYER};
|
use fragment::{CoordinateSystem, Fragment, FragmentBorderBoxIterator, HAS_LAYER};
|
||||||
use fragment::{SpecificFragmentInfo};
|
use fragment::{SpecificFragmentInfo};
|
||||||
use incremental::{REFLOW, REFLOW_OUT_OF_FLOW};
|
use incremental::{REFLOW, REFLOW_OUT_OF_FLOW};
|
||||||
|
@ -494,6 +495,20 @@ impl<'a> PostorderFlowTraversal for AbsoluteStoreOverflowTraversal<'a> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
flow.mutate_fragments(&mut |f: &mut Fragment| {
|
||||||
|
match f.specific {
|
||||||
|
SpecificFragmentInfo::InlineBlock(ref mut info) => {
|
||||||
|
let block = flow_ref::deref_mut(&mut info.flow_ref);
|
||||||
|
(block.as_mut_block() as &mut Flow).early_store_overflow(self.layout_context);
|
||||||
|
}
|
||||||
|
SpecificFragmentInfo::InlineAbsolute(ref mut info) => {
|
||||||
|
let block = flow_ref::deref_mut(&mut info.flow_ref);
|
||||||
|
(block.as_mut_block() as &mut Flow).early_store_overflow(self.layout_context);
|
||||||
|
}
|
||||||
|
_ => (),
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
flow.early_store_overflow(self.layout_context);
|
flow.early_store_overflow(self.layout_context);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -953,10 +953,11 @@ unsafe impl Sync for BaseFlow {}
|
||||||
impl fmt::Debug for BaseFlow {
|
impl fmt::Debug for BaseFlow {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
write!(f,
|
write!(f,
|
||||||
"@ {:?}, CC {}, ADC {}",
|
"@ {:?}, CC {}, ADC {}, Ovr {:?}",
|
||||||
self.position,
|
self.position,
|
||||||
self.parallel.children_count.load(Ordering::SeqCst),
|
self.parallel.children_count.load(Ordering::SeqCst),
|
||||||
self.abs_descendants.len())
|
self.abs_descendants.len(),
|
||||||
|
self.overflow)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2179,11 +2179,11 @@ impl Fragment {
|
||||||
match self.specific {
|
match self.specific {
|
||||||
SpecificFragmentInfo::InlineBlock(ref info) => {
|
SpecificFragmentInfo::InlineBlock(ref info) => {
|
||||||
let block_flow = info.flow_ref.as_block();
|
let block_flow = info.flow_ref.as_block();
|
||||||
overflow = overflow.union(&block_flow.compute_overflow());
|
overflow = overflow.union(&flow::base(block_flow).overflow);
|
||||||
}
|
}
|
||||||
SpecificFragmentInfo::InlineAbsolute(ref info) => {
|
SpecificFragmentInfo::InlineAbsolute(ref info) => {
|
||||||
let block_flow = info.flow_ref.as_block();
|
let block_flow = info.flow_ref.as_block();
|
||||||
overflow = overflow.union(&block_flow.compute_overflow());
|
overflow = overflow.union(&flow::base(block_flow).overflow);
|
||||||
}
|
}
|
||||||
_ => (),
|
_ => (),
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@ use block::{AbsoluteAssignBSizesTraversal, AbsoluteStoreOverflowTraversal};
|
||||||
use context::LayoutContext;
|
use context::LayoutContext;
|
||||||
use display_list_builder::{FragmentDisplayListBuilding, InlineFlowDisplayListBuilding};
|
use display_list_builder::{FragmentDisplayListBuilding, InlineFlowDisplayListBuilding};
|
||||||
use floats::{FloatKind, Floats, PlacementInfo};
|
use floats::{FloatKind, Floats, PlacementInfo};
|
||||||
use flow::{MutableFlowUtils, OpaqueFlow};
|
use flow::{MutableFlowUtils, EarlyAbsolutePositionInfo, OpaqueFlow};
|
||||||
use flow::{self, BaseFlow, FlowClass, Flow, ForceNonfloatedFlag, IS_ABSOLUTELY_POSITIONED};
|
use flow::{self, BaseFlow, FlowClass, Flow, ForceNonfloatedFlag, IS_ABSOLUTELY_POSITIONED};
|
||||||
use flow_ref;
|
use flow_ref;
|
||||||
use fragment::{CoordinateSystem, Fragment, FragmentBorderBoxIterator, SpecificFragmentInfo};
|
use fragment::{CoordinateSystem, Fragment, FragmentBorderBoxIterator, SpecificFragmentInfo};
|
||||||
|
@ -1616,6 +1616,31 @@ impl Flow for InlineFlow {
|
||||||
Au(0),
|
Au(0),
|
||||||
-self.base.position.size.block));
|
-self.base.position.size.block));
|
||||||
|
|
||||||
|
let containing_block_size = LogicalSize::new(writing_mode,
|
||||||
|
Au(0),
|
||||||
|
self.base.position.size.block);
|
||||||
|
self.mutate_fragments(&mut |f: &mut Fragment| {
|
||||||
|
match f.specific {
|
||||||
|
SpecificFragmentInfo::InlineBlock(ref mut info) => {
|
||||||
|
let block = flow_ref::deref_mut(&mut info.flow_ref);
|
||||||
|
flow::mut_base(block).early_absolute_position_info = EarlyAbsolutePositionInfo {
|
||||||
|
relative_containing_block_size: containing_block_size,
|
||||||
|
relative_containing_block_mode: writing_mode,
|
||||||
|
};
|
||||||
|
(block.as_mut_block() as &mut Flow).late_store_overflow(layout_context);
|
||||||
|
}
|
||||||
|
SpecificFragmentInfo::InlineAbsolute(ref mut info) => {
|
||||||
|
let block = flow_ref::deref_mut(&mut info.flow_ref);
|
||||||
|
flow::mut_base(block).early_absolute_position_info = EarlyAbsolutePositionInfo {
|
||||||
|
relative_containing_block_size: containing_block_size,
|
||||||
|
relative_containing_block_mode: writing_mode,
|
||||||
|
};
|
||||||
|
(block.as_mut_block() as &mut Flow).late_store_overflow(layout_context);
|
||||||
|
}
|
||||||
|
_ => (),
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
self.base.restyle_damage.remove(REFLOW_OUT_OF_FLOW | REFLOW);
|
self.base.restyle_damage.remove(REFLOW_OUT_OF_FLOW | REFLOW);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1817,7 +1842,11 @@ impl Flow for InlineFlow {
|
||||||
|
|
||||||
impl fmt::Debug for InlineFlow {
|
impl fmt::Debug for InlineFlow {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
write!(f, "{:?} - {:x} - {:?}", self.class(), self.base.debug_id(), self.fragments)
|
write!(f, "{:?} - {:x} - Ovr {:?} - {:?}",
|
||||||
|
self.class(),
|
||||||
|
self.base.debug_id(),
|
||||||
|
flow::base(self).overflow,
|
||||||
|
self.fragments)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -271,6 +271,7 @@ flaky_cpu == linebreak_simple_a.html linebreak_simple_b.html
|
||||||
# Should be ==?
|
# Should be ==?
|
||||||
!= overflow_position_abs_inside_normal_a.html overflow_position_abs_inside_normal_b.html
|
!= overflow_position_abs_inside_normal_a.html overflow_position_abs_inside_normal_b.html
|
||||||
== overflow_position_abs_simple_a.html overflow_position_abs_simple_b.html
|
== overflow_position_abs_simple_a.html overflow_position_abs_simple_b.html
|
||||||
|
== overflow_position_rel_inline_block.html overflow_position_rel_inline_block_ref.html
|
||||||
== overflow_scroll.html overflow_simple_b.html
|
== overflow_scroll.html overflow_simple_b.html
|
||||||
== overflow_simple_a.html overflow_simple_b.html
|
== overflow_simple_a.html overflow_simple_b.html
|
||||||
== overflow_wrap_a.html overflow_wrap_ref.html
|
== overflow_wrap_a.html overflow_wrap_ref.html
|
||||||
|
|
11
tests/ref/overflow_position_rel_inline_block.html
Normal file
11
tests/ref/overflow_position_rel_inline_block.html
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
<style>
|
||||||
|
div {
|
||||||
|
overflow:hidden;
|
||||||
|
display:inline-block;
|
||||||
|
position:relative;
|
||||||
|
width:100px;
|
||||||
|
height:100px;
|
||||||
|
background:red
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<div></div>
|
9
tests/ref/overflow_position_rel_inline_block_ref.html
Normal file
9
tests/ref/overflow_position_rel_inline_block_ref.html
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
<style>
|
||||||
|
div {
|
||||||
|
position:relative;
|
||||||
|
width:100px;
|
||||||
|
height:100px;
|
||||||
|
background:red
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<div></div>
|
Loading…
Add table
Add a link
Reference in a new issue