mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Implement "child text content" concept; use it where appropriate.
This commit is contained in:
parent
872ec89a9c
commit
9073a2f4c6
4 changed files with 8 additions and 11 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue