diff options
author | Corey Farwell <coreyf@rwell.org> | 2016-12-10 17:41:33 -1000 |
---|---|---|
committer | Corey Farwell <coreyf@rwell.org> | 2016-12-15 17:24:13 -0500 |
commit | 9073a2f4c6820506a12189ced1e5100df9c5c196 (patch) | |
tree | d4f1ea1967d885bcb98acbf8c4846e9dd2a8458a /components/script/dom/node.rs | |
parent | 872ec89a9c546eb05246b5047aabfc032d140eff (diff) | |
download | servo-9073a2f4c6820506a12189ced1e5100df9c5c196.tar.gz servo-9073a2f4c6820506a12189ced1e5100df9c5c196.zip |
Implement "child text content" concept; use it where appropriate.
Diffstat (limited to 'components/script/dom/node.rs')
-rw-r--r-- | components/script/dom/node.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs index 983f11f478c..bf46ffaf1ef 100644 --- a/components/script/dom/node.rs +++ b/components/script/dom/node.rs @@ -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 { |