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 upSetting current color to black if canvas is not rendered in document #10651
Conversation
highfive
commented
Apr 16, 2016
|
Heads up! This PR modifies the following files:
|
highfive
commented
Apr 16, 2016
|
The change looks good, but the 2d context spec defines being rendered quite precisely, and it's not what we're doing here:
That is, if the node has an associated layout fragment. I think testing for presence in the document and the computed value of the I'm not sure if there's another way for an element not to generate a layout box (and if that's well specified enough). If the condition is more complex, we might need to query layout, but... I'll check the CSS spec and other browsers' implementation, meanwhile that change is probably saner :) -S-awaiting-review +S-needs-code-changes Review status: 0 of 1 files reviewed at latest revision, 1 unresolved discussion, some commit checks broke. components/script/dom/canvasrenderingcontext2d.rs, line 497 [r1] (raw file): Comments from Reviewable |
6614076
to
cc5f04b
|
Review status: 0 of 1 files reviewed at latest revision, 1 unresolved discussion. components/script/dom/canvasrenderingcontext2d.rs, line 497 [r1] (raw file): Comments from Reviewable |
|
When I have time later I will try to add the computed value of the display as well. Review status: 0 of 1 files reviewed at latest revision, 1 unresolved discussion. Comments from Reviewable |
|
|
|
@jdm: Yeah my concern is if it's the only one or not (appart from not being in a document) :) |
|
I remember looking at this when I was implementing, and the spec doesn't match what existing browsers do. Don't remember the exact details, but please tread carefully! (and file a spec bug after investigation, like I should have done before) |
cc5f04b
to
7d08bee
|
Assuming that the |
|
Review status: 0 of 1 files reviewed at latest revision, 2 unresolved discussions. components/script/dom/canvasrenderingcontext2d.rs, line 498 [r3] (raw file): Comments from Reviewable |
|
I don't think it's actually needed to extract it in its own method, probably using short-circuiting or would suffice :) Let's check if this matches what the 2dcontext test suite expects :) @bors-servo: try |
Setting current color to black if canvas is not rendered in document Fixes #10601 The change seems deceptively easy, I hope I am not missing anything... <!-- 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/10651) <!-- Reviewable:end -->
|
|
|
The test says it fails, yet if I run the test, it do see the canvas getting set to black. Is this an implementation error or does the test itself need to be changed? |
|
@craftytrickster The test says it PASSES, doesn't it? It's just expected to FAIL instead.
|
|
@KiChjang I see that too, but it says that the expected output is a black rectangle. Prior to the change the output was a red rectangle, but now it is indeed black, so why would it be considered a failure? Is it possible it was just set to expect a failure to pass CI? |
|
@craftytrickster Nonononono, the test is currently passing, but our test suite expects it to fail. What you need to do in this case is to change the test expectations, i.e. remove this file. |
7d08bee
to
e482bd7
|
@KiChjang thanks for the pointer on the .ini file, I have removed it as suggested. |
|
Right now, we only have a test for the
and check what other browsers do there. |
e482bd7
to
3ce61ae
|
whatwg/html#1099 affects this PR. |
| style.GetPropertyValue(DOMString::from("display")) == "none"; | ||
|
|
||
| if element_not_rendered { | ||
| self.parse_color("black") |
This comment has been minimized.
This comment has been minimized.
Ms2ger
Apr 22, 2016
Contributor
Let's make this
Ok(RGBA {
red: 0.0,
green: 0.0,
blue: 0.0,
alpha: 0.0,
})
This comment has been minimized.
This comment has been minimized.
craftytrickster
Apr 22, 2016
•
Author
Contributor
Done, although I made alpha 1 to correspond to "black"
3ce61ae
to
b5159dc
|
@bors-servo r+ |
|
|
Setting current color to black if canvas is not rendered in document Fixes #10601 The change seems deceptively easy, I hope I am not missing anything... <!-- 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/10651) <!-- Reviewable:end -->
|
|
highfive
commented
Apr 22, 2016
|
|
@bors-servo retry #10760 |
Setting current color to black if canvas is not rendered in document Fixes #10601 The change seems deceptively easy, I hope I am not missing anything... <!-- 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/10651) <!-- Reviewable:end -->
|
|
craftytrickster commentedApr 16, 2016
•
edited by KiChjang
Fixes #10601
The change seems deceptively easy, I hope I am not missing anything...
This change is