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

[WIP] Implement live NodeList #22264

Closed
wants to merge 4 commits into from
Closed

Conversation

@KiChjang
Copy link
Member

KiChjang commented Nov 24, 2018

Creating this PR just to see what WPT says for now.


This change is Reviewable

@highfive
Copy link

highfive commented Nov 24, 2018

Heads up! This PR modifies the following files:

  • @asajeffrey: components/script/dom/nodelist.rs, components/script/dom/document.rs, components/script/dom/bindings/trace.rs
  • @KiChjang: components/script/dom/nodelist.rs, components/script/dom/document.rs, components/script/dom/bindings/trace.rs
@highfive
Copy link

highfive commented Nov 24, 2018

warning Warning warning

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

KiChjang commented Nov 24, 2018

@bors-servo try=wpt

@bors-servo
Copy link
Contributor

bors-servo commented Nov 24, 2018

Trying commit 90fcb1c with merge 04a2f73...

bors-servo added a commit that referenced this pull request Nov 24, 2018
[WIP] Implement live NodeList

Creating this PR just to see what WPT says for now.

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

bors-servo commented Nov 24, 2018

💔 Test failed - linux-rel-wpt

@KiChjang KiChjang force-pushed the KiChjang:live-nodelist branch from 90fcb1c to a0d358b Nov 24, 2018
@KiChjang KiChjang force-pushed the KiChjang:live-nodelist branch from a0d358b to 9ca312e Nov 25, 2018
@KiChjang
Copy link
Member Author

KiChjang commented Nov 25, 2018

@bors-servo try=wpt

@bors-servo
Copy link
Contributor

bors-servo commented Nov 25, 2018

Trying commit 896f34d with merge cf254ae...

bors-servo added a commit that referenced this pull request Nov 25, 2018
[WIP] Implement live NodeList

Creating this PR just to see what WPT says for now.

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

bors-servo commented Nov 25, 2018

💔 Test failed - linux-rel-css

@KiChjang KiChjang force-pushed the KiChjang:live-nodelist branch from 896f34d to 50f111e Nov 25, 2018
@@ -372,6 +373,7 @@ unsafe impl<A: JSTraceable, B: JSTraceable, C: JSTraceable> JSTraceable for (A,

unsafe_no_jsmanaged_fields!(ActiveAttribInfo);
unsafe_no_jsmanaged_fields!(ActiveUniformInfo);
unsafe_no_jsmanaged_fields!(Box<dyn Fn(&Node) -> Box<dyn Iterator<Item = DomRoot<Node>>> + 'static>);

This comment has been minimized.

Copy link
@emilio

emilio Nov 25, 2018

Member

Hmm, how is this safe at all?

This comment has been minimized.

Copy link
@KiChjang

KiChjang Nov 26, 2018

Author Member

I had my huge doubts as well, and eventually I created a trait to encapsulate this idea instead.

.get_attribute(&ns!(), &local_name!("name"))
.map_or(false, |attr| &**attr.value() == &*name)
})
let doc = self.GetDocumentElement();

This comment has been minimized.

Copy link
@emilio

emilio Nov 25, 2018

Member

Why using the document element instead of self? A document is a node as well.

This comment has been minimized.

Copy link
@KiChjang

KiChjang Nov 26, 2018

Author Member

Yeah, I think there wasn't any reason why the document element needs to be used. Let's update this.

Copy link
Member

emilio left a comment

I think we need to come up with something a bit better perf wise... What gecko does is using nsIMutationObserver on the root, which is effectively a combination of the children_changed / attribute_changed/ etc functions.

Some(doc_node) => NodeList::new_live_list(&self.window, doc_node, move |root| {
let name = name.clone();
Box::new(
root.traverse_preorder()

This comment has been minimized.

Copy link
@emilio

emilio Nov 25, 2018

Member

Calling this function every time you access an element or the length of the collection is going to be terrible for performance.

This comment has been minimized.

Copy link
@nox

nox Nov 27, 2018

Member

The last one needs to be cached.

@KiChjang KiChjang force-pushed the KiChjang:live-nodelist branch 5 times, most recently from 1ba54dc to e8e6d57 Nov 26, 2018
@KiChjang
Copy link
Member Author

KiChjang commented Dec 2, 2018

@bors-servo try=wpt

@bors-servo
Copy link
Contributor

bors-servo commented Dec 2, 2018

Trying commit e8e6d57 with merge f1ca1c0...

bors-servo added a commit that referenced this pull request Dec 2, 2018
[WIP] Implement live NodeList

Creating this PR just to see what WPT says for now.

<!-- 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/22264)
<!-- Reviewable:end -->
@KiChjang KiChjang force-pushed the KiChjang:live-nodelist branch from 558ceaa to a7b9be1 Dec 7, 2018
@emilio
Copy link
Member

emilio commented Dec 8, 2018

@bors-servo try=wpt

@bors-servo
Copy link
Contributor

bors-servo commented Dec 8, 2018

Trying commit a7b9be1 with merge b604022...

bors-servo added a commit that referenced this pull request Dec 8, 2018
[WIP] Implement live NodeList

Creating this PR just to see what WPT says for now.

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

bors-servo commented Dec 8, 2018

💔 Test failed - linux-rel-css

@bors-servo
Copy link
Contributor

bors-servo commented Mar 11, 2019

The latest upstream changes (presumably #23013) made this pull request unmergeable. Please resolve the merge conflicts.

@KiChjang KiChjang force-pushed the KiChjang:live-nodelist branch from a7b9be1 to cae0f59 Jul 4, 2019
@highfive highfive removed the S-tests-failed label Jul 4, 2019
@KiChjang
Copy link
Member Author

KiChjang commented Jul 4, 2019

@bors-servo try=wpt

@bors-servo
Copy link
Contributor

bors-servo commented Jul 4, 2019

Trying commit cae0f59 with merge 0624356...

bors-servo added a commit that referenced this pull request Jul 4, 2019
[WIP] Implement live NodeList

Creating this PR just to see what WPT says for now.

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

bors-servo commented Jul 4, 2019

💔 Test failed - linux-rel-css

@bors-servo
Copy link
Contributor

bors-servo commented Jul 31, 2019

The latest upstream changes (presumably #23870) made this pull request unmergeable. Please resolve the merge conflicts.

@KiChjang KiChjang mentioned this pull request Jan 6, 2020
4 of 4 tasks complete
@pshaughn
Copy link
Member

pshaughn commented Jan 6, 2020

I apologize for not noticing this PR when I started working on my own solutions to node list liveness issues. I hope you're not upset that I've been duplicating some of your work. If you want to be the one who continues taking this forward, maybe some of what I've written will help you with the subcases you haven't already solved.

@asajeffrey asajeffrey mentioned this pull request Jan 6, 2020
4 of 4 tasks complete
@KiChjang
Copy link
Member Author

KiChjang commented Jan 11, 2020

Fixed by #25435.

@KiChjang KiChjang closed this Jan 11, 2020
@KiChjang KiChjang deleted the KiChjang:live-nodelist branch Jan 11, 2020
@KiChjang
Copy link
Member Author

KiChjang commented Jan 11, 2020

@pshaughn No worries! I was asking just to see if anything from this PR was useful to yours. Thanks for picking this up!

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

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