Implement "child text content" concept; use it where appropriate.

This commit is contained in:
Corey Farwell 2016-12-10 17:41:33 -10:00
parent 872ec89a9c
commit 9073a2f4c6
4 changed files with 8 additions and 11 deletions

View file

@ -1788,6 +1788,11 @@ impl Node {
copy
}
/// https://html.spec.whatwg.org/multipage/#child-text-content
pub fn child_text_content(&self) -> DOMString {
Node::collect_text_contents(self.children())
}
pub fn collect_text_contents<T: Iterator<Item=Root<Node>>>(iterator: T) -> DOMString {
let mut content = String::new();
for node in iterator {