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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutObject.cpp

Issue 1363913004: [Reland] Invalidate whitespace text on text color changes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
Index: third_party/WebKit/Source/core/layout/LayoutObject.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutObject.cpp b/third_party/WebKit/Source/core/layout/LayoutObject.cpp
index d0c0e001d1fd64cf6d40c402f37b7d80c5e0a784..80565df0ef762904c649c481e51d244adfde82f2 100644
--- a/third_party/WebKit/Source/core/layout/LayoutObject.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutObject.cpp
@@ -1722,10 +1722,13 @@ StyleDifference LayoutObject::adjustStyleDifference(StyleDifference diff) const
diff.setNeedsPaintInvalidationLayer();
}
- if (diff.textOrColorChanged() && !diff.needsPaintInvalidation()) {
+ // Optimization: for decoration/color property changes, invalidation is only needed if we have style or text affected by these properties.
+ if (diff.textDecorationOrColorChanged() && !diff.needsPaintInvalidation()) {
if (style()->hasBorder() || style()->hasOutline()
|| style()->isBackgroundColorCurrentColor()
- || (isText() && !toLayoutText(this)->isAllCollapsibleWhitespace()))
+ // Skip any text nodes that do not contain text boxes. Whitespace cannot be
+ // skipped or we will miss invalidating decorations (e.g., underlines).
+ || (isText() && !isBR() && toLayoutText(this)->hasTextBoxes()))
diff.setNeedsPaintInvalidationObject();
}

Powered by Google App Engine
This is Rietveld 408576698