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

Unified Diff: third_party/WebKit/Source/core/dom/Text.cpp

Issue 2369963005: Avoid creating consecutive whitespace renderers. (Closed)
Patch Set: Rebased and manually fixed expectations Created 4 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
Index: third_party/WebKit/Source/core/dom/Text.cpp
diff --git a/third_party/WebKit/Source/core/dom/Text.cpp b/third_party/WebKit/Source/core/dom/Text.cpp
index 89d8f9b7e117e18cf10bf07a05200ee52fc68cca..7e5f6d230874ef0cc85fc35180835d43d8e67084 100644
--- a/third_party/WebKit/Source/core/dom/Text.cpp
+++ b/third_party/WebKit/Source/core/dom/Text.cpp
@@ -294,6 +294,8 @@ bool Text::textLayoutObjectIsNeeded(const ComputedStyle& style, const LayoutObje
const LayoutObject* prev = LayoutTreeBuilderTraversal::previousSiblingLayoutObject(*this);
if (prev && prev->isBR()) // <span><br/> <br/></span>
return false;
+ if (prev && prev->isText() && prev->node()->isTextNode() && toText(prev->node())->containsOnlyWhitespace())
+ return false;
if (parent.isLayoutInline()) {
// <span><div/> <div/></span>

Powered by Google App Engine
This is Rietveld 408576698