mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 18:17:22 +02:00
LibWeb/CSS: Move property code from CSSStyleDeclaration to *Properties
CSSStyleDeclaration is a base class that's used by various collections of style properties or descriptors. This commit moves all style-property-related code into CSSStyleProperties, where it belongs. As noted in the previous commit, we also apply the CSSStyleProperties prototype now.
This commit is contained in:
Notes:
github-actions[bot]
2025-03-19 13:54:14 +00:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/LadybirdBrowser/ladybird/commit/a28197669a9 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3983
@@ -97,8 +97,8 @@ protected:
|
||||
GeneratedCSSStyleProperties() = default;
|
||||
virtual ~GeneratedCSSStyleProperties() = default;
|
||||
|
||||
virtual CSS::CSSStyleDeclaration& generated_style_properties_to_css_style_declaration() = 0;
|
||||
CSS::CSSStyleDeclaration const& generated_style_properties_to_css_style_declaration() const { return const_cast<GeneratedCSSStyleProperties&>(*this).generated_style_properties_to_css_style_declaration(); }
|
||||
virtual CSS::CSSStyleProperties& generated_style_properties_to_css_style_properties() = 0;
|
||||
CSS::CSSStyleProperties const& generated_style_properties_to_css_style_properties() const { return const_cast<GeneratedCSSStyleProperties&>(*this).generated_style_properties_to_css_style_properties(); }
|
||||
}; // class GeneratedCSSStyleProperties
|
||||
|
||||
} // namespace Web::Bindings
|
||||
@@ -114,7 +114,7 @@ ErrorOr<void> generate_implementation_file(JsonObject& properties, Core::File& f
|
||||
SourceGenerator generator { builder };
|
||||
|
||||
generator.append(R"~~~(
|
||||
#include <LibWeb/CSS/CSSStyleDeclaration.h>
|
||||
#include <LibWeb/CSS/CSSStyleProperties.h>
|
||||
#include <LibWeb/CSS/GeneratedCSSStyleProperties.h>
|
||||
#include <LibWeb/WebIDL/ExceptionOr.h>
|
||||
|
||||
@@ -131,12 +131,12 @@ namespace Web::Bindings {
|
||||
definition_generator.append(R"~~~(
|
||||
WebIDL::ExceptionOr<void> GeneratedCSSStyleProperties::set_@name:acceptable_cpp@(StringView value)
|
||||
{
|
||||
return generated_style_properties_to_css_style_declaration().set_property("@name@"sv, value, ""sv);
|
||||
return generated_style_properties_to_css_style_properties().set_property("@name@"sv, value, ""sv);
|
||||
}
|
||||
|
||||
String GeneratedCSSStyleProperties::@name:acceptable_cpp@() const
|
||||
{
|
||||
return generated_style_properties_to_css_style_declaration().get_property_value("@name@"sv);
|
||||
return generated_style_properties_to_css_style_properties().get_property_value("@name@"sv);
|
||||
}
|
||||
)~~~");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user