Skip to content

Commit

Permalink
fix: generate atomic string for css properties.
Browse files Browse the repository at this point in the history
  • Loading branch information
andycall committed Nov 18, 2024
1 parent ee43fb1 commit 6131f5e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 0 additions & 1 deletion bridge/core/css/parser/css_selector_parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1766,7 +1766,6 @@ tcb::span<CSSSelector> CSSSelectorParser::ConsumeCompoundSelector(CSSParserToken
AtomicString namespace_prefix;
AtomicString element_name;
const bool has_q_name = ConsumeName(stream, element_name, namespace_prefix);
element_name = element_name.LowerASCII();

// A tag name is not valid following a pseudo-element. This can happen for
// e.g. :::part(x):is(div).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ const char* <%= class_name %>::GetPropertyName() const {
return "<%= exposed_property.name %>";
}

const AtomicString& <%= class_name %>::GetPropertyNameAtomicString() const {
thread_local static AtomicString name("<%= exposed_property.name %>");
return name;
}

const char* <%= class_name %>::GetJSPropertyName() const {
return "<%= lowerCamelCase(exposed_property.name) %>";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ class <%= class_name %> final : public <%= property.superclass %> {
public:
constexpr <%= class_name %>() : <%= property.superclass %>(<%= ctor_args.join(', ') %> ) { }
const char* GetPropertyName() const override;
const AtomicString& GetPropertyNameAtomicString() const override;
const char* GetJSPropertyName() const override;
<% if(property.alternative) { %>
CSSPropertyID GetAlternative() const override {
Expand Down

0 comments on commit 6131f5e

Please sign in to comment.