mirror of
https://github.com/servo/servo.git
synced 2025-07-23 15:23:42 +01:00
Auto merge of #7313 - pcwalton:position-relative-percentage-overflow, r=mbrubeck
layout: Make overflow calculation take relative percentages into account. This necessitated changing overflow to be calculated by the parent flow if relatively positioned children are present. That is because the overflow regions cannot be calculated without knowing relative offsets, which themselves cannot be calculated without knowing the parent size (because of percentages). To accomplish this without sacrificing parallelism in the non-relative case, this patch splits overflow into "early" and "late" computation. Late overflow computation cannot be parallelized across children, while early overflow computation can. Makes the "Apple Music" text show up over the full-bleed promotional background on apple.com. r? @SimonSapin -- would appreciate a look over the iframe test case that was changed. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7313) <!-- Reviewable:end -->
This commit is contained in:
commit
dcaf66397a
19 changed files with 223 additions and 108 deletions
|
@ -1176,8 +1176,7 @@ impl<'a> PaintContext<'a> {
|
||||||
// FIXME(https://github.com/rust-lang/rust/issues/23338)
|
// FIXME(https://github.com/rust-lang/rust/issues/23338)
|
||||||
let font = self.font_context.get_paint_font_from_template(
|
let font = self.font_context.get_paint_font_from_template(
|
||||||
&text.text_run.font_template, text.text_run.actual_pt_size);
|
&text.text_run.font_template, text.text_run.actual_pt_size);
|
||||||
font
|
font.borrow()
|
||||||
.borrow()
|
|
||||||
.draw_text(&temporary_draw_target.draw_target,
|
.draw_text(&temporary_draw_target.draw_target,
|
||||||
&*text.text_run,
|
&*text.text_run,
|
||||||
&text.range,
|
&text.range,
|
||||||
|
@ -1245,7 +1244,8 @@ impl<'a> PaintContext<'a> {
|
||||||
|
|
||||||
// Calculate the transform matrix.
|
// Calculate the transform matrix.
|
||||||
let old_transform = self.draw_target.get_transform();
|
let old_transform = self.draw_target.get_transform();
|
||||||
let inflated_size = Rect::new(Point2D::new(0.0, 0.0), Size2D::new(size.width as AzFloat,
|
let inflated_size = Rect::new(Point2D::new(0.0, 0.0),
|
||||||
|
Size2D::new(size.width as AzFloat,
|
||||||
size.height as AzFloat));
|
size.height as AzFloat));
|
||||||
let temporary_draw_target_bounds = old_transform.transform_rect(&inflated_size);
|
let temporary_draw_target_bounds = old_transform.transform_rect(&inflated_size);
|
||||||
matrix = Matrix2D::identity().translate(
|
matrix = Matrix2D::identity().translate(
|
||||||
|
@ -1276,7 +1276,8 @@ impl<'a> PaintContext<'a> {
|
||||||
self.draw_target.set_transform(&Matrix2D::identity());
|
self.draw_target.set_transform(&Matrix2D::identity());
|
||||||
let rect = Rect::new(Point2D::new(0.0, 0.0), self.draw_target.get_size().to_azure_size());
|
let rect = Rect::new(Point2D::new(0.0, 0.0), self.draw_target.get_size().to_azure_size());
|
||||||
|
|
||||||
let rect_temporary = Rect::new(Point2D::new(0.0, 0.0), temporary_draw_target.get_size().to_azure_size());
|
let rect_temporary = Rect::new(Point2D::new(0.0, 0.0),
|
||||||
|
temporary_draw_target.get_size().to_azure_size());
|
||||||
|
|
||||||
// Create the Azure filter pipeline.
|
// Create the Azure filter pipeline.
|
||||||
let mut accum_blur = Au(0);
|
let mut accum_blur = Au(0);
|
||||||
|
@ -1297,7 +1298,10 @@ impl<'a> PaintContext<'a> {
|
||||||
self.pop_clip_if_applicable();
|
self.pop_clip_if_applicable();
|
||||||
|
|
||||||
debug!("######### use expanded Rect.");
|
debug!("######### use expanded Rect.");
|
||||||
self.draw_target.draw_filter(&filter_node, &rect_temporary, &rect_temporary.origin, draw_options);
|
self.draw_target.draw_filter(&filter_node,
|
||||||
|
&rect_temporary,
|
||||||
|
&rect_temporary.origin,
|
||||||
|
draw_options);
|
||||||
self.push_clip_if_applicable();
|
self.push_clip_if_applicable();
|
||||||
} else {
|
} else {
|
||||||
debug!("######### use regular Rect.");
|
debug!("######### use regular Rect.");
|
||||||
|
@ -1348,7 +1352,8 @@ impl<'a> PaintContext<'a> {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Draw the shadow, and blur if we need to.
|
// Draw the shadow, and blur if we need to.
|
||||||
temporary_draw_target.draw_target.fill(&path,
|
temporary_draw_target.draw_target.fill(
|
||||||
|
&path,
|
||||||
Pattern::Color(ColorPattern::new(color)).to_pattern_ref(),
|
Pattern::Color(ColorPattern::new(color)).to_pattern_ref(),
|
||||||
&DrawOptions::new(1.0, CompositionOp::Over, AntialiasMode::None));
|
&DrawOptions::new(1.0, CompositionOp::Over, AntialiasMode::None));
|
||||||
self.blur_if_necessary(temporary_draw_target, blur_radius);
|
self.blur_if_necessary(temporary_draw_target, blur_radius);
|
||||||
|
|
|
@ -36,10 +36,10 @@ use flow::{CLEARS_LEFT, CLEARS_RIGHT};
|
||||||
use flow::{HAS_LEFT_FLOATED_DESCENDANTS, HAS_RIGHT_FLOATED_DESCENDANTS};
|
use flow::{HAS_LEFT_FLOATED_DESCENDANTS, HAS_RIGHT_FLOATED_DESCENDANTS};
|
||||||
use flow::{IMPACTED_BY_LEFT_FLOATS, IMPACTED_BY_RIGHT_FLOATS, INLINE_POSITION_IS_STATIC};
|
use flow::{IMPACTED_BY_LEFT_FLOATS, IMPACTED_BY_RIGHT_FLOATS, INLINE_POSITION_IS_STATIC};
|
||||||
use flow::{IS_ABSOLUTELY_POSITIONED};
|
use flow::{IS_ABSOLUTELY_POSITIONED};
|
||||||
use flow::{ImmutableFlowUtils, MutableFlowUtils, OpaqueFlow, PreorderFlowTraversal};
|
use flow::{ImmutableFlowUtils, LateAbsolutePositionInfo, MutableFlowUtils, OpaqueFlow};
|
||||||
use flow::{LAYERS_NEEDED_FOR_DESCENDANTS, NEEDS_LAYER};
|
use flow::{LAYERS_NEEDED_FOR_DESCENDANTS, NEEDS_LAYER};
|
||||||
use flow::{PostorderFlowTraversal, mut_base};
|
use flow::{PostorderFlowTraversal, PreorderFlowTraversal, mut_base};
|
||||||
use flow::{self, AbsolutePositionInfo, BaseFlow, ForceNonfloatedFlag, FlowClass, Flow};
|
use flow::{self, BaseFlow, EarlyAbsolutePositionInfo, ForceNonfloatedFlag, FlowClass, Flow};
|
||||||
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};
|
||||||
|
@ -485,7 +485,7 @@ impl<'a> PostorderFlowTraversal for AbsoluteStoreOverflowTraversal<'a> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
flow.store_overflow(self.layout_context);
|
flow.early_store_overflow(self.layout_context);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -959,6 +959,19 @@ impl BlockFlow {
|
||||||
//
|
//
|
||||||
// FIXME(pcwalton): This looks not idempotent. Is it?
|
// FIXME(pcwalton): This looks not idempotent. Is it?
|
||||||
self.fragment.border_box.size.block = block_size;
|
self.fragment.border_box.size.block = block_size;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Write in the size of the relative containing block for children. (This information
|
||||||
|
// is also needed to handle RTL.)
|
||||||
|
for kid in self.base.child_iter() {
|
||||||
|
flow::mut_base(kid).early_absolute_position_info = EarlyAbsolutePositionInfo {
|
||||||
|
relative_containing_block_size: self.fragment.content_box().size,
|
||||||
|
relative_containing_block_mode: self.fragment.style().writing_mode,
|
||||||
|
};
|
||||||
|
kid.late_store_overflow(layout_context)
|
||||||
|
}
|
||||||
|
|
||||||
|
if self.base.flags.contains(IS_ABSOLUTELY_POSITIONED) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1730,7 +1743,7 @@ impl Flow for BlockFlow {
|
||||||
self.base.thread_id = parent_thread_id;
|
self.base.thread_id = parent_thread_id;
|
||||||
if self.base.restyle_damage.intersects(REFLOW_OUT_OF_FLOW | REFLOW) {
|
if self.base.restyle_damage.intersects(REFLOW_OUT_OF_FLOW | REFLOW) {
|
||||||
self.assign_block_size(layout_context);
|
self.assign_block_size(layout_context);
|
||||||
self.store_overflow(layout_context);
|
(self as &mut Flow).early_store_overflow(layout_context);
|
||||||
// Don't remove the restyle damage; `assign_block_size` decides whether that is
|
// Don't remove the restyle damage; `assign_block_size` decides whether that is
|
||||||
// appropriate (which in the case of e.g. absolutely-positioned flows, it is not).
|
// appropriate (which in the case of e.g. absolutely-positioned flows, it is not).
|
||||||
}
|
}
|
||||||
|
@ -1775,7 +1788,7 @@ impl Flow for BlockFlow {
|
||||||
|
|
||||||
fn compute_absolute_position(&mut self, layout_context: &LayoutContext) {
|
fn compute_absolute_position(&mut self, layout_context: &LayoutContext) {
|
||||||
if (self.base.flags.contains(IS_ABSOLUTELY_POSITIONED) &&
|
if (self.base.flags.contains(IS_ABSOLUTELY_POSITIONED) &&
|
||||||
self.base.absolute_position_info.layers_needed_for_positioned_flows) ||
|
self.base.late_absolute_position_info.layers_needed_for_positioned_flows) ||
|
||||||
self.base.flags.contains(NEEDS_LAYER) {
|
self.base.flags.contains(NEEDS_LAYER) {
|
||||||
self.fragment.flags.insert(HAS_LAYER)
|
self.fragment.flags.insert(HAS_LAYER)
|
||||||
}
|
}
|
||||||
|
@ -1816,7 +1829,7 @@ impl Flow for BlockFlow {
|
||||||
// Absolute position of the containing block + position of absolute
|
// Absolute position of the containing block + position of absolute
|
||||||
// flow w.r.t. the containing block.
|
// flow w.r.t. the containing block.
|
||||||
self.base
|
self.base
|
||||||
.absolute_position_info
|
.late_absolute_position_info
|
||||||
.stacking_relative_position_of_absolute_containing_block + position_start
|
.stacking_relative_position_of_absolute_containing_block + position_start
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1842,13 +1855,13 @@ impl Flow for BlockFlow {
|
||||||
// other hand, is only established if we are positioned.
|
// other hand, is only established if we are positioned.
|
||||||
let relative_offset =
|
let relative_offset =
|
||||||
self.fragment.relative_position(&self.base
|
self.fragment.relative_position(&self.base
|
||||||
.absolute_position_info
|
.early_absolute_position_info
|
||||||
.relative_containing_block_size);
|
.relative_containing_block_size);
|
||||||
if self.contains_positioned_fragments() {
|
if self.contains_positioned_fragments() {
|
||||||
let border_box_origin = (self.fragment.border_box -
|
let border_box_origin = (self.fragment.border_box -
|
||||||
self.fragment.style.logical_border_width()).start;
|
self.fragment.style.logical_border_width()).start;
|
||||||
self.base
|
self.base
|
||||||
.absolute_position_info
|
.late_absolute_position_info
|
||||||
.stacking_relative_position_of_absolute_containing_block =
|
.stacking_relative_position_of_absolute_containing_block =
|
||||||
self.base.stacking_relative_position +
|
self.base.stacking_relative_position +
|
||||||
(border_box_origin + relative_offset).to_physical(self.base.writing_mode,
|
(border_box_origin + relative_offset).to_physical(self.base.writing_mode,
|
||||||
|
@ -1875,14 +1888,12 @@ impl Flow for BlockFlow {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
self.base
|
self.base
|
||||||
.absolute_position_info
|
.late_absolute_position_info
|
||||||
.stacking_relative_position_of_absolute_containing_block
|
.stacking_relative_position_of_absolute_containing_block
|
||||||
};
|
};
|
||||||
let absolute_position_info_for_children = AbsolutePositionInfo {
|
let late_absolute_position_info_for_children = LateAbsolutePositionInfo {
|
||||||
stacking_relative_position_of_absolute_containing_block:
|
stacking_relative_position_of_absolute_containing_block:
|
||||||
stacking_relative_position_of_absolute_containing_block_for_children,
|
stacking_relative_position_of_absolute_containing_block_for_children,
|
||||||
relative_containing_block_size: self.fragment.content_box().size,
|
|
||||||
relative_containing_block_mode: self.base.writing_mode,
|
|
||||||
layers_needed_for_positioned_flows: self.base
|
layers_needed_for_positioned_flows: self.base
|
||||||
.flags
|
.flags
|
||||||
.contains(LAYERS_NEEDED_FOR_DESCENDANTS),
|
.contains(LAYERS_NEEDED_FOR_DESCENDANTS),
|
||||||
|
@ -1934,10 +1945,10 @@ impl Flow for BlockFlow {
|
||||||
self.fragment
|
self.fragment
|
||||||
.stacking_relative_border_box(&self.base.stacking_relative_position,
|
.stacking_relative_border_box(&self.base.stacking_relative_position,
|
||||||
&self.base
|
&self.base
|
||||||
.absolute_position_info
|
.early_absolute_position_info
|
||||||
.relative_containing_block_size,
|
.relative_containing_block_size,
|
||||||
self.base
|
self.base
|
||||||
.absolute_position_info
|
.early_absolute_position_info
|
||||||
.relative_containing_block_mode,
|
.relative_containing_block_mode,
|
||||||
CoordinateSystem::Own);
|
CoordinateSystem::Own);
|
||||||
let clip = self.fragment.clipping_region_for_children(
|
let clip = self.fragment.clipping_region_for_children(
|
||||||
|
@ -1985,7 +1996,8 @@ impl Flow for BlockFlow {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
flow::mut_base(kid).absolute_position_info = absolute_position_info_for_children;
|
flow::mut_base(kid).late_absolute_position_info =
|
||||||
|
late_absolute_position_info_for_children;
|
||||||
flow::mut_base(kid).clip = clip.clone();
|
flow::mut_base(kid).clip = clip.clone();
|
||||||
flow::mut_base(kid).stacking_relative_position_of_display_port =
|
flow::mut_base(kid).stacking_relative_position_of_display_port =
|
||||||
stacking_relative_position_of_display_port_for_children;
|
stacking_relative_position_of_display_port_for_children;
|
||||||
|
@ -2056,7 +2068,9 @@ impl Flow for BlockFlow {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn compute_overflow(&self) -> Rect<Au> {
|
fn compute_overflow(&self) -> Rect<Au> {
|
||||||
self.fragment.compute_overflow()
|
self.fragment.compute_overflow(&self.base
|
||||||
|
.early_absolute_position_info
|
||||||
|
.relative_containing_block_size)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn iterate_through_fragment_border_boxes(&self,
|
fn iterate_through_fragment_border_boxes(&self,
|
||||||
|
@ -2072,10 +2086,10 @@ impl Flow for BlockFlow {
|
||||||
&self.fragment
|
&self.fragment
|
||||||
.stacking_relative_border_box(&self.base.stacking_relative_position,
|
.stacking_relative_border_box(&self.base.stacking_relative_position,
|
||||||
&self.base
|
&self.base
|
||||||
.absolute_position_info
|
.early_absolute_position_info
|
||||||
.relative_containing_block_size,
|
.relative_containing_block_size,
|
||||||
self.base
|
self.base
|
||||||
.absolute_position_info
|
.early_absolute_position_info
|
||||||
.relative_containing_block_mode,
|
.relative_containing_block_mode,
|
||||||
CoordinateSystem::Own)
|
CoordinateSystem::Own)
|
||||||
.translate(stacking_context_position));
|
.translate(stacking_context_position));
|
||||||
|
|
|
@ -1152,9 +1152,9 @@ impl FragmentDisplayListBuilding for Fragment {
|
||||||
StackingContextCreationMode::Normal |
|
StackingContextCreationMode::Normal |
|
||||||
StackingContextCreationMode::OuterScrollWrapper => {
|
StackingContextCreationMode::OuterScrollWrapper => {
|
||||||
self.stacking_relative_border_box(&base_flow.stacking_relative_position,
|
self.stacking_relative_border_box(&base_flow.stacking_relative_position,
|
||||||
&base_flow.absolute_position_info
|
&base_flow.early_absolute_position_info
|
||||||
.relative_containing_block_size,
|
.relative_containing_block_size,
|
||||||
base_flow.absolute_position_info
|
base_flow.early_absolute_position_info
|
||||||
.relative_containing_block_mode,
|
.relative_containing_block_mode,
|
||||||
CoordinateSystem::Parent)
|
CoordinateSystem::Parent)
|
||||||
}
|
}
|
||||||
|
@ -1533,8 +1533,12 @@ impl BlockFlowDisplayListBuilding for BlockFlow {
|
||||||
.build_display_list(display_list,
|
.build_display_list(display_list,
|
||||||
layout_context,
|
layout_context,
|
||||||
&self.base.stacking_relative_position,
|
&self.base.stacking_relative_position,
|
||||||
&self.base.absolute_position_info.relative_containing_block_size,
|
&self.base
|
||||||
self.base.absolute_position_info.relative_containing_block_mode,
|
.early_absolute_position_info
|
||||||
|
.relative_containing_block_size,
|
||||||
|
self.base
|
||||||
|
.early_absolute_position_info
|
||||||
|
.relative_containing_block_mode,
|
||||||
border_painting_mode,
|
border_painting_mode,
|
||||||
background_border_level,
|
background_border_level,
|
||||||
&clip,
|
&clip,
|
||||||
|
@ -1616,8 +1620,8 @@ impl BlockFlowDisplayListBuilding for BlockFlow {
|
||||||
&mut outer_display_list_for_overflow_scroll,
|
&mut outer_display_list_for_overflow_scroll,
|
||||||
layout_context,
|
layout_context,
|
||||||
&self.base.stacking_relative_position,
|
&self.base.stacking_relative_position,
|
||||||
&self.base.absolute_position_info.relative_containing_block_size,
|
&self.base.early_absolute_position_info.relative_containing_block_size,
|
||||||
self.base.absolute_position_info.relative_containing_block_mode,
|
self.base.early_absolute_position_info.relative_containing_block_mode,
|
||||||
border_painting_mode,
|
border_painting_mode,
|
||||||
BackgroundAndBorderLevel::RootOfStackingContext,
|
BackgroundAndBorderLevel::RootOfStackingContext,
|
||||||
&clip,
|
&clip,
|
||||||
|
@ -1775,10 +1779,10 @@ impl InlineFlowDisplayListBuilding for InlineFlow {
|
||||||
layout_context,
|
layout_context,
|
||||||
&self.base.stacking_relative_position,
|
&self.base.stacking_relative_position,
|
||||||
&self.base
|
&self.base
|
||||||
.absolute_position_info
|
.early_absolute_position_info
|
||||||
.relative_containing_block_size,
|
.relative_containing_block_size,
|
||||||
self.base
|
self.base
|
||||||
.absolute_position_info
|
.early_absolute_position_info
|
||||||
.relative_containing_block_mode,
|
.relative_containing_block_mode,
|
||||||
BorderPaintingMode::Separate,
|
BorderPaintingMode::Separate,
|
||||||
BackgroundAndBorderLevel::Content,
|
BackgroundAndBorderLevel::Content,
|
||||||
|
@ -1857,11 +1861,11 @@ impl ListItemFlowDisplayListBuilding for ListItemFlow {
|
||||||
&self.block_flow.base.stacking_relative_position,
|
&self.block_flow.base.stacking_relative_position,
|
||||||
&self.block_flow
|
&self.block_flow
|
||||||
.base
|
.base
|
||||||
.absolute_position_info
|
.early_absolute_position_info
|
||||||
.relative_containing_block_size,
|
.relative_containing_block_size,
|
||||||
self.block_flow
|
self.block_flow
|
||||||
.base
|
.base
|
||||||
.absolute_position_info
|
.early_absolute_position_info
|
||||||
.relative_containing_block_mode,
|
.relative_containing_block_mode,
|
||||||
BorderPaintingMode::Separate,
|
BorderPaintingMode::Separate,
|
||||||
BackgroundAndBorderLevel::Content,
|
BackgroundAndBorderLevel::Content,
|
||||||
|
|
|
@ -222,7 +222,11 @@ pub trait Flow: fmt::Debug + Sync + Send + 'static {
|
||||||
if impacted {
|
if impacted {
|
||||||
mut_base(self).thread_id = parent_thread_id;
|
mut_base(self).thread_id = parent_thread_id;
|
||||||
self.assign_block_size(layout_context);
|
self.assign_block_size(layout_context);
|
||||||
self.store_overflow(layout_context);
|
// FIXME(pcwalton): Should use `early_store_overflow()` here but that fails due to a
|
||||||
|
// compiler bug (`Self` does not have a constant size).
|
||||||
|
if !self.contains_relatively_positioned_fragments() {
|
||||||
|
self.store_overflow(layout_context)
|
||||||
|
}
|
||||||
mut_base(self).restyle_damage.remove(REFLOW_OUT_OF_FLOW | REFLOW);
|
mut_base(self).restyle_damage.remove(REFLOW_OUT_OF_FLOW | REFLOW);
|
||||||
}
|
}
|
||||||
impacted
|
impacted
|
||||||
|
@ -246,7 +250,7 @@ pub trait Flow: fmt::Debug + Sync + Send + 'static {
|
||||||
match self.class() {
|
match self.class() {
|
||||||
FlowClass::Block |
|
FlowClass::Block |
|
||||||
FlowClass::TableCaption |
|
FlowClass::TableCaption |
|
||||||
FlowClass::TableCell if !base(self).children.is_empty() => {
|
FlowClass::TableCell => {
|
||||||
// FIXME(#2795): Get the real container size.
|
// FIXME(#2795): Get the real container size.
|
||||||
let container_size = Size2D::zero();
|
let container_size = Size2D::zero();
|
||||||
for kid in mut_base(self).children.iter_mut() {
|
for kid in mut_base(self).children.iter_mut() {
|
||||||
|
@ -310,13 +314,6 @@ pub trait Flow: fmt::Debug + Sync + Send + 'static {
|
||||||
// different behaviour for different types of Flow, so they can't go into
|
// different behaviour for different types of Flow, so they can't go into
|
||||||
// the Immutable / Mutable Flow Utils traits without additional casts.
|
// the Immutable / Mutable Flow Utils traits without additional casts.
|
||||||
|
|
||||||
/// Return true if store overflow is delayed for this flow.
|
|
||||||
///
|
|
||||||
/// Currently happens only for absolutely positioned flows.
|
|
||||||
fn is_store_overflow_delayed(&mut self) -> bool {
|
|
||||||
false
|
|
||||||
}
|
|
||||||
|
|
||||||
fn is_root(&self) -> bool {
|
fn is_root(&self) -> bool {
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
|
@ -459,6 +456,11 @@ pub trait ImmutableFlowUtils {
|
||||||
/// Returns true if this flow is an inline flow.
|
/// Returns true if this flow is an inline flow.
|
||||||
fn is_inline_flow(self) -> bool;
|
fn is_inline_flow(self) -> bool;
|
||||||
|
|
||||||
|
/// Returns true if this flow can have its overflow area calculated early (during its
|
||||||
|
/// block-size assignment) or false if it must have its overflow area calculated late (during
|
||||||
|
/// its parent's block-size assignment).
|
||||||
|
fn can_calculate_overflow_area_early(self) -> bool;
|
||||||
|
|
||||||
/// Dumps the flow tree for debugging.
|
/// Dumps the flow tree for debugging.
|
||||||
fn dump(self);
|
fn dump(self);
|
||||||
|
|
||||||
|
@ -495,6 +497,12 @@ pub trait MutableFlowUtils {
|
||||||
/// Calls `repair_style` and `bubble_inline_sizes`. You should use this method instead of
|
/// Calls `repair_style` and `bubble_inline_sizes`. You should use this method instead of
|
||||||
/// calling them individually, since there is no reason not to perform both operations.
|
/// calling them individually, since there is no reason not to perform both operations.
|
||||||
fn repair_style_and_bubble_inline_sizes(self, style: &Arc<ComputedValues>);
|
fn repair_style_and_bubble_inline_sizes(self, style: &Arc<ComputedValues>);
|
||||||
|
|
||||||
|
/// Calls `store_overflow()` if the overflow can be calculated early.
|
||||||
|
fn early_store_overflow(self, layout_context: &LayoutContext);
|
||||||
|
|
||||||
|
/// Calls `store_overflow()` if the overflow cannot be calculated early.
|
||||||
|
fn late_store_overflow(self, layout_context: &LayoutContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub trait MutableOwnedFlowUtils {
|
pub trait MutableOwnedFlowUtils {
|
||||||
|
@ -780,15 +788,30 @@ impl<'a> Iterator for AbsoluteDescendantIter<'a> {
|
||||||
pub type AbsoluteDescendantOffsetIter<'a> = Zip<AbsoluteDescendantIter<'a>, IterMut<'a, Au>>;
|
pub type AbsoluteDescendantOffsetIter<'a> = Zip<AbsoluteDescendantIter<'a>, IterMut<'a, Au>>;
|
||||||
|
|
||||||
/// Information needed to compute absolute (i.e. viewport-relative) flow positions (not to be
|
/// Information needed to compute absolute (i.e. viewport-relative) flow positions (not to be
|
||||||
/// confused with absolutely-positioned flows).
|
/// confused with absolutely-positioned flows) that is computed during block-size assignment.
|
||||||
#[derive(RustcEncodable, Copy, Clone)]
|
pub struct EarlyAbsolutePositionInfo {
|
||||||
pub struct AbsolutePositionInfo {
|
|
||||||
/// The size of the containing block for relatively-positioned descendants.
|
/// The size of the containing block for relatively-positioned descendants.
|
||||||
pub relative_containing_block_size: LogicalSize<Au>,
|
pub relative_containing_block_size: LogicalSize<Au>,
|
||||||
|
|
||||||
/// The writing mode for `relative_containing_block_size`.
|
/// The writing mode for `relative_containing_block_size`.
|
||||||
pub relative_containing_block_mode: WritingMode,
|
pub relative_containing_block_mode: WritingMode,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl EarlyAbsolutePositionInfo {
|
||||||
|
pub fn new(writing_mode: WritingMode) -> EarlyAbsolutePositionInfo {
|
||||||
|
// FIXME(pcwalton): The initial relative containing block-size should be equal to the size
|
||||||
|
// of the root layer.
|
||||||
|
EarlyAbsolutePositionInfo {
|
||||||
|
relative_containing_block_size: LogicalSize::zero(writing_mode),
|
||||||
|
relative_containing_block_mode: writing_mode,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Information needed to compute absolute (i.e. viewport-relative) flow positions (not to be
|
||||||
|
/// confused with absolutely-positioned flows) that is computed during final position assignment.
|
||||||
|
#[derive(RustcEncodable, Copy, Clone)]
|
||||||
|
pub struct LateAbsolutePositionInfo {
|
||||||
/// The position of the absolute containing block relative to the nearest ancestor stacking
|
/// The position of the absolute containing block relative to the nearest ancestor stacking
|
||||||
/// context. If the absolute containing block establishes the stacking context for this flow,
|
/// context. If the absolute containing block establishes the stacking context for this flow,
|
||||||
/// and this flow is not itself absolutely-positioned, then this is (0, 0).
|
/// and this flow is not itself absolutely-positioned, then this is (0, 0).
|
||||||
|
@ -800,13 +823,9 @@ pub struct AbsolutePositionInfo {
|
||||||
pub layers_needed_for_positioned_flows: bool,
|
pub layers_needed_for_positioned_flows: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl AbsolutePositionInfo {
|
impl LateAbsolutePositionInfo {
|
||||||
pub fn new(writing_mode: WritingMode) -> AbsolutePositionInfo {
|
pub fn new() -> LateAbsolutePositionInfo {
|
||||||
// FIXME(pcwalton): The initial relative containing block-size should be equal to the size
|
LateAbsolutePositionInfo {
|
||||||
// of the root layer.
|
|
||||||
AbsolutePositionInfo {
|
|
||||||
relative_containing_block_size: LogicalSize::zero(writing_mode),
|
|
||||||
relative_containing_block_mode: writing_mode,
|
|
||||||
stacking_relative_position_of_absolute_containing_block: Point2D::zero(),
|
stacking_relative_position_of_absolute_containing_block: Point2D::zero(),
|
||||||
layers_needed_for_positioned_flows: false,
|
layers_needed_for_positioned_flows: false,
|
||||||
}
|
}
|
||||||
|
@ -875,8 +894,13 @@ pub struct BaseFlow {
|
||||||
pub absolute_cb: ContainingBlockLink,
|
pub absolute_cb: ContainingBlockLink,
|
||||||
|
|
||||||
/// Information needed to compute absolute (i.e. viewport-relative) flow positions (not to be
|
/// Information needed to compute absolute (i.e. viewport-relative) flow positions (not to be
|
||||||
/// confused with absolutely-positioned flows).
|
/// confused with absolutely-positioned flows) that is computed during block-size assignment.
|
||||||
pub absolute_position_info: AbsolutePositionInfo,
|
pub early_absolute_position_info: EarlyAbsolutePositionInfo,
|
||||||
|
|
||||||
|
/// Information needed to compute absolute (i.e. viewport-relative) flow positions (not to be
|
||||||
|
/// confused with absolutely-positioned flows) that is computed during final position
|
||||||
|
/// assignment.
|
||||||
|
pub late_absolute_position_info: LateAbsolutePositionInfo,
|
||||||
|
|
||||||
/// The clipping region for this flow and its descendants, in layer coordinates.
|
/// The clipping region for this flow and its descendants, in layer coordinates.
|
||||||
pub clip: ClippingRegion,
|
pub clip: ClippingRegion,
|
||||||
|
@ -1038,7 +1062,8 @@ impl BaseFlow {
|
||||||
block_container_explicit_block_size: None,
|
block_container_explicit_block_size: None,
|
||||||
absolute_cb: ContainingBlockLink::new(),
|
absolute_cb: ContainingBlockLink::new(),
|
||||||
display_list_building_result: DisplayListBuildingResult::None,
|
display_list_building_result: DisplayListBuildingResult::None,
|
||||||
absolute_position_info: AbsolutePositionInfo::new(writing_mode),
|
early_absolute_position_info: EarlyAbsolutePositionInfo::new(writing_mode),
|
||||||
|
late_absolute_position_info: LateAbsolutePositionInfo::new(),
|
||||||
clip: ClippingRegion::max(),
|
clip: ClippingRegion::max(),
|
||||||
stacking_relative_position_of_display_port: Rect::zero(),
|
stacking_relative_position_of_display_port: Rect::zero(),
|
||||||
flags: flags,
|
flags: flags,
|
||||||
|
@ -1276,6 +1301,13 @@ impl<'a> ImmutableFlowUtils for &'a Flow {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Returns true if this flow can have its overflow area calculated early (during its
|
||||||
|
/// block-size assignment) or false if it must have its overflow area calculated late (during
|
||||||
|
/// its parent's block-size assignment).
|
||||||
|
fn can_calculate_overflow_area_early(self) -> bool {
|
||||||
|
!self.contains_relatively_positioned_fragments()
|
||||||
|
}
|
||||||
|
|
||||||
/// Dumps the flow tree for debugging.
|
/// Dumps the flow tree for debugging.
|
||||||
fn dump(self) {
|
fn dump(self) {
|
||||||
self.dump_with_level(0)
|
self.dump_with_level(0)
|
||||||
|
@ -1354,6 +1386,20 @@ impl<'a> MutableFlowUtils for &'a mut Flow {
|
||||||
|
|
||||||
traversal.process(*self)
|
traversal.process(*self)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Calls `store_overflow()` if the overflow can be calculated early.
|
||||||
|
fn early_store_overflow(self, layout_context: &LayoutContext) {
|
||||||
|
if self.can_calculate_overflow_area_early() {
|
||||||
|
self.store_overflow(layout_context)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Calls `store_overflow()` if the overflow cannot be calculated early.
|
||||||
|
fn late_store_overflow(self, layout_context: &LayoutContext) {
|
||||||
|
if !self.can_calculate_overflow_area_early() {
|
||||||
|
self.store_overflow(layout_context)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl MutableOwnedFlowUtils for FlowRef {
|
impl MutableOwnedFlowUtils for FlowRef {
|
||||||
|
|
|
@ -2049,7 +2049,7 @@ impl Fragment {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Computes the overflow rect of this fragment relative to the start of the flow.
|
/// Computes the overflow rect of this fragment relative to the start of the flow.
|
||||||
pub fn compute_overflow(&self) -> Rect<Au> {
|
pub fn compute_overflow(&self, relative_containing_block_size: &LogicalSize<Au>) -> Rect<Au> {
|
||||||
// FIXME(pcwalton, #2795): Get the real container size.
|
// FIXME(pcwalton, #2795): Get the real container size.
|
||||||
let container_size = Size2D::zero();
|
let container_size = Size2D::zero();
|
||||||
let mut border_box = self.border_box.to_physical(self.style.writing_mode, container_size);
|
let mut border_box = self.border_box.to_physical(self.style.writing_mode, container_size);
|
||||||
|
@ -2058,10 +2058,9 @@ impl Fragment {
|
||||||
//
|
//
|
||||||
// FIXME(pcwalton): I'm not a fan of the way this makes us crawl though so many styles all
|
// FIXME(pcwalton): I'm not a fan of the way this makes us crawl though so many styles all
|
||||||
// the time. Can't we handle relative positioning by just adjusting `border_box`?
|
// the time. Can't we handle relative positioning by just adjusting `border_box`?
|
||||||
let relative_position =
|
let relative_position = self.relative_position(relative_containing_block_size);
|
||||||
self.relative_position(&LogicalSize::zero(self.style.writing_mode));
|
border_box =
|
||||||
border_box = border_box.translate_by_size(&relative_position.to_physical(
|
border_box.translate_by_size(&relative_position.to_physical(self.style.writing_mode));
|
||||||
self.style.writing_mode));
|
|
||||||
let mut overflow = border_box;
|
let mut overflow = border_box;
|
||||||
|
|
||||||
// Box shadows cause us to draw outside our border box.
|
// Box shadows cause us to draw outside our border box.
|
||||||
|
|
|
@ -1645,10 +1645,10 @@ impl Flow for InlineFlow {
|
||||||
let stacking_relative_border_box =
|
let stacking_relative_border_box =
|
||||||
fragment.stacking_relative_border_box(&self.base.stacking_relative_position,
|
fragment.stacking_relative_border_box(&self.base.stacking_relative_position,
|
||||||
&self.base
|
&self.base
|
||||||
.absolute_position_info
|
.early_absolute_position_info
|
||||||
.relative_containing_block_size,
|
.relative_containing_block_size,
|
||||||
self.base
|
self.base
|
||||||
.absolute_position_info
|
.early_absolute_position_info
|
||||||
.relative_containing_block_mode,
|
.relative_containing_block_mode,
|
||||||
CoordinateSystem::Parent);
|
CoordinateSystem::Parent);
|
||||||
let clip = fragment.clipping_region_for_children(&self.base.clip,
|
let clip = fragment.clipping_region_for_children(&self.base.clip,
|
||||||
|
@ -1661,13 +1661,14 @@ impl Flow for InlineFlow {
|
||||||
flow::mut_base(flow).clip = clip;
|
flow::mut_base(flow).clip = clip;
|
||||||
|
|
||||||
let block_flow = flow.as_mut_block();
|
let block_flow = flow.as_mut_block();
|
||||||
block_flow.base.absolute_position_info = self.base.absolute_position_info;
|
block_flow.base.late_absolute_position_info =
|
||||||
|
self.base.late_absolute_position_info;
|
||||||
|
|
||||||
let stacking_relative_position = self.base.stacking_relative_position;
|
let stacking_relative_position = self.base.stacking_relative_position;
|
||||||
if is_positioned {
|
if is_positioned {
|
||||||
let padding_box_origin = containing_block_positions.next().unwrap();
|
let padding_box_origin = containing_block_positions.next().unwrap();
|
||||||
block_flow.base
|
block_flow.base
|
||||||
.absolute_position_info
|
.late_absolute_position_info
|
||||||
.stacking_relative_position_of_absolute_containing_block =
|
.stacking_relative_position_of_absolute_containing_block =
|
||||||
stacking_relative_position + *padding_box_origin;
|
stacking_relative_position + *padding_box_origin;
|
||||||
}
|
}
|
||||||
|
@ -1681,7 +1682,8 @@ impl Flow for InlineFlow {
|
||||||
let flow = flow_ref::deref_mut(&mut info.flow_ref);
|
let flow = flow_ref::deref_mut(&mut info.flow_ref);
|
||||||
flow::mut_base(flow).clip = clip;
|
flow::mut_base(flow).clip = clip;
|
||||||
let block_flow = flow.as_mut_block();
|
let block_flow = flow.as_mut_block();
|
||||||
block_flow.base.absolute_position_info = self.base.absolute_position_info;
|
block_flow.base.late_absolute_position_info =
|
||||||
|
self.base.late_absolute_position_info;
|
||||||
|
|
||||||
block_flow.base.stacking_relative_position =
|
block_flow.base.stacking_relative_position =
|
||||||
stacking_relative_border_box.origin;
|
stacking_relative_border_box.origin;
|
||||||
|
@ -1693,12 +1695,13 @@ impl Flow for InlineFlow {
|
||||||
flow::mut_base(flow).clip = clip;
|
flow::mut_base(flow).clip = clip;
|
||||||
|
|
||||||
let block_flow = flow.as_mut_block();
|
let block_flow = flow.as_mut_block();
|
||||||
block_flow.base.absolute_position_info = self.base.absolute_position_info;
|
block_flow.base.late_absolute_position_info =
|
||||||
|
self.base.late_absolute_position_info;
|
||||||
|
|
||||||
let stacking_relative_position = self.base.stacking_relative_position;
|
let stacking_relative_position = self.base.stacking_relative_position;
|
||||||
let padding_box_origin = containing_block_positions.next().unwrap();
|
let padding_box_origin = containing_block_positions.next().unwrap();
|
||||||
block_flow.base
|
block_flow.base
|
||||||
.absolute_position_info
|
.late_absolute_position_info
|
||||||
.stacking_relative_position_of_absolute_containing_block =
|
.stacking_relative_position_of_absolute_containing_block =
|
||||||
stacking_relative_position + *padding_box_origin;
|
stacking_relative_position + *padding_box_origin;
|
||||||
|
|
||||||
|
@ -1725,7 +1728,8 @@ impl Flow for InlineFlow {
|
||||||
fn compute_overflow(&self) -> Rect<Au> {
|
fn compute_overflow(&self) -> Rect<Au> {
|
||||||
let mut overflow = ZERO_RECT;
|
let mut overflow = ZERO_RECT;
|
||||||
for fragment in &self.fragments.fragments {
|
for fragment in &self.fragments.fragments {
|
||||||
overflow = overflow.union(&fragment.compute_overflow())
|
overflow = overflow.union(&fragment.compute_overflow(
|
||||||
|
&self.base.early_absolute_position_info.relative_containing_block_size))
|
||||||
}
|
}
|
||||||
overflow
|
overflow
|
||||||
}
|
}
|
||||||
|
@ -1742,9 +1746,9 @@ impl Flow for InlineFlow {
|
||||||
|
|
||||||
let stacking_relative_position = &self.base.stacking_relative_position;
|
let stacking_relative_position = &self.base.stacking_relative_position;
|
||||||
let relative_containing_block_size =
|
let relative_containing_block_size =
|
||||||
&self.base.absolute_position_info.relative_containing_block_size;
|
&self.base.early_absolute_position_info.relative_containing_block_size;
|
||||||
let relative_containing_block_mode =
|
let relative_containing_block_mode =
|
||||||
self.base.absolute_position_info.relative_containing_block_mode;
|
self.base.early_absolute_position_info.relative_containing_block_mode;
|
||||||
iterator.process(fragment,
|
iterator.process(fragment,
|
||||||
level,
|
level,
|
||||||
&fragment.stacking_relative_border_box(stacking_relative_position,
|
&fragment.stacking_relative_border_box(stacking_relative_position,
|
||||||
|
|
|
@ -184,11 +184,11 @@ impl Flow for ListItemFlow {
|
||||||
.stacking_relative_position,
|
.stacking_relative_position,
|
||||||
&self.block_flow
|
&self.block_flow
|
||||||
.base
|
.base
|
||||||
.absolute_position_info
|
.early_absolute_position_info
|
||||||
.relative_containing_block_size,
|
.relative_containing_block_size,
|
||||||
self.block_flow
|
self.block_flow
|
||||||
.base
|
.base
|
||||||
.absolute_position_info
|
.early_absolute_position_info
|
||||||
.relative_containing_block_mode,
|
.relative_containing_block_mode,
|
||||||
CoordinateSystem::Own)
|
CoordinateSystem::Own)
|
||||||
.translate(stacking_context_position));
|
.translate(stacking_context_position));
|
||||||
|
|
|
@ -10,8 +10,8 @@ use block::{ISizeConstraintInput, ISizeConstraintSolution};
|
||||||
use block::{self, BlockFlow, CandidateBSizeIterator, ISizeAndMarginsComputer};
|
use block::{self, BlockFlow, CandidateBSizeIterator, ISizeAndMarginsComputer};
|
||||||
use context::LayoutContext;
|
use context::LayoutContext;
|
||||||
use display_list_builder::{BlockFlowDisplayListBuilding, BorderPaintingMode};
|
use display_list_builder::{BlockFlowDisplayListBuilding, BorderPaintingMode};
|
||||||
use flow::{ImmutableFlowUtils, OpaqueFlow};
|
use flow::{IMPACTED_BY_RIGHT_FLOATS, ImmutableFlowUtils, MutableFlowUtils, OpaqueFlow};
|
||||||
use flow::{self, Flow, FlowClass, IMPACTED_BY_LEFT_FLOATS, IMPACTED_BY_RIGHT_FLOATS};
|
use flow::{self, EarlyAbsolutePositionInfo, Flow, FlowClass, IMPACTED_BY_LEFT_FLOATS};
|
||||||
use fragment::{Fragment, FragmentBorderBoxIterator};
|
use fragment::{Fragment, FragmentBorderBoxIterator};
|
||||||
use incremental::{REFLOW, REFLOW_OUT_OF_FLOW};
|
use incremental::{REFLOW, REFLOW_OUT_OF_FLOW};
|
||||||
use layout_debug;
|
use layout_debug;
|
||||||
|
@ -761,7 +761,7 @@ pub trait TableLikeFlow {
|
||||||
|
|
||||||
impl TableLikeFlow for BlockFlow {
|
impl TableLikeFlow for BlockFlow {
|
||||||
fn assign_block_size_for_table_like_flow<'a>(&mut self,
|
fn assign_block_size_for_table_like_flow<'a>(&mut self,
|
||||||
_: &'a LayoutContext<'a>,
|
layout_context: &'a LayoutContext<'a>,
|
||||||
block_direction_spacing: Au) {
|
block_direction_spacing: Au) {
|
||||||
debug_assert!(self.fragment.style.get_inheritedtable().border_collapse ==
|
debug_assert!(self.fragment.style.get_inheritedtable().border_collapse ==
|
||||||
border_collapse::T::separate || block_direction_spacing == Au(0));
|
border_collapse::T::separate || block_direction_spacing == Au(0));
|
||||||
|
@ -838,6 +838,16 @@ impl TableLikeFlow for BlockFlow {
|
||||||
self.fragment.border_box.size.block = current_block_offset;
|
self.fragment.border_box.size.block = current_block_offset;
|
||||||
self.fragment.border_box.start.b = Au(0);
|
self.fragment.border_box.start.b = Au(0);
|
||||||
self.base.position.size.block = current_block_offset;
|
self.base.position.size.block = current_block_offset;
|
||||||
|
|
||||||
|
// Write in the size of the relative containing block for children. (This information
|
||||||
|
// is also needed to handle RTL.)
|
||||||
|
for kid in self.base.child_iter() {
|
||||||
|
flow::mut_base(kid).early_absolute_position_info = EarlyAbsolutePositionInfo {
|
||||||
|
relative_containing_block_size: self.fragment.content_box().size,
|
||||||
|
relative_containing_block_mode: self.fragment.style().writing_mode,
|
||||||
|
};
|
||||||
|
kid.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);
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
use block::{BlockFlow, ISizeAndMarginsComputer};
|
use block::{BlockFlow, ISizeAndMarginsComputer};
|
||||||
use context::LayoutContext;
|
use context::LayoutContext;
|
||||||
use display_list_builder::{BlockFlowDisplayListBuilding, BorderPaintingMode};
|
use display_list_builder::{BlockFlowDisplayListBuilding, BorderPaintingMode};
|
||||||
use flow::{self, FlowClass, Flow, ImmutableFlowUtils, OpaqueFlow};
|
use flow::{self, EarlyAbsolutePositionInfo, FlowClass, Flow, ImmutableFlowUtils, OpaqueFlow};
|
||||||
use flow_list::MutFlowListIterator;
|
use flow_list::MutFlowListIterator;
|
||||||
use fragment::{Fragment, FragmentBorderBoxIterator};
|
use fragment::{Fragment, FragmentBorderBoxIterator};
|
||||||
use layout_debug;
|
use layout_debug;
|
||||||
|
@ -162,7 +162,15 @@ impl TableRowFlow {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Assign the child's block size.
|
// Assign the child's block size.
|
||||||
child_table_cell.block_flow.base.position.size.block = block_size
|
child_table_cell.block_flow.base.position.size.block = block_size;
|
||||||
|
|
||||||
|
// Write in the size of the relative containing block for children. (This information
|
||||||
|
// is also needed to handle RTL.)
|
||||||
|
child_table_cell.block_flow.base.early_absolute_position_info =
|
||||||
|
EarlyAbsolutePositionInfo {
|
||||||
|
relative_containing_block_size: self.block_flow.fragment.content_box().size,
|
||||||
|
relative_containing_block_mode: self.block_flow.fragment.style().writing_mode,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
use construct::FlowConstructor;
|
use construct::FlowConstructor;
|
||||||
use context::LayoutContext;
|
use context::LayoutContext;
|
||||||
use css::matching::{ApplicableDeclarations, MatchMethods, StyleSharingResult};
|
use css::matching::{ApplicableDeclarations, MatchMethods, StyleSharingResult};
|
||||||
use flow::{PreorderFlowTraversal, PostorderFlowTraversal};
|
use flow::{MutableFlowUtils, PreorderFlowTraversal, PostorderFlowTraversal};
|
||||||
use flow::{self, Flow};
|
use flow::{self, Flow};
|
||||||
use incremental::{self, BUBBLE_ISIZES, REFLOW, REFLOW_OUT_OF_FLOW, RestyleDamage};
|
use incremental::{self, BUBBLE_ISIZES, REFLOW, REFLOW_OUT_OF_FLOW, RestyleDamage};
|
||||||
use script::layout_interface::ReflowGoal;
|
use script::layout_interface::ReflowGoal;
|
||||||
|
@ -368,7 +368,7 @@ impl<'a> PostorderFlowTraversal for AssignBSizesAndStoreOverflow<'a> {
|
||||||
}
|
}
|
||||||
|
|
||||||
flow.assign_block_size(self.layout_context);
|
flow.assign_block_size(self.layout_context);
|
||||||
flow.store_overflow(self.layout_context);
|
flow.early_store_overflow(self.layout_context);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
|
|
|
@ -296,6 +296,7 @@ flaky_cpu == linebreak_simple_a.html linebreak_simple_b.html
|
||||||
== position_relative_painting_order_a.html position_relative_painting_order_ref.html
|
== position_relative_painting_order_a.html position_relative_painting_order_ref.html
|
||||||
== position_relative_stacking_context_a.html position_relative_stacking_context_ref.html
|
== position_relative_stacking_context_a.html position_relative_stacking_context_ref.html
|
||||||
== position_relative_top_percentage_a.html position_relative_top_percentage_b.html
|
== position_relative_top_percentage_a.html position_relative_top_percentage_b.html
|
||||||
|
== position_relative_vertical_percentage_overflow_a.html position_relative_vertical_percentage_overflow_ref.html
|
||||||
== pre_ignorable_whitespace_a.html pre_ignorable_whitespace_ref.html
|
== pre_ignorable_whitespace_a.html pre_ignorable_whitespace_ref.html
|
||||||
== pre_with_tab.html pre_with_tab_ref.html
|
== pre_with_tab.html pre_with_tab_ref.html
|
||||||
== pseudo_element_a.html pseudo_element_b.html
|
== pseudo_element_a.html pseudo_element_b.html
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<style>
|
||||||
|
body, html {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
#a {
|
||||||
|
display: block;
|
||||||
|
position: absolute;
|
||||||
|
top: 100px;
|
||||||
|
left: 100px;
|
||||||
|
width: 100px;
|
||||||
|
height: 100px;
|
||||||
|
transform: translateX(0px); /* force creation of stacking context */
|
||||||
|
}
|
||||||
|
#b {
|
||||||
|
display: block;
|
||||||
|
position: relative;
|
||||||
|
top: -50%;
|
||||||
|
width: 100px;
|
||||||
|
height: 100px;
|
||||||
|
background: purple;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<div id=a><div id=b>
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<style>
|
||||||
|
body, html {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
#a {
|
||||||
|
display: block;
|
||||||
|
position: absolute;
|
||||||
|
top: 50px;
|
||||||
|
left: 100px;
|
||||||
|
width: 100px;
|
||||||
|
height: 100px;
|
||||||
|
background: purple;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<div id=a>
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
[abs-pos-non-replaced-vlr-069.htm]
|
|
||||||
type: reftest
|
|
||||||
expected: FAIL
|
|
|
@ -1,3 +0,0 @@
|
||||||
[abs-pos-non-replaced-vlr-177.htm]
|
|
||||||
type: reftest
|
|
||||||
expected: FAIL
|
|
|
@ -1,3 +0,0 @@
|
||||||
[abs-pos-non-replaced-vlr-193.htm]
|
|
||||||
type: reftest
|
|
||||||
expected: FAIL
|
|
|
@ -1,3 +0,0 @@
|
||||||
[abs-pos-non-replaced-vrl-176.htm]
|
|
||||||
type: reftest
|
|
||||||
expected: FAIL
|
|
|
@ -1,3 +0,0 @@
|
||||||
[abs-pos-non-replaced-vrl-192.htm]
|
|
||||||
type: reftest
|
|
||||||
expected: FAIL
|
|
|
@ -1,3 +0,0 @@
|
||||||
[absolute-replaced-width-015.htm]
|
|
||||||
type: reftest
|
|
||||||
expected: FAIL
|
|
Loading…
Add table
Add a link
Reference in a new issue