Repository navigation
style: Move font-variant-alternates outside of mako - #19167
Conversation
|
Heads up! This PR modifies the following files:
|
| }, | ||
| VariantAlternates::HistoricalForms => { | ||
| dest.write_str("historical-forms") | ||
| }, |
There was a problem hiding this comment.
I think you could derive(ToCss) here using #[css(function)] annotations.
There was a problem hiding this comment.
I'll try to implement ToCss for Box<[CustomIdent]> in another PR.
Then, I'll update this.
emilio
left a comment
There was a problem hiding this comment.
Looks great! Just one bug I noticed, and a couple nits. Thanks as always!
| pub use self::border::{BorderImageSlice, BorderImageWidth, BorderImageSideWidth}; | ||
| pub use self::border::{BorderRadius, BorderCornerRadius, BorderSpacing}; | ||
| pub use self::font::{FontSize, FontSizeAdjust, FontWeight, MozScriptLevel, MozScriptMinSize, XTextZoom}; | ||
| pub use self::font::{ |
There was a problem hiding this comment.
nit: Use two lines for imports instead of breaking them into multiple lines, see the border imports on the line above.
| bitflags! { | ||
| #[cfg_attr(feature = "servo", derive(MallocSizeOf))] | ||
| /// Flags of variant alternates in bit | ||
| pub struct ParsingFlags: u8 { |
There was a problem hiding this comment.
Let's call this something more specific like VariantAlternatesParsingFlags.
There was a problem hiding this comment.
Oh, sorry for that I forgot to remove the pub. I'll update it!
| // FIXME: remove clone() when lifetimes are non-lexical | ||
| match input.next()?.clone() { | ||
| Token::Ident(ref ident) => { | ||
| if *ident == "historical-forms" { |
There was a problem hiding this comment.
This should be ident.eq_ignore_ascii_case("historical-forms"), could you add a test for this?
Something in the lines of:
<!doctype html>
<div style="font-variant-alternates: Historical-Forms"></div>
<script>
getComputedStyle(document.querySelector('div')).fontVariantAlternates == "historical-forms"
</script>Though... I guess it would need to be a test for Firefox, not servo, so let's fix it and I'll land the test in https://bugzilla.mozilla.org/show_bug.cgi?id=1415946
| let idents = i.parse_comma_separated(|i| { | ||
| let location = i.current_source_location(); | ||
| CustomIdent::from_ident(location, i.expect_ident()?, &[]) | ||
| })?; |
There was a problem hiding this comment.
Hmm, the duplication here is slightly worrying, but it's not too much, so I guess it's fine.
There was a problem hiding this comment.
Hmm... yes, I also would like to improve them with checking with multiple patterns of pattern matching; however, there're very small different inside the match body. If there's a good way to solve this problem, I think we can reduce this match.
| pub use self::border::{BorderImageSideWidth, BorderRadius, BorderSideWidth, BorderSpacing}; | ||
| pub use self::font::{FontSize, FontSizeAdjust, FontWeight, MozScriptLevel, MozScriptMinSize, XTextZoom}; | ||
| pub use self::font::{ | ||
| FontSize, FontSizeAdjust, FontWeight, FontVariantAlternates, |
There was a problem hiding this comment.
Same regarding multiline imports.
|
☔ The latest upstream changes (presumably #19165) made this pull request unmergeable. Please resolve the merge conflicts. |
5d96982 to
773e7fc
Compare
773e7fc to
aeae311
Compare
|
Looks good! Let's try to derive it in a followup. @bors-servo r+ |
|
📌 Commit aeae311 has been approved by |
…milio style: Move font-variant-alternates outside of mako This is a sub-PR of #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 #19166 (github issue number if applicable). - [x] These changes do not require tests <!-- 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/19167) <!-- 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 of #19015
r? emilio
./mach build -ddoes not report any errors./mach test-tidydoes not report any errorsThis change is