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 upStylo: replace product={gecko,servo} with engine={gecko,servo-2013,servo-2020} #23856
Conversation
highfive
commented
Jul 25, 2019
|
Heads up! This PR modifies the following files:
|
highfive
commented
Jul 25, 2019
|
This still needs work in the script crate, to compile in |
|
The new variable name makes more sense, too :) This looks generally good, let me know when it's ready for a final look. |
| @@ -615,9 +642,14 @@ def _add_logical_props(data, props): | |||
| props.add(prop.name) | |||
|
|
|||
|
|
|||
| def remove(set_, item): | |||
| if item in set_: | |||
This comment has been minimized.
This comment has been minimized.
emilio
Jul 25, 2019
Member
I was intentionally using remove() so that getting it wrong errored loud, fwiw...
This comment has been minimized.
This comment has been minimized.
SimonSapin
Jul 26, 2019
Author
Member
This is intended to catch a typo in the name, right?
My reasoning was that I don’t want to conditionally remove based on the engine, because we’d forget to edit this back when adding that property to the new layout engine.
I also tried not having a property exist at all before it is implemented in layout, but that’s already a lost cause: various parts of the style and script crate already refer to Rust APIs for specific APIs, so I used a pref to disable parsing instead. I’ll do the same here.
|
|
||
| #[cfg(feature = "servo-layout-2020")] | ||
| fn unimplemented_in_servo_2020(_context: &ParserContext) -> bool { | ||
| servo_config::prefs::pref_map().get("layout.2020.unimplemented").as_bool().unwrap_or(false) |
This comment has been minimized.
This comment has been minimized.
emilio
Jul 25, 2019
Member
This logic reads backwards... You only parse it if it's unimplemented?
I assume that this is what you want and that that pref would always be false, but why making it a pref at all? You could just stash false here and use parse(condition = "not_servo_2020") or such, which would read a bit nicer?
This comment has been minimized.
This comment has been minimized.
SimonSapin
Jul 25, 2019
Author
Member
Oh yeah it’s totally backward :] Yes making it always false based on the build-time flag also works, but since there’s a pref for properties this felt more consistent.
This comment has been minimized.
This comment has been minimized.
SimonSapin
Jul 26, 2019
Author
Member
Wait no, it’s not backward. The layout logic for this value is unimplemented. We only parse the keyword if the “enable unimplemented syntax” pref is on. I’ve renamed to parse_unimplemented_in_servo_2020 to hopefully clarify.
This pref is basically never intended to be on, but prefs are what already had support in Mako template for disabling parsing of some properties while still generating a Rust type for their values.
This comment has been minimized.
This comment has been minimized.
emilio
Jul 27, 2019
Member
Right, my point is that it reads backwards. I understand what it's doing, it just reads "parse if unimplemented_in_servo_2020", which is confusing, I think. Prefixing it with parse_ makes it a bit less confusing I guess.
f08be6e
to
ed930b4
|
|
Added a line in |
|
LGTM, feel free to r=me. |
|
@bors-servo r=nox |
|
|
Stylo: replace product={gecko,servo} with engine={gecko,servo-2013,servo-2020}
Renaming the variable helped make sure I looked at every use.
Also auto-generate relevant parts of `CSSStyleDeclaration.webidl`, to make libscript compile accordingly.
<!-- 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/23856)
<!-- Reviewable:end -->
|
|
…’ build scripts … rather than as an extra step after `cargo doc`. This helps always using the correct set of CSS properties (for layout 2013 v.s. 2020).
|
Removed the unused import, and removed the bit of unit test that runs a Python script that doesn’t exist anymore. (Kept the part where it check that the generated JSON file looks reasonable.) @bors-servo r=nox |
|
|
Stylo: replace product={gecko,servo} with engine={gecko,servo-2013,servo-2020}
Renaming the variable helped make sure I looked at every use.
Also auto-generate relevant parts of `CSSStyleDeclaration.webidl`, to make libscript compile accordingly.
<!-- 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/23856)
<!-- Reviewable:end -->
|
|
… properties based on the style crate. r=nox Cherry-picked from servo/servo#23856
…,servo-2013,servo-2020}. r=emilio,nox Renaming the variable helped make sure I looked at every use. Cherry-picked from: servo/servo#23856
…ocs as part of crates' build scripts. r=nox … rather than as an extra step after `cargo doc`. This helps always using the correct set of CSS properties (for layout 2013 v.s. 2020). Cherry-picked from: servo/servo#23856
… properties based on the style crate. r=nox Cherry-picked from servo/servo#23856
…,servo-2013,servo-2020}. r=emilio,nox Renaming the variable helped make sure I looked at every use. Cherry-picked from: servo/servo#23856
…ocs as part of crates' build scripts. r=nox … rather than as an extra step after `cargo doc`. This helps always using the correct set of CSS properties (for layout 2013 v.s. 2020). Cherry-picked from: servo/servo#23856
… properties based on the style crate. r=nox Cherry-picked from servo/servo#23856 UltraBlame original commit: 144f4ff252829f1fa36bb74d2663836ce2f7f298
…,servo-2013,servo-2020}. r=emilio,nox Renaming the variable helped make sure I looked at every use. Cherry-picked from: servo/servo#23856 UltraBlame original commit: d6be422cd134b0cc94f42bfacdd972923a54ccee
…ocs as part of crates' build scripts. r=nox … rather than as an extra step after `cargo doc`. This helps always using the correct set of CSS properties (for layout 2013 v.s. 2020). Cherry-picked from: servo/servo#23856 UltraBlame original commit: 741d67d502bd15ee4c463e99abb290e691813e06
… properties based on the style crate. r=nox Cherry-picked from servo/servo#23856 UltraBlame original commit: 144f4ff252829f1fa36bb74d2663836ce2f7f298
…,servo-2013,servo-2020}. r=emilio,nox Renaming the variable helped make sure I looked at every use. Cherry-picked from: servo/servo#23856 UltraBlame original commit: d6be422cd134b0cc94f42bfacdd972923a54ccee
…ocs as part of crates' build scripts. r=nox … rather than as an extra step after `cargo doc`. This helps always using the correct set of CSS properties (for layout 2013 v.s. 2020). Cherry-picked from: servo/servo#23856 UltraBlame original commit: 741d67d502bd15ee4c463e99abb290e691813e06
… properties based on the style crate. r=nox Cherry-picked from servo/servo#23856 UltraBlame original commit: 144f4ff252829f1fa36bb74d2663836ce2f7f298
…,servo-2013,servo-2020}. r=emilio,nox Renaming the variable helped make sure I looked at every use. Cherry-picked from: servo/servo#23856 UltraBlame original commit: d6be422cd134b0cc94f42bfacdd972923a54ccee
…ocs as part of crates' build scripts. r=nox … rather than as an extra step after `cargo doc`. This helps always using the correct set of CSS properties (for layout 2013 v.s. 2020). Cherry-picked from: servo/servo#23856 UltraBlame original commit: 741d67d502bd15ee4c463e99abb290e691813e06
SimonSapin commentedJul 25, 2019
•
edited
Renaming the variable helped make sure I looked at every use.
Also auto-generate relevant parts of
CSSStyleDeclaration.webidl, to make libscript compile accordingly.This change is