Changeset 295450 in webkit
- Timestamp:
- Jun 10, 2022 5:26:02 AM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/style/InlineTextBoxStyle.cpp
r295444 r295450 49 49 } 50 50 51 static void minLogicalTopForTextDecorationLine(const InlineIterator::LineBoxIterator& lineBox, float& minLogicalTop, const RenderElement* decorationRenderer, OptionSet<TextDecorationLine> textDecorationLine) 52 { 51 static float minLogicalTopForTextDecorationLine(const InlineIterator::LineBoxIterator& lineBox, float textRunLogicalTop, const RenderElement* decorationRenderer, OptionSet<TextDecorationLine> textDecorationLine) 52 { 53 auto minLogicalTop = textRunLogicalTop; 53 54 for (auto run = lineBox->firstLeafBox(); run; run.traverseNextOnLine()) { 54 55 if (run->renderer().isOutOfFlowPositioned()) … … 64 65 minLogicalTop = std::min<float>(minLogicalTop, run->logicalTop()); 65 66 } 66 } 67 68 static void maxLogicalBottomForTextDecorationLine(const InlineIterator::LineBoxIterator& lineBox, float& maxLogicalBottom, const RenderElement* decorationRenderer, OptionSet<TextDecorationLine> textDecorationLine) 69 { 67 return minLogicalTop; 68 } 69 70 static float maxLogicalBottomForTextDecorationLine(const InlineIterator::LineBoxIterator& lineBox, float textRunLogicalBottom, const RenderElement* decorationRenderer, OptionSet<TextDecorationLine> textDecorationLine) 71 { 72 auto maxLogicalBottom = textRunLogicalBottom; 70 73 for (auto run = lineBox->firstLeafBox(); run; run.traverseNextOnLine()) { 71 74 if (run->renderer().isOutOfFlowPositioned()) … … 81 84 maxLogicalBottom = std::max<float>(maxLogicalBottom, run->logicalBottom()); 82 85 } 86 return maxLogicalBottom; 83 87 } 84 88 … … 141 145 float offset; 142 146 if (context.renderer->style().isFlippedLinesWritingMode()) { 143 offset = context.textRunLogicalTop; 144 minLogicalTopForTextDecorationLine(context.lineBox, offset, decorationRenderer, TextDecorationLine::Underline); 145 offset = context.textRunLogicalTop - offset; 147 auto minLogicalTop = minLogicalTopForTextDecorationLine(context.lineBox, context.textRunLogicalTop, decorationRenderer, TextDecorationLine::Underline); 148 offset = context.textRunLogicalTop - minLogicalTop; 146 149 } else { 147 offset = context.textRunLogicalBottom; 148 maxLogicalBottomForTextDecorationLine(context.lineBox, offset, decorationRenderer, TextDecorationLine::Underline); 150 offset = maxLogicalBottomForTextDecorationLine(context.lineBox, context.textRunLogicalBottom, decorationRenderer, TextDecorationLine::Underline); 149 151 offset -= context.textRunLogicalBottom; 150 152 }
Note: See TracChangeset
for help on using the changeset viewer.