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

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: Address review comments. 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..04a423e3dd88197eb77e0ac8be3b9a0454dc8aa9 100644
--- a/third_party/WebKit/Source/core/style/ComputedStyle.cpp
+++ b/third_party/WebKit/Source/core/style/ComputedStyle.cpp
@@ -1206,6 +1206,29 @@ bool ComputedStyle::hasEntirelyFixedBackground() const
return allLayersAreFixed(backgroundLayers());
}
+static bool allLayersAreLocal(const FillLayer* layer)
+{
+ for (; layer; layer = layer->next()) {
+ if (layer->attachment() == LocalBackgroundAttachment)
+ continue;
+ // Solid color layers with a background clip of the padding box can be treated
+ // as local.
+ // 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 (!layer->image() && !layer->next() && layer->clip() == PaddingFillBox)
+ continue;
+ return false;
+ }
+
+ return true;
+}
+
+bool ComputedStyle::hasEntirelyLocalBackground() const
+{
+ const FillLayer& layer = backgroundLayers();
+ return allLayersAreLocal(&layer);
+}
+
const CounterDirectiveMap* ComputedStyle::counterDirectives() const
{
return m_rareNonInheritedData->m_counterDirectives.get();

Powered by Google App Engine
This is Rietveld 408576698