Changeset 85411 in webkit
- Timestamp:
- May 1, 2011 2:19:17 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r85406 r85411 1 2011-05-01 Dan Bernstein <mitz@apple.com> 2 3 Reviewed by Anders Carlsson. 4 5 <rdar://problem/9155067> REGRESSION (float-based line boxes): Gaps and overlaps in selection highlight 6 https://bugs.webkit.org/show_bug.cgi?id=56658 7 8 * fast/text/selection-rect-rounding.html: Added. 9 * platform/mac/fast/text/selection-rect-rounding-expected.png: Added. 10 * platform/mac/fast/text/selection-rect-rounding-expected.txt: Added. 11 1 12 2011-04-30 Justin Schuh <jschuh@chromium.org> 2 13 -
trunk/Source/WebCore/ChangeLog
r85406 r85411 1 2011-05-01 Dan Bernstein <mitz@apple.com> 2 3 Reviewed by Anders Carlsson. 4 5 <rdar://problem/9155067> REGRESSION (float-based line boxes): Gaps and overlaps in selection highlight 6 https://bugs.webkit.org/show_bug.cgi?id=56658 7 8 Test: fast/text/selection-rect-rounding.html 9 10 * platform/graphics/FontFastPath.cpp: 11 (WebCore::Font::selectionRectForSimpleText): Account for non-integral anchor point coordinates. 12 * platform/graphics/mac/FontComplexTextMac.cpp: 13 (WebCore::Font::selectionRectForComplexText): Ditto. 14 * rendering/InlineTextBox.cpp: 15 (WebCore::InlineTextBox::selectionRect): Floor the horizontal sides of the clip rect. 16 (WebCore::InlineTextBox::paintSelection): Pass the logical left location to Font::selectionRectForText(), 17 since it affects rounding. 18 1 19 2011-04-30 Justin Schuh <jschuh@chromium.org> 2 20 -
trunk/Source/WebCore/platform/graphics/FontFastPath.cpp
r82056 r85411 474 474 it.advance(run.length()); 475 475 float totalWidth = it.m_runWidthSoFar; 476 return FloatRect( point.x() + floorf(totalWidth - afterWidth), point.y(), roundf(totalWidth - beforeWidth) - floorf(totalWidth - afterWidth), h);477 } 478 479 return FloatRect( point.x() + floorf(beforeWidth), point.y(), roundf(afterWidth) - floorf(beforeWidth), h);476 return FloatRect(floorf(point.x() + totalWidth - afterWidth), point.y(), roundf(point.x() + totalWidth - beforeWidth) - floorf(point.x() + totalWidth - afterWidth), h); 477 } 478 479 return FloatRect(floorf(point.x() + beforeWidth), point.y(), roundf(point.x() + afterWidth) - floorf(point.x() + beforeWidth), h); 480 480 } 481 481 -
trunk/Source/WebCore/platform/graphics/mac/FontComplexTextMac.cpp
r81684 r85411 51 51 if (run.rtl()) { 52 52 float totalWidth = controller.totalWidth(); 53 return FloatRect( point.x() + floorf(totalWidth - afterWidth), point.y(), roundf(totalWidth - beforeWidth) - floorf(totalWidth - afterWidth), h);53 return FloatRect(floorf(point.x() + totalWidth - afterWidth), point.y(), roundf(point.x() + totalWidth - beforeWidth) - floorf(point.x() + totalWidth - afterWidth), h); 54 54 } 55 55 56 return FloatRect( point.x() + floorf(beforeWidth), point.y(), roundf(afterWidth) - floorf(beforeWidth), h);56 return FloatRect(floorf(point.x() + beforeWidth), point.y(), roundf(point.x() + afterWidth) - floorf(point.x() + beforeWidth), h); 57 57 } 58 58 -
trunk/Source/WebCore/rendering/InlineTextBox.cpp
r85143 r85411 195 195 196 196 IntRect r = enclosingIntRect(f.selectionRectForText(TextRun(characters, len, textObj->allowTabs(), textPos(), m_expansion, expansionBehavior(), direction(), m_dirOverride), 197 IntPoint(), selHeight, sPos, ePos));198 197 FloatPoint(logicalLeft(), selTop), selHeight, sPos, ePos)); 198 199 199 int logicalWidth = r.width(); 200 if (r.x() > m_logicalWidth)200 if (r.x() > logicalRight()) 201 201 logicalWidth = 0; 202 else if (r.maxX() > m_logicalWidth)203 logicalWidth = m_logicalWidth- r.x();204 205 IntPoint topPoint = isHorizontal() ? IntPoint( tx + m_x + r.x(), ty + selTop) : IntPoint(tx + selTop, ty + m_y +r.x());202 else if (r.maxX() > logicalRight()) 203 logicalWidth = logicalRight() - r.x(); 204 205 IntPoint topPoint = isHorizontal() ? IntPoint(r.x(), ty + selTop) : IntPoint(tx + selTop, r.x()); 206 206 int width = isHorizontal() ? logicalWidth : selHeight; 207 207 int height = isHorizontal() ? selHeight : logicalWidth; 208 208 209 209 return IntRect(topPoint, IntSize(width, height)); 210 210 } … … 785 785 void InlineTextBox::paintSelection(GraphicsContext* context, const FloatPoint& boxOrigin, RenderStyle* style, const Font& font) 786 786 { 787 if (context->paintingDisabled()) 788 return; 789 787 790 // See if we have a selection to paint at all. 788 791 int sPos, ePos; … … 818 821 int selHeight = selectionHeight(); 819 822 FloatPoint localOrigin(boxOrigin.x(), boxOrigin.y() - deltaY); 820 context->clip(FloatRect(localOrigin, FloatSize(m_logicalWidth, selHeight))); 823 824 FloatRect clipRect(localOrigin, FloatSize(m_logicalWidth, selHeight)); 825 float maxX = floorf(clipRect.maxX()); 826 clipRect.setX(floorf(clipRect.x())); 827 clipRect.setWidth(maxX - clipRect.x()); 828 context->clip(clipRect); 829 821 830 context->drawHighlightForText(font, TextRun(characters, length, textRenderer()->allowTabs(), textPos(), m_expansion, expansionBehavior(), 822 831 direction(), m_dirOverride || style->visuallyOrdered()),
Note: See TracChangeset
for help on using the changeset viewer.