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

Bump euclid to 0.14.x. #17184

Merged
merged 2 commits into from Jun 14, 2017
Merged

Bump euclid to 0.14.x. #17184

merged 2 commits into from Jun 14, 2017

Conversation

@nical
Copy link
Contributor

nical commented Jun 6, 2017

  • ./mach build -d does not report any errors (kinda, need webrender published and Cargo.toml fixed up)
  • ./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 it is a refactoring in which the difference is mostly a compile-time/strong-typing thing with no change to the logic.

This change is Reviewable

@highfive
Copy link

highfive commented Jun 6, 2017

Thanks for the pull request, and welcome! The Servo team is excited to review your changes, and you should hear from @asajeffrey (or someone else) soon.

@highfive
Copy link

highfive commented Jun 6, 2017

Heads up! This PR modifies the following files:

  • @bholley: components/style/gecko_bindings/sugar/ns_timing_function.rs, components/style/properties/gecko.mako.rs, components/style/animation.rs, components/style/properties/helpers/animated_properties.mako.rs, components/style/properties/properties.mako.rs and 7 more
  • @jgraham: components/webdriver_server/Cargo.toml
  • @wafflespeanut: python/tidy/servo_tidy_tests/rust_tidy.rs
  • @emilio: components/style/gecko_bindings/sugar/ns_timing_function.rs, components/style/properties/gecko.mako.rs, components/style/animation.rs, components/layout/multicol.rs, components/layout/list_item.rs and 21 more
  • @fitzgen: components/script/dom/htmlcanvaselement.rs, components/script/timers.rs, components/script/dom/imagedata.rs, components/script_traits/script_msg.rs, components/script_traits/script_msg.rs and 25 more
  • @KiChjang: components/script/dom/htmlcanvaselement.rs, components/script/timers.rs, components/script/dom/imagedata.rs, components/script_traits/script_msg.rs, components/script_traits/script_msg.rs and 25 more
  • @asajeffrey: components/constellation/browsingcontext.rs, components/constellation/constellation.rs, components/webdriver_server/Cargo.toml, components/constellation/pipeline.rs, components/constellation/Cargo.toml
@highfive
Copy link

highfive commented Jun 6, 2017

warning Warning warning

  • These commits modify unsafe code. Please review it carefully!
@nical
Copy link
Contributor Author

nical commented Jun 6, 2017

This requires webrender the equivalent WebRender and rust-azure changes to be merged/published, in order to build (I did get it to work locally), but the review is going to be a lot of work so I am submitting this early for people to start looking at it. This pull request is enormous, and I am truly sorry for this.
We made some major changes to euclid, in particular the separation of points and vector types. See servo/euclid#159.

cc @nox

@bors-servo
Copy link
Contributor

bors-servo commented Jun 6, 2017

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

@asajeffrey
Copy link
Member

asajeffrey commented Jun 7, 2017

Gosh, you're not kidding about this being a big change!

Are most of the changes to euclid naming? Would it be possible/useful to publish an intermediate version of euclid with both naming schemes?

@nical
Copy link
Contributor Author

nical commented Jun 8, 2017

The biggest change is the separation between vector and points. The rest of the diff is trivial changes like renaming Matrix2D/4D into Transform2D/3D and cleaning up the namespaces (use euclid::rect::Rect; becomes use euclid::Rect).
There is also two commits about SVG and animations that are not actually from this PR but that appear in the diff. After I have rebased this, they will disappear from the diff.

Once I have rebased this patch though, most of the non-trivial changes won't be in the diff, and if you want I can roll back the the Matrix/Transform renaming (this specific part doesn't occupy much room in the diff though) since I left an alias for the old name in euclid marked as deprecated, so it can be postponed if servo build does not deny warnings.

For the other changes, I am sorry but I spent way too much time getting this euclid bump into all of the servo crates outside the main repo, getting reviews an getting things published on crates in the correct order. I ended up doing mostly that for more than a week and I won't do it again. Had I known how much work this would be, I would not have made these changes to euclid.

@nical nical force-pushed the nical:euclid-bump branch 2 times, most recently from 7251988 to 7ff6ee1 Jun 8, 2017
@nical
Copy link
Contributor Author

nical commented Jun 8, 2017

I rebased and added a commit that reverts the matrix/transform renaming part (at the cost of introducing deprecation warnings). The total diff is a lot less scary to look at now.
Let me know if you prefer things squashed as is and move the matrix/transform stuff to a separate PR or if you want it in this one.

I kept another commit separated: the one that turns BaseFlow::stacking_relative_position into a vector instead of a point. For this one I wasn't 100% sure whether it made most sense as a vector or a point (short of knowing the layout code well enough), so it is still in its own commit which can be removed easily if need be.

Things still don't build on CI because I still need the equivalent webrender PR to be merged, but it works locally.

@bors-servo
Copy link
Contributor

bors-servo commented Jun 9, 2017

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

Cargo.toml Outdated

"https://github.com/servo/webrender#0.40.0" = { path = "../webrender/webrender/" }
"https://github.com/servo/webrender#webrender_traits:0.40.0" = { path = "../webrender/webrender_traits/" }
"https://github.com/servo/rust-azure#azure:0.16.0" = { path = "../rust-azure/" }

This comment has been minimized.

@mrobinson

mrobinson Jun 12, 2017

Member

Now that azure has the WebRender bump as well, I guess this can be removed.

@nical nical force-pushed the nical:euclid-bump branch 2 times, most recently from 2de0439 to 2f5fbdf Jun 12, 2017
Copy link
Member

asajeffrey left a comment

Looks perfectly sensible, and a lot of work! Just a couple of nits.

transform_origin_y,
transform_origin_z);
transform_origin_y,
transform_origin_z);

This comment has been minimized.

@asajeffrey

asajeffrey Jun 12, 2017

Member

Nit: I think our indentation style is the old version of the code.

pub fn translate(&mut self, point: &Point2D<Au>) {
self.scroll = self.scroll.translate(point);
self.paint = self.paint.translate(point);
pub fn translate(&mut self, by: &Vector2D<Au>) {

This comment has been minimized.

@asajeffrey

asajeffrey Jun 12, 2017

Member

This makes a lot more sense with the new type name!

@@ -86,12 +86,22 @@ trait ToPointF {
fn to_pointf(&self) -> webrender_traits::LayoutPoint;
}

trait ToVectorF {
fn to_vectorf(&self) -> webrender_traits::LayoutVector2D;

This comment has been minimized.

@asajeffrey

asajeffrey Jun 12, 2017

Member

Nit: the function name is not very self-explanatory.

@nical nical changed the title [WIP] Bump eucld to 0.14.x. [WIP] Bump euclid to 0.14.x. Jun 12, 2017
@nical nical force-pushed the nical:euclid-bump branch from 2f5fbdf to cee0715 Jun 12, 2017
@nical nical changed the title [WIP] Bump euclid to 0.14.x. Bump euclid to 0.14.x. Jun 12, 2017
@SimonSapin
Copy link
Member

SimonSapin commented Jun 13, 2017

Looks good to me.


Reviewed 39 of 87 files at r1, 41 of 51 files at r4, 9 of 9 files at r5.
Review status: all files reviewed at latest revision, 3 unresolved discussions.


components/canvas/canvas_paint_thread.rs, line 651 at r5 (raw file):

        // Step 6.
        let dest_rect = dirty_rect.translate(&offset.to_vector()).to_i32();

Should offset be a vector to start with?


components/script/dom/document.rs, line 869 at r5 (raw file):

                let rect = iframe.upcast::<Element>().GetBoundingClientRect();
                let child_origin = Point2D::new(rect.X() as f32, rect.Y() as f32);
                let child_point = client_point - child_origin.to_vector();

Could child_origin be a vector to start with? (Here and 3 others in this file.)


Comments from Reviewable

@nical nical force-pushed the nical:euclid-bump branch from cee0715 to b3a42b1 Jun 13, 2017
@nical
Copy link
Contributor Author

nical commented Jun 14, 2017

The review comments have been addressed, should we land this now?

@nical nical force-pushed the nical:euclid-bump branch from b3a42b1 to 87e6a6c Jun 14, 2017
@SimonSapin
Copy link
Member

SimonSapin commented Jun 14, 2017

Thank you!

@bors-servo r+


Reviewed 3 of 13 files at r6, 9 of 9 files at r7, 1 of 10 files at r8, 9 of 9 files at r9.
Review status: all files reviewed at latest revision, 1 unresolved discussion.


Comments from Reviewable

@bors-servo
Copy link
Contributor

bors-servo commented Jun 14, 2017

📌 Commit 87e6a6c has been approved by SimonSapin

@bors-servo
Copy link
Contributor

bors-servo commented Jun 14, 2017

Testing commit 87e6a6c with merge 4e25084...

bors-servo added a commit that referenced this pull request Jun 14, 2017
Bump euclid to 0.14.x.

- [x] `./mach build -d` does not report any errors (kinda, need webrender published and Cargo.toml fixed up)
- [x] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because it is a refactoring in which the difference is mostly a compile-time/strong-typing thing with no change to the logic.

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

bors-servo commented Jun 14, 2017

💔 Test failed - linux-dev

@nical nical force-pushed the nical:euclid-bump branch from 87e6a6c to 997608f Jun 14, 2017
@SimonSapin
Copy link
Member

SimonSapin commented Jun 14, 2017

@bors-servo r+


Reviewed 15 of 24 files at r10, 9 of 9 files at r11.
Review status: all files reviewed at latest revision, 1 unresolved discussion.


Comments from Reviewable

@bors-servo
Copy link
Contributor

bors-servo commented Jun 14, 2017

📌 Commit 997608f has been approved by SimonSapin

@bors-servo
Copy link
Contributor

bors-servo commented Jun 14, 2017

Testing commit 997608f with merge 18653f6...

bors-servo added a commit that referenced this pull request Jun 14, 2017
Bump euclid to 0.14.x.

- [x] `./mach build -d` does not report any errors (kinda, need webrender published and Cargo.toml fixed up)
- [x] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because it is a refactoring in which the difference is mostly a compile-time/strong-typing thing with no change to the logic.

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

bors-servo commented Jun 14, 2017

@bors-servo bors-servo merged commit 997608f into servo:master Jun 14, 2017
3 checks passed
3 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
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

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