Changeset 168624 in webkit
- Timestamp:
- May 12, 2014 10:56:17 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r168622 r168624 1 2014-05-12 Antti Koivisto <antti@apple.com> 2 3 REGRESSION (r159560): Text clips on tile border if line-height < font-size 4 https://bugs.webkit.org/show_bug.cgi?id=132822 5 6 Reviewed by Andreas Kling. 7 8 * fast/text/simple-lines-range-low-line-height-expected.html: Added. 9 * fast/text/simple-lines-range-low-line-height.html: Added. 10 1 11 2014-05-12 Krzysztof Wolanski <k.wolanski@samsung.com> 2 12 -
trunk/Source/WebCore/ChangeLog
r168621 r168624 1 2014-05-12 Antti Koivisto <antti@apple.com> 2 3 REGRESSION (r159560): Text clips on tile border if line-height < font-size 4 https://bugs.webkit.org/show_bug.cgi?id=132822 5 6 Reviewed by Andreas Kling. 7 8 The first line of simple line layout run range was miscomputed. 9 10 Test: fast/text/simple-lines-range-low-line-height.html 11 12 * rendering/SimpleLineLayoutResolver.h: 13 (WebCore::SimpleLineLayout::RunResolver::lineIndexForHeight): 14 15 Lines may overlap if line-height < font-size. Apply different adjustment when searching for range begin 16 so that overflowing earlier lines are taken into account. 17 18 (WebCore::SimpleLineLayout::RunResolver::rangeForRect): 19 1 20 2014-05-12 Radu Stavila <stavila@adobe.com> 2 21 -
trunk/Source/WebCore/rendering/SimpleLineLayoutResolver.h
r167580 r168624 103 103 104 104 private: 105 unsigned lineIndexForHeight(LayoutUnit) const; 105 enum class IndexType { First, Last }; 106 unsigned lineIndexForHeight(LayoutUnit, IndexType) const; 106 107 107 108 const Layout& m_layout; … … 271 272 } 272 273 273 inline unsigned RunResolver::lineIndexForHeight(LayoutUnit height ) const274 inline unsigned RunResolver::lineIndexForHeight(LayoutUnit height, IndexType type) const 274 275 { 275 276 ASSERT(m_lineHeight); 276 float y = std::max<float>(height - m_borderAndPaddingBefore - m_baseline + m_ascent, 0); 277 float y = height - m_borderAndPaddingBefore; 278 // Lines may overlap, adjust to get the first or last line at this height. 279 if (type == IndexType::First) 280 y += m_lineHeight - (m_baseline + m_descent); 281 else 282 y -= m_baseline - m_ascent; 283 y = std::max<float>(y, 0); 277 284 return std::min<unsigned>(y / m_lineHeight, m_layout.lineCount() - 1); 278 285 } … … 283 290 return Range<Iterator>(begin(), end()); 284 291 285 unsigned firstLine = lineIndexForHeight(rect.y() );286 unsigned lastLine = std::max(firstLine, lineIndexForHeight(rect.maxY() ));292 unsigned firstLine = lineIndexForHeight(rect.y(), IndexType::First); 293 unsigned lastLine = std::max(firstLine, lineIndexForHeight(rect.maxY(), IndexType::Last)); 287 294 288 295 auto rangeBegin = begin().advanceLines(firstLine);
Note: See TracChangeset
for help on using the changeset viewer.