Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(624)

Unified Diff: third_party/WebKit/Source/core/paint/InlineTextBoxPainter.cpp

Issue 2065723002: Don't use selection bounds to paint document marker (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Don't use selection bounds to paint document marker Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/paint/text/text-match-highlights-big-line-height-expected.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..cab7bfb04142e213294e596ad1ee9fc98a6f16f9 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);
+
+ LayoutRect boxRect(boxOrigin, LayoutSize(m_inlineTextBox.logicalWidth(), m_inlineTextBox.logicalHeight()));
+ context.clip(FloatRect(boxRect));
+ context.drawHighlightForText(font, run, FloatPoint(boxOrigin), boxRect.height(), color, sPos, ePos);
}
« no previous file with comments | « third_party/WebKit/LayoutTests/paint/text/text-match-highlights-big-line-height-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698