Prevent '&nbsp' from stripping as whitespace

This commit is contained in:
Junyoung Cho 2014-02-21 16:16:06 +09:00
parent 65191b0d63
commit 327e1e20a9
3 changed files with 7 additions and 5 deletions

View file

@ -43,6 +43,7 @@ use style::ComputedValues;
use servo_util::namespace;
use servo_util::url::parse_url;
use servo_util::url::is_image_data;
use servo_util::str::is_whitespace_not_nbsp;
use extra::url::Url;
use extra::arc::Arc;
@ -724,10 +725,7 @@ impl<'ln> NodeUtils for ThreadSafeLayoutNode<'ln> {
match self.type_id() {
TextNodeTypeId => {
unsafe {
if !self.with_text(|text| text.characterdata
.data
.chars()
.all(|c| c.is_whitespace())) {
if !self.with_text(|text| is_whitespace_not_nbsp(text.characterdata.data)) {
return false
}