diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-12-15 16:54:38 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-15 16:54:38 -0800 |
commit | 7fecaa3e8496d9cee06f967caf978ba7685cc390 (patch) | |
tree | 0cdbcf1845a5835a50b69e78d150ac858362f96f /components/script/dom/node.rs | |
parent | bde8dce756902b1b3ad2cff4a5b5bed1f3325852 (diff) | |
parent | 9073a2f4c6820506a12189ced1e5100df9c5c196 (diff) | |
download | servo-7fecaa3e8496d9cee06f967caf978ba7685cc390.tar.gz servo-7fecaa3e8496d9cee06f967caf978ba7685cc390.zip |
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 -->
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 736020e360a..7146154a647 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 { |