aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/inline.rs
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2014-12-18 18:59:42 -0800
committerPatrick Walton <pcwalton@mimiga.net>2015-01-04 17:41:59 -0800
commit5ea2c6dcfdfc24ce3730f736fcd045a13bcdc5b6 (patch)
treebd04f1fa5d53a938e91817c8d099456f93b01950 /components/layout/inline.rs
parentba8cf6b0e6145265f9472d4855f078d8b5943fe7 (diff)
downloadservo-5ea2c6dcfdfc24ce3730f736fcd045a13bcdc5b6.tar.gz
servo-5ea2c6dcfdfc24ce3730f736fcd045a13bcdc5b6.zip
layout: Paint stacking contexts' overflow areas properly.
This was making `box-shadow` not show up in many cases, in particular, but the effects were not limited to that.
Diffstat (limited to 'components/layout/inline.rs')
-rw-r--r--components/layout/inline.rs16
1 files changed, 12 insertions, 4 deletions
diff --git a/components/layout/inline.rs b/components/layout/inline.rs
index 2230fb3e823..f8a19708d1e 100644
--- a/components/layout/inline.rs
+++ b/components/layout/inline.rs
@@ -12,7 +12,7 @@ use flow::{BaseFlow, FlowClass, Flow, MutableFlowUtils, ForceNonfloatedFlag};
use flow::{IS_ABSOLUTELY_POSITIONED};
use flow;
use fragment::{Fragment, SpecificFragmentInfo};
-use fragment::{FragmentBoundsIterator, ScannedTextFragmentInfo};
+use fragment::{FragmentOverflowIterator, ScannedTextFragmentInfo};
use fragment::SplitInfo;
use incremental::{REFLOW, REFLOW_OUT_OF_FLOW};
use layout_debug;
@@ -20,12 +20,12 @@ use model::IntrinsicISizesContribution;
use text;
use collections::{RingBuf};
-use geom::Size2D;
+use geom::{Rect, Size2D};
use gfx::display_list::DisplayList;
use gfx::font::FontMetrics;
use gfx::font_context::FontContext;
use gfx::text::glyph::CharIndex;
-use servo_util::geometry::Au;
+use servo_util::geometry::{Au, ZERO_RECT};
use servo_util::logical_geometry::{LogicalRect, LogicalSize, WritingMode};
use servo_util::opts;
use servo_util::range::{Range, RangeIndex};
@@ -1271,7 +1271,15 @@ impl Flow for InlineFlow {
fn repair_style(&mut self, _: &Arc<ComputedValues>) {}
- fn iterate_through_fragment_bounds(&self, iterator: &mut FragmentBoundsIterator) {
+ fn compute_overflow(&self) -> Rect<Au> {
+ let mut overflow = ZERO_RECT;
+ for fragment in self.fragments.fragments.iter() {
+ overflow = overflow.union(&fragment.compute_overflow())
+ }
+ overflow
+ }
+
+ fn iterate_through_fragment_overflow(&self, iterator: &mut FragmentOverflowIterator) {
for fragment in self.fragments.fragments.iter() {
if iterator.should_process(fragment) {
let fragment_origin =