ladybird/Libraries/LibWeb/CSS/CSSFunctionDescriptors.cpp
Andreas Kling 388ec003ca LibWeb: Take UTF-16 names in CSS property APIs
Move the remaining CSSStyleDeclaration property-name APIs to
Utf16FlyString. This lets CSSOM binding and generated accessor code
pass JS property names without first constructing FlyString values.

Keep internal custom-property and descriptor storage unchanged for now.
Those remaining FlyString conversions are at storage boundaries that
will be migrated in follow-up commits.
2026-06-09 11:48:02 +02:00

38 lines
1 KiB
C++

/*
* Copyright (c) 2026, Callum Law <callumlaw1709@outlook.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include "CSSFunctionDescriptors.h"
#include <LibWeb/Bindings/CSSFunctionDescriptors.h>
#include <LibWeb/Bindings/Intrinsics.h>
namespace Web::CSS {
GC_DEFINE_ALLOCATOR(CSSFunctionDescriptors);
GC::Ref<CSSFunctionDescriptors> CSSFunctionDescriptors::create(JS::Realm& realm, Vector<Descriptor> descriptors)
{
return realm.create<CSSFunctionDescriptors>(realm, move(descriptors));
}
void CSSFunctionDescriptors::initialize(JS::Realm& realm)
{
WEB_SET_PROTOTYPE_FOR_INTERFACE(CSSFunctionDescriptors);
Base::initialize(realm);
}
// https://drafts.csswg.org/css-mixins-1/#dom-cssfunctiondescriptors-result
String CSSFunctionDescriptors::result() const
{
return get_property_value("result"_utf16_fly_string);
}
// https://drafts.csswg.org/css-mixins-1/#dom-cssfunctiondescriptors-result
WebIDL::ExceptionOr<void> CSSFunctionDescriptors::set_result(StringView value)
{
return set_property("result"_utf16_fly_string, value, ""sv);
}
}