LibWeb/CSS: Store CSSStyleSheet location as a URL

We already have a URL when we construct these, and we want a URL later,
so avoid serializing and re-parsing it.
This commit is contained in:
Sam Atkins 2025-04-08 13:18:56 +01:00 committed by Tim Ledbetter
commit da1ff1ba40
Notes: github-actions[bot] 2025-04-09 17:48:14 +00:00
7 changed files with 20 additions and 12 deletions

View file

@ -834,8 +834,8 @@ static void gather_style_sheets(Vector<Web::CSS::StyleSheetIdentifier>& results,
}
if (valid) {
if (auto location = sheet.location(); location.has_value())
identifier.url = location.release_value();
if (auto sheet_url = sheet.href(); sheet_url.has_value())
identifier.url = sheet_url.release_value();
identifier.rule_count = sheet.rules().length();
results.append(move(identifier));