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 MutationObserver childList mutations. #16933

Merged
merged 1 commit into from May 20, 2017

Conversation

@MortimerGoro
Copy link
Contributor

MortimerGoro commented May 18, 2017

Implement MutationObserver childList mutations


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes fix #__ (github issue number if applicable).
  • There are tests for these changes OR
  • These changes do not require tests because _____

This change is Reviewable

@highfive
Copy link

highfive commented May 18, 2017

Heads up! This PR modifies the following files:

  • @fitzgen: components/script/dom/node.rs, components/script/dom/mutationobserver.rs, components/script/dom/nodelist.rs, components/script/dom/mutationrecord.rs
  • @KiChjang: components/script/dom/node.rs, components/script/dom/mutationobserver.rs, components/script/dom/nodelist.rs, components/script/dom/mutationrecord.rs
@MortimerGoro
Copy link
Contributor Author

MortimerGoro commented May 18, 2017

cc @jdm I was able to run some basic AFrame demos with the current implementation. Still have to do more tests because more complex demos crash due to a GC issue (it isn't related to mutation observers). I might need disconnect method implementation too.

Copy link
Member

jdm left a comment

Great work! My only comment is that we should be queueing the mutation records at the points that matches the relevant specification algorithm, rather than in children_changed.

@@ -2449,6 +2449,58 @@ impl VirtualMethods for Node {
if let Some(list) = self.child_list.get() {
list.as_children_list().children_changed(mutation);
}

// Queue Mutation Observer records
match *mutation {

This comment has been minimized.

@jdm

jdm May 18, 2017

Member

I appreciate how nice it is to group these together here, but we really should be calling queue_a_mutation_record from places like https://dxr.mozilla.org/servo/rev/d1eef9d08a4dc3c7ff057797281d2b4f8d4f71c7/components/script/dom/node.rs#1619 instead. This will match https://dom.spec.whatwg.org/#concept-node-insert step 4 and step 7 better, for example.

@jdm jdm assigned jdm and unassigned cbrewster May 18, 2017
@jdm
Copy link
Member

jdm commented May 18, 2017

@MortimerGoro Please file that crash as a separate issue. I am extremely interested in all JS engine crashes.

@MortimerGoro MortimerGoro force-pushed the MortimerGoro:mutation_children branch from 5a58939 to 0290e40 May 19, 2017
@MortimerGoro
Copy link
Contributor Author

MortimerGoro commented May 19, 2017

Great work! My only comment is that we should be queueing the mutation records at the points that matches the relevant specification algorithm, rather than in children_changed.

Done!

Please file that crash as a separate issue. I am extremely interested in all JS engine crashes.

Ok, will create the issue ;)

@jdm
Copy link
Member

jdm commented May 19, 2017

@bors-servo
Copy link
Contributor

bors-servo commented May 19, 2017

📌 Commit 0290e40 has been approved by jdm

@jdm
jdm approved these changes May 19, 2017
@bors-servo
Copy link
Contributor

bors-servo commented May 20, 2017

Testing commit 0290e40 with merge 8e9301736ea3d984d41cb53dd34ff270c666c37f...

@bors-servo
Copy link
Contributor

bors-servo commented May 20, 2017

💔 Test failed - linux-dev

@jdm
Copy link
Member

jdm commented May 20, 2017

@bors-servo: retry
Llvm error

@bors-servo
Copy link
Contributor

bors-servo commented May 20, 2017

Testing commit 0290e40 with merge 323760f...

bors-servo added a commit that referenced this pull request May 20, 2017
Implement MutationObserver childList mutations.

<!-- Please describe your changes on the following line: -->

Implement MutationObserver childList mutations

---
<!-- 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
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [x] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- 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/16933)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented May 20, 2017

☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel-css, linux-rel-wpt, mac-dev-unit, mac-rel-css, mac-rel-wpt1, mac-rel-wpt2, windows-msvc-dev
Approved by: jdm
Pushing 323760f to master...

@bors-servo bors-servo merged commit 0290e40 into servo:master May 20, 2017
2 of 3 checks passed
2 of 3 checks passed
continuous-integration/appveyor/pr AppVeyor build failed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
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.

None yet

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