Repository navigation
style: Move outline-style outside of mako - #19548
Conversation
|
Heads up! This PR modifies the following files:
|
| @@ -0,0 +1,7 @@ | |||
| /* This Source Code Form is subject to the terms of the Mozilla Public | |||
| * License, v. 2.0. If a copy of the MPL was not distributed with this | |||
| * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | |||
There was a problem hiding this comment.
*/ should move to next line?
There was a problem hiding this comment.
I think maybe it's okay.
I just copied this License from other files.
|
|
||
| //! Computed values for outline properties | ||
|
|
||
| pub use values::specified::OutlineStyle; No newline at end of file |
There was a problem hiding this comment.
need a new line at the end
03e955e to
0172705
Compare
| } | ||
|
|
||
| /// Parse outline-style | ||
| pub fn parse<'i, 't>( |
There was a problem hiding this comment.
Hmm, so this is weird, how are we parsing auto now?
Before that, we used Parse, and then reject BorderStyle::Hidden, now that's not happening.
Let's change OutlineStyle to not be Either, but just be:
#[derive(ToCss, ToComputedValue, ...)]
pub enum OutlineStyle {
Auto,
Other(BorderStyle),
}And parse Auto manually.
There was a problem hiding this comment.
Thanks!
I think using enum is more reasonable for this attribute.
I'm going to fix it.
| _ => Ok(Either::Second(result)) | ||
| } | ||
| } else { | ||
| Err(input.new_custom_error(SelectorParseErrorKind::UnexpectedIdent("hidden".into()))) |
There was a problem hiding this comment.
This is wrong, this is returning an "unexpected token: hidden" error, when BorderStyle doesn't parse.
Instead we should propagate the error up.
So, with the above, it'd look something like:
if let Ok(border_style) = input.try(|i| BorderStyle::parse(context, i)) {
if matches!(border_style, BorderStyle::Hidden) {
return Err(input.new_custom_error(SelectorParseErrorKind::UnexpectedIdent("hidden".into())))
}
return Ok(OutlineStyle::Other(border_style));
}
input.expect_ident_matching("auto")?;
Ok(OutlineStyle::Auto)7208f16 to
e70bdbf
Compare
e70bdbf to
b9b91b3
Compare
|
@bors-servo r+ |
|
📌 Commit b9b91b3 has been approved by |
style: Move outline-style 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 #19546 - [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/19548) <!-- 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