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 upPrefer auto-generation for some keyword props #13902
Conversation
highfive
commented
Oct 24, 2016
|
Heads up! This PR modifies the following files:
|
highfive
commented
Oct 24, 2016
| // And, firefox doesn't support 'pixelated' (https://bugzilla.mozilla.org/show_bug.cgi?id=856337) | ||
| ${helpers.single_keyword("image-rendering", | ||
| "auto crispedges", | ||
| extra_gecko_values="optimizequality optimizespeed", |
This comment has been minimized.
This comment has been minimized.
Manishearth
Oct 24, 2016
Member
this needs to be manual, since the serialization is custom, and there's some aliasing going on.
This comment has been minimized.
This comment has been minimized.
wafflespeanut
Oct 24, 2016
Author
Member
Okay, yeah, the problem lies in crisp-edges. I'll better add an option for that in python.
|
r? @emilio |
|
@emilio The parsing/serialization code for |
| # This is a workaround for gecko constants with unexpected names i.e., a constant | ||
| # corresponding to a keyword 'foo-bar' declared as FOOBAR instead of FOO_BAR | ||
| if self.keyword is not None: | ||
| self.keyword.ignore_hyphens = ignore_hyphens |
This comment has been minimized.
This comment has been minimized.
emilio
Oct 25, 2016
Member
I think this feels a lot like a hack. If we want to both work-around it and auto-generate it, I think instead of this we should be passing a "keyword to constant" map instead, and then look it up in gecko_constant or replace otherwise.
What do you think?
This comment has been minimized.
This comment has been minimized.
Manishearth
Oct 25, 2016
Member
IMO workarounds like ignore_hyphens that get used just once probably shouldn't exist
|
@emilio @Manishearth So, I've gone for predicting constants based on their edit distance (python has a built-in object for that). It works quite well for all the constants we generate now. You think this would be useful? If it is, then I'll go ahead and fix the tests. If it's not, then I'll revert the changes to image-rendering stuff and we'll land this. |
|
r=me with those addressed, thanks for doing this! :) |
| @@ -312,6 +312,7 @@ | |||
| keyword_kwargs = {a: kwargs.pop(a, None) for a in [ | |||
| 'gecko_constant_prefix', 'gecko_enum_prefix', | |||
| 'extra_gecko_values', 'extra_servo_values', | |||
| 'custom_consts', | |||
This comment has been minimized.
This comment has been minimized.
| pub mod computed_value { | ||
| use cssparser::ToCss; | ||
| use std::fmt; | ||
| <% consts_map = { "crisp-edges": "CRISPEDGES" } %> |
This comment has been minimized.
This comment has been minimized.
fb6a195
to
ff27e4f
|
@bors-servo r=emilio |
|
|
Prefer auto-generation for some keyword props <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build-geckolib` does not report any errors <!-- Either: --> - [x] These changes do not require tests because it's a refactor <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> r? @Manishearth or @emilio <!-- 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/13902) <!-- Reviewable:end -->
|
|
|
@bors-servo r=emilio Oops. Forgot to change the enum variants in other crates :) |
|
|
|
|
Prefer auto-generation for some keyword props <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build-geckolib` does not report any errors <!-- Either: --> - [x] These changes do not require tests because it's a refactor <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> r? @Manishearth or @emilio <!-- 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/13902) <!-- Reviewable:end -->
|
|
|
@bors-servo retry #13776 |
|
|
|
|
wafflespeanut commentedOct 24, 2016
•
edited by larsbergstrom
./mach build-geckolibdoes not report any errorsr? @Manishearth or @emilio
This change is