From b5c05307e04237e404551961aa288b7fa19a90ea Mon Sep 17 00:00:00 2001 From: "Brian J. Burg" Date: Sat, 13 Oct 2012 18:14:12 -0700 Subject: [PATCH] add RenderBox::is_whitespace() --- src/servo/layout/box.rs | 8 ++++++++ 1 file changed, 8 insertions(+) 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);