Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: f6d1f488ddcb07a5f54796920b5a5c4358fef24c
      
https://github.com/WebKit/WebKit/commit/f6d1f488ddcb07a5f54796920b5a5c4358fef24c
  Author: Chris Dumez <[email protected]>
  Date:   2026-05-04 (Mon, 04 May 2026)

  Changed paths:
    M Source/WTF/wtf/text/StringImpl.h
    M Source/WebCore/css/scripts/process-css-properties.py
    M Source/WebCore/css/scripts/process-css-values.py

  Log Message:
  -----------
  Use StaticStringImpl for CSS property names and value keywords to avoid heap 
allocations
https://bugs.webkit.org/show_bug.cgi?id=313722

Reviewed by Sam Weinig.

Similarly to what was done for EventNames in 312329@main, use
static constexpr StaticStringImpl with the StringAtom flag for CSS property
names (~589 strings) and CSS value keywords (~2 x 1301 strings). When 
nameString()
constructs an AtomString from a StaticStringImpl with StringAtom, the isAtom()
fast path returns the static pointer directly, avoiding heap allocation and
runtime hash computation.

Also added a literal() getter on StaticStringImpl to cleanly convert back to
ASCIILiteral, used by nameLiteral() functions.

* Source/WTF/wtf/text/StringImpl.h:
(WTF::StringImpl::StaticStringImpl::literal const):
* Source/WebCore/css/scripts/process-css-properties.py:
(GenerateCSSPropertyNames._generate_css_property_names_gperf_prelude):
(GenerateCSSPropertyNames):
* Source/WebCore/css/scripts/process-css-values.py:
(GenerationContext._generate_css_value_keywords_gperf_heading):
(GenerationContext):

Canonical link: https://commits.webkit.org/312580@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to