Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: bd2bb29108bba91d95b1d75bc4f12d64c95901c8
      
https://github.com/WebKit/WebKit/commit/bd2bb29108bba91d95b1d75bc4f12d64c95901c8
  Author: Jer Noble <[email protected]>
  Date:   2026-03-15 (Sun, 15 Mar 2026)

  Changed paths:
    M Source/WebCore/Headers.cmake
    M Source/WebCore/Modules/system-preview/ARKitBadgeSystemImage.mm
    M Source/WebCore/WebCore.xcodeproj/project.pbxproj
    M Source/WebCore/accessibility/AXTextMarker.cpp
    M Source/WebCore/accessibility/cocoa/AccessibilityObjectCocoa.mm
    M Source/WebCore/css/parser/SizesAttributeParser.cpp
    M Source/WebCore/dom/DocumentMarkerController.cpp
    M Source/WebCore/dom/Element.cpp
    M Source/WebCore/dom/ImageOverlay.cpp
    M Source/WebCore/editing/Editor.cpp
    M Source/WebCore/editing/TextManipulationController.cpp
    M Source/WebCore/editing/cocoa/EditingHTMLConverter.mm
    M Source/WebCore/editing/cocoa/NodeHTMLConverter.mm
    M Source/WebCore/editing/cocoa/WebContentReaderCocoa.mm
    M Source/WebCore/html/HTMLAnchorElement.cpp
    M Source/WebCore/html/HTMLTextFormControlElement.cpp
    M Source/WebCore/html/NumberInputType.cpp
    M Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp
    M Source/WebCore/html/canvas/CanvasRenderingContext2DBase.h
    M Source/WebCore/html/canvas/OffscreenCanvasRenderingContext2D.cpp
    M Source/WebCore/inspector/InspectorOverlay.cpp
    M Source/WebCore/inspector/agents/InspectorCSSAgent.cpp
    M Source/WebCore/inspector/agents/page/PageTimelineAgent.cpp
    M Source/WebCore/layout/formattingContexts/inline/InlineContentBreaker.cpp
    M 
Source/WebCore/layout/formattingContexts/inline/InlineContentConstrainer.cpp
    M Source/WebCore/layout/formattingContexts/inline/InlineItemsBuilder.cpp
    M Source/WebCore/layout/formattingContexts/inline/InlineLevelBox.h
    M Source/WebCore/layout/formattingContexts/inline/InlineLevelBoxInlines.h
    M 
Source/WebCore/layout/formattingContexts/inline/display/InlineDisplayContentBuilder.cpp
    M Source/WebCore/layout/formattingContexts/inline/text/TextUtil.cpp
    M Source/WebCore/layout/formattingContexts/inline/text/TextUtil.h
    M Source/WebCore/layout/integration/LayoutIntegrationBoxGeometryUpdater.cpp
    M Source/WebCore/layout/integration/inline/InlineIteratorBoxModernPath.h
    M Source/WebCore/layout/integration/inline/InlineIteratorSVGTextBox.cpp
    M 
Source/WebCore/layout/integration/inline/LayoutIntegrationInlineContentBuilder.cpp
    M Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp
    M Source/WebCore/loader/cache/CachedImage.cpp
    M Source/WebCore/page/DebugPageOverlays.cpp
    M Source/WebCore/page/ios/FrameIOS.mm
    M Source/WebCore/page/linux/ResourceUsageOverlayLinux.cpp
    M Source/WebCore/platform/graphics/ComplexTextController.cpp
    M Source/WebCore/platform/graphics/Font.cpp
    M Source/WebCore/platform/graphics/Font.h
    M Source/WebCore/platform/graphics/FontCascade.cpp
    M Source/WebCore/platform/graphics/FontCascade.h
    A Source/WebCore/platform/graphics/FontCascadeEnums.h
    M Source/WebCore/platform/graphics/FontCascadeFonts.h
    M Source/WebCore/platform/graphics/FontCascadeInlines.h
    A Source/WebCore/platform/graphics/FontInlines.h
    M Source/WebCore/platform/graphics/TextMeasurementCache.h
    M Source/WebCore/platform/graphics/WidthIterator.cpp
    M Source/WebCore/platform/graphics/adwaita/ProgressBarAdwaita.cpp
    M Source/WebCore/platform/graphics/ca/PlatformCALayer.mm
    M Source/WebCore/platform/graphics/cairo/FontCairoHarfbuzzNG.cpp
    M Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp
    M Source/WebCore/platform/graphics/cocoa/FontCascadeCocoaInlines.h
    M Source/WebCore/platform/graphics/coretext/ComplexTextControllerCoreText.mm
    M Source/WebCore/platform/graphics/coretext/DrawGlyphsRecorder.cpp
    M Source/WebCore/platform/graphics/coretext/FontCascadeCoreText.cpp
    M Source/WebCore/platform/graphics/coretext/SimpleFontDataCoreText.cpp
    A Source/WebCore/platform/graphics/coretext/SimpleFontDataCoreText.h
    M Source/WebCore/platform/graphics/freetype/GlyphPageTreeNodeFreeType.cpp
    M 
Source/WebCore/platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp
    M Source/WebCore/platform/graphics/opentype/OpenTypeVerticalData.cpp
    M Source/WebCore/platform/graphics/skia/ComplexTextControllerSkia.cpp
    M Source/WebCore/platform/graphics/skia/FontCascadeSkia.cpp
    M Source/WebCore/platform/graphics/skia/FontPlatformDataSkia.cpp
    M Source/WebCore/platform/graphics/skia/SkiaHarfBuzzFont.cpp
    M Source/WebCore/platform/graphics/win/ComplexTextControllerUniscribe.cpp
    M Source/WebCore/platform/mock/MockRealtimeVideoSource.cpp
    M Source/WebCore/platform/text/TextSpacing.cpp
    M Source/WebCore/platform/text/TextSpacing.h
    M Source/WebCore/rendering/LegacyInlineFlowBox.cpp
    M Source/WebCore/rendering/RenderBlock.cpp
    M Source/WebCore/rendering/RenderCombineText.cpp
    M Source/WebCore/rendering/RenderEmbeddedObject.cpp
    M Source/WebCore/rendering/RenderFileUploadControl.cpp
    M Source/WebCore/rendering/RenderImage.cpp
    M Source/WebCore/rendering/RenderInline.cpp
    M Source/WebCore/rendering/RenderLayerBacking.cpp
    M Source/WebCore/rendering/RenderListBox.cpp
    M Source/WebCore/rendering/RenderReplaced.cpp
    M Source/WebCore/rendering/RenderText.cpp
    M Source/WebCore/rendering/TextBoxPainter.cpp
    M Source/WebCore/rendering/line/LineInlineHeaders.h
    M Source/WebCore/rendering/mathml/MathOperator.cpp
    M Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp
    M Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp
    M Source/WebCore/rendering/mathml/RenderMathMLScripts.cpp
    M Source/WebCore/rendering/mathml/RenderMathMLToken.cpp
    M Source/WebCore/rendering/style/RenderStyle.cpp
    M Source/WebCore/rendering/svg/RenderSVGInlineText.cpp
    M Source/WebCore/rendering/svg/RenderSVGText.cpp
    M Source/WebCore/rendering/svg/SVGInlineTextBox.cpp
    M Source/WebCore/rendering/svg/SVGTextBoxPainter.cpp
    M Source/WebCore/rendering/svg/SVGTextLayoutEngineBaseline.cpp
    M Source/WebCore/rendering/updating/RenderTreeBuilderFirstLetter.cpp
    M Source/WebCore/style/InlineTextBoxStyle.cpp
    M Source/WebCore/style/StyleBuilderCustom.h
    M Source/WebCore/style/StyleExtractorCustom.h
    M Source/WebCore/style/StyleInterpolationFunctions.h
    M Source/WebCore/style/StyleResolver.cpp
    M Source/WebCore/style/computed/StyleComputedStyleBase.cpp
    M Source/WebCore/style/values/primitives/StyleLengthResolution.cpp
    M Source/WebKit/WebProcess/WebCoreSupport/mac/WebPopupMenuMac.mm
    M Source/WebKit/WebProcess/WebCoreSupport/win/WebPopupMenuWin.cpp
    M Source/WebKit/WebProcess/WebPage/WebFoundTextRangeController.cpp
    M Source/WebKitLegacy/mac/DOM/DOM.mm
    M Source/WebKitLegacy/mac/WebCoreSupport/PopupMenuMac.mm
    M Tools/TestWebKitAPI/Tests/WebCore/ComplexTextController.cpp
    M Tools/TestWebKitAPI/Tests/WebCore/MonospaceFontTests.cpp
    M Tools/TestWebKitAPI/Tests/WebCore/cg/BifurcatedGraphicsContextTestsCG.cpp

  Log Message:
  -----------
  [Build Speed] Thin FontCascade.h and Font.h to reduce compile times
rdar://172148530
https://bugs.webkit.org/show_bug.cgi?id=309547

Reviewed by Ryosuke Niwa and BJ Burg.

FontCascade.h was the #24 most expensive header in WebCore by total parse
time (328 inclusions × 535ms average = 175s). This patch reduces that to
328 × 366ms = 120s, a ~32% improvement, moving it to #36.

Changes to FontCascade.h:
- Remove includes of FloatSegment.h, FontCascadeFonts.h, Path.h,
  TextSpacing.h, CheckedRef.h, HashSet.h, CharacterProperties.h,
  CharacterNames.h, and RuntimeApplicationChecksCocoa.h, replacing them
  with forward declarations where needed.
- Move inline method bodies (primaryFont, fallbackRangesAt, isFixedPitch,
  canTakeFixedPitchFastContentMeasuring, fontSelector, isPlatformFont,
  metricsOfPrimaryFont, tabWidth, widthForTextUsingSimplifiedMeasuring,
  widthOfSpaceString, treatAsSpace, treatAsZeroWidthSpace,
  treatAsZeroWidthSpaceInComplexScript, normalizeSpaces,
  isCharacterWhoseGlyphsShouldBeDeletedForTextRendering,
  isInvisibleReplacementObjectCharacter) to FontCascadeInlines.h.
- Extract CodePath and CustomFontNotReadyAction enums to a new
  lightweight FontCascadeEnums.h so downstream headers can reference
  these types without pulling in all of FontCascade.h.
- Move GlyphGeometryCacheEntry out of FontCascadeFonts to namespace
  scope so it can be forward-declared in FontCascade.h.

Changes to Font.h:
- Remove includes of GlyphPage.h, Hasher.h, StringHash.h,
  OpenTypeMathData.h, and OpenTypeVerticalData.h.
- Move inline method bodies (boundsForGlyph, boundsForGlyphs,
  widthForGlyph, verticalData) to a new FontInlines.h.

~90 .cpp/.mm files are updated to add explicit includes for headers they
previously obtained transitively.

Tests: Tools/TestWebKitAPI/Tests/WebCore/ComplexTextController.cpp
       Tools/TestWebKitAPI/Tests/WebCore/MonospaceFontTests.cpp
       Tools/TestWebKitAPI/Tests/WebCore/cg/BifurcatedGraphicsContextTestsCG.cpp

* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/accessibility/AXTextMarker.cpp:
* Source/WebCore/accessibility/cocoa/AccessibilityObjectCocoa.mm:
* Source/WebCore/css/parser/SizesAttributeParser.cpp:
* Source/WebCore/dom/DocumentMarkerController.cpp:
* Source/WebCore/dom/ImageOverlay.cpp:
* Source/WebCore/editing/Editor.cpp:
* Source/WebCore/editing/TextManipulationController.cpp:
* Source/WebCore/editing/cocoa/EditingHTMLConverter.mm:
* Source/WebCore/editing/cocoa/NodeHTMLConverter.mm:
* Source/WebCore/editing/cocoa/WebContentReaderCocoa.mm:
* Source/WebCore/html/HTMLAnchorElement.cpp:
* Source/WebCore/html/HTMLTextFormControlElement.cpp:
* Source/WebCore/html/NumberInputType.cpp:
* Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp:
* Source/WebCore/html/canvas/CanvasRenderingContext2DBase.h:
* Source/WebCore/html/canvas/OffscreenCanvasRenderingContext2D.cpp:
* Source/WebCore/inspector/InspectorOverlay.cpp:
* Source/WebCore/inspector/agents/InspectorCSSAgent.cpp:
* Source/WebCore/layout/formattingContexts/inline/InlineContentBreaker.cpp:
* Source/WebCore/layout/formattingContexts/inline/InlineContentConstrainer.cpp:
* Source/WebCore/layout/formattingContexts/inline/InlineItemsBuilder.cpp:
* Source/WebCore/layout/formattingContexts/inline/InlineLevelBox.h:
* Source/WebCore/layout/formattingContexts/inline/InlineLevelBoxInlines.h:
* 
Source/WebCore/layout/formattingContexts/inline/display/InlineDisplayContentBuilder.cpp:
* Source/WebCore/layout/formattingContexts/inline/text/TextUtil.cpp:
* Source/WebCore/layout/formattingContexts/inline/text/TextUtil.h:
* Source/WebCore/layout/integration/LayoutIntegrationBoxGeometryUpdater.cpp:
* Source/WebCore/layout/integration/inline/InlineIteratorBoxModernPath.h:
* Source/WebCore/layout/integration/inline/InlineIteratorSVGTextBox.cpp:
* 
Source/WebCore/layout/integration/inline/LayoutIntegrationInlineContentBuilder.cpp:
* Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp:
* Source/WebCore/loader/cache/CachedImage.cpp:
* Source/WebCore/page/DebugPageOverlays.cpp:
* Source/WebCore/platform/graphics/ComplexTextController.cpp:
* Source/WebCore/platform/graphics/Font.cpp:
* Source/WebCore/platform/graphics/Font.h:
(WebCore::Font::ctFont const):
(WebCore::Font::verticalData const): Deleted.
(WebCore::Font::boundsForGlyph const): Deleted.
(WebCore::Font::boundsForGlyphs const): Deleted.
(WebCore::Font::widthForGlyph const): Deleted.
* Source/WebCore/platform/graphics/FontCascade.cpp:
(WebCore::FontCascade::widthForSimpleTextSlow const):
* Source/WebCore/platform/graphics/FontCascade.h:
(WebCore::FontCascade::primaryFont const): Deleted.
(WebCore::FontCascade::fallbackRangesAt const): Deleted.
(WebCore::FontCascade::isFixedPitch const): Deleted.
(WebCore::FontCascade::canTakeFixedPitchFastContentMeasuring const): Deleted.
(WebCore::FontCascade::fontSelector const): Deleted.
(WebCore::FontCascade::tabWidth const): Deleted.
(WebCore::FontCascade::widthForTextUsingSimplifiedMeasuring const): Deleted.
* Source/WebCore/platform/graphics/FontCascadeEnums.h: Copied from 
Source/WebKit/WebProcess/WebCoreSupport/mac/WebPopupMenuMac.mm.
* Source/WebCore/platform/graphics/FontCascadeFonts.h:
* Source/WebCore/platform/graphics/FontCascadeInlines.h:
(WebCore::FontCascade::primaryFont const):
(WebCore::FontCascade::fallbackRangesAt const):
(WebCore::FontCascade::isFixedPitch const):
(WebCore::FontCascade::canTakeFixedPitchFastContentMeasuring const):
(WebCore::FontCascade::fontSelector const):
(WebCore::FontCascade::tabWidth const):
(WebCore::FontCascade::widthForTextUsingSimplifiedMeasuring const):
(WebCore::FontCascade::isPlatformFont const):
(WebCore::FontCascade::metricsOfPrimaryFont const):
(WebCore::FontCascade::isInvisibleReplacementObjectCharacter):
(WebCore::FontCascade::treatAsSpace):
(WebCore::FontCascade::isCharacterWhoseGlyphsShouldBeDeletedForTextRendering):
(WebCore::FontCascade::treatAsZeroWidthSpace):
(WebCore::FontCascade::treatAsZeroWidthSpaceInComplexScript):
(WebCore::FontCascade::normalizeSpaces):
(WebCore::FontCascade::widthOfSpaceString const):
* Source/WebCore/platform/graphics/FontInlines.h: Added.
(WebCore::Font::verticalData const):
(WebCore::Font::boundsForGlyph const):
(WebCore::Font::boundsForGlyphs const):
(WebCore::Font::widthForGlyph const):
* Source/WebCore/platform/graphics/TextMeasurementCache.h:
* Source/WebCore/platform/graphics/WidthIterator.cpp:
* Source/WebCore/platform/graphics/ca/PlatformCALayer.mm:
* Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp:
* Source/WebCore/platform/graphics/coretext/ComplexTextControllerCoreText.mm:
* Source/WebCore/platform/graphics/coretext/DrawGlyphsRecorder.cpp:
* Source/WebCore/platform/graphics/coretext/FontCascadeCoreText.cpp:
* Source/WebCore/platform/graphics/opentype/OpenTypeVerticalData.cpp:
* Source/WebCore/platform/mock/MockRealtimeVideoSource.cpp:
* Source/WebCore/platform/text/TextSpacing.cpp:
* Source/WebCore/platform/text/TextSpacing.h:
* Source/WebCore/rendering/LegacyInlineFlowBox.cpp:
* Source/WebCore/rendering/RenderBlock.cpp:
* Source/WebCore/rendering/RenderCombineText.cpp:
* Source/WebCore/rendering/RenderEmbeddedObject.cpp:
* Source/WebCore/rendering/RenderFileUploadControl.cpp:
* Source/WebCore/rendering/RenderImage.cpp:
* Source/WebCore/rendering/RenderInline.cpp:
* Source/WebCore/rendering/RenderLayerBacking.cpp:
* Source/WebCore/rendering/RenderListBox.cpp:
* Source/WebCore/rendering/RenderReplaced.cpp:
* Source/WebCore/rendering/RenderText.cpp:
* Source/WebCore/rendering/TextBoxPainter.cpp:
* Source/WebCore/rendering/line/LineInlineHeaders.h:
* Source/WebCore/rendering/mathml/MathOperator.cpp:
* Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp:
* Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp:
* Source/WebCore/rendering/mathml/RenderMathMLScripts.cpp:
* Source/WebCore/rendering/mathml/RenderMathMLToken.cpp:
* Source/WebCore/rendering/style/RenderStyle.cpp:
* Source/WebCore/rendering/svg/RenderSVGInlineText.cpp:
* Source/WebCore/rendering/svg/RenderSVGText.cpp:
* Source/WebCore/rendering/svg/SVGInlineTextBox.cpp:
* Source/WebCore/rendering/svg/SVGTextBoxPainter.cpp:
* Source/WebCore/rendering/svg/SVGTextLayoutEngineBaseline.cpp:
* Source/WebCore/rendering/updating/RenderTreeBuilderFirstLetter.cpp:
* Source/WebCore/style/InlineTextBoxStyle.cpp:
* Source/WebCore/style/StyleBuilderCustom.h:
* Source/WebCore/style/StyleExtractorCustom.h:
* Source/WebCore/style/StyleInterpolationFunctions.h:
* Source/WebCore/style/StyleResolver.cpp:
* Source/WebCore/style/computed/StyleComputedStyleBase.cpp:
* Source/WebCore/style/values/primitives/StyleLengthResolution.cpp:
* Source/WebKit/WebProcess/WebCoreSupport/mac/WebPopupMenuMac.mm:
* Source/WebKitLegacy/mac/DOM/DOM.mm:
* Source/WebKitLegacy/mac/WebCoreSupport/PopupMenuMac.mm:
* Tools/TestWebKitAPI/Tests/WebCore/ComplexTextController.cpp:
* Tools/TestWebKitAPI/Tests/WebCore/MonospaceFontTests.cpp:
* Tools/TestWebKitAPI/Tests/WebCore/cg/BifurcatedGraphicsContextTestsCG.cpp:

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



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

Reply via email to