Index: third_party/WebKit/Source/core/style/ComputedStyle.cpp |
diff --git a/third_party/WebKit/Source/core/style/ComputedStyle.cpp b/third_party/WebKit/Source/core/style/ComputedStyle.cpp |
index f1f26471f33d4eab5c6e9dcd5a0c5bce22aa2edd..a9b9186573173e1c0ae054cef247e0ec3ee0d488 100644 |
--- a/third_party/WebKit/Source/core/style/ComputedStyle.cpp |
+++ b/third_party/WebKit/Source/core/style/ComputedStyle.cpp |
@@ -22,6 +22,8 @@ |
#include "core/style/ComputedStyle.h" |
+#include "core/css/CSSPaintValue.h" |
+#include "core/css/CSSPropertyEquality.h" |
#include "core/css/resolver/StyleResolver.h" |
#include "core/layout/LayoutTheme.h" |
#include "core/layout/TextAutosizer.h" |
@@ -759,6 +761,46 @@ bool ComputedStyle::diffNeedsPaintInvalidationObject(const ComputedStyle& other) |
if (resize() != other.resize()) |
return true; |
+ const StyleImage* image = borderImage().image(); |
+ if (image && image->isPaintImage() && diffNeedsPaintInvalidationObjectForPaintImage(image, other)) |
+ return true; |
+ |
+ const StyleImage* listImage = listStyleImage(); |
+ if (listImage && listImage->isPaintImage() && diffNeedsPaintInvalidationObjectForPaintImage(listImage, other)) |
+ return true; |
+ |
+ for (const FillLayer* bgLayer = &m_background->background(); bgLayer; bgLayer = bgLayer->next()) { |
+ if (bgLayer->image() && bgLayer->image()->isPaintImage() && diffNeedsPaintInvalidationObjectForPaintImage(bgLayer->image(), other)) |
+ return true; |
+ } |
+ |
+ for (const ContentData* data = contentData(); data; data = data->next()) { |
+ if (data->isImage() && toImageContentData(data)->image()->isPaintImage() && diffNeedsPaintInvalidationObjectForPaintImage(toImageContentData(data)->image(), other)) |
+ return true; |
+ } |
+ |
+ return false; |
+} |
+ |
+bool ComputedStyle::diffNeedsPaintInvalidationObjectForPaintImage(const StyleImage* image, const ComputedStyle& other) const |
+{ |
+ CSSPaintValue* value = toCSSPaintValue(image->cssValue()); |
+ |
+ if (!value->nativeInvalidationProperties() || !value->customInvalidationProperties()) |
+ return true; |
+ |
+ for (CSSPropertyID propertyID : *value->nativeInvalidationProperties()) { |
+ if (!CSSPropertyEquality::propertiesEqual(propertyID, *this, other)) |
+ return true; |
+ } |
+ |
+ for (const AtomicString& property : *value->customInvalidationProperties()) { |
+ CSSVariableData* thisVar = variables() ? variables()->getVariable(property) : nullptr; |
+ CSSVariableData* otherVar = other.variables() ? other.variables()->getVariable(property) : nullptr; |
+ if (thisVar != otherVar) |
+ return true; |
+ } |
+ |
return false; |
} |