aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/fragment.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/layout/fragment.rs')
-rw-r--r--components/layout/fragment.rs15
1 files changed, 7 insertions, 8 deletions
diff --git a/components/layout/fragment.rs b/components/layout/fragment.rs
index 02af5569d84..3b9596d27b9 100644
--- a/components/layout/fragment.rs
+++ b/components/layout/fragment.rs
@@ -2049,7 +2049,7 @@ impl Fragment {
}
/// 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.
let container_size = Size2D::zero();
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
// the time. Can't we handle relative positioning by just adjusting `border_box`?
- let relative_position =
- self.relative_position(&LogicalSize::zero(self.style.writing_mode));
- border_box = border_box.translate_by_size(&relative_position.to_physical(
- self.style.writing_mode));
+ 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;
// Box shadows cause us to draw outside our border box.
@@ -2300,10 +2299,10 @@ bitflags! {
// Various flags we can use when splitting fragments. See
// `calculate_split_position_using_breaking_strategy()`.
flags SplitOptions: u8 {
- #[doc="True if this is the first fragment on the line."]
+ #[doc = "True if this is the first fragment on the line."]
const STARTS_LINE = 0x01,
- #[doc="True if we should attempt to split at character boundaries if this split fails. \
- This is used to implement `overflow-wrap: break-word`."]
+ #[doc = "True if we should attempt to split at character boundaries if this split fails. \
+ This is used to implement `overflow-wrap: break-word`."]
const RETRY_AT_CHARACTER_BOUNDARIES = 0x02,
}
}