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