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

Switched Element::Get_attributes to use a RootedVec #5692

Merged
merged 1 commit into from Apr 27, 2015

Conversation

@pgonda
Copy link
Contributor

pgonda commented Apr 14, 2015

Changes Element::get_attributes to use a &mut Rooted<JS<Attr>> param instead of returning a Vec<Temporary<Attr>>, fixes #5684.

Review on Reviewable

@pgonda
Copy link
Contributor Author

pgonda commented Apr 15, 2015

@jdm Could this get a code review? Thanks!

@jdm
Copy link
Member

jdm commented Apr 15, 2015

Reviewed files:

  • components/script/dom/element.rs @ r1
  • components/script/dom/node.rs @ r1

components/script/dom/element.rs, line 703 [r1] (raw file):
Is the explicit type here necessary?


components/script/dom/element.rs, line 956 [r1] (raw file):
This doesn't look necessary.


components/script/dom/node.rs, line 2426 [r1] (raw file):
Is the explicit type here necessary?



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.

@nox

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.

@nox

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?

@bors-servo
Copy link
Contributor

bors-servo commented Apr 21, 2015

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

@jdm
Copy link
Member

jdm commented Apr 21, 2015

Reviewed files:

  • components/script/dom/element.rs @ r2

Comments from the review on Reviewable.io

@jdm
Copy link
Member

jdm commented Apr 21, 2015

Sorry, I was thrown off by the change from awaiting-review to needs-code-changes.

@pgonda
Copy link
Contributor Author

pgonda commented Apr 21, 2015

components/script/dom/element.rs, line 705 [r2] (raw file):
Without calling get_attributes() wouldn't we just have all that code duplicated?



Comments from the review on Reviewable.io

@jdm
Copy link
Member

jdm commented Apr 21, 2015

Let's leave it using get_attributes; we can file an issue separately if we want to change that.

pgonda added a commit to pgonda/servo that referenced this pull request Apr 21, 2015
@pgonda
Copy link
Contributor Author

pgonda commented Apr 22, 2015

How can I resolve these conflicts?

@jdm
Copy link
Member

jdm commented Apr 22, 2015

@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 Rebase Branch button".

@pgonda pgonda force-pushed the pgonda:get_attributes-memory-safety branch from 29a6789 to dbfbbc5 Apr 22, 2015
@jdm
Copy link
Member

jdm commented Apr 23, 2015

@bors-servo
Copy link
Contributor

bors-servo commented Apr 23, 2015

📌 Commit dbfbbc5 has been approved by jdm

@bors-servo
Copy link
Contributor

bors-servo commented Apr 23, 2015

Testing commit dbfbbc5 with merge e40253c...

bors-servo pushed a commit that referenced this pull request Apr 23, 2015
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
Copy link
Contributor

bors-servo commented Apr 23, 2015

💔 Test failed - mac2

@jdm
Copy link
Member

jdm commented Apr 27, 2015

@pgonda Could you squash these again?

…ing a Vec<Temporary>, fixes  #5684
@pgonda pgonda force-pushed the pgonda:get_attributes-memory-safety branch from 0783e30 to a270f3e Apr 27, 2015
@pgonda
Copy link
Contributor Author

pgonda commented Apr 27, 2015

squashed!

@jdm
Copy link
Member

jdm commented Apr 27, 2015

@bors-servo
Copy link
Contributor

bors-servo commented Apr 27, 2015

📌 Commit a270f3e has been approved by jdm

@bors-servo
Copy link
Contributor

bors-servo commented Apr 27, 2015

Testing commit a270f3e with merge 8ecb9d6...

bors-servo pushed a commit that referenced this pull request Apr 27, 2015
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
Copy link
Contributor

bors-servo commented Apr 27, 2015

💔 Test failed - linux2

@jdm
Copy link
Member

jdm commented Apr 27, 2015

@bors-servo
Copy link
Contributor

bors-servo commented Apr 27, 2015

Previous build results for android, gonk, linux1, mac1, mac2 are reusable. Rebuilding only linux2...

@bors-servo
Copy link
Contributor

bors-servo commented Apr 27, 2015

☀️ Test successful - android, gonk, linux1, linux2, mac1, mac2

@bors-servo bors-servo merged commit a270f3e into servo:master Apr 27, 2015
2 checks passed
2 checks passed
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
6 participants
You can’t perform that action at this time.