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 parsing webkit-prefixed gradient functions #15441
Comments
|
I would really like to work on this. If some one can give some extended mentoring on this it will be great. Some links to similar properties will be super awesome. |
|
This is not about property, but about another syntax for The relevant code is https://github.com/servo/servo/blob/master/components/style/values/specified/image.rs#L102-L155 You would need to add a bunch of prefixed gradient functions there which are similar but have tricky minor difference to the unprefixed ones. |
|
Humm right, but for example in the specs they say
|
|
No, because it says, e.g.
The current version of |
|
aah, okay |
|
Also, i just noticed |
|
They are different... |
|
ah! didn't see that. If they were same it made sense . I guess there is no real advantage merging them now |
|
Does serialisation need to preserve the prefixes? |
|
We probably need to, because there seems to be some functional difference? It seems to me Gecko preserves the prefix in computed style (via If we are not going to implement |
The differences are only in parsing AFAICT: the token As a side-note, didn't we forget to handle the |
|
The |
|
So Servo implements the unitless-zero-as-zero-degree, and Gecko never has that. But Servo should probably remove that support, and do what the current spec says instead. |
Probably check with Blink/WebKit and see if they do that? @miketaylr, could you help checking this? Also this may be something worth putting into the Compat spec as well. |
|
@upsuper Should the prefix also be preserved for serialisation of computed values? |
<div style="background-image: -webkit-linear-gradient(top, yellow, blue);">
<script>console.log(document.querySelector('div').style.backgroundImage)</script>Unsurprisingly, both Safari and Chrome serialise that as the prefixed thing. No idea about Edge. |
|
Serialization of computation is done in Gecko side for Stylo, so probably doesn't really matter here, but we probably want to be consistent to specified value here? I guess we would need to fix the Gecko side code to prefer using webkit-prefix first... |
|
@upsuper I already have a patch ready for parsing and serialisation of both specified and computed values, do you want me to make a PR of that, so that a try run can be done on Gecko's side, maybe? |
|
Err, I missed the operative part: that patch only handle linear gradients for now. |
|
I probably should figure out a plan for bug 1337655 first (which I totally forgot before). There may not be a significant difference on test result without having that bug resolved, so probably it isn't worth making a separate PR if you haven't finished all the gradient stuff. |
|
I'm on PTO tomorrow and Monday is a national holiday, so I'll file it anyway. :) |
This is half of servo#15441.
This is half of servo#15441.
Implement webkit-prefixed linear gradients This is half of #15441. <!-- 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/16440) <!-- Reviewable:end -->
This is half of servo#15441.
|
According to bug 1241623 comment 8, we also need to implement the 2008 version of Also, |
Implement -webkit-radial-gradient() (fixes #15441) <!-- 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/16511) <!-- Reviewable:end -->
This is defined in the Compatibility Standard: https://compat.spec.whatwg.org/#css-image-type
The corresponding syntax is in https://www.w3.org/TR/2011/WD-css3-images-20110217/#gradients