WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-243577-20220804205126.patch (text/plain), 5.00 KB, created by
alan
on 2022-08-04 20:51:27 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
alan
Created:
2022-08-04 20:51:27 PDT
Size:
5.00 KB
patch
obsolete
>From d3d40a7f0e98a30e77c7bad63c9a9740fb3b6506 Mon Sep 17 00:00:00 2001 >From: Alan Bujtas <zalan@apple.com> >Date: Thu, 4 Aug 2022 20:41:52 -0700 >Subject: [PATCH] [Painting] Rename textRunLogicalOffsetFromLineBottom to > textRunOffsetFromBottomMost https://bugs.webkit.org/show_bug.cgi?id=243577 > >Reviewed by NOBODY (OOPS!). > >This offset value is the distance between the current text run's logical bottom and the lowest position of all the text runs on line that belong to the same decoration box. >This value is input to the underline position. > >* Source/WebCore/style/InlineTextBoxStyle.cpp: >(WebCore::textRunOffsetFromBottomMost): >(WebCore::computeUnderlineOffset): >(WebCore::visualOverflowForDecorations): >(WebCore::underlineOffsetForTextBoxPainting): >(WebCore::textRunLogicalOffsetFromLineBottom): Deleted. >* Source/WebCore/style/InlineTextBoxStyle.h: >--- > Source/WebCore/style/InlineTextBoxStyle.cpp | 8 ++++---- > Source/WebCore/style/InlineTextBoxStyle.h | 4 +++- > 2 files changed, 7 insertions(+), 5 deletions(-) > >diff --git a/Source/WebCore/style/InlineTextBoxStyle.cpp b/Source/WebCore/style/InlineTextBoxStyle.cpp >index 7eb441ac8032..b6c3b2464de3 100644 >--- a/Source/WebCore/style/InlineTextBoxStyle.cpp >+++ b/Source/WebCore/style/InlineTextBoxStyle.cpp >@@ -110,7 +110,7 @@ static const RenderElement* enclosingRendererWithTextDecoration(const RenderText > return current; > } > >-static float textRunLogicalOffsetFromLineBottom(const InlineIterator::LineBoxIterator& lineBox, const RenderText& renderer, float textBoxLogicalTop, float textBoxLogicalBottom) >+static float textRunOffsetFromBottomMost(const InlineIterator::LineBoxIterator& lineBox, const RenderText& renderer, float textBoxLogicalTop, float textBoxLogicalBottom) > { > float offset = 0.f; > auto* decorationRenderer = enclosingRendererWithTextDecoration(renderer, lineBox->isFirst()); >@@ -166,7 +166,7 @@ static float computeUnderlineOffset(const UnderlineOffsetArguments& context) > case TextUnderlinePosition::Under: { > ASSERT(context.textUnderlinePositionUnder); > // Position underline relative to the bottom edge of the lowest element's content box. >- auto desiredOffset = context.textUnderlinePositionUnder->textRunLogicalHeight + gap + std::max(context.textUnderlinePositionUnder->textRunOffsetFromLineBottom, 0.0f) + underlineOffset.lengthOr(0); >+ auto desiredOffset = context.textUnderlinePositionUnder->textRunLogicalHeight + gap + std::max(context.textUnderlinePositionUnder->textRunOffsetFromBottomMost, 0.0f) + underlineOffset.lengthOr(0); > return std::max<float>(desiredOffset, fontMetrics.ascent()); > } > } >@@ -255,7 +255,7 @@ GlyphOverflow visualOverflowForDecorations(const InlineIterator::LineBoxIterator > { > auto& style = lineBox->isFirst() ? renderer.firstLineStyle() : renderer.style(); > auto underlineOffset = style.textDecorationsInEffect().contains(TextDecorationLine::Underline) >- ? std::make_optional(computeUnderlineOffset({ style, defaultGap(style), TextUnderlinePositionUnder { lineBox->baselineType(), textBoxLogicalBottom - textBoxLogicalTop, textRunLogicalOffsetFromLineBottom(lineBox, renderer, textBoxLogicalTop, textBoxLogicalBottom) } })) >+ ? std::make_optional(computeUnderlineOffset({ style, defaultGap(style), TextUnderlinePositionUnder { lineBox->baselineType(), textBoxLogicalBottom - textBoxLogicalTop, textRunOffsetFromBottomMost(lineBox, renderer, textBoxLogicalTop, textBoxLogicalBottom) } })) > : std::nullopt; > return computedVisualOverflowForDecorations(style, underlineOffset); > } >@@ -281,7 +281,7 @@ float underlineOffsetForTextBoxPainting(const RenderStyle& style, const InlineIt > auto textUnderlinePositionUnder = TextUnderlinePositionUnder { > textBox->lineBox()->baselineType(), > textBox->logicalBottom() - textBox->logicalTop(), >- textRunLogicalOffsetFromLineBottom(textBox->lineBox(), textBox->renderer(), textBox->logicalTop(), textBox->logicalBottom()) >+ textRunOffsetFromBottomMost(textBox->lineBox(), textBox->renderer(), textBox->logicalTop(), textBox->logicalBottom()) > }; > return computeUnderlineOffset({ style , defaultGap(style), textUnderlinePositionUnder }); > } >diff --git a/Source/WebCore/style/InlineTextBoxStyle.h b/Source/WebCore/style/InlineTextBoxStyle.h >index 23b4336488be..8b07c5a929ba 100644 >--- a/Source/WebCore/style/InlineTextBoxStyle.h >+++ b/Source/WebCore/style/InlineTextBoxStyle.h >@@ -57,7 +57,9 @@ WavyStrokeParameters getWavyStrokeParameters(float fontSize); > struct TextUnderlinePositionUnder { > FontBaseline baselineType { AlphabeticBaseline }; > float textRunLogicalHeight { 0 }; >- float textRunOffsetFromLineBottom { 0 }; >+ // This offset value is the distance between the current text run's logical bottom and the lowest position of all the text runs >+ // on line that belong to the same decoration box. >+ float textRunOffsetFromBottomMost { 0 }; > }; > GlyphOverflow visualOverflowForDecorations(const RenderStyle&); > GlyphOverflow visualOverflowForDecorations(const RenderStyle&, TextUnderlinePositionUnder);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
ews-feeder
:
commit-queue-
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 243577
: 461417