Chromium Code Reviews| 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 2a8d96148b2551660a4739d5e892cbc991cb3fc0..d5425ccf47fe32858fd7c0366dfdb2b3ee5abf9a 100644 |
| --- a/third_party/WebKit/Source/core/layout/LayoutObject.cpp |
| +++ b/third_party/WebKit/Source/core/layout/LayoutObject.cpp |
| @@ -1844,13 +1844,15 @@ void LayoutObject::setPseudoStyle(PassRefPtr<ComputedStyle> pseudoStyle) |
| void LayoutObject::firstLineStyleDidChange(const ComputedStyle& oldStyle, const ComputedStyle& newStyle) |
| { |
| - StyleDifference diff = oldStyle.visualInvalidationDiff(newStyle); |
| - if (diff.hasDifference()) { |
| - // TODO(rune@opera.com): We should use the diff to determine whether a repaint vs. layout |
| - // is needed, but for now just assume a layout will be required. The diff code |
| - // in LayoutObject::setStyle would need to be factored out so that it could be reused. |
| - setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(LayoutInvalidationReason::StyleChange); |
| + StyleDifference diff = adjustStyleDifference(oldStyle.visualInvalidationDiff(newStyle)); |
|
chrishtr
2015/11/24 23:21:56
Is the change in this file strictly necessary?
Xianzhu
2015/11/24 23:26:58
I think yes.
The above line ensures that StyleDif
|
| + |
| + if (diff.needsPaintInvalidation()) { |
| + setShouldDoFullPaintInvalidation(); |
| + if (isLayoutBlockFlow()) |
| + toLayoutBlockFlow(this)->invalidateDisplayItemClientsOfFirstLine(); |
| } |
| + if (diff.needsLayout()) |
| + setNeedsLayoutAndPrefWidthsRecalc(LayoutInvalidationReason::StyleChange); |
| } |
| void LayoutObject::markContainingBlocksForOverflowRecalc() |