mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-02 17:28:48 +00:00
LibWeb: Don't tolerate unit-less lengths (except 0) in standards mode
"width: 500" is not a valid CSS property in standards mode and should be ignored. To plumb the quirks-mode flag into CSS parsing, this patch adds a new CSS::ParsingContext object that must be passed to the CSS parser. Currently it only allows you to check the quirks-mode flag. In the future it will be a good place to put additional information needed for things like relative URL resolution, etc. This narrows <div class=parser> on ACID2 to the correct width. :^)
This commit is contained in:
parent
c1acf67715
commit
9e642827fc
Notes:
sideshowbarker
2024-07-19 05:20:39 +09:00
Author: https://github.com/awesomekling
Commit: 9e642827fc
7 changed files with 221 additions and 112 deletions
|
@ -48,7 +48,7 @@ void HTMLStyleElement::children_changed()
|
|||
if (is<Text>(child))
|
||||
builder.append(to<Text>(child).text_content());
|
||||
});
|
||||
m_stylesheet = parse_css(builder.to_string());
|
||||
m_stylesheet = parse_css(CSS::ParsingContext(document()), builder.to_string());
|
||||
if (m_stylesheet)
|
||||
document().style_sheets().add_sheet(*m_stylesheet);
|
||||
else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue