Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: ecccac5a57413edab61015471eed14ba65dcb41f
      
https://github.com/WebKit/WebKit/commit/ecccac5a57413edab61015471eed14ba65dcb41f
  Author: Nikolas Zimmermann <[email protected]>
  Date:   2026-08-20 (Thu, 20 Aug 2026)

  Changed paths:
    M Source/WebCore/style/StyleTreeResolver.cpp

  Log Message:
  -----------
  Skip anchor-positioning bookkeeping when there is no anchor state
https://bugs.webkit.org/show_bug.cgi?id=322062

Reviewed by Kiet Ho.

updateAnchorPositioningState() runs for every styled element and
does extra work that can be avoided in the common case, where
there is no anchor state present. Benchmarking MotionMark/Suits
under LBSE - which uses no anchor positioning - showed up
unnecessary hash lookups under high complexity (8000+ shapes).

Only bother performing updates involving ::before/::after styles
if they are present - saving two hash lookups per element.
Furthermore only attempt to look up the element in the
anchor-positioned state map, when the map is not empty, this
is purely cosmetic.

Covered by existing tests.

* Source/WebCore/style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::updateAnchorPositioningState):

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



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

Reply via email to