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

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

Issue 1407003002: Don't widen selection paint rect for linebreaks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More test expectations. Created 5 years, 2 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/platform/win/virtual/spv2/paint/selection/text-selection-newline-br-expected.png ('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 b438aa1d136d5506c8acfc42b002107db9c31510..590e62e14778aee0df254a588cc775baee6b6b47 100644
--- a/third_party/WebKit/Source/core/paint/InlineTextBoxPainter.cpp
+++ b/third_party/WebKit/Source/core/paint/InlineTextBoxPainter.cpp
@@ -488,7 +488,9 @@ void InlineTextBoxPainter::paintSelection(GraphicsContext* context, const Layout
FloatPoint localOrigin(boxRect.x().toFloat(), (boxRect.y() - deltaY).toFloat());
LayoutRect selectionRect = LayoutRect(font.selectionRectForText(textRun, localOrigin, selHeight, sPos, ePos));
- if (m_inlineTextBox.hasWrappedSelectionNewline())
+ if (m_inlineTextBox.hasWrappedSelectionNewline()
+ // For line breaks, just painting a selection where the line break itself is rendered is sufficient.
+ && !m_inlineTextBox.isLineBreak())
expandToIncludeNewlineForSelection(selectionRect);
context->fillRect(FloatRect(selectionRect), c);
« no previous file with comments | « third_party/WebKit/LayoutTests/platform/win/virtual/spv2/paint/selection/text-selection-newline-br-expected.png ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698