mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-03 07:07:23 +00:00
LibIDL: Allow overwriting the generated attribute callback name
This will allow the CSSStyleDeclaration IDL attribute generator to implement it's own C++ acceptable identifier sanitization and deduplication.
This commit is contained in:
committed by
Andreas Kling
parent
300f212044
commit
d95ae629ee
@@ -326,8 +326,16 @@ void Parser::parse_attribute(HashMap<ByteString, ByteString>& extended_attribute
|
||||
|
||||
assert_specific(';');
|
||||
|
||||
auto getter_callback_name = ByteString::formatted("{}_getter", name.to_snakecase());
|
||||
auto setter_callback_name = ByteString::formatted("{}_setter", name.to_snakecase());
|
||||
ByteString attribute_callback_name;
|
||||
auto custom_callback_name = extended_attributes.find("AttributeCallbackName");
|
||||
if (custom_callback_name != extended_attributes.end()) {
|
||||
attribute_callback_name = custom_callback_name->value;
|
||||
} else {
|
||||
attribute_callback_name = name.to_snakecase().replace("-"sv, "_"sv, ReplaceMode::All);
|
||||
}
|
||||
|
||||
auto getter_callback_name = ByteString::formatted("{}_getter", attribute_callback_name);
|
||||
auto setter_callback_name = ByteString::formatted("{}_setter", attribute_callback_name);
|
||||
|
||||
Attribute attribute {
|
||||
inherit,
|
||||
|
||||
Reference in New Issue
Block a user