mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-15 20:49:41 +00:00
When setting style to a CSSStyleValue we need to convert it to a StyleValue. If we already have one, we might as well use it avoid the work of serialization and re-parsing. I realised I misunderstood what "constructed from a USVString" means, so I've adjusted based on that. It does raise a question on what the source USVString is if that string resulted in multiple CSSStyleValues being created - see the linked issue.
19 lines
500 B
C++
19 lines
500 B
C++
/*
|
|
* Copyright (c) 2025, Sam Atkins <sam@ladybird.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include "AbstractImageStyleValue.h"
|
|
#include <LibWeb/CSS/CSSImageValue.h>
|
|
|
|
namespace Web::CSS {
|
|
|
|
// https://drafts.css-houdini.org/css-typed-om-1/#reify-stylevalue
|
|
GC::Ref<CSSStyleValue> AbstractImageStyleValue::reify(JS::Realm& realm, FlyString const&) const
|
|
{
|
|
// AD-HOC: There's no spec description of how to reify as a CSSImageValue.
|
|
return CSSImageValue::create(realm, *this);
|
|
}
|
|
|
|
}
|