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

Unified Diff: Source/core/layout/LayoutBR.cpp

Issue 1350973003: Invalidate line break selection rects when selected. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Don't need redundant early-out for selection rect. Created 5 years, 3 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 | « Source/core/layout/LayoutBR.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/LayoutBR.cpp
diff --git a/Source/core/layout/LayoutBR.cpp b/Source/core/layout/LayoutBR.cpp
index 7ddd1277d1311dfba5bf9c31b24f1d073132a336..d58513bd7a4ba9dcc15695cc820bee37ef47323a 100644
--- a/Source/core/layout/LayoutBR.cpp
+++ b/Source/core/layout/LayoutBR.cpp
@@ -44,6 +44,16 @@ LayoutBR::~LayoutBR()
{
}
+LayoutRect LayoutBR::selectionRectForPaintInvalidation(const LayoutBoxModelObject* paintInvalidationContainer) const
+{
+ if (!RuntimeEnabledFeatures::selectionPaintingWithoutSelectionGapsEnabled())
+ return LayoutRect();
+
+ // Although line breaks contain no actual text, if we're selected we need
+ // to return a rect that includes space to illustrate a newline.
+ return LayoutText::selectionRectForPaintInvalidation(paintInvalidationContainer);
+}
+
int LayoutBR::lineHeight(bool firstLine) const
{
const ComputedStyle& style = styleRef(firstLine && document().styleEngine().usesFirstLineRules());
« no previous file with comments | « Source/core/layout/LayoutBR.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698