Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: a5f3b98ac0cf172b86b5191339d8d21ecd21ace2
      
https://github.com/WebKit/WebKit/commit/a5f3b98ac0cf172b86b5191339d8d21ecd21ace2
  Author: Vitor Roriz <[email protected]>
  Date:   2026-02-25 (Wed, 25 Feb 2026)

  Changed paths:
    M Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp
    M Source/WebCore/platform/graphics/FontCascade.cpp
    M Source/WebCore/platform/graphics/FontCascade.h
    M Source/WebCore/platform/graphics/FontCascadeFonts.cpp
    M Source/WebCore/platform/graphics/FontCascadeFonts.h
    M Source/WebCore/platform/graphics/TextMeasurementCache.h

  Log Message:
  -----------
  FontCascade::layoutText: cache TextShapingResult and improve 
TextMeasurementCache 'tab' rejection
https://bugs.webkit.org/show_bug.cgi?id=308653
rdar://152873937

Reviewed by Sammy Gill.

We now intercept FontCascade::layoutText for full-range, non-emphasis calls
and check the ShapedTextCache before shaping.

TextMeasurementCache now checks for actual tab characters in the run text 
instead
of rejecting all runs where allowTabs() is true. This allows caching for content
in which allowTabs is true but runs don't necessarily contain tabs

This is important because it would have made us reject caching content that,
for example, has 'white-space: pre' but no actual tab character (0x9) in the 
run.
This can be found, for example, in the style of web editors.

* Source/WebCore/platform/graphics/FontCascade.cpp:
(WebCore::FontCascade::layoutText const):
* Source/WebCore/platform/graphics/FontCascade.h:
* Source/WebCore/platform/graphics/FontCascadeFonts.cpp:
(WebCore::FontCascadeFonts::getOrCreateCachedShapedText):
* Source/WebCore/platform/graphics/FontCascadeFonts.h:
* Source/WebCore/platform/graphics/TextMeasurementCache.h:
(WebCore::TextMeasurementCache::add):

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



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

Reply via email to