mirror of
https://github.com/zebrajr/ladybird.git
synced 2025-12-06 00:19:53 +01: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
|
|
@ -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…
Reference in New Issue
Block a user