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 upSwitched Element::Get_attributes to use a RootedVec #5692
Conversation
|
@jdm Could this get a code review? Thanks! |
|
Reviewed files:
components/script/dom/element.rs, line 703 [r1] (raw file): components/script/dom/element.rs, line 956 [r1] (raw file): components/script/dom/node.rs, line 2426 [r1] (raw file): Comments from the review on Reviewable.io |
| self.get_attributes(local_name).into_iter().map(|attr| attr.root()) | ||
| let mut attributes = RootedVec::new(); | ||
| self.get_attributes(local_name, &mut attributes); | ||
| attributes.iter().map(|attr| attr.root()) |
This comment has been minimized.
This comment has been minimized.
nox
Apr 17, 2015
Member
Now that Temporary::root() does not consume the Temporary value, that could just be:
attributes.iter().find(|attr| attr.root().r().namespace() == namespace)
This comment has been minimized.
This comment has been minimized.
nox
Apr 17, 2015
Member
I'm not even sure the best way to write get_attribute() is by calling get_attributes(), maybe it should just work on self.attrs directly?
|
|
|
Reviewed files:
Comments from the review on Reviewable.io |
|
Sorry, I was thrown off by the change from awaiting-review to needs-code-changes. |
|
components/script/dom/element.rs, line 705 [r2] (raw file): Comments from the review on Reviewable.io |
|
Let's leave it using get_attributes; we can file an issue separately if we want to change that. |
|
How can I resolve these conflicts? |
|
@pgonda You will need to rebase your changes on a recent version of the master branch. You can follow the steps at https://github.com/servo/servo/wiki/Github-&-Critic-PR-handling-101 - the step starting at "When you know there is a substantive change" is the relevant one here. You can ignore the step about "Use the |
29a6789
to
dbfbbc5
|
@bors-servo: r+ |
|
|
Changes Element::get_attributes to use a `&mut Rooted<JS<Attr>>` param instead of returning a `Vec<Temporary<Attr>>`, fixes #5684. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/5692) <!-- Reviewable:end -->
|
|
|
@pgonda Could you squash these again? |
0783e30
to
a270f3e
|
squashed! |
|
@bors-servo: r+ |
|
|
Changes Element::get_attributes to use a `&mut Rooted<JS<Attr>>` param instead of returning a `Vec<Temporary<Attr>>`, fixes #5684. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/5692) <!-- Reviewable:end -->
|
|
|
@bors-servo: retry |
pgonda commentedApr 14, 2015
Changes Element::get_attributes to use a
&mut Rooted<JS<Attr>>param instead of returning aVec<Temporary<Attr>>, fixes #5684.