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
parent 5cc371d54c
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

@@ -27,6 +27,13 @@ void StyleSheet::visit_edges(Cell::Visitor& visitor)
visitor.visit(m_media);
}
Optional<String> StyleSheet::href() const
{
if (m_location.has_value())
return m_location->to_string();
return {};
}
void StyleSheet::set_owner_node(DOM::Element* element)
{
m_owner_node = element;