Chromium Code Reviews| Index: third_party/WebKit/Source/core/paint/InlineTextBoxPainter.cpp |
| diff --git a/third_party/WebKit/Source/core/paint/InlineTextBoxPainter.cpp b/third_party/WebKit/Source/core/paint/InlineTextBoxPainter.cpp |
| index 30b53803e6fda58ba2cc1c7594bcb5d29a200178..dde30c54999a81eb3c7e561cc8783cb7211eacb3 100644 |
| --- a/third_party/WebKit/Source/core/paint/InlineTextBoxPainter.cpp |
| +++ b/third_party/WebKit/Source/core/paint/InlineTextBoxPainter.cpp |
| @@ -832,11 +832,6 @@ void InlineTextBoxPainter::paintTextMatchMarkerBackground(const PaintInfo& paint |
| if (!LineLayoutAPIShim::layoutObjectFrom(m_inlineTextBox.getLineLayoutItem())->frame()->editor().markedTextMatchesAreHighlighted()) |
| return; |
| - // Use same y positioning and height as for selection, so that when the selection and this highlight are on |
| - // the same word there are no pieces sticking out. |
| - int deltaY = m_inlineTextBox.getLineLayoutItem().style()->isFlippedLinesWritingMode() ? m_inlineTextBox.root().selectionBottom() - m_inlineTextBox.logicalBottom() : m_inlineTextBox.logicalTop() - m_inlineTextBox.root().selectionTop(); |
| - int selHeight = m_inlineTextBox.root().selectionHeight(); |
| - |
| int sPos = std::max(marker->startOffset() - m_inlineTextBox.start(), (unsigned)0); |
| int ePos = std::min(marker->endOffset() - m_inlineTextBox.start(), m_inlineTextBox.len()); |
| TextRun run = m_inlineTextBox.constructTextRun(style, font); |
| @@ -844,8 +839,10 @@ void InlineTextBoxPainter::paintTextMatchMarkerBackground(const PaintInfo& paint |
| Color color = LayoutTheme::theme().platformTextSearchHighlightColor(marker->activeMatch()); |
| GraphicsContext& context = paintInfo.context; |
| GraphicsContextStateSaver stateSaver(context); |
| - context.clip(FloatRect(boxOrigin.x().toFloat(), (boxOrigin.y() - deltaY).toFloat(), m_inlineTextBox.logicalWidth().toFloat(), selHeight)); |
| - context.drawHighlightForText(font, run, FloatPoint(boxOrigin.x().toFloat(), (boxOrigin.y() - deltaY).toFloat()), selHeight, color, sPos, ePos); |
| + int height = m_inlineTextBox.logicalHeight(); |
|
jbroman
2016/06/15 08:37:10
Why coerce this to int, but not the other dimensio
Xianzhu
2016/06/15 16:40:48
This is because GraphicsContext::drawHighlightForT
jbroman
2016/06/15 18:19:47
For consistency, would you mind matching the way t
Xianzhu
2016/06/15 19:41:11
Done.
|
| + FloatRect clipRect(boxOrigin.x().toFloat(), boxOrigin.y().toFloat(), m_inlineTextBox.logicalWidth().toFloat(), height); |
| + context.clip(clipRect); |
| + context.drawHighlightForText(font, run, clipRect.location(), height, color, sPos, ePos); |
| } |