From 1cb15261783d7a5900f9dd0f7ab6e0e3ea6c80ab Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Fri, 2 May 2025 12:21:17 +0100 Subject: [PATCH] LibWeb/CSS: Remove document-URL hack from create_a_style_sheet() We no longer need this, because we don't complete URLs during parsing, and the location is set elsewhere when needed. --- Libraries/LibWeb/CSS/StyleSheetList.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Libraries/LibWeb/CSS/StyleSheetList.cpp b/Libraries/LibWeb/CSS/StyleSheetList.cpp index 07b1f1e3d14..4d2a09ca86f 100644 --- a/Libraries/LibWeb/CSS/StyleSheetList.cpp +++ b/Libraries/LibWeb/CSS/StyleSheetList.cpp @@ -66,9 +66,7 @@ GC::Ref StyleSheetList::create_a_css_style_sheet(String const& cs { // 1. Create a new CSS style sheet object and set its properties as specified. // AD-HOC: The spec never tells us when to parse this style sheet, but the most logical place is here. - // AD-HOC: Are we supposed to use the document's URL for the stylesheet's location during parsing? Not doing it breaks things. - auto location_url = location.value_or(document().url()); - auto sheet = parse_css_stylesheet(Parser::ParsingParams { document() }, css_text, location_url); + auto sheet = parse_css_stylesheet(Parser::ParsingParams { document() }, css_text, location); sheet->set_parent_css_style_sheet(parent_style_sheet); sheet->set_owner_css_rule(owner_rule);