Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 231a8d1265f65af84aa8aab98ddc6a46bf78c769
      
https://github.com/WebKit/WebKit/commit/231a8d1265f65af84aa8aab98ddc6a46bf78c769
  Author: Nipun Shukla <[email protected]>
  Date:   2026-01-31 (Sat, 31 Jan 2026)

  Changed paths:
    M Source/WebCore/rendering/TextPainter.cpp

  Log Message:
  -----------
  REGRESSION(305254@main): MotionMark design suite regressed
https://bugs.webkit.org/show_bug.cgi?id=306546
rdar://168966510

Reviewed by Simon Fraser.

305254@main added a GraphicsContextStateSaver around glyph display list
replay to fix font state contamination. This caused a regression in MotionMark
because the save/restore was applied to every cached text render, even for
fonts that never modify graphics state.

This change makes the state save conditional by checking whether color or stroke
change at replay time. For most fonts and cases, this returns false,
indicating the display list contains only safe operations so needsStateSave is
false and GraphicsContextStateSaver becomes a no-op. For fonts with
state-modifying operations, needsStateSave is true and state is properly 
saved/restored.

This behavior is tested by ensuring we do not regress tests added in 305254@main
such as fast/text/glyph-display-lists/colr-glyph-state-leak.html

* Source/WebCore/rendering/TextPainter.cpp:
(WebCore::TextPainter::paintTextOrEmphasisMarks):

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



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

Reply via email to