Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 59d0c6060bde2e375f299e379872bde8534e99dd
      
https://github.com/WebKit/WebKit/commit/59d0c6060bde2e375f299e379872bde8534e99dd
  Author: Chris Dumez <[email protected]>
  Date:   2026-04-03 (Fri, 03 Apr 2026)

  Changed paths:
    M Source/WebCore/css/SelectorFilter.cpp

  Log Message:
  -----------
  SelectorFilter::initializeParentStack() should not defeat inline vector 
storage
https://bugs.webkit.org/show_bug.cgi?id=311411

Reviewed by Anne van Kesteren.

m_parentStack is a Vector with inline capacity of 20. The previous code called
reserveCapacity(capacity() + ancestors.size()), which always added 20 (the 
inline
capacity) to the ancestor count, forcing a heap allocation even for shallow DOM 
trees
that would fit entirely in inline storage. Just reserve ancestors.size() 
instead, which
is a no-op when the count fits within the existing inline capacity.

* Source/WebCore/css/SelectorFilter.cpp:
(WebCore::SelectorFilter::initializeParentStack):

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



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

Reply via email to