diff --git a/src/servo/layout/box.rs b/src/servo/layout/box.rs index e92b6813134..73087d74383 100644 --- a/src/servo/layout/box.rs +++ b/src/servo/layout/box.rs @@ -101,6 +101,7 @@ trait RenderBoxMethods { pure fn is_replaced() -> bool; pure fn can_split() -> bool; + pure fn is_whitespace_only() -> bool; pure fn can_merge_with_box(@self, other: @RenderBox) -> bool; pure fn requires_inline_spacers() -> bool; pure fn content_box() -> Rect; @@ -149,6 +150,13 @@ impl RenderBox : RenderBoxMethods { } } + pure fn is_whitespace_only() -> bool { + match self { + UnscannedTextBox(_, raw_text) => raw_text.is_whitespace(), + _ => false + } + } + pure fn can_merge_with_box(@self, other: @RenderBox) -> bool { assert !core::box::ptr_eq(self, other);