-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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 ChildNode::before & ChildNode::after #6800
Implement ChildNode::before & ChildNode::after #6800
Conversation
-S-awaiting-review +S-needs-code-changes Reviewed 5 of 5 files at r1. components/script/dom/bindings/utils.rs, line 983 [r1] (raw file): components/script/dom/bindings/utils.rs, line 987 [r1] (raw file): nodes.find(|node| {
not_in.iter().all(|n| {
match n {
&NodeOrString::eNode(ref n) => *n != node,
_ => true,
}
})
}) ? (I like my iterator methods.) components/script/dom/node.rs, line 818 [r1] (raw file): tests/wpt/web-platform-tests/dom/nodes/ChildNode-after.html, line 110 [r1] (raw file): tests/wpt/web-platform-tests/dom/nodes/ChildNode-before.html, line 110 [r1] (raw file): tests/wpt/web-platform-tests/dom/nodes/ChildNode-before.html, line 112 [r1] (raw file): var parent = document.createElement("div")
var x = parent.appendChild(document.createElement("a"));
var y = parent.appendChild(document.createElement("b"));
var z = parent.appendChild(document.createElement("c"));
var u = parent.appendChild(document.createElement("d"));
parent.appendChild(child);
child.before(z, u); from #6536 (comment). Comments from the review on Reviewable.io |
tests/wpt/web-platform-tests/dom/nodes/ChildNode-before.html, line 112 [r1] (raw file): Comments from the review on Reviewable.io |
components/script/dom/node.rs, line 818 [r1] (raw file): Comments from the review on Reviewable.io |
ae2ca78
to
e785a4b
Compare
tests/wpt/web-platform-tests/dom/nodes/ChildNode-before.html, line 112 [r1] (raw file): Comments from the review on Reviewable.io |
Addressed all the comments in the latest force push, with exception to the Comments from the review on Reviewable.io |
Reviewed 4 of 4 files at r2. components/script/dom/node.rs, line 818 [r1] (raw file): tests/wpt/web-platform-tests/dom/nodes/ChildNode-after.html, line 111 [r2] (raw file): tests/wpt/web-platform-tests/dom/nodes/ChildNode-before.html, line 111 [r2] (raw file): tests/wpt/web-platform-tests/dom/nodes/ChildNode-before.html, line 126 [r1] (raw file): Comments from the review on Reviewable.io |
components/script/dom/node.rs, line 818 [r1] (raw file): Comments from the review on Reviewable.io |
tests/wpt/web-platform-tests/dom/nodes/ChildNode-before.html, line 112 [r1] (raw file): Comments from the review on Reviewable.io |
Continued from servo#6536 The current implementations of `ChildNode::before` and `ChildNode::after` do not match the WHATWG spec. This commit updates the implementations to match the spec. Our current implementation of `ChildNode::after` passes all the WPT tests. So I made sure to add a regression test that failed with the current implementation. There are a few other unit tests I added to exhaust other corner cases I encountered.
e785a4b
to
8cfccda
Compare
The latest force push addresses the second round of comments Comments from the review on Reviewable.io |
Thank you for your PR. -S-awaiting-review +S-awaiting-merge @bors-servo r+ Reviewed 3 of 3 files at r3. Comments from the review on Reviewable.io |
📌 Commit 8cfccda has been approved by |
…2ger Implement ChildNode::before & ChildNode::after Continued from #6536 The current implementations of `ChildNode::before` and `ChildNode::after` do not match the WHATWG spec. This commit updates the implementations to match the spec. Our current implementation of `ChildNode::after` passes all the WPT tests. So I made sure to add a regression test that failed with the current implementation. There are a few other unit tests I added to exhaust other corner cases I encountered. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6800) <!-- Reviewable:end -->
Continued from #6536
The current implementations of
ChildNode::before
andChildNode::after
do not match the WHATWG spec. This commit updates theimplementations to match the spec.
Our current implementation of
ChildNode::after
passes all the WPTtests. So I made sure to add a regression test that failed with the
current implementation. There are a few other unit tests I added
to exhaust other corner cases I encountered.