Repository navigation
style: Move font -moz-script-min-size outside of mako - #19051
Conversation
|
Heads up! This PR modifies the following files:
|
canova
left a comment
There was a problem hiding this comment.
Thanks for doing this!
It looks good overall but adding some minor comments.
| } | ||
| } | ||
|
|
||
| #[allow(non_snake_case)] |
There was a problem hiding this comment.
nit: We don't change anything here and the new methods will be removed after my comment below. So we can put that back to its previous place.
| #[allow(non_snake_case)] | ||
| pub fn reset__x_lang(&mut self, other: &Self) { | ||
| self.copy__x_lang_from(other) | ||
| pub fn set__moz_script_min_size(&mut self, v: longhands::_moz_script_min_size::computed_value::T) { |
There was a problem hiding this comment.
I believe we can create these methods with something like
${impl_absolute_length("_moz_script_min_size", "mScriptMinSize")}
Or we can append this dictionary with "MozScriptMinSize": impl_absolute_length,: https://dxr.mozilla.org/servo/source/components/style/properties/gecko.mako.rs#1107 This list is probably for more generic stuff but I don't have a preference.
There was a problem hiding this comment.
Thanks for review! I'll try the second solution!
| use values::specified::length::{FontBaseSize, NoCalcLength}; | ||
|
|
||
| pub use values::specified::font::XTextZoom; | ||
| pub use values::computed::Length as MozScriptMinSize; |
There was a problem hiding this comment.
I think we should avoid adding uses like this. We might need Length in that file at some point. How about creating a type alias instead?
There was a problem hiding this comment.
This is fine, we do this in another places.
There was a problem hiding this comment.
A type alias has the inconvenience that you can't use enum variants anymore, this is a rust known issue, so I'd rather keep this for now.
There was a problem hiding this comment.
@emilio Thanks for the clarification! I didn't know about that type alias would have that inconvenience but now I learn it 😄
|
|
||
| pub use values::specified::font::XTextZoom; | ||
| pub use values::computed::Length as MozScriptMinSize; | ||
| pub use values::specified::font::{XTextZoom, MozScriptMinSize as SpecifiedMozScriptMinSize }; |
There was a problem hiding this comment.
nit: afaict, we don't need to make SpecifiedMozScriptMinSize use public.
| use values::specified::length::FontBaseSize; | ||
| use values::specified::length::{AU_PER_PT, AU_PER_PX, FontBaseSize}; | ||
|
|
||
| const DEFAULT_SCRIPT_MIN_SIZE_PT: ::std::os::raw::c_uint = 8; |
There was a problem hiding this comment.
It might be best to get this from bindings like the previous approach. We can wrap the new structs and its impls with #[cfg(feature = "gecko")] since it's only used in gecko.
There was a problem hiding this comment.
I suggested doing this, because we're removing the Gecko constant anyway, and the less build-time dependent stuff we have the better. It should probably be a u32 though.
There was a problem hiding this comment.
Thanks emilio for clarification. I'll update the type to u32.
5e69f57 to
9bba945
Compare
| } | ||
| } | ||
|
|
||
| impl Parse for specified::MozScriptMinSize { |
There was a problem hiding this comment.
nit: Parse implementations go usually in the specified module, mind moving this there?
Also, there's some weird indentation below (not really your fault), mind fixing it up like:
fn parse<'i, 't>(_: &ParserContext, input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i>> {
// ...
}With that, this looks great, thanks a lot!
There was a problem hiding this comment.
Let me move it into specified module.
9bba945 to
63cd930
Compare
|
@bors-servo r=emilio,canaltinova |
|
📌 Commit 63cd930 has been approved by |
…naltinova style: Move font -moz-script-min-size outside of mako This is a sub-PR for #19015 r? @emilio --- - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #19034 (github issue number if applicable). - [X] These changes do not require tests because _____ <!-- 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/19051) <!-- Reviewable:end -->
|
💔 Test failed - linux-rel-wpt |
|
@bors-servo retry #19064 |
…naltinova style: Move font -moz-script-min-size outside of mako This is a sub-PR for #19015 r? emilio --- - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #19034 (github issue number if applicable). - [X] These changes do not require tests because _____ <!-- 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/19051) <!-- Reviewable:end -->
|
☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel-css, linux-rel-wpt, mac-dev-unit, mac-rel-css1, mac-rel-css2, mac-rel-wpt1, mac-rel-wpt2, mac-rel-wpt3, mac-rel-wpt4, windows-msvc-dev |
This is a sub-PR for #19015
r? emilio
./mach build -ddoes not report any errors./mach test-tidydoes not report any errorsThis change is