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 20681097384728f6e84ccc056967ab3512b3b711..290bd6286983e64f5a0a4a5275032bf11104923f 100644 |
--- a/third_party/WebKit/Source/core/style/ComputedStyle.cpp |
+++ b/third_party/WebKit/Source/core/style/ComputedStyle.cpp |
@@ -1206,6 +1206,24 @@ bool ComputedStyle::hasEntirelyFixedBackground() const |
return allLayersAreFixed(backgroundLayers()); |
} |
+static bool allLayersAreLocal(const FillLayer& layer) |
chrishtr
2016/08/12 17:03:00
Seems to be cleaner to inline this in hasEntirelyL
flackr
2016/08/16 17:52:51
Done.
trchen
2016/08/17 01:22:55
Did you forget to git add?
|
+{ |
+ for (const FillLayer* currLayer = &layer; currLayer; currLayer = currLayer->next()) { |
+ // TODO(flackr): We can handle other fill boxes with solid colors as long as they |
+ // are essentially the same (i.e. PaddingFillBox == ContentFillBox when padding = 0). |
+ if (currLayer->attachment() != LocalBackgroundAttachment |
+ && (currLayer->image() || currLayer->clip() != PaddingFillBox)) |
chrishtr
2016/08/12 17:03:00
I don't understand the PaddingFillBox parts, could
trchen
2016/08/13 00:06:42
I think he is making an exception for solid color
flackr
2016/08/16 17:52:51
Done.
|
+ return false; |
+ } |
+ |
+ return true; |
+} |
+ |
+bool ComputedStyle::hasEntirelyLocalBackground() const |
+{ |
+ return allLayersAreLocal(backgroundLayers()); |
+} |
+ |
const CounterDirectiveMap* ComputedStyle::counterDirectives() const |
{ |
return m_rareNonInheritedData->m_counterDirectives.get(); |