mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-24 02:03:06 -05:00
LibWeb: Hack the CSS parser to skip over UTF-8 BOM
This is a rather ugly hack that fixes CSS parsing on websites where we get a stylesheet that starts with a BOM.
This commit is contained in:
parent
bbcc71fec4
commit
09da5f7263
Notes:
sideshowbarker
2024-07-19 01:07:36 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/09da5f7263e
1 changed files with 5 additions and 0 deletions
|
@ -909,6 +909,11 @@ public:
|
|||
|
||||
RefPtr<CSS::StyleSheet> parse_sheet()
|
||||
{
|
||||
if (peek(0) == (char)0xef && peek(1) == (char)0xbb && peek(2) == (char)0xbf) {
|
||||
// HACK: Skip UTF-8 BOM.
|
||||
index += 3;
|
||||
}
|
||||
|
||||
while (index < css.length()) {
|
||||
parse_rule();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue