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 upImplement currentColor for Canvas colors #7120
Conversation
It actually isn't: these objects are not bound to one particular canvas. |
85a6349
to
813f4a8
|
Simon found the spec text in #7106 and I updated the PR to match. It doesn't check whether the canvas is actually being rendered, I'll do that in a followup since I'll need to add a new message and some layout code. |
|
The second commit checks if the canvas is rendered before grabbing the used color for currentColor.
However, Firefox, Chrome, and Safari all display a red rect instead of a black one, so I think this requirement isn't actually necessary. |
|
I don't see that test case in the PR? ;) |
|
I didn't want to spend effort making it an actual reftest in case we decided not to land the second patch. If you think we should follow the spec here instead of changing it to match browsers, I can add the test. |
|
I'd probably stick with matching current browsers and filing issues. I still want the test, though, with the colours swapped. |
|
Ok, I changed the test a little and added it. |
|
|
a25c698
to
1637b0e
|
|
4ef38f6
to
01bd6c5
|
|
|
r? @Ms2ger |
|
Reviewed 7 of 7 files at r1. components/script/dom/canvasgradient.rs, line 53 [r1] (raw file): components/script/dom/canvasrenderingcontext2d.rs, line 426 [r1] (raw file): tests/wpt/web-platform-tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.current.notrendered.html, line 2 [r1] (raw file): Comments from the review on Reviewable.io |
|
@dzbarsky Any updates on this? |
|
Didn't realize this got reviewed, I'll fix it up. |
|
Review status: all files reviewed at latest revision, 3 unresolved discussions, some commit checks failed. components/script/dom/canvasgradient.rs, line 53 [r1] (raw file): components/script/dom/canvasrenderingcontext2d.rs, line 426 [r1] (raw file): tests/wpt/web-platform-tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.current.notrendered.html, line 2 [r1] (raw file): Comments from the review on Reviewable.io |
|
The computed styles question sounds very similar to #7267. |
|
@bors-servo r+ Reviewed 3 of 3 files at r2. Comments from the review on Reviewable.io |
|
|
Implement currentColor for Canvas colors I made addColorStop throw for currentColor, which matches Firefox. It's easy enough to change the behavior to fetch the color from the canvas, which is what Chrome and Safari do. I'll file a spec bug to decide what to do here. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7120) <!-- Reviewable:end -->
|
|
|
Implement currentColor for Canvas colors Fixes #7120. This is #7120 by @dzbarsky, with one tidy error fixed. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8656) <!-- Reviewable:end -->
dzbarsky commentedAug 10, 2015
I made addColorStop throw for currentColor, which matches Firefox. It's easy enough to change the behavior to fetch the color from the canvas, which is what Chrome and Safari do. I'll file a spec bug to decide what to do here.