LibWeb: Move and rename CSSStyleValue to StyleValues/StyleValue.{h,cpp}

This reverts 0e3487b9ab.

Back when I made that change, I thought we could make our StyleValue
classes match the typed-om definitions directly. However, they have
different requirements. Typed-om types need to be mutable and GCed,
whereas StyleValues are immutable and ideally wouldn't require a JS VM.

While I was already making such a cataclysmic change, I've moved it into
the StyleValues directory, because it *not* being there has bothered me
for a long time. 😅
This commit is contained in:
Sam Atkins 2025-08-08 10:11:51 +01:00 committed by Tim Ledbetter
commit c57975c9fd
Notes: github-actions[bot] 2025-08-08 14:20:54 +00:00
167 changed files with 989 additions and 990 deletions

View file

@ -43,7 +43,7 @@ void ImageStyleValue::visit_edges(JS::Cell::Visitor& visitor) const
{
Base::visit_edges(visitor);
// FIXME: visit_edges in non-GC allocated classes is confusing pattern.
// Consider making CSSStyleValue to be GC allocated instead.
// Consider making StyleValue to be GC allocated instead.
visitor.visit(m_resource_request);
visitor.visit(m_style_sheet);
visitor.visit(m_timer);
@ -122,7 +122,7 @@ String ImageStyleValue::to_string(SerializationMode) const
return m_url.to_string();
}
bool ImageStyleValue::equals(CSSStyleValue const& other) const
bool ImageStyleValue::equals(StyleValue const& other) const
{
if (type() != other.type())
return false;
@ -186,7 +186,7 @@ void ImageStyleValue::set_style_sheet(GC::Ptr<CSSStyleSheet> style_sheet)
m_style_sheet = style_sheet;
}
ValueComparingNonnullRefPtr<CSSStyleValue const> ImageStyleValue::absolutized(CSSPixelRect const&, Length::FontMetrics const&, Length::FontMetrics const&) const
ValueComparingNonnullRefPtr<StyleValue const> ImageStyleValue::absolutized(CSSPixelRect const&, Length::FontMetrics const&, Length::FontMetrics const&) const
{
if (m_url.url().is_empty())
return *this;