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()); |