Auto merge of #14549 - frewsxcv:child-text-content, r=Ms2ger

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

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14549)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-12-15 16:54:38 -08:00 committed by GitHub
commit 7fecaa3e84
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 {