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

stylo: Support linear-gradients as background-image #11456

Merged
merged 6 commits into from Jun 2, 2016

Conversation

@emilio
Copy link
Member

emilio commented May 26, 2016

This PR supports setting the background-image property to a linear-gradient in Geckolib.


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes do not require tests because these are geckolib-only changes.

r? @mbrubeck
cc @heycam @bholley


This change is Reviewable

@highfive
Copy link

highfive commented May 26, 2016

Heads up! This PR modifies the following files:

@highfive
Copy link

highfive commented May 26, 2016

warning Warning warning

  • These commits modify unsafe code. Please review it carefully!
  • These commits modify style code, but no tests are modified. Please consider adding a test!
@emilio
Copy link
Member Author

emilio commented May 26, 2016

// NB: stops are guaranteed to be none in the gecko side by
// default.
stop.position.to_gecko_style_coord(&mut coord.mUnit,
&mut coord.mValue);

This comment has been minimized.

@mbrubeck

mbrubeck May 27, 2016

Contributor

You can write this as coord.set(stop.position);.

if let AngleOrCorner::Angle(angle) = gradient.angle_or_corner {
unsafe {
angle.to_gecko_style_coord(&mut (*gecko_gradient).mAngle.mUnit,
&mut (*gecko_gradient).mAngle.mValue);

This comment has been minimized.

@mbrubeck

mbrubeck May 27, 2016

Contributor

gecko_gradient.mAngle.set(angle);

@mbrubeck
Copy link
Contributor

mbrubeck commented May 27, 2016

r=mbrubeck with some minor cleanup suggestions (above).

@emilio emilio force-pushed the emilio:stylo-linear-gradient branch from 7306c76 to bd72743 May 27, 2016
@highfive
Copy link

highfive commented May 27, 2016

New code was committed to pull request.

@emilio
Copy link
Member Author

emilio commented May 27, 2016

@mbrubeck: Thanks for the fast review! Forgot about those methods :)

Addressed the comments, maybe worth waiting for @heycam's review in Gecko to see if any other change is required.

@emilio
Copy link
Member Author

emilio commented Jun 1, 2016

Gecko changes got r+'d, so I'm going to land this (per the r=mbrubeck above) and make the nsTArray bindings work in a separate PR today.

@bors-servo: r=mbrubeck

@bors-servo
Copy link
Contributor

bors-servo commented Jun 1, 2016

📌 Commit bd72743 has been approved by mbrubeck

@bors-servo
Copy link
Contributor

bors-servo commented Jun 1, 2016

Testing commit bd72743 with merge e3e1cc8...

bors-servo added a commit that referenced this pull request Jun 1, 2016
stylo: Support linear-gradients as background-image

This PR supports setting the background-image property to a linear-gradient in Geckolib.

---
<!-- 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

- [x] These changes do not require tests because these are geckolib-only changes.

r? @mbrubeck
cc @heycam @bholley

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11456)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Jun 1, 2016

💔 Test failed - mac-rel-css

@highfive
Copy link

highfive commented Jun 1, 2016

  ▶ TIMEOUT [expected PASS] /css-transforms-1_dev/html/svg-translate-multiple-002.htm
@emilio
Copy link
Member Author

emilio commented Jun 1, 2016

@bors-servo: retry

  • Possibly new intermittent?
@highfive
Copy link

highfive commented Jun 1, 2016

New code was committed to pull request.

1 similar comment
@highfive
Copy link

highfive commented Jun 1, 2016

New code was committed to pull request.

@emilio
Copy link
Member Author

emilio commented Jun 1, 2016

Added the nsTArray bindings, had to add a patch from @bholley that fixes overflow-wrap with the new bindings. cc @heycam about that.

Note that this won't build until #11445 lands, since it uses copy_from().

re-r? @mbrubeck

emilio and others added 3 commits May 26, 2016
@emilio emilio force-pushed the emilio:stylo-linear-gradient branch from 25d4baa to 33829b4 Jun 1, 2016
@highfive
Copy link

highfive commented Jun 1, 2016

New code was committed to pull request.

Gecko's allocs are infallible by default.
@highfive
Copy link

highfive commented Jun 1, 2016

New code was committed to pull request.

@mbrubeck
Copy link
Contributor

mbrubeck commented Jun 2, 2016

-S-blocked-on-external -S-awaiting-review +S-awaiting-answer

Looks good to me, with one suggested change. r=mbrubeck with or without the change.

Previously, highfive wrote…

New code was committed to pull request.


Reviewed 5 of 5 files at r1, 1 of 1 files at r2, 6 of 6 files at r3, 2 of 9 files at r6, 4 of 6 files at r7, 1 of 1 files at r8, 1 of 2 files at r9, 1 of 1 files at r10.
Review status: all files reviewed at latest revision, 1 unresolved discussion, some commit checks failed.


ports/geckolib/gecko_bindings/sugar/ns_t_array.rs, line 9 [r3] (raw file):

use structs::{nsTArray, nsTArrayHeader};

impl<T> Index<u32> for nsTArray<T> {

Would it make sense to instead impl Deref/DerefMut with Target=[T] for nsTArray<T>? Then we would get len, Index, IndexMut and other slice methods for free.


Comments from Reviewable

@emilio emilio mentioned this pull request Jun 2, 2016
2 of 5 tasks complete
Makes things a lot nicer :)
@highfive
Copy link

highfive commented Jun 2, 2016

New code was committed to pull request.

@emilio
Copy link
Member Author

emilio commented Jun 2, 2016

Yep, that's a great idea, I don't know why I didn't thought about it :)

@bors-servo: r=mbrubeck

@bors-servo
Copy link
Contributor

bors-servo commented Jun 2, 2016

📌 Commit c6340c4 has been approved by mbrubeck

@bors-servo
Copy link
Contributor

bors-servo commented Jun 2, 2016

Testing commit c6340c4 with merge e23962c...

bors-servo added a commit that referenced this pull request Jun 2, 2016
stylo: Support linear-gradients as background-image

This PR supports setting the background-image property to a linear-gradient in Geckolib.

---
<!-- 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

- [x] These changes do not require tests because these are geckolib-only changes.

r? @mbrubeck
cc @heycam @bholley

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11456)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Jun 2, 2016

@bors-servo bors-servo merged commit c6340c4 into servo:master Jun 2, 2016
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Jun 9, 2016
…ray bindings r=heycam

See servo/servo#11456, when they where added.

MozReview-Commit-ID: FsHMk9FjOo1
jdashg pushed a commit to jdashg/gecko-cinn that referenced this pull request Jun 11, 2016
…ray bindings r=heycam

See servo/servo#11456, when they where added.

MozReview-Commit-ID: FsHMk9FjOo1
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Sep 30, 2019
…ray bindings r=heycam

See servo/servo#11456, when they where added.

MozReview-Commit-ID: FsHMk9FjOo1

UltraBlame original commit: 0560b158bb22366202b489a95d78cb66605d456e
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request Sep 30, 2019
…ray bindings r=heycam

See servo/servo#11456, when they where added.

MozReview-Commit-ID: FsHMk9FjOo1

UltraBlame original commit: 0560b158bb22366202b489a95d78cb66605d456e
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request Sep 30, 2019
…ray bindings r=heycam

See servo/servo#11456, when they where added.

MozReview-Commit-ID: FsHMk9FjOo1

UltraBlame original commit: 0560b158bb22366202b489a95d78cb66605d456e
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

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