-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
LibWebView: Crashes viewing the source of the acid1 test #3169
Comments
trflynn89
added
bug
Something isn't working
has repro
We have a way to reproduce this bug.
labels
Jan 7, 2025
The file in question has |
Interesting... I swapped them with a hex editor and that didn't solve the crash. Nor could I reproduce the crash with a small test file using |
Smallest repro: <style>
.foo {
hello
}
</style> (with Not sure what happened earlier, maybe I messed something else up. |
AtkinsSJ
added a commit
to AtkinsSJ/ladybird
that referenced
this issue
Jan 8, 2025
The previous code to determine the SourceDocument's lines was too naive: the source text can contain other newline characters and sequences, and the HTML/CSS/JS syntax highlighters would take those into account when determining what line a token is on. This disagreement would cause incorrect highlighting, or even crashes, if the source doesn't solely use `\n` for its newlines. In order to have everyone agree on what a line is, this patch first processes the source to replace all newlines with `\n`. The need to copy the source like this is unfortunate, but viewing the source is a rare enough action that this should not cause any noticeable performance problems. Fixes LadybirdBrowser#3169
AtkinsSJ
added a commit
to AtkinsSJ/ladybird
that referenced
this issue
Jan 13, 2025
The previous code to determine the SourceDocument's lines was too naive: the source text can contain other newline characters and sequences, and the HTML/CSS/JS syntax highlighters would take those into account when determining what line a token is on. This disagreement would cause incorrect highlighting, or even crashes, if the source didn't solely use `\n` for its newlines. In order to have everyone agree on what a line is, this patch first processes the source to replace all newlines with `\n`. The need to copy the source like this is unfortunate, but viewing the source is a rare enough action that this should not cause any noticeable performance problems. As the callers have a String, and we want a String, this also changes the function parameters to keep the source as a String instead of converting it to StringView and back. Fixes LadybirdBrowser#3169
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://www.w3.org/Style/CSS/Test/CSS1/current/test5526c.htm
"View Source" on this page and see the following stack:
CC @AtkinsSJ
The text was updated successfully, but these errors were encountered: