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

Side by Side 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: Merge allLayersAreLocal and ComputedStyle::hasEntirelyLocalBackground 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) 2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
4 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. 4 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 1188 matching lines...) Expand 10 before | Expand all | Expand 10 after
1199 } 1199 }
1200 1200
1201 return true; 1201 return true;
1202 } 1202 }
1203 1203
1204 bool ComputedStyle::hasEntirelyFixedBackground() const 1204 bool ComputedStyle::hasEntirelyFixedBackground() const
1205 { 1205 {
1206 return allLayersAreFixed(backgroundLayers()); 1206 return allLayersAreFixed(backgroundLayers());
1207 } 1207 }
1208 1208
1209 bool ComputedStyle::hasEntirelyLocalBackground() const
1210 {
1211 const FillLayer* layer = &backgroundLayers();
1212 for (; layer; layer = layer->next()) {
1213 if (layer->attachment() == LocalBackgroundAttachment)
1214 continue;
1215 // Solid color layers with a background clip of the padding box can be t reated
1216 // as local.
1217 // TODO(flackr): We can handle other fill boxes with solid colors as lon g as they
1218 // are essentially the same (i.e. PaddingFillBox == ContentFillBox when padding = 0).
1219 if (!layer->image() && !layer->next() && layer->clip() == PaddingFillBox )
1220 continue;
1221 return false;
1222 }
1223 return true;
1224 }
1225
1209 const CounterDirectiveMap* ComputedStyle::counterDirectives() const 1226 const CounterDirectiveMap* ComputedStyle::counterDirectives() const
1210 { 1227 {
1211 return m_rareNonInheritedData->m_counterDirectives.get(); 1228 return m_rareNonInheritedData->m_counterDirectives.get();
1212 } 1229 }
1213 1230
1214 CounterDirectiveMap& ComputedStyle::accessCounterDirectives() 1231 CounterDirectiveMap& ComputedStyle::accessCounterDirectives()
1215 { 1232 {
1216 std::unique_ptr<CounterDirectiveMap>& map = m_rareNonInheritedData.access()- >m_counterDirectives; 1233 std::unique_ptr<CounterDirectiveMap>& map = m_rareNonInheritedData.access()- >m_counterDirectives;
1217 if (!map) 1234 if (!map)
1218 map = wrapUnique(new CounterDirectiveMap); 1235 map = wrapUnique(new CounterDirectiveMap);
(...skipping 747 matching lines...) Expand 10 before | Expand all | Expand 10 after
1966 if (value < 0) 1983 if (value < 0)
1967 fvalue -= 0.5f; 1984 fvalue -= 0.5f;
1968 else 1985 else
1969 fvalue += 0.5f; 1986 fvalue += 0.5f;
1970 } 1987 }
1971 1988
1972 return roundForImpreciseConversion<int>(fvalue / zoomFactor); 1989 return roundForImpreciseConversion<int>(fvalue / zoomFactor);
1973 } 1990 }
1974 1991
1975 } // namespace blink 1992 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698