mirror of
https://github.com/servo/servo.git
synced 2025-06-24 09:04:33 +01:00
add RenderBox::is_whitespace()
This commit is contained in:
parent
d1c6e186bf
commit
b5c05307e0
1 changed files with 8 additions and 0 deletions
|
@ -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<au>;
|
||||
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue