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..910c4482e1a1a68ae814234d2f87009e34fa5bec 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,43 @@ bool ComputedStyle::diffNeedsPaintInvalidationObject(const ComputedStyle& other) |
if (resize() != other.resize()) |
return true; |
+ const StyleImage* image = borderImage().image(); |
ikilpatrick
2016/04/19 22:31:25
Should this block be if-guarded with:
1) if (Runti
rune
2016/04/27 11:34:34
Something like that. I would check the performance
ikilpatrick
2016/04/28 22:30:16
Changed this quite a bit now after chat with ellio
|
+ if (image && image->isPaintImage() && diffNeedsPaintInvalidationObjectForPaintImage(image, other)) |
rune
2016/04/27 11:34:34
So the assumption here is that the image pointers
ikilpatrick
2016/04/28 22:30:16
Yup thats correct.
|
+ 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()); |
+ |
+ 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; |
rune
2016/04/27 11:34:34
The variable is resolved at this point, I guess? (
ikilpatrick
2016/04/28 22:30:16
Yup, the variables are resolved with each other at
|
+ if (thisVar != otherVar) |
rune
2016/04/27 11:34:34
A pointer comparison. Is that correct?
If one of
ikilpatrick
2016/04/28 22:30:16
Oh, yeah completely not correct. Sorry about that.
|
+ return true; |
+ } |
+ |
return false; |
} |