mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
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:
commit
40048b791c
1 changed files with 3 additions and 4 deletions
|
@ -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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue