Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upImplement MutationObserver.disconnect() #20740
Conversation
highfive
commented
May 2, 2018
|
Heads up! This PR modifies the following files:
|
|
@jdm did you assign it to you to work on it? (I don't mind at all) |
|
@fabricedesre No, that's just @jdm assigning himself for review. |
|
That's confusing, as there's a distinct "reviewer" role. |
|
I like this change. Is there a reason it's still marked [wip]? |
|
No other reason than I was not sure this would be the correct approach. |
|
@bors-servo r+ |
|
|
Implement MutationObserver.disconnect() <!-- Please describe your changes on the following line: --> This implements https://dom.spec.whatwg.org/#dom-mutationobserver-disconnect I added a `node_list` to the `MutationObserver` struct to keep track of the nodes involved in an observer because otherwise I could not find a way to unregister the observers on the node themselves without traversing the whole document tree. Let me know if there's something I missed. --- <!-- 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/20740) <!-- Reviewable:end -->
|
|
|
@bors-servo retry |
|
@fabricedesre: |
|
@fabricedesre The test expectation will need to be updated; the test probably uses MutationObserver in a way that doesn't break now. |
|
Oh, yes, pretty obvious looking at it... |
|
@bors-servo retry |
Implement MutationObserver.disconnect() <!-- Please describe your changes on the following line: --> This implements https://dom.spec.whatwg.org/#dom-mutationobserver-disconnect I added a `node_list` to the `MutationObserver` struct to keep track of the nodes involved in an observer because otherwise I could not find a way to unregister the observers on the node themselves without traversing the whole document tree. Let me know if there's something I missed. --- <!-- 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/20740) <!-- Reviewable:end -->
|
|
|
|
I'm not sure what's failing here, things look fine locally:
And I double checked that the displayed results matched the |
|
You're right. Those result changes are unrelated to this PR. |
Implement MutationObserver.disconnect() <!-- Please describe your changes on the following line: --> This implements https://dom.spec.whatwg.org/#dom-mutationobserver-disconnect I added a `node_list` to the `MutationObserver` struct to keep track of the nodes involved in an observer because otherwise I could not find a way to unregister the observers on the node themselves without traversing the whole document tree. Let me know if there's something I missed. --- <!-- 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/20740) <!-- Reviewable:end -->
|
|
|
@bors-servo retry |
Implement MutationObserver.disconnect() <!-- Please describe your changes on the following line: --> This implements https://dom.spec.whatwg.org/#dom-mutationobserver-disconnect I added a `node_list` to the `MutationObserver` struct to keep track of the nodes involved in an observer because otherwise I could not find a way to unregister the observers on the node themselves without traversing the whole document tree. Let me know if there's something I missed. --- <!-- 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/20740) <!-- Reviewable:end -->
|
|
fabricedesre commentedMay 2, 2018
•
edited by SimonSapin
This implements https://dom.spec.whatwg.org/#dom-mutationobserver-disconnect
I added a
node_listto theMutationObserverstruct to keep track of the nodes involved in an observer because otherwise I could not find a way to unregister the observers on the node themselves without traversing the whole document tree. Let me know if there's something I missed../mach build -ddoes not report any errors./mach test-tidydoes not report any errorsThis change is