mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +00:00
LibWeb/CSS: Let CSSStyleValue know its CSSStyleSheet
The CSS `fetch_foo()` functions resolve the URL relative to the CSSStyleSheet if one is provided. So, style values that do so need to know what CSSStyleSheet they are part of so that, for example, `url (foo.png)` is loaded relative to the style sheet's URL instead of the document's one. That all works without this change because we currently absolutize URLs during parsing, but we're in the process of stopping that. This commit adds the infrastructure for telling style values what their CSSStyleSheet is.
This commit is contained in:
parent
bf873a2d5b
commit
9f00425dad
Notes:
github-actions[bot]
2025-04-15 09:30:34 +00:00
Author: https://github.com/AtkinsSJ
Commit: 9f00425dad
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4319
7 changed files with 34 additions and 2 deletions
|
@ -433,4 +433,11 @@ String ShorthandStyleValue::to_string(SerializationMode mode) const
|
|||
}
|
||||
}
|
||||
|
||||
void ShorthandStyleValue::set_style_sheet(GC::Ptr<CSSStyleSheet> style_sheet)
|
||||
{
|
||||
Base::set_style_sheet(style_sheet);
|
||||
for (auto& value : m_properties.values)
|
||||
const_cast<CSSStyleValue&>(*value).set_style_sheet(style_sheet);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue