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 eaf131347ee76602bf0b2eefd5e9eff3e529bf2f..9c81f60109f88fe1f4a4280d450dacfc9dafd753 100644 |
--- a/third_party/WebKit/Source/core/layout/LayoutObject.cpp |
+++ b/third_party/WebKit/Source/core/layout/LayoutObject.cpp |
@@ -1930,6 +1930,33 @@ void LayoutObject::styleDidChange(StyleDifference diff, |
oldStyle->backgroundLayers() != styleRef().backgroundLayers()) |
setBackgroundChangedSinceLastPaintInvalidation(); |
} |
+ |
+ if (oldStyle && oldStyle->styleType() == PseudoIdNone) |
+ applyPseudoStyleChanges(*oldStyle); |
+} |
+ |
+void LayoutObject::applyPseudoStyleChanges(const ComputedStyle& oldStyle) { |
+ if (oldStyle.hasPseudoStyle(PseudoIdFirstLine) || |
+ styleRef().hasPseudoStyle(PseudoIdFirstLine)) |
+ applyFirstLineChanges(oldStyle); |
+ |
+ // TODO(rune@opera.com): Move the invalidation for ::selection here. |
+ // Instead of having a PaintInvalidationSelectionOnly PaintInvalidationType |
+ // used for the element diff, we should use PaintInvalidationObject diff on |
+ // the pseudo element style here instead. |
+} |
+ |
+void LayoutObject::applyFirstLineChanges(const ComputedStyle& oldStyle) { |
+ RefPtr<ComputedStyle> oldPseudoStyle; |
+ RefPtr<ComputedStyle> newPseudoStyle; |
+ if (oldStyle.hasPseudoStyle(PseudoIdFirstLine)) |
+ oldPseudoStyle = oldStyle.getCachedPseudoStyle(PseudoIdFirstLine); |
+ if (styleRef().hasPseudoStyle(PseudoIdFirstLine) && oldPseudoStyle) |
mstensho (USE GERRIT)
2017/03/07 10:04:26
This will never be true if oldStyle.hasPseudoStyle
rune
2017/03/07 10:42:54
Done.
|
+ newPseudoStyle = uncachedFirstLineStyle(mutableStyle()); |
+ if (oldPseudoStyle && newPseudoStyle) |
mstensho (USE GERRIT)
2017/03/07 10:04:26
Ditto - if you just return after the firstLineStyl
rune
2017/03/07 10:42:54
Done.
|
+ firstLineStyleDidChange(*oldPseudoStyle, *newPseudoStyle); |
+ else |
+ setNeedsLayoutAndPrefWidthsRecalc(LayoutInvalidationReason::StyleChange); |
} |
void LayoutObject::propagateStyleToAnonymousChildren() { |