mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-31 07:22:50 +00:00
LibWeb/DOM: Use document's URL as location for inline stylesheets
This is ad-hoc, and the spec doesn't seem to tell us what to actually do here. Without this, following the spec steps for loading relative `@import` URLs from a `<style>` tag always fails, because that uses the parent style sheet's location as the base URL.
This commit is contained in:
parent
bc02e3e9a9
commit
a8ab4d64c4
Notes:
github-actions[bot]
2025-04-09 17:47:44 +00:00
Author: https://github.com/AtkinsSJ
Commit: a8ab4d64c4
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4285
Reviewed-by: https://github.com/tcl3 ✅
1 changed files with 2 additions and 1 deletions
|
@ -54,7 +54,8 @@ void StyleElementUtils::update_a_style_block(DOM::Element& style_element)
|
|||
|
||||
// FIXME: This is a bit awkward, as the spec doesn't actually tell us when to parse the CSS text,
|
||||
// so we just do it here and pass the parsed sheet to create_a_css_style_sheet().
|
||||
auto* sheet = parse_css_stylesheet(CSS::Parser::ParsingParams(style_element.document()), style_element.text_content().value_or(String {}));
|
||||
// AD-HOC: Are we supposed to use the document's URL for the stylesheet's location? Not doing it breaks things.
|
||||
auto* sheet = parse_css_stylesheet(CSS::Parser::ParsingParams(style_element.document()), style_element.text_content().value_or(String {}), style_element.document().url());
|
||||
if (!sheet)
|
||||
return;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue