Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 07c0febdf78a2b510900595f78894e3b8b685bbf
https://github.com/WebKit/WebKit/commit/07c0febdf78a2b510900595f78894e3b8b685bbf
Author: Antti Koivisto <[email protected]>
Date: 2026-10-08 (Thu, 08 Oct 2026)
Changed paths:
M Source/WebCore/layout/integration/inline/InlineIteratorSVGTextBox.cpp
M Source/WebCore/layout/integration/inline/InlineIteratorSVGTextBox.h
M Source/WebCore/layout/integration/inline/LayoutIntegrationLineLayout.cpp
M Source/WebCore/layout/integration/inline/LayoutIntegrationLineLayout.h
M Source/WebCore/rendering/svg/RenderSVGText.cpp
M Source/WebCore/rendering/svg/SVGTextBoxPainter.cpp
M Source/WebCore/rendering/svg/SVGTextBoxPainter.h
M Source/WebCore/rendering/svg/SVGTextChunk.cpp
M Source/WebCore/rendering/svg/SVGTextChunk.h
M Source/WebCore/rendering/svg/SVGTextChunkBuilder.cpp
M Source/WebCore/rendering/svg/SVGTextChunkBuilder.h
M Source/WebCore/rendering/svg/SVGTextLayoutEngine.cpp
M Source/WebCore/rendering/svg/SVGTextLayoutEngine.h
Log Message:
-----------
[IFC][SVG text] Optimize SVGTextLayoutEngine for IFC
https://bugs.webkit.org/show_bug.cgi?id=326776
rdar://problem/189484187
Reviewed by Alan Baradlay.
IFC uses indexed vectors instead of linked lists. We can utilize this in SVG
text code.
With IFC, SVGTextLayoutEngine collected fragments in a hash map keyed by
renderer and box start, walked the boxes
through InlineIterator, and LineLayout::applySVGTextFragments looked every box
up in the map again.
Walk the display boxes by index and write the fragments directly to the per box
storage in InlineContent.
The legacy path keeps the fragment map.
* Source/WebCore/layout/integration/inline/InlineIteratorSVGTextBox.cpp:
(WebCore::InlineIterator::SVGTextBox::calculateBoundariesIncludingSVGTransform):
* Source/WebCore/layout/integration/inline/InlineIteratorSVGTextBox.h:
* Source/WebCore/layout/integration/inline/LayoutIntegrationLineLayout.cpp:
(WebCore::LayoutIntegration::LineLayout::resetSVGTextFragments):
Clear the per box fragments before layout. A box without fragments could keep
stale ones.
(WebCore::LayoutIntegration::LineLayout::applySVGTextFragments):
* Source/WebCore/layout/integration/inline/LayoutIntegrationLineLayout.h:
* Source/WebCore/rendering/svg/RenderSVGText.cpp:
(WebCore::layoutCharactersInDisplayBoxes):
(WebCore::RenderSVGText::computePerCharacterLayoutInformation):
(WebCore::RenderSVGText::layoutCharactersInTextBoxes):
* Source/WebCore/rendering/svg/SVGTextBoxPainter.cpp:
(WebCore::SVGTextBoxPainter<TextBoxPath>::SVGTextBoxPainter):
Look up the parent renderer once.
* Source/WebCore/rendering/svg/SVGTextBoxPainter.h:
* Source/WebCore/rendering/svg/SVGTextChunk.cpp:
(WebCore::SVGTextChunk::SVGTextChunk):
* Source/WebCore/rendering/svg/SVGTextChunk.h:
* Source/WebCore/rendering/svg/SVGTextChunkBuilder.cpp:
(WebCore::SVGTextChunkBuilder::buildTextChunks):
(WebCore::SVGTextChunkBuilder::layoutTextChunks):
* Source/WebCore/rendering/svg/SVGTextChunkBuilder.h:
* Source/WebCore/rendering/svg/SVGTextLayoutEngine.cpp:
(WebCore::SVGTextLayoutEngine::SVGTextLayoutEngine):
(WebCore::SVGTextLayoutEngine::recordTextFragment):
(WebCore::SVGTextLayoutEngine::recordedFragments):
(WebCore::SVGTextLayoutEngine::layoutInlineTextBox):
(WebCore::SVGTextLayoutEngine::finishLayout):
(WebCore::SVGTextLayoutEngine::currentVisualCharacterMetrics):
(WebCore::SVGTextLayoutEngine::layoutTextOnLineOrPath):
Chunk starts are a flat list of fragment indexes since boxes are laid out in
order.
* Source/WebCore/rendering/svg/SVGTextLayoutEngine.h:
Canonical link: https://commits.webkit.org/323104@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications