Skip to content
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

LibWeb: Style computer should never fail #23473

Closed
awesomekling opened this issue Mar 5, 2024 · 1 comment · Fixed by #23486
Closed

LibWeb: Style computer should never fail #23473

awesomekling opened this issue Mar 5, 2024 · 1 comment · Fixed by #23486
Labels
bug Something isn't working

Comments

@awesomekling
Copy link
Member

We should never fail to compute style for an element.
If a property is somehow invalid, we should not abort style computation.
Basically all use of ErrorOr and TRY in StyleComputer is wrong or at least misused.

As an example, https://twinings.co.uk/ crashes (after a while) right now because some animated CSS transform has an invalid value.

cc @mattco98 @kalenikaliaksandr

@awesomekling awesomekling added the bug Something isn't working label Mar 5, 2024
@mattco98
Copy link
Collaborator

mattco98 commented Mar 5, 2024

That wasn't clear to me since the cascade functions return ErrorOr. Turns out, it's all because of this one little allocation 😅:

TRY(custom_properties.try_ensure_capacity(needed_capacity));

#23471 is related; The type of a StyleValue for a property shouldn't be VERIFYd, since it can be anything (probably not for all properties, but it's a good assumption to make regardless).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants