Merge pull request #2994 from mechaxl/master

Only strip HTML whitespace in the document.title getter (fixes #2969); r=Ms2ger
This commit is contained in:
Ms2ger 2014-08-05 16:46:54 +02:00
commit 40048b791c

View file

@ -48,7 +48,7 @@ use hubbub::hubbub::{QuirksMode, NoQuirks, LimitedQuirks, FullQuirks};
use layout_interface::{DocumentDamageLevel, ContentChangedDocumentDamage}; use layout_interface::{DocumentDamageLevel, ContentChangedDocumentDamage};
use servo_util::namespace; use servo_util::namespace;
use servo_util::namespace::{Namespace, Null}; use servo_util::namespace::{Namespace, Null};
use servo_util::str::{DOMString, null_str_as_empty_ref}; use servo_util::str::{DOMString, null_str_as_empty_ref, split_html_space_chars};
use std::collections::hashmap::HashMap; use std::collections::hashmap::HashMap;
use std::ascii::StrAsciiExt; use std::ascii::StrAsciiExt;
@ -520,9 +520,8 @@ impl<'a> DocumentMethods for JSRef<'a, Document> {
} }
}); });
}); });
let v: Vec<&str> = title.as_slice().words().collect(); let v: Vec<&str> = split_html_space_chars(title.as_slice()).collect();
let title = v.connect(" "); v.connect(" ")
title.as_slice().trim().to_string()
} }
// http://www.whatwg.org/specs/web-apps/current-work/#document.title // http://www.whatwg.org/specs/web-apps/current-work/#document.title