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..ff366cd2570eae7e854f1094a13c67f6d22a8fc7 100644 |
--- a/third_party/WebKit/Source/core/layout/LayoutObject.cpp |
+++ b/third_party/WebKit/Source/core/layout/LayoutObject.cpp |
@@ -1845,12 +1845,23 @@ 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()) { |
+ LayoutBlock* block = nullptr; |
+ if (isLayoutBlockFlow() || isLayoutButton()) { |
+ block = toLayoutBlock(this); |
+ } else if (isLayoutInline()) { |
+ if (toLayoutInline(this)->firstLineBoxIncludingCulling()->isFirstLineStyle()) |
mstensho (USE GERRIT)
2015/12/02 10:09:31
Can't firstLineBoxIncludingCulling() return nullpt
Xianzhu
2015/12/02 17:41:57
Not sure though didn't encounter. Added nullptr ch
|
+ block = containingBlock(); |
+ } |
+ if (block) { |
+ block->invalidateDisplayItemClientsOfFirstLine(); |
+ if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled()) |
+ block->setShouldDoFullPaintInvalidation(); |
+ } |
} |
+ if (diff.needsLayout()) |
+ setNeedsLayoutAndPrefWidthsRecalc(LayoutInvalidationReason::StyleChange); |
} |
void LayoutObject::markContainingBlocksForOverflowRecalc() |