diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2019-04-12 14:37:45 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-12 14:37:45 -0400 |
commit | 9832feddf3b6111dbf648ab758faa312ab30fd07 (patch) | |
tree | 5a6d10ce2fc7c510b4bd1ed506c240f9ff896af3 /components/script | |
parent | 83186242d443d57a38c23d4dd873b4e26bc0a336 (diff) | |
parent | 1dd1cb4f4fc17d713cddff251b52221241c2b521 (diff) | |
download | servo-9832feddf3b6111dbf648ab758faa312ab30fd07.tar.gz servo-9832feddf3b6111dbf648ab758faa312ab30fd07.zip |
Auto merge of #23192 - jackxbritton:issue-23134, r=jdm
Implement DocumentFragment XML serialization.
When serializing a DocumentFragment node, we should follow [this guy](https://w3c.github.io/DOM-Parsing/#dfn-xml-serializing-a-documentfragment-node) and serialize the node's immediate children. This commit makes that change.
---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [X] These changes fix #23134 (GitHub issue number if applicable)
<!-- Either: -->
- [x] There are tests for these changes OR
- [ ] These changes do not require tests because ___ well, they probably do, but I don't know how to do that and could use some help.
<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->
<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
<!-- 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/23192)
<!-- Reviewable:end -->
Diffstat (limited to 'components/script')
-rw-r--r-- | components/script/dom/servoparser/html.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/components/script/dom/servoparser/html.rs b/components/script/dom/servoparser/html.rs index fe6d06064f4..106c6dc7261 100644 --- a/components/script/dom/servoparser/html.rs +++ b/components/script/dom/servoparser/html.rs @@ -10,6 +10,7 @@ use crate::dom::bindings::root::{Dom, DomRoot}; use crate::dom::bindings::trace::JSTraceable; use crate::dom::characterdata::CharacterData; use crate::dom::document::Document; +use crate::dom::documentfragment::DocumentFragment; use crate::dom::documenttype::DocumentType; use crate::dom::element::Element; use crate::dom::htmlscriptelement::HTMLScriptElement; @@ -166,7 +167,7 @@ fn rev_children_iter(n: &Node) -> impl Iterator<Item = DomRoot<Node>> { impl SerializationIterator { fn new(node: &Node, skip_first: bool) -> SerializationIterator { let mut ret = SerializationIterator { stack: vec![] }; - if skip_first { + if skip_first || node.is::<DocumentFragment>() { for c in rev_children_iter(node) { ret.push_node(&*c); } |