Modified: trunk/Source/WebCore/rendering/TextBoxPainter.cpp (294382 => 294383)
--- trunk/Source/WebCore/rendering/TextBoxPainter.cpp 2022-05-18 04:47:20 UTC (rev 294382)
+++ trunk/Source/WebCore/rendering/TextBoxPainter.cpp 2022-05-18 06:26:53 UTC (rev 294383)
@@ -45,29 +45,34 @@
namespace WebCore {
-TextBoxPainter::TextBoxPainter(const LegacyInlineTextBox& textBox, PaintInfo& paintInfo, const LayoutPoint& paintOffset)
- : TextBoxPainter(InlineIterator::textBoxFor(&textBox), paintInfo, paintOffset)
+static FloatRect calculateDocumentMarkerBounds(const InlineIterator::TextBoxIterator&, const MarkedText&);
+
+LegacyTextBoxPainter::LegacyTextBoxPainter(const LegacyInlineTextBox& textBox, PaintInfo& paintInfo, const LayoutPoint& paintOffset)
+ : TextBoxPainter(InlineIterator::BoxLegacyPath { &textBox }, paintInfo, paintOffset)
{
m_emphasisMarkExistsAndIsAbove = textBox.emphasisMarkExistsAndIsAbove(m_style);
}
#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
-TextBoxPainter::TextBoxPainter(const LayoutIntegration::InlineContent& inlineContent, const InlineDisplay::Box& box, PaintInfo& paintInfo, const LayoutPoint& paintOffset)
- : TextBoxPainter(InlineIterator::textBoxFor(inlineContent, box), paintInfo, paintOffset)
+ModernTextBoxPainter::ModernTextBoxPainter(const LayoutIntegration::InlineContent& inlineContent, const InlineDisplay::Box& box, PaintInfo& paintInfo, const LayoutPoint& paintOffset)
+ : TextBoxPainter(InlineIterator::BoxModernPath { inlineContent, inlineContent.indexForBox(box) }, paintInfo, paintOffset)
{
}
#endif
-TextBoxPainter::TextBoxPainter(const InlineIterator::TextBoxIterator& textBox, PaintInfo& paintInfo, const LayoutPoint& paintOffset)
- : m_textBox(textBox)
- , m_renderer(m_textBox->renderer())
+template<typename TextBoxPath>
+TextBoxPainter<TextBoxPath>::TextBoxPainter(TextBoxPath&& textBox, PaintInfo& paintInfo, const LayoutPoint& paintOffset)
+ : m_textBox(WTFMove(textBox))
+ , m_renderer(downcast<RenderText>(m_textBox.renderer()))
, m_document(m_renderer.document())
- , m_style(m_textBox->style())
- , m_paintTextRun(m_textBox->createTextRun())
+ , m_style(m_textBox.style())
+ , m_logicalRect(m_textBox.isHorizontal() ? m_textBox.visualRectIgnoringBlockDirection() : m_textBox.visualRectIgnoringBlockDirection().transposedRect())
+ , m_paintTextRun(m_textBox.createTextRun(InlineIterator::CreateTextRunMode::Painting))
, m_paintInfo(paintInfo)
- , m_selectableRange(m_textBox->selectableRange())
+ , m_selectableRange(m_textBox.selectableRange())
, m_paintRect(computePaintRect(paintOffset))
- , m_isFirstLine(m_textBox->lineBox()->isFirst())
+ , m_isFirstLine(m_textBox.isFirstLine())
+ , m_isCombinedText(is<RenderCombineText>(m_renderer) && downcast<RenderCombineText>(m_renderer).isCombined())
, m_isPrinting(m_document.printing())
, m_haveSelection(computeHaveSelection())
, m_containsComposition(m_renderer.textNode() && m_renderer.frame().editor().compositionNode() == m_renderer.textNode())
@@ -76,12 +81,21 @@
ASSERT(paintInfo.phase == PaintPhase::Foreground || paintInfo.phase == PaintPhase::Selection || paintInfo.phase == PaintPhase::TextClip || paintInfo.phase == PaintPhase::EventRegion);
}
-TextBoxPainter::~TextBoxPainter()
+template<typename TextBoxPath>
+TextBoxPainter<TextBoxPath>::~TextBoxPainter()
{
}
-void TextBoxPainter::paint()
+template<typename TextBoxPath>
+InlineIterator::TextBoxIterator TextBoxPainter<TextBoxPath>::makeIterator() const
{
+ auto pathCopy = m_textBox;
+ return InlineIterator::TextBoxIterator { WTFMove(pathCopy) };
+}
+
+template<typename TextBoxPath>
+void TextBoxPainter<TextBoxPath>::paint()
+{
if (m_paintInfo.phase == PaintPhase::Selection && !m_haveSelection)
return;
@@ -91,7 +105,7 @@
return;
}
- bool shouldRotate = !textBox().isHorizontal() && !textBox().isCombinedText();
+ bool shouldRotate = !textBox().isHorizontal() && !m_isCombinedText;
if (shouldRotate)
m_paintInfo.context().concatCTM(rotation(m_paintRect, Clockwise));
@@ -115,7 +129,8 @@
m_paintInfo.context().concatCTM(rotation(m_paintRect, Counterclockwise));
}
-MarkedText TextBoxPainter::createMarkedTextFromSelectionInBox()
+template<typename TextBoxPath>
+MarkedText TextBoxPainter<TextBoxPath>::createMarkedTextFromSelectionInBox()
{
auto [selectionStart, selectionEnd] = m_renderer.view().selection().rangeForTextBox(m_renderer, m_selectableRange);
if (selectionStart < selectionEnd)
@@ -123,7 +138,8 @@
return { };
}
-void TextBoxPainter::paintBackground()
+template<typename TextBoxPath>
+void TextBoxPainter<TextBoxPath>::paintBackground()
{
auto shouldPaintCompositionBackground = m_containsComposition && !m_useCustomUnderlines;
#if ENABLE(TEXT_SELECTION)
@@ -169,7 +185,8 @@
paintBackground(markedText);
}
-void TextBoxPainter::paintForegroundAndDecorations()
+template<typename TextBoxPath>
+void TextBoxPainter<TextBoxPath>::paintForegroundAndDecorations()
{
auto shouldPaintSelectionForeground = m_haveSelection && !m_useCustomUnderlines;
auto hasTextDecoration = !m_style.textDecorationsInEffect().isEmpty();
@@ -231,8 +248,7 @@
}
if (hasDecoration && m_paintInfo.phase != PaintPhase::Selection) {
- TextRun textRun = textBox().createTextRun();
- unsigned length = m_selectableRange.truncation.value_or(textRun.length());
+ unsigned length = m_selectableRange.truncation.value_or(m_paintTextRun.length());
unsigned selectionStart = 0;
unsigned selectionEnd = 0;
if (m_haveSelection)
@@ -287,7 +303,8 @@
}
}
-void TextBoxPainter::paintCompositionBackground()
+template<typename TextBoxPath>
+void TextBoxPainter<TextBoxPath>::paintCompositionBackground()
{
auto& editor = m_renderer.frame().editor();
@@ -314,12 +331,14 @@
}
}
-void TextBoxPainter::paintBackground(const StyledMarkedText& markedText)
+template<typename TextBoxPath>
+void TextBoxPainter<TextBoxPath>::paintBackground(const StyledMarkedText& markedText)
{
- paintBackground(markedText.startOffset, markedText.endOffset, markedText.style.backgroundColor);
+ paintBackground(markedText.startOffset, markedText.endOffset, markedText.style.backgroundColor, BackgroundStyle::Normal);
}
-void TextBoxPainter::paintBackground(unsigned startOffset, unsigned endOffset, const Color& color, BackgroundStyle backgroundStyle)
+template<typename TextBoxPath>
+void TextBoxPainter<TextBoxPath>::paintBackground(unsigned startOffset, unsigned endOffset, const Color& color, BackgroundStyle backgroundStyle)
{
if (startOffset >= endOffset)
return;
@@ -330,14 +349,14 @@
// Note that if the text is truncated, we let the thing being painted in the truncation
// draw its own highlight.
- auto lineBox = textBox().lineBox();
+ auto lineBox = makeIterator()->lineBox();
auto selectionBottom = LineSelection::logicalBottom(*lineBox);
auto selectionTop = LineSelection::logicalTopAdjustedForPrecedingBlock(*lineBox);
// Use same y positioning and height as for selection, so that when the selection and this subrange are on
// the same word there are no pieces sticking out.
- auto deltaY = LayoutUnit { m_style.isFlippedLinesWritingMode() ? selectionBottom - textBox().logicalBottom() : textBox().logicalTop() - selectionTop };
+ auto deltaY = LayoutUnit { m_style.isFlippedLinesWritingMode() ? selectionBottom - m_logicalRect.maxY() : m_logicalRect.y() - selectionTop };
auto selectionHeight = LayoutUnit { std::max(0.f, selectionBottom - selectionTop) };
- auto selectionRect = LayoutRect { LayoutUnit(m_paintRect.x()), LayoutUnit(m_paintRect.y() - deltaY), LayoutUnit(textBox().logicalWidth()), selectionHeight };
+ auto selectionRect = LayoutRect { LayoutUnit(m_paintRect.x()), LayoutUnit(m_paintRect.y() - deltaY), LayoutUnit(m_logicalRect.width()), selectionHeight };
fontCascade().adjustSelectionRectForText(m_paintTextRun, selectionRect, startOffset, endOffset);
// FIXME: Support painting combined text. See <https://bugs.webkit.org/show_bug.cgi?id=180993>.
@@ -352,7 +371,8 @@
context.fillRect(backgroundRect, color);
}
-void TextBoxPainter::paintForeground(const StyledMarkedText& markedText)
+template<typename TextBoxPath>
+void TextBoxPainter<TextBoxPath>::paintForeground(const StyledMarkedText& markedText)
{
if (markedText.startOffset >= markedText.endOffset)
return;
@@ -373,7 +393,7 @@
if (m_style.hasAppleColorFilter())
textPainter.setShadowColorFilter(&m_style.appleColorFilter());
}
- textPainter.setEmphasisMark(emphasisMark, emphasisMarkOffset, textBox().isCombinedText() ? &downcast<RenderCombineText>(m_renderer) : nullptr);
+ textPainter.setEmphasisMark(emphasisMark, emphasisMarkOffset, m_isCombinedText ? &downcast<RenderCombineText>(m_renderer) : nullptr);
if (auto* debugShadow = debugTextShadow())
textPainter.setShadow(debugShadow);
@@ -382,11 +402,11 @@
context.setAlpha(markedText.style.alpha);
updateGraphicsContext(context, markedText.style.textStyles);
- if (auto* legacyInlineBox = textBox().legacyInlineBox())
- textPainter.setGlyphDisplayListIfNeeded(*legacyInlineBox, m_paintInfo, m_paintTextRun);
+ if constexpr (std::is_same_v<TextBoxPath, InlineIterator::BoxLegacyPath>)
+ textPainter.setGlyphDisplayListIfNeeded(downcast<LegacyInlineTextBox>(*textBox().legacyInlineBox()), m_paintInfo, m_paintTextRun);
#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
else
- textPainter.setGlyphDisplayListIfNeeded(*textBox().inlineBox(), m_paintInfo, m_paintTextRun);
+ textPainter.setGlyphDisplayListIfNeeded(textBox().box(), m_paintInfo, m_paintTextRun);
#endif
// TextPainter wants the box rectangle and text origin of the entire line box.
@@ -393,7 +413,8 @@
textPainter.paintRange(m_paintTextRun, m_paintRect, textOriginFromPaintRect(m_paintRect), markedText.startOffset, markedText.endOffset);
}
-TextDecorationPainter TextBoxPainter::createDecorationPainter(const StyledMarkedText& markedText, const FloatRect& clipOutRect, const FloatRect& snappedSelectionRect)
+template<typename TextBoxPath>
+TextDecorationPainter TextBoxPainter<TextBoxPath>::createDecorationPainter(const StyledMarkedText& markedText, const FloatRect& clipOutRect, const FloatRect& snappedSelectionRect)
{
GraphicsContext& context = m_paintInfo.context();
@@ -416,7 +437,7 @@
auto textDecorations = m_style.textDecorationsInEffect();
textDecorations.add(TextDecorationPainter::textDecorationsInEffectForStyle(markedText.style.textDecorationStyles));
TextDecorationPainter decorationPainter { context, textDecorations, m_renderer, m_isFirstLine, font, markedText.style.textDecorationStyles };
- decorationPainter.setTextBox(m_textBox);
+ decorationPainter.setTextBox(makeIterator());
decorationPainter.setWidth(snappedSelectionRect.width());
decorationPainter.setIsHorizontal(textBox().isHorizontal());
if (markedText.style.textShadow) {
@@ -428,31 +449,32 @@
return decorationPainter;
}
-void TextBoxPainter::paintBackgroundDecorations(TextDecorationPainter& decorationPainter, const StyledMarkedText& markedText, const FloatRect& snappedSelectionRect)
+template<typename TextBoxPath>
+void TextBoxPainter<TextBoxPath>::paintBackgroundDecorations(TextDecorationPainter& decorationPainter, const StyledMarkedText& markedText, const FloatRect& snappedSelectionRect)
{
- bool isCombinedText = textBox().isCombinedText();
- if (isCombinedText)
+ if (m_isCombinedText)
m_paintInfo.context().concatCTM(rotation(m_paintRect, Clockwise));
decorationPainter.paintBackgroundDecorations(m_paintTextRun.subRun(markedText.startOffset, markedText.endOffset - markedText.startOffset), textOriginFromPaintRect(snappedSelectionRect), snappedSelectionRect.location());
- if (isCombinedText)
+ if (m_isCombinedText)
m_paintInfo.context().concatCTM(rotation(m_paintRect, Counterclockwise));
}
-void TextBoxPainter::paintForegroundDecorations(TextDecorationPainter& decorationPainter, const FloatRect& snappedSelectionRect)
+template<typename TextBoxPath>
+void TextBoxPainter<TextBoxPath>::paintForegroundDecorations(TextDecorationPainter& decorationPainter, const FloatRect& snappedSelectionRect)
{
- bool isCombinedText = textBox().isCombinedText();
- if (isCombinedText)
+ if (m_isCombinedText)
m_paintInfo.context().concatCTM(rotation(m_paintRect, Clockwise));
decorationPainter.paintForegroundDecorations(snappedSelectionRect.location());
- if (isCombinedText)
+ if (m_isCombinedText)
m_paintInfo.context().concatCTM(rotation(m_paintRect, Counterclockwise));
}
-void TextBoxPainter::paintCompositionUnderlines()
+template<typename TextBoxPath>
+void TextBoxPainter<TextBoxPath>::paintCompositionUnderlines()
{
for (auto& underline : m_renderer.frame().editor().customCompositionUnderlines()) {
if (underline.endOffset <= textBox().start()) {
@@ -480,19 +502,21 @@
start = logicalWidth - width - start;
}
-static float textPosition(const InlineIterator::TextBoxIterator& textBox)
+template<typename TextBoxPath>
+float TextBoxPainter<TextBoxPath>::textPosition()
{
// When computing the width of a text run, RenderBlock::computeInlineDirectionPositionsForLine() doesn't include the actual offset
// from the containing block edge in its measurement. textPosition() should be consistent so the text are rendered in the same width.
- if (!textBox->logicalLeft())
+ if (!m_logicalRect.x())
return 0;
- return textBox->logicalLeft() - textBox->lineBox()->contentLogicalLeft();
+ return m_logicalRect.x() - makeIterator()->lineBox()->contentLogicalLeft();
}
-void TextBoxPainter::paintCompositionUnderline(const CompositionUnderline& underline)
+template<typename TextBoxPath>
+void TextBoxPainter<TextBoxPath>::paintCompositionUnderline(const CompositionUnderline& underline)
{
float start = 0; // start of line to draw, relative to tx
- float width = textBox().logicalWidth(); // how much line to draw
+ float width = m_logicalRect.width(); // how much line to draw
bool useWholeWidth = true;
unsigned paintStart = textBox().start();
unsigned paintEnd = textBox().end();
@@ -499,7 +523,7 @@
if (paintStart <= underline.startOffset) {
paintStart = underline.startOffset;
useWholeWidth = false;
- start = m_renderer.width(textBox().start(), paintStart - textBox().start(), textPosition(m_textBox), m_isFirstLine);
+ start = m_renderer.width(textBox().start(), paintStart - textBox().start(), textPosition(), m_isFirstLine);
}
if (paintEnd != underline.endOffset) {
paintEnd = std::min(paintEnd, (unsigned)underline.endOffset);
@@ -510,8 +534,8 @@
useWholeWidth = false;
}
if (!useWholeWidth) {
- width = m_renderer.width(paintStart, paintEnd - paintStart, textPosition(m_textBox) + start, m_isFirstLine);
- mirrorRTLSegment(textBox().logicalWidth(), textBox().direction(), start, width);
+ width = m_renderer.width(paintStart, paintEnd - paintStart, textPosition() + start, m_isFirstLine);
+ mirrorRTLSegment(m_logicalRect.width(), textBox().direction(), start, width);
}
// Thick marked text underlines are 2px thick as long as there is room for the 2px line under the baseline.
@@ -519,7 +543,7 @@
// If there's not enough space the underline will touch or overlap characters.
int lineThickness = 1;
int baseline = m_style.metricsOfPrimaryFont().ascent();
- if (underline.thick && textBox().logicalHeight() - baseline >= 2)
+ if (underline.thick && m_logicalRect.height() - baseline >= 2)
lineThickness = 2;
// We need to have some space between underlines of subsequent clauses, because some input methods do not use different underline styles for those.
@@ -533,10 +557,11 @@
GraphicsContext& context = m_paintInfo.context();
context.setStrokeColor(underlineColor);
context.setStrokeThickness(lineThickness);
- context.drawLineForText(FloatRect(m_paintRect.x() + start, m_paintRect.y() + textBox().logicalHeight() - lineThickness, width, lineThickness), m_document.printing());
+ context.drawLineForText(FloatRect(m_paintRect.x() + start, m_paintRect.y() + m_logicalRect.height() - lineThickness, width, lineThickness), m_isPrinting);
}
-void TextBoxPainter::paintPlatformDocumentMarkers()
+template<typename TextBoxPath>
+void TextBoxPainter<TextBoxPath>::paintPlatformDocumentMarkers()
{
auto markedTexts = MarkedText::collectForDocumentMarkers(m_renderer, m_selectableRange, MarkedText::PaintPhase::Decoration);
for (auto& markedText : MarkedText::subdivide(markedTexts, MarkedText::OverlapStrategy::Frontmost))
@@ -543,7 +568,7 @@
paintPlatformDocumentMarker(markedText);
}
-FloatRect TextBoxPainter::calculateUnionOfAllDocumentMarkerBounds(const LegacyInlineTextBox& textBox)
+FloatRect LegacyTextBoxPainter::calculateUnionOfAllDocumentMarkerBounds(const LegacyInlineTextBox& textBox)
{
// This must match paintPlatformDocumentMarkers().
FloatRect result;
@@ -553,13 +578,14 @@
return result;
}
-void TextBoxPainter::paintPlatformDocumentMarker(const MarkedText& markedText)
+template<typename TextBoxPath>
+void TextBoxPainter<TextBoxPath>::paintPlatformDocumentMarker(const MarkedText& markedText)
{
// Never print spelling/grammar markers (5327887)
if (m_document.printing())
return;
- auto bounds = calculateDocumentMarkerBounds(m_textBox, markedText);
+ auto bounds = calculateDocumentMarkerBounds(makeIterator(), markedText);
auto lineStyleForMarkedTextType = [&]() -> DocumentMarkerLineStyle {
bool shouldUseDarkAppearance = m_renderer.useDarkAppearance();
@@ -587,12 +613,13 @@
m_paintInfo.context().drawDotsForDocumentMarker(bounds, lineStyleForMarkedTextType());
}
-FloatRect TextBoxPainter::computePaintRect(const LayoutPoint& paintOffset)
+template<typename TextBoxPath>
+FloatRect TextBoxPainter<TextBoxPath>::computePaintRect(const LayoutPoint& paintOffset)
{
FloatPoint localPaintOffset(paintOffset);
if (m_selectableRange.truncation) {
- if (m_renderer.containingBlock()->style().isLeftToRightDirection() != textBox().isLeftToRightDirection()) {
+ if (m_renderer.containingBlock()->style().direction() != textBox().direction()) {
// Make the visible fragment of text hug the edge closest to the rest of the run by moving the origin
// at which we start drawing text.
// e.g. In the case of LTR text truncated in an RTL Context, the correct behavior is:
@@ -601,21 +628,24 @@
// farther to the right.
// NOTE: WebKit's behavior differs from that of IE which appears to just overlay the ellipsis on top of the
// truncated string i.e. |Hello|CBA| -> |...lo|CBA|
- LayoutUnit widthOfVisibleText { m_renderer.width(textBox().start(), *m_selectableRange.truncation, textPosition(m_textBox), m_isFirstLine) };
- LayoutUnit widthOfHiddenText { textBox().logicalWidth() - widthOfVisibleText };
- LayoutSize truncationOffset(textBox().isLeftToRightDirection() ? widthOfHiddenText : -widthOfHiddenText, 0_lu);
+ LayoutUnit widthOfVisibleText { m_renderer.width(textBox().start(), *m_selectableRange.truncation, textPosition(), m_isFirstLine) };
+ LayoutUnit widthOfHiddenText { m_logicalRect.width() - widthOfVisibleText };
+ LayoutSize truncationOffset(textBox().direction() == TextDirection::LTR ? widthOfHiddenText : -widthOfHiddenText, 0_lu);
localPaintOffset.move(textBox().isHorizontal() ? truncationOffset : truncationOffset.transposedSize());
}
}
- localPaintOffset.move(0, m_style.isHorizontalWritingMode() ? 0 : -textBox().logicalHeight());
+ localPaintOffset.move(0, m_style.isHorizontalWritingMode() ? 0 : -m_logicalRect.height());
- auto boxOrigin = textBox().visualRect(textBox().lineBox()->containingBlock().logicalHeight()).location();
+ auto visualRect = textBox().visualRectIgnoringBlockDirection();
+ textBox().containingBlock().flipForWritingMode(visualRect);
+
+ auto boxOrigin = visualRect.location();
boxOrigin.moveBy(localPaintOffset);
- return { boxOrigin, FloatSize(textBox().logicalWidth(), textBox().logicalHeight()) };
+ return { boxOrigin, FloatSize(m_logicalRect.width(), m_logicalRect.height()) };
}
-FloatRect TextBoxPainter::calculateDocumentMarkerBounds(const InlineIterator::TextBoxIterator& textBox, const MarkedText& markedText)
+FloatRect calculateDocumentMarkerBounds(const InlineIterator::TextBoxIterator& textBox, const MarkedText& markedText)
{
auto& font = textBox->fontCascade();
auto ascent = font.metricsOfPrimaryFont().ascent();
@@ -634,7 +664,8 @@
return FloatRect(0, y, textBox->logicalWidth(), height);
}
-bool TextBoxPainter::computeHaveSelection() const
+template<typename TextBoxPath>
+bool TextBoxPainter<TextBoxPath>::computeHaveSelection() const
{
if (m_isPrinting || m_paintInfo.phase == PaintPhase::TextClip)
return false;
@@ -642,15 +673,20 @@
return m_renderer.view().selection().highlightStateForTextBox(m_renderer, m_selectableRange) != RenderObject::HighlightState::None;
}
-const FontCascade& TextBoxPainter::fontCascade() const
+template<typename TextBoxPath>
+const FontCascade& TextBoxPainter<TextBoxPath>::fontCascade() const
{
- return m_textBox->fontCascade();
+ if (m_isCombinedText)
+ return downcast<RenderCombineText>(m_renderer).textCombineFont();
+
+ return m_textBox.style().fontCascade();
}
-FloatPoint TextBoxPainter::textOriginFromPaintRect(const FloatRect& paintRect) const
+template<typename TextBoxPath>
+FloatPoint TextBoxPainter<TextBoxPath>::textOriginFromPaintRect(const FloatRect& paintRect) const
{
FloatPoint textOrigin { paintRect.x(), paintRect.y() + fontCascade().metricsOfPrimaryFont().ascent() };
- if (textBox().isCombinedText()) {
+ if (m_isCombinedText) {
if (auto newOrigin = downcast<RenderCombineText>(m_renderer).computeTextOrigin(paintRect))
textOrigin = newOrigin.value();
}
@@ -661,11 +697,12 @@
return textOrigin;
}
-const ShadowData* TextBoxPainter::debugTextShadow() const
+template<typename TextBoxPath>
+const ShadowData* TextBoxPainter<TextBoxPath>::debugTextShadow() const
{
if (!m_renderer.settings().legacyLineLayoutVisualCoverageEnabled())
return nullptr;
- if (!textBox().legacyInlineBox())
+ if constexpr (std::is_same_v<TextBoxPath, InlineIterator::BoxModernPath>)
return nullptr;
static NeverDestroyed<ShadowData> debugTextShadow(LengthPoint(Length(LengthType::Fixed), Length(LengthType::Fixed)), Length(10, LengthType::Fixed), Length(20, LengthType::Fixed), ShadowStyle::Normal, true, SRGBA<uint8_t> { 150, 0, 0, 190 });
@@ -672,4 +709,7 @@
return &debugTextShadow.get();
}
+template class TextBoxPainter<InlineIterator::BoxModernPath>;
+template class TextBoxPainter<InlineIterator::BoxLegacyPath>;
+
}