Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement DocumentFragment XML serialization. #23192

Merged
merged 1 commit into from Apr 12, 2019

Conversation

@jackxbritton
Copy link
Contributor

jackxbritton commented Apr 11, 2019

When serializing a DocumentFragment node, we should follow this guy and serialize the node's immediate children. This commit makes that change.


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes fix #23134 (GitHub issue number if applicable)
  • 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.

This change is Reviewable

@highfive
Copy link

highfive commented Apr 11, 2019

Thanks for the pull request, and welcome! The Servo team is excited to review your changes, and you should hear from @ferjm (or someone else) soon.

@highfive
Copy link

highfive commented Apr 11, 2019

Heads up! This PR modifies the following files:

  • @asajeffrey: components/script/dom/servoparser/html.rs
  • @KiChjang: components/script/dom/servoparser/html.rs
@highfive
Copy link

highfive commented Apr 11, 2019

warning Warning warning

  • These commits modify script code, but no tests are modified. Please consider adding a test!
@KiChjang
Copy link
Member

KiChjang commented Apr 11, 2019

@bors-servo try=wpt

bors-servo added a commit that referenced this pull request Apr 11, 2019
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
- [ ] `./mach test-tidy` does not report any errors
- [X] These changes fix #23134 (GitHub issue number if applicable)

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] 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 -->
@bors-servo
Copy link
Contributor

bors-servo commented Apr 11, 2019

Trying commit 2100cc2 with merge edc598c...

@bors-servo
Copy link
Contributor

bors-servo commented Apr 11, 2019

☀️ Test successful - linux-rel-css, linux-rel-wpt, status-taskcluster
State: approved= try=True

@jdm jdm assigned jdm and unassigned ferjm Apr 11, 2019
@jdm
Copy link
Member

jdm commented Apr 11, 2019

I recommend following the example of #23153 and adding a test to tests/wpt/web-platform-tests/domparsing/XMLSerializer-serializeToString.html. You can run those tests with ./mach test-wpt tests/wpt/web-platform-tests/domparsing/XMLSerializer-serializeToString.html.

@jdm
Copy link
Member

jdm commented Apr 11, 2019

@bors-servo try=wpt

@jdm jdm added S-needs-tests and removed S-awaiting-review labels Apr 11, 2019
@jackxbritton
Copy link
Contributor Author

jackxbritton commented Apr 12, 2019

Cool, I'll get to it

@servo-wpt-sync
Copy link
Collaborator

servo-wpt-sync commented Apr 12, 2019

Opened new PR for upstreamable changes.

Completed upstream sync of web-platform-test changes at web-platform-tests/wpt#16333.

Copy link
Member

jdm left a comment

This looks great! One small change and then it's ready to merge :) Please squash the commits into one, as well.

@@ -166,7 +166,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.type_id() == NodeTypeId::DocumentFragment {

This comment has been minimized.

@jdm

jdm Apr 12, 2019

Member

Let's use node.is::<DocumentFragment>() instead for clarity.

@jdm
Copy link
Member

jdm commented Apr 12, 2019

You will need to run ./mach update-manifest as well.

@jackxbritton jackxbritton force-pushed the jackxbritton:issue-23134 branch from 683cabf to 1dd1cb4 Apr 12, 2019
@servo-wpt-sync
Copy link
Collaborator

servo-wpt-sync commented Apr 12, 2019

Transplanted upstreamable changes to existing PR.

Completed upstream sync of web-platform-test changes at web-platform-tests/wpt#16333.

@jdm
Copy link
Member

jdm commented Apr 12, 2019

@bors-servo r+
Thanks!

@bors-servo
Copy link
Contributor

bors-servo commented Apr 12, 2019

📌 Commit 1dd1cb4 has been approved by jdm

@bors-servo
Copy link
Contributor

bors-servo commented Apr 12, 2019

Testing commit 1dd1cb4 with merge 9832fed...

bors-servo added a commit that referenced this pull request Apr 12, 2019
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 -->
@bors-servo
Copy link
Contributor

bors-servo commented Apr 12, 2019

@bors-servo bors-servo merged commit 1dd1cb4 into servo:master Apr 12, 2019
4 checks passed
4 checks passed
Taskcluster (pull_request) TaskGroup: success
Details
Travis CI - Pull Request Build Passed
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
homu Test successful
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

7 participants
You can’t perform that action at this time.