[webkit-changes] [WebKit/WebKit] 31aadb: Rename widthForSimpleText, floatWidthForSimpleText...

Vitor Roriz noreply at github.com
Tue Mar 26 17:01:18 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 31aadb040e324bd558d1b40cf825e1f7d6d153c2
      https://github.com/WebKit/WebKit/commit/31aadb040e324bd558d1b40cf825e1f7d6d153c2
  Author: Vitor Roriz <vitor.roriz at apple.com>
  Date:   2024-03-26 (Tue, 26 Mar 2024)

  Changed paths:
    M Source/WebCore/layout/formattingContexts/inline/text/TextUtil.cpp
    M Source/WebCore/platform/graphics/FontCascade.cpp
    M Source/WebCore/platform/graphics/FontCascade.h
    M Source/WebCore/platform/graphics/WidthIterator.cpp
    M Tools/TestWebKitAPI/Tests/WebCore/MonospaceFontTests.cpp

  Log Message:
  -----------
  Rename widthForSimpleText, floatWidthForSimpleText, floatWidthForComplexText
https://bugs.webkit.org/show_bug.cgi?id=271729
rdar://problem/125440731

Reviewed by Alan Baradlay.

We currently have 3 functions for width calculation named:

1. widthForSimpleText
2. floatWidthForSimpleText
3. floatWidthForComplexText

These functions all do something similar but their names are a bit confusing, specially by the different meanings of the word "simple" here.
They scale in level of complexity:

1. widthForSimpleText: does not use any width iterator, but has to pass "computeCanUseSimplifiedTextMeasuring" to be used.
2. floatWidthForSimpleText: It is used when we have a CodePath::Simple (calculated on FontCascade). It uses iterator WidthIterator
3. floatWidthForComplexText: It is used when we have a CodePath::Complex (calculated on FontCascade). It uses the ComplexTextControler, a more complete and slower iterator (supports kerning and ligaments, for example, which are currently not supported by WidthIterator).

We are renaming them to:

1. widthForSimpleText -> widthForTextUsingSimplifiedMeasuring
2. floatWidthForSimpleText -> widthForTextUsingWidthIterator
3. floatWidthForComplexText -> floatWidthForTextUsingComplexTextController

* Source/WebCore/layout/formattingContexts/inline/text/TextUtil.cpp:
(WebCore::Layout::TextUtil::width):
* Source/WebCore/platform/graphics/FontCascade.cpp:
(WebCore::FontCascade::width const):
(WebCore::FontCascade::widthForTextUsingWidthIterator const):
(WebCore::FontCascade::widthForTextUsingComplexTextController const):
(WebCore::FontCascade::offsetForPositionForSimpleText const):
(WebCore::FontCascade::floatWidthForSimpleText const): Deleted.
(WebCore::FontCascade::floatWidthForComplexText const): Deleted.
* Source/WebCore/platform/graphics/FontCascade.h:
(WebCore::FontCascade::widthForTextUsingSimplifiedMeasuring const):
(WebCore::FontCascade::widthForSimpleText const): Deleted.
* Source/WebCore/platform/graphics/WidthIterator.cpp:
(WebCore::WidthIterator::advanceInternal):
* Tools/TestWebKitAPI/Tests/WebCore/MonospaceFontTests.cpp:
(TestWebKitAPI::TEST):

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



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


More information about the webkit-changes mailing list