mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
layout: white_space::pre
should not yield ignorable whitespace.
Improves the Google home page.
This commit is contained in:
parent
543f11b62b
commit
d30762bb9f
5 changed files with 28 additions and 5 deletions
|
@ -1501,10 +1501,17 @@ impl Fragment {
|
|||
}
|
||||
}
|
||||
|
||||
/// Returns true if this fragment is an unscanned text fragment that consists entirely of whitespace.
|
||||
pub fn is_whitespace_only(&self) -> bool {
|
||||
/// Returns true if this fragment is an unscanned text fragment that consists entirely of
|
||||
/// whitespace that should be stripped.
|
||||
pub fn is_ignorable_whitespace(&self) -> bool {
|
||||
match self.white_space() {
|
||||
white_space::pre => return false,
|
||||
white_space::normal | white_space::nowrap => {}
|
||||
}
|
||||
match self.specific {
|
||||
UnscannedTextFragment(ref text_fragment_info) => is_whitespace(text_fragment_info.text.as_slice()),
|
||||
UnscannedTextFragment(ref text_fragment_info) => {
|
||||
is_whitespace(text_fragment_info.text.as_slice())
|
||||
}
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue