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 d18a8bdfec657ca4677d650192fcf9a19d44e955..b7c4b85f5e3f6091644fb148fe3d1feab7aedcda 100644 |
| --- a/third_party/WebKit/Source/core/layout/LayoutObject.cpp |
| +++ b/third_party/WebKit/Source/core/layout/LayoutObject.cpp |
| @@ -1845,12 +1845,24 @@ 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); |
| + |
| + if (diff.needsPaintInvalidation() || diff.textDecorationOrColorChanged()) { |
| + LayoutBlockFlow* block = nullptr; |
| + if (isLayoutBlockFlow()) { |
| + block = toLayoutBlockFlow(this); |
| + } else { |
| + ASSERT(isLayoutInline()); |
| + if (toLayoutInline(this)->firstLineBoxIncludingCulling()->isFirstLineStyle()) |
| + block = toLayoutBlockFlow(containingBlock()); |
| + } |
| + if (block) { |
| + block->invalidateDisplayItemClientsOfFirstLine(); |
| + if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled()) |
| + block->setShouldDoFullPaintInvalidation(); |
|
Xianzhu
2015/12/01 20:06:25
This is needed for rect-based invalidation. Curren
|
| + } |
| } |
| + if (diff.needsLayout()) |
| + setNeedsLayoutAndPrefWidthsRecalc(LayoutInvalidationReason::StyleChange); |
| } |
| void LayoutObject::markContainingBlocksForOverflowRecalc() |