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 upstyle: support calc() in color functions. #19457
Conversation
highfive
commented
Dec 1, 2017
|
Heads up! This PR modifies the following files:
|
highfive
commented
Dec 1, 2017
|
r? @SimonSapin |
| @@ -4552,7 +4552,16 @@ pub unsafe extern "C" fn Servo_SelectorList_Drop(list: RawServoSelectorListOwned | |||
| fn parse_color(value: &str) -> Result<specified::Color, ()> { | |||
This comment has been minimized.
This comment has been minimized.
SimonSapin
Dec 2, 2017
Member
Is every use of this function intended to support full CSS syntax, including calc? I traced one use back to aBGColor in DocumentRendererChild::RenderDocument. Is that <body bgcolor>? https://html.spec.whatwg.org/multipage/#the-page links to https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#rules-for-parsing-a-legacy-colour-value
This comment has been minimized.
This comment has been minimized.
emilio
Dec 2, 2017
Author
Member
It is not, that's handled from nsAttrValue::ParseColor (https://searchfox.org/mozilla-central/rev/0b613c3887789f7786cd3131dfe9648398f4a6ac/dom/html/HTMLBodyElement.cpp#58).
That seems to be the default background color to render in a child process if there's no content.
The only web-exposed use of this is CanvasGradient::AddColorStop, and the spec for that is:
https://html.spec.whatwg.org/multipage/#dom-canvasgradient-addcolorstop
Which says to parse as a CSS <color> value, that is, with calc().
|
|
389e8d5
to
d39b896
|
@bors-servo try |
style: support calc() in color functions. Depends on #19456 and servo/rust-cssparser#207. <!-- 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/19457) <!-- Reviewable:end -->
|
@bors-servo try |
style: support calc() in color functions. Depends on #19456 and servo/rust-cssparser#207. <!-- 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/19457) <!-- Reviewable:end -->
|
|
|
Sigh, I expected tests to be there already... I'll write some. |
|
r+ with one last change Reviewed 14 of 14 files at r1, 1 of 1 files at r2, 1 of 4 files at r3, 7 of 7 files at r6. components/style/values/specified/color.rs, line 162 at r6 (raw file):
This probably doesn’t make a difference in behavior since all valid color keywords are ASCII, but this should be Comments from Reviewable |
|
@bors-servo r=SimonSapin |
|
|
style: support calc() in color functions. Depends on #19456 and servo/rust-cssparser#207. Fixes https://bugzilla.mozilla.org/show_bug.cgi?id=984021 <!-- 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/19457) <!-- Reviewable:end -->
|
|
|
|
|
@bors-servo r=SimonSapin p=1 |
|
|
style: support calc() in color functions. Depends on #19456 and servo/rust-cssparser#207. Fixes https://bugzilla.mozilla.org/show_bug.cgi?id=984021 <!-- 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/19457) <!-- Reviewable:end -->
|
|
Upstreamed from servo/servo#19457 [ci skip]
emilio commentedDec 1, 2017
•
edited
Depends on #19456 and servo/rust-cssparser#207.
Fixes https://bugzilla.mozilla.org/show_bug.cgi?id=984021
This change is