Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(671)

Unified Diff: third_party/WebKit/Source/core/style/ComputedStyle.cpp

Issue 2068723002: Paint local attachment backgrounds into composited scrolling contents layer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add/update tests and simplify added code. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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();

Powered by Google App Engine
This is Rietveld 408576698