mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
layout: Separate out overflow-for-scrolling from overflow-for-paint.
Closes #9484.
This commit is contained in:
parent
f605c6aa69
commit
7c5b2d6cb3
17 changed files with 131 additions and 56 deletions
|
@ -43,7 +43,7 @@ use flow::{NEEDS_LAYER, PostorderFlowTraversal, PreorderFlowTraversal, Fragmenta
|
|||
use flow::{self, BaseFlow, EarlyAbsolutePositionInfo, Flow, FlowClass, ForceNonfloatedFlag};
|
||||
use flow_list::FlowList;
|
||||
use flow_ref::FlowRef;
|
||||
use fragment::{CoordinateSystem, Fragment, FragmentBorderBoxIterator, HAS_LAYER};
|
||||
use fragment::{CoordinateSystem, Fragment, FragmentBorderBoxIterator, HAS_LAYER, Overflow};
|
||||
use fragment::{SpecificFragmentInfo};
|
||||
use gfx::display_list::{ClippingRegion, DisplayList};
|
||||
use gfx_traits::LayerId;
|
||||
|
@ -2098,7 +2098,7 @@ impl Flow for BlockFlow {
|
|||
self.fragment.repair_style(new_style)
|
||||
}
|
||||
|
||||
fn compute_overflow(&self) -> Rect<Au> {
|
||||
fn compute_overflow(&self) -> Overflow {
|
||||
let flow_size = self.base.position.size.to_physical(self.base.writing_mode);
|
||||
self.fragment.compute_overflow(&flow_size,
|
||||
&self.base
|
||||
|
|
|
@ -1218,7 +1218,7 @@ impl FragmentDisplayListBuilding for Fragment {
|
|||
CoordinateSystem::Parent)
|
||||
}
|
||||
StackingContextCreationMode::InnerScrollWrapper => {
|
||||
Rect::new(Point2D::zero(), base_flow.overflow.size)
|
||||
Rect::new(Point2D::zero(), base_flow.overflow.scroll.size)
|
||||
}
|
||||
};
|
||||
let overflow = match mode {
|
||||
|
@ -1228,7 +1228,7 @@ impl FragmentDisplayListBuilding for Fragment {
|
|||
let border_box_offset =
|
||||
border_box.translate(&-base_flow.stacking_relative_position).origin;
|
||||
// Then, using that, compute our overflow region relative to our border box.
|
||||
base_flow.overflow.translate(&-border_box_offset)
|
||||
base_flow.overflow.paint.translate(&-border_box_offset)
|
||||
}
|
||||
StackingContextCreationMode::InnerScrollWrapper |
|
||||
StackingContextCreationMode::OuterScrollWrapper => {
|
||||
|
|
|
@ -10,7 +10,7 @@ use app_units::Au;
|
|||
use block::BlockFlow;
|
||||
use context::LayoutContext;
|
||||
use display_list_builder::FlexFlowDisplayListBuilding;
|
||||
use euclid::{Point2D, Rect};
|
||||
use euclid::Point2D;
|
||||
use floats::FloatKind;
|
||||
use flow;
|
||||
use flow::INLINE_POSITION_IS_STATIC;
|
||||
|
@ -18,7 +18,7 @@ use flow::IS_ABSOLUTELY_POSITIONED;
|
|||
use flow::ImmutableFlowUtils;
|
||||
use flow::{Flow, FlowClass, OpaqueFlow};
|
||||
use flow::{HAS_LEFT_FLOATED_DESCENDANTS, HAS_RIGHT_FLOATED_DESCENDANTS};
|
||||
use fragment::{Fragment, FragmentBorderBoxIterator};
|
||||
use fragment::{Fragment, FragmentBorderBoxIterator, Overflow};
|
||||
use gfx::display_list::DisplayList;
|
||||
use incremental::{REFLOW, REFLOW_OUT_OF_FLOW};
|
||||
use layout_debug;
|
||||
|
@ -432,7 +432,7 @@ impl Flow for FlexFlow {
|
|||
self.block_flow.repair_style(new_style)
|
||||
}
|
||||
|
||||
fn compute_overflow(&self) -> Rect<Au> {
|
||||
fn compute_overflow(&self) -> Overflow {
|
||||
self.block_flow.compute_overflow()
|
||||
}
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ use euclid::{Point2D, Rect, Size2D};
|
|||
use floats::Floats;
|
||||
use flow_list::{FlowList, FlowListIterator, MutFlowListIterator};
|
||||
use flow_ref::{self, FlowRef, WeakFlowRef};
|
||||
use fragment::{Fragment, FragmentBorderBoxIterator, SpecificFragmentInfo};
|
||||
use fragment::{Fragment, FragmentBorderBoxIterator, Overflow, SpecificFragmentInfo};
|
||||
use gfx::display_list::{ClippingRegion, DisplayList};
|
||||
use gfx_traits::{LayerId, LayerType};
|
||||
use incremental::{RECONSTRUCT_FLOW, REFLOW, REFLOW_OUT_OF_FLOW, REPAINT, RestyleDamage};
|
||||
|
@ -266,15 +266,16 @@ pub trait Flow: fmt::Debug + Sync + Send + 'static {
|
|||
// FIXME(#2795): Get the real container size.
|
||||
let container_size = Size2D::zero();
|
||||
for kid in mut_base(self).children.iter_mut() {
|
||||
let kid_overflow = base(kid).overflow;
|
||||
let mut kid_overflow = base(kid).overflow;
|
||||
let kid_position = base(kid).position.to_physical(base(kid).writing_mode,
|
||||
container_size);
|
||||
overflow = overflow.union(&kid_overflow.translate(&kid_position.origin))
|
||||
kid_overflow.translate(&kid_position.origin);
|
||||
overflow.union(&kid_overflow)
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
mut_base(self).overflow = overflow;
|
||||
mut_base(self).overflow = overflow
|
||||
}
|
||||
|
||||
/// Phase 4 of reflow: computes absolute positions.
|
||||
|
@ -286,7 +287,7 @@ pub trait Flow: fmt::Debug + Sync + Send + 'static {
|
|||
fn build_display_list(&mut self, layout_context: &LayoutContext);
|
||||
|
||||
/// Returns the union of all overflow rects of all of this flow's fragments.
|
||||
fn compute_overflow(&self) -> Rect<Au>;
|
||||
fn compute_overflow(&self) -> Overflow;
|
||||
|
||||
/// Iterates through border boxes of all of this flow's fragments.
|
||||
/// Level provides a zero based index indicating the current
|
||||
|
@ -865,7 +866,7 @@ pub struct BaseFlow {
|
|||
|
||||
/// The amount of overflow of this flow, relative to the containing block. Must include all the
|
||||
/// pixels of all the display list items for correct invalidation.
|
||||
pub overflow: Rect<Au>,
|
||||
pub overflow: Overflow,
|
||||
|
||||
/// Data used during parallel traversals.
|
||||
///
|
||||
|
@ -1078,7 +1079,7 @@ impl BaseFlow {
|
|||
children: FlowList::new(),
|
||||
intrinsic_inline_sizes: IntrinsicISizes::new(),
|
||||
position: LogicalRect::zero(writing_mode),
|
||||
overflow: Rect::zero(),
|
||||
overflow: Overflow::new(),
|
||||
parallel: FlowParallelInfo::new(),
|
||||
floats: Floats::new(writing_mode),
|
||||
collapsible_margins: CollapsibleMargins::new(),
|
||||
|
@ -1132,7 +1133,7 @@ impl BaseFlow {
|
|||
let container_size = Size2D::zero();
|
||||
let position_with_overflow = self.position
|
||||
.to_physical(self.writing_mode, container_size)
|
||||
.union(&self.overflow);
|
||||
.union(&self.overflow.paint);
|
||||
let bounds = Rect::new(self.stacking_relative_position, position_with_overflow.size);
|
||||
|
||||
let all_items = match self.display_list_building_result {
|
||||
|
|
|
@ -2176,7 +2176,7 @@ impl Fragment {
|
|||
pub fn compute_overflow(&self,
|
||||
flow_size: &Size2D<Au>,
|
||||
relative_containing_block_size: &LogicalSize<Au>)
|
||||
-> Rect<Au> {
|
||||
-> Overflow {
|
||||
let mut border_box = self.border_box.to_physical(self.style.writing_mode, *flow_size);
|
||||
|
||||
// Relative position can cause us to draw outside our border box.
|
||||
|
@ -2186,31 +2186,33 @@ impl Fragment {
|
|||
let relative_position = self.relative_position(relative_containing_block_size);
|
||||
border_box =
|
||||
border_box.translate_by_size(&relative_position.to_physical(self.style.writing_mode));
|
||||
let mut overflow = border_box;
|
||||
let mut overflow = Overflow::from_rect(&border_box);
|
||||
|
||||
// Box shadows cause us to draw outside our border box.
|
||||
for box_shadow in &self.style().get_effects().box_shadow.0 {
|
||||
let offset = Point2D::new(box_shadow.offset_x, box_shadow.offset_y);
|
||||
let inflation = box_shadow.spread_radius + box_shadow.blur_radius *
|
||||
BLUR_INFLATION_FACTOR;
|
||||
overflow = overflow.union(&border_box.translate(&offset).inflate(inflation, inflation))
|
||||
overflow.paint = overflow.paint.union(&border_box.translate(&offset)
|
||||
.inflate(inflation, inflation))
|
||||
}
|
||||
|
||||
// Outlines cause us to draw outside our border box.
|
||||
let outline_width = self.style.get_outline().outline_width;
|
||||
if outline_width != Au(0) {
|
||||
overflow = overflow.union(&border_box.inflate(outline_width, outline_width))
|
||||
overflow.paint = overflow.paint.union(&border_box.inflate(outline_width,
|
||||
outline_width))
|
||||
}
|
||||
|
||||
// Include the overflow of the block flow, if any.
|
||||
match self.specific {
|
||||
SpecificFragmentInfo::InlineBlock(ref info) => {
|
||||
let block_flow = info.flow_ref.as_block();
|
||||
overflow = overflow.union(&flow::base(block_flow).overflow);
|
||||
overflow.union(&flow::base(block_flow).overflow);
|
||||
}
|
||||
SpecificFragmentInfo::InlineAbsolute(ref info) => {
|
||||
let block_flow = info.flow_ref.as_block();
|
||||
overflow = overflow.union(&flow::base(block_flow).overflow);
|
||||
overflow.union(&flow::base(block_flow).overflow);
|
||||
}
|
||||
_ => (),
|
||||
}
|
||||
|
@ -2572,6 +2574,45 @@ impl WhitespaceStrippingResult {
|
|||
}
|
||||
}
|
||||
|
||||
/// The overflow area. We need two different notions of overflow: paint overflow and scrollable
|
||||
/// overflow.
|
||||
#[derive(Copy, Clone, Debug)]
|
||||
pub struct Overflow {
|
||||
pub scroll: Rect<Au>,
|
||||
pub paint: Rect<Au>,
|
||||
}
|
||||
|
||||
impl Overflow {
|
||||
pub fn new() -> Overflow {
|
||||
Overflow {
|
||||
scroll: Rect::zero(),
|
||||
paint: Rect::zero(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn from_rect(border_box: &Rect<Au>) -> Overflow {
|
||||
Overflow {
|
||||
scroll: *border_box,
|
||||
paint: *border_box,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn union(&mut self, other: &Overflow) {
|
||||
self.scroll = self.scroll.union(&other.scroll);
|
||||
self.paint = self.paint.union(&other.paint);
|
||||
}
|
||||
|
||||
pub fn union_rect(&mut self, rect: &Rect<Au>) {
|
||||
self.scroll = self.scroll.union(&rect);
|
||||
self.paint = self.paint.union(&rect);
|
||||
}
|
||||
|
||||
pub fn translate(&mut self, point: &Point2D<Au>) {
|
||||
self.scroll = self.scroll.translate(point);
|
||||
self.paint = self.paint.translate(point);
|
||||
}
|
||||
}
|
||||
|
||||
bitflags! {
|
||||
flags FragmentFlags: u8 {
|
||||
/// Whether this fragment has a layer.
|
||||
|
|
|
@ -8,12 +8,13 @@ use app_units::Au;
|
|||
use block::AbsoluteAssignBSizesTraversal;
|
||||
use context::LayoutContext;
|
||||
use display_list_builder::{FragmentDisplayListBuilding, InlineFlowDisplayListBuilding};
|
||||
use euclid::{Point2D, Rect, Size2D};
|
||||
use euclid::{Point2D, Size2D};
|
||||
use floats::{FloatKind, Floats, PlacementInfo};
|
||||
use flow::{EarlyAbsolutePositionInfo, MutableFlowUtils, OpaqueFlow};
|
||||
use flow::{self, BaseFlow, Flow, FlowClass, ForceNonfloatedFlag, IS_ABSOLUTELY_POSITIONED};
|
||||
use flow_ref;
|
||||
use fragment::{CoordinateSystem, Fragment, FragmentBorderBoxIterator, SpecificFragmentInfo};
|
||||
use fragment::{CoordinateSystem, Fragment, FragmentBorderBoxIterator, Overflow};
|
||||
use fragment::{SpecificFragmentInfo};
|
||||
use gfx::display_list::OpaqueNode;
|
||||
use gfx::font::FontMetrics;
|
||||
use gfx::font_context::FontContext;
|
||||
|
@ -1756,14 +1757,13 @@ impl Flow for InlineFlow {
|
|||
|
||||
fn repair_style(&mut self, _: &Arc<ComputedValues>) {}
|
||||
|
||||
fn compute_overflow(&self) -> Rect<Au> {
|
||||
let mut overflow = Rect::zero();
|
||||
fn compute_overflow(&self) -> Overflow {
|
||||
let mut overflow = Overflow::new();
|
||||
let flow_size = self.base.position.size.to_physical(self.base.writing_mode);
|
||||
let relative_containing_block_size =
|
||||
&self.base.early_absolute_position_info.relative_containing_block_size;
|
||||
for fragment in &self.fragments.fragments {
|
||||
overflow = overflow.union(&fragment.compute_overflow(&flow_size,
|
||||
&relative_containing_block_size))
|
||||
overflow.union(&fragment.compute_overflow(&flow_size, &relative_containing_block_size))
|
||||
}
|
||||
overflow
|
||||
}
|
||||
|
|
|
@ -865,7 +865,7 @@ impl LayoutThread {
|
|||
if rw_data.stylist.viewport_constraints().is_some() {
|
||||
root_flow.position.size.to_physical(root_flow.writing_mode)
|
||||
} else {
|
||||
root_flow.overflow.size
|
||||
root_flow.overflow.scroll.size
|
||||
}
|
||||
};
|
||||
let mut display_list = box DisplayList::new();
|
||||
|
|
|
@ -11,10 +11,11 @@ use app_units::Au;
|
|||
use block::BlockFlow;
|
||||
use context::LayoutContext;
|
||||
use display_list_builder::ListItemFlowDisplayListBuilding;
|
||||
use euclid::{Point2D, Rect};
|
||||
use euclid::Point2D;
|
||||
use floats::FloatKind;
|
||||
use flow::{Flow, FlowClass, OpaqueFlow};
|
||||
use fragment::{CoordinateSystem, Fragment, FragmentBorderBoxIterator, GeneratedContentInfo};
|
||||
use fragment::{Overflow};
|
||||
use generated_content;
|
||||
use gfx::display_list::DisplayList;
|
||||
use incremental::RESOLVE_GENERATED_CONTENT;
|
||||
|
@ -152,14 +153,14 @@ impl Flow for ListItemFlow {
|
|||
self.block_flow.repair_style(new_style)
|
||||
}
|
||||
|
||||
fn compute_overflow(&self) -> Rect<Au> {
|
||||
fn compute_overflow(&self) -> Overflow {
|
||||
let mut overflow = self.block_flow.compute_overflow();
|
||||
let flow_size = self.block_flow.base.position.size.to_physical(self.block_flow.base.writing_mode);
|
||||
let relative_containing_block_size =
|
||||
&self.block_flow.base.early_absolute_position_info.relative_containing_block_size;
|
||||
|
||||
for fragment in &self.marker_fragments {
|
||||
overflow = overflow.union(&fragment.compute_overflow(&flow_size, &relative_containing_block_size))
|
||||
overflow.union(&fragment.compute_overflow(&flow_size, &relative_containing_block_size))
|
||||
}
|
||||
overflow
|
||||
}
|
||||
|
|
|
@ -9,11 +9,11 @@
|
|||
use app_units::Au;
|
||||
use block::BlockFlow;
|
||||
use context::LayoutContext;
|
||||
use euclid::{Point2D, Rect};
|
||||
use euclid::Point2D;
|
||||
use floats::FloatKind;
|
||||
use flow::{Flow, FlowClass, OpaqueFlow, mut_base, FragmentationContext};
|
||||
use flow_ref::{self, FlowRef};
|
||||
use fragment::{Fragment, FragmentBorderBoxIterator};
|
||||
use fragment::{Fragment, FragmentBorderBoxIterator, Overflow};
|
||||
use std::cmp::{min, max};
|
||||
use std::fmt;
|
||||
use std::sync::Arc;
|
||||
|
@ -186,7 +186,7 @@ impl Flow for MulticolFlow {
|
|||
self.block_flow.repair_style(new_style)
|
||||
}
|
||||
|
||||
fn compute_overflow(&self) -> Rect<Au> {
|
||||
fn compute_overflow(&self) -> Overflow {
|
||||
self.block_flow.compute_overflow()
|
||||
}
|
||||
|
||||
|
@ -264,7 +264,7 @@ impl Flow for MulticolColumnFlow {
|
|||
self.block_flow.repair_style(new_style)
|
||||
}
|
||||
|
||||
fn compute_overflow(&self) -> Rect<Au> {
|
||||
fn compute_overflow(&self) -> Overflow {
|
||||
self.block_flow.compute_overflow()
|
||||
}
|
||||
|
||||
|
|
|
@ -11,10 +11,10 @@ use block::{BlockFlow, CandidateBSizeIterator, ISizeAndMarginsComputer};
|
|||
use block::{ISizeConstraintInput, ISizeConstraintSolution};
|
||||
use context::LayoutContext;
|
||||
use display_list_builder::{BlockFlowDisplayListBuilding, BorderPaintingMode};
|
||||
use euclid::{Point2D, Rect};
|
||||
use euclid::Point2D;
|
||||
use flow::{IMPACTED_BY_RIGHT_FLOATS, ImmutableFlowUtils, OpaqueFlow};
|
||||
use flow::{self, EarlyAbsolutePositionInfo, Flow, FlowClass, IMPACTED_BY_LEFT_FLOATS};
|
||||
use fragment::{Fragment, FragmentBorderBoxIterator};
|
||||
use fragment::{Fragment, FragmentBorderBoxIterator, Overflow};
|
||||
use gfx::display_list::DisplayList;
|
||||
use incremental::{REFLOW, REFLOW_OUT_OF_FLOW};
|
||||
use layout_debug;
|
||||
|
@ -536,7 +536,7 @@ impl Flow for TableFlow {
|
|||
self.block_flow.repair_style(new_style)
|
||||
}
|
||||
|
||||
fn compute_overflow(&self) -> Rect<Au> {
|
||||
fn compute_overflow(&self) -> Overflow {
|
||||
self.block_flow.compute_overflow()
|
||||
}
|
||||
|
||||
|
|
|
@ -9,9 +9,9 @@
|
|||
use app_units::Au;
|
||||
use block::BlockFlow;
|
||||
use context::LayoutContext;
|
||||
use euclid::{Point2D, Rect};
|
||||
use euclid::Point2D;
|
||||
use flow::{Flow, FlowClass, OpaqueFlow};
|
||||
use fragment::{Fragment, FragmentBorderBoxIterator};
|
||||
use fragment::{Fragment, FragmentBorderBoxIterator, Overflow};
|
||||
use std::fmt;
|
||||
use std::sync::Arc;
|
||||
use style::properties::ComputedValues;
|
||||
|
@ -83,7 +83,7 @@ impl Flow for TableCaptionFlow {
|
|||
self.block_flow.repair_style(new_style)
|
||||
}
|
||||
|
||||
fn compute_overflow(&self) -> Rect<Au> {
|
||||
fn compute_overflow(&self) -> Overflow {
|
||||
self.block_flow.compute_overflow()
|
||||
}
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ use cssparser::Color;
|
|||
use display_list_builder::{BlockFlowDisplayListBuilding, BorderPaintingMode};
|
||||
use euclid::{Point2D, Rect, SideOffsets2D, Size2D};
|
||||
use flow::{Flow, FlowClass, OpaqueFlow};
|
||||
use fragment::{Fragment, FragmentBorderBoxIterator};
|
||||
use fragment::{Fragment, FragmentBorderBoxIterator, Overflow};
|
||||
use gfx::display_list::DisplayList;
|
||||
use layout_debug;
|
||||
use model::MaybeAuto;
|
||||
|
@ -197,7 +197,7 @@ impl Flow for TableCellFlow {
|
|||
self.block_flow.repair_style(new_style)
|
||||
}
|
||||
|
||||
fn compute_overflow(&self) -> Rect<Au> {
|
||||
fn compute_overflow(&self) -> Overflow {
|
||||
self.block_flow.compute_overflow()
|
||||
}
|
||||
|
||||
|
|
|
@ -8,9 +8,9 @@
|
|||
|
||||
use app_units::Au;
|
||||
use context::LayoutContext;
|
||||
use euclid::{Point2D, Rect};
|
||||
use euclid::Point2D;
|
||||
use flow::{BaseFlow, Flow, FlowClass, ForceNonfloatedFlag, OpaqueFlow};
|
||||
use fragment::{Fragment, FragmentBorderBoxIterator, SpecificFragmentInfo};
|
||||
use fragment::{Fragment, FragmentBorderBoxIterator, Overflow, SpecificFragmentInfo};
|
||||
use layout_debug;
|
||||
use std::cmp::max;
|
||||
use std::fmt;
|
||||
|
@ -94,8 +94,8 @@ impl Flow for TableColGroupFlow {
|
|||
|
||||
fn repair_style(&mut self, _: &Arc<ComputedValues>) {}
|
||||
|
||||
fn compute_overflow(&self) -> Rect<Au> {
|
||||
Rect::zero()
|
||||
fn compute_overflow(&self) -> Overflow {
|
||||
Overflow::new()
|
||||
}
|
||||
|
||||
fn generated_containing_block_size(&self, _: OpaqueFlow) -> LogicalSize<Au> {
|
||||
|
|
|
@ -11,10 +11,10 @@ use block::{BlockFlow, ISizeAndMarginsComputer};
|
|||
use context::LayoutContext;
|
||||
use cssparser::{Color, RGBA};
|
||||
use display_list_builder::{BlockFlowDisplayListBuilding, BorderPaintingMode};
|
||||
use euclid::{Point2D, Rect};
|
||||
use euclid::Point2D;
|
||||
use flow::{self, EarlyAbsolutePositionInfo, Flow, FlowClass, ImmutableFlowUtils, OpaqueFlow};
|
||||
use flow_list::MutFlowListIterator;
|
||||
use fragment::{Fragment, FragmentBorderBoxIterator};
|
||||
use fragment::{Fragment, FragmentBorderBoxIterator, Overflow};
|
||||
use gfx::display_list::DisplayList;
|
||||
use layout_debug;
|
||||
use model::MaybeAuto;
|
||||
|
@ -439,7 +439,7 @@ impl Flow for TableRowFlow {
|
|||
self.block_flow.repair_style(new_style)
|
||||
}
|
||||
|
||||
fn compute_overflow(&self) -> Rect<Au> {
|
||||
fn compute_overflow(&self) -> Overflow {
|
||||
self.block_flow.compute_overflow()
|
||||
}
|
||||
|
||||
|
|
|
@ -9,9 +9,9 @@
|
|||
use app_units::Au;
|
||||
use block::{BlockFlow, ISizeAndMarginsComputer};
|
||||
use context::LayoutContext;
|
||||
use euclid::{Point2D, Rect};
|
||||
use euclid::Point2D;
|
||||
use flow::{Flow, FlowClass, OpaqueFlow};
|
||||
use fragment::{Fragment, FragmentBorderBoxIterator};
|
||||
use fragment::{Fragment, FragmentBorderBoxIterator, Overflow};
|
||||
use layout_debug;
|
||||
use rustc_serialize::{Encodable, Encoder};
|
||||
use std::fmt;
|
||||
|
@ -217,7 +217,7 @@ impl Flow for TableRowGroupFlow {
|
|||
self.block_flow.repair_style(new_style)
|
||||
}
|
||||
|
||||
fn compute_overflow(&self) -> Rect<Au> {
|
||||
fn compute_overflow(&self) -> Overflow {
|
||||
self.block_flow.compute_overflow()
|
||||
}
|
||||
|
||||
|
|
|
@ -17,11 +17,11 @@ use app_units::Au;
|
|||
use block::{AbsoluteNonReplaced, BlockFlow, FloatNonReplaced, ISizeAndMarginsComputer, ISizeConstraintInput};
|
||||
use block::{ISizeConstraintSolution, MarginsMayCollapseFlag};
|
||||
use context::LayoutContext;
|
||||
use euclid::{Point2D, Rect};
|
||||
use euclid::Point2D;
|
||||
use floats::FloatKind;
|
||||
use flow::{Flow, FlowClass, ImmutableFlowUtils};
|
||||
use flow::{IMPACTED_BY_LEFT_FLOATS, IMPACTED_BY_RIGHT_FLOATS, INLINE_POSITION_IS_STATIC, OpaqueFlow};
|
||||
use fragment::{Fragment, FragmentBorderBoxIterator};
|
||||
use fragment::{Fragment, FragmentBorderBoxIterator, Overflow};
|
||||
use model::MaybeAuto;
|
||||
use std::cmp::{max, min};
|
||||
use std::fmt;
|
||||
|
@ -451,7 +451,7 @@ impl Flow for TableWrapperFlow {
|
|||
self.block_flow.repair_style(new_style)
|
||||
}
|
||||
|
||||
fn compute_overflow(&self) -> Rect<Au> {
|
||||
fn compute_overflow(&self) -> Overflow {
|
||||
self.block_flow.compute_overflow()
|
||||
}
|
||||
|
||||
|
|
32
tests/html/overflow-box-shadow.html
Normal file
32
tests/html/overflow-box-shadow.html
Normal file
|
@ -0,0 +1,32 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- Nothing on this page should be scrollable. -->
|
||||
<style>
|
||||
body {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.red {
|
||||
background: red;
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.green {
|
||||
background: green;
|
||||
position: absolute;
|
||||
width: 500px;
|
||||
height: 100%;
|
||||
right: 0px;
|
||||
|
||||
width: 500px;
|
||||
transform: translateX(250px);
|
||||
box-shadow: 0px 0px 200px black;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="red">
|
||||
<div class="green"></div>
|
||||
</div>
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue