Changeset 266995 in webkit
- Timestamp:
- Sep 13, 2020 9:19:09 AM (4 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r266994 r266995 1 2020-09-13 Zalan Bujtas <zalan@apple.com> 2 3 [LFC][IFC] Text run is at incorrect vertical position when parent inline box is stretched 4 https://bugs.webkit.org/show_bug.cgi?id=216453 5 6 Reviewed by Antti Koivisto. 7 8 Text runs don't necessarily start at the top of the parent inline box. When the inline box is 9 stretched by some other content (nested inline box or atomic inline-level box) the run is pushed down. 10 This patch computes the correct vertical position by using the inline box's baseline (text always sits on the baseline). 11 12 * layout/inlineformatting/InlineLineBox.cpp: 13 (WebCore::Layout::LineBox::logicalRectForTextRun const): 14 1 15 2020-09-13 Zalan Bujtas <zalan@apple.com> 2 16 -
trunk/Source/WebCore/layout/inlineformatting/InlineLineBox.cpp
r266978 r266995 148 148 ASSERT(run.isText() || run.isLineBreak()); 149 149 auto& parentInlineBox = inlineBoxForLayoutBox(run.layoutBox().parent()); 150 auto inlineBoxRect = parentInlineBox.logicalRect(); 151 return { inlineBoxRect.top(), m_horizontalAlignmentOffset.valueOr(InlineLayoutUnit { }) + run.logicalLeft(), run.logicalWidth(), inlineBoxRect.height() }; 150 auto& fontMetrics = parentInlineBox.fontMetrics(); 151 auto runlogicalTop = parentInlineBox.logicalTop() + parentInlineBox.baseline() - fontMetrics.ascent(); 152 InlineLayoutUnit logicalHeight = fontMetrics.height(); 153 return { runlogicalTop, m_horizontalAlignmentOffset.valueOr(InlineLayoutUnit { }) + run.logicalLeft(), run.logicalWidth(), logicalHeight }; 152 154 } 153 155
Note: See TracChangeset
for help on using the changeset viewer.