-
Notifications
You must be signed in to change notification settings - Fork 64
enable text-overflow property for Servo #270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Any ancestors of this commit are from upstream mozilla-central, with some filtering and renaming. Our patches and sync tooling start here. The sync tooling has all been squashed into this commit, based on: https://github.com/servo/stylo/commits/64731e10dc8ef87ef52aa2fb9f988c3b2530f3a7
This is a rebase of aac89c5 Signed-off-by: Oriol Brufau <[email protected]>
Signed-off-by: Oriol Brufau <[email protected]>
Signed-off-by: Oriol Brufau <[email protected]>
Signed-off-by: Oriol Brufau <[email protected]>
Signed-off-by: Oriol Brufau <[email protected]>
Signed-off-by: Oriol Brufau <[email protected]>
Signed-off-by: Oriol Brufau <[email protected]>
Signed-off-by: Oriol Brufau <[email protected]>
Signed-off-by: Oriol Brufau <[email protected]>
- Bump stylo_* to 0.9.0 - Bump servo_arc to 0.4.3 - Bump selectors to 0.33.0 - Bump to_shmem to 0.3.0 Signed-off-by: Oriol Brufau <[email protected]>
This will allow de-duplicating phf in Servo. Signed-off-by: Oriol Brufau <[email protected]>
Signed-off-by: Nico Burns <[email protected]>
Loirooriol
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As said in the Servo review, since it's not handling strings or 2 values, this should alter the parser to reject these cases for Servo.
Alternatively, you can put this property behind a flag, and then in Servo make it an experimental web platform feature flag. Then it won't be enabled by default, but it will be used in tests.
Signed-off-by: Simon Wülker <[email protected]>
* Support font-optical-sizing in servo Signed-off-by: Simon Wülker <[email protected]> * Add font-variation-settings to list of font shorthands for servo Signed-off-by: Simon Wülker <[email protected]> --------- Signed-off-by: Simon Wülker <[email protected]>
9c4e698 to
5d14c6b
Compare
ebdcfa5 to
1f40f82
Compare
| input: &mut Parser<'i, 't>, | ||
| ) -> Result<TextOverflow, ParseError<'i>> { | ||
| let first = TextOverflowSide::parse(context, input)?; | ||
| let first = <TextOverflowSide as Parse>::parse(context, input)?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why add this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So for some reason, stylo now can't correctly decide which Parse to use (or rather, for some reason in the past, it can choose the right one), and so if you don't specify, it will result in a compilation error:
error[E0061]: this function takes 1 argument but 2 arguments were supplied
--> style\values\specified\text.rs:231:21
|
231 | let first = TextOverflowSide::parse(context, input)?;
| ^^^^^^^^^^^^^^^^^^^^^^^ ------- unexpected argument #1 of type `&ParserContext<'_>`
|
note: associated function defined here
--> style\values\specified\text.rs:178:5
|
178 | Parse,
| ^^^^^
= note: this error originates in the derive macro `Parse` (in Nightly builds, run with -Z macro-backtrace for more info)
help: remove the extra argument
|
231 - let first = TextOverflowSide::parse(context, input)?;
231 + let first = TextOverflowSide::parse(input)?;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Undo it, no longer needed
| first, | ||
| second, | ||
| sides_are_logical: false, | ||
| if let Ok(second) = input.try_parse(|input| <TextOverflowSide as Parse>::parse(context, input)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why add this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As with the other case, the compiler now can't resolve to the correct Parse.
error[E0061]: this function takes 1 argument but 2 arguments were supplied
--> style\values\specified\text.rs:231:21
|
231 | let first = TextOverflowSide::parse(context, input)?;
| ^^^^^^^^^^^^^^^^^^^^^^^ ------- unexpected argument #1 of type `&ParserContext<'_>`
|
note: associated function defined here
--> style\values\specified\text.rs:178:5
|
178 | Parse,
| ^^^^^
= note: this error originates in the derive macro `Parse` (in Nightly builds, run with -Z macro-backtrace for more info)
help: remove the extra argument
|
231 - let first = TextOverflowSide::parse(context, input)?;
231 + let first = TextOverflowSide::parse(input)?;
|
@Loirooriol I noticed earlier today that a PR on Stylo has been merged (#271), so I tried to rebase. However, I got some compilation errors. |
Loirooriol
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since changing the struct affects things more than what I expected, maybe just do something like
#[cfg(feature = "servo")]
if matches!(first, TextOverflowSide::String(_)) {
return Err(input.new_custom_error(StyleParseErrorKind::UnspecifiedError));
}
#[cfg(feature = "gecko")]
if let Ok(second) = input.try_parse(|input| TextOverflowSide::parse(context, input)) {
return Ok(Self {
first,
second,
sides_are_logical: false,
});
}
Ok(Self {
first: TextOverflowSide::Clip,
second: first,
sides_are_logical: true,
})Or add support for strings as Nico says in servo/servo#40526 (comment)
1f40f82 to
0017e21
Compare
Signed-off-by: Richard Tjokroutomo <[email protected]> Co-authored-by: Oriol Brufau <[email protected]>
6bdf687 to
cb461f6
Compare
Signed-off-by: Richard Tjokroutomo <[email protected]>
cb461f6 to
5c4f381
Compare
Enable
text-overflowfor Servo. Companion PR: #40526