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

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: Improve opaque layer detection and fix non-composited border painting bug in layout tests. 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 1187 matching lines...) Expand 10 before | Expand all | Expand 10 after
1198 } 1198 }
1199 1199
1200 return true; 1200 return true;
1201 } 1201 }
1202 1202
1203 bool ComputedStyle::hasEntirelyFixedBackground() const 1203 bool ComputedStyle::hasEntirelyFixedBackground() const
1204 { 1204 {
1205 return allLayersAreFixed(backgroundLayers()); 1205 return allLayersAreFixed(backgroundLayers());
1206 } 1206 }
1207 1207
1208 static bool allLayersAreLocal(const FillLayer& layer)
1209 {
1210 for (const FillLayer* currLayer = &layer; currLayer; currLayer = currLayer-> next()) {
1211 if (currLayer->attachment() != LocalBackgroundAttachment)
1212 return false;
1213 }
1214
1215 return true;
1216 }
1217
1218 bool ComputedStyle::hasEntirelyLocalBackground() const
1219 {
1220 return allLayersAreLocal(backgroundLayers());
1221 }
1222
1208 const CounterDirectiveMap* ComputedStyle::counterDirectives() const 1223 const CounterDirectiveMap* ComputedStyle::counterDirectives() const
1209 { 1224 {
1210 return m_rareNonInheritedData->m_counterDirectives.get(); 1225 return m_rareNonInheritedData->m_counterDirectives.get();
1211 } 1226 }
1212 1227
1213 CounterDirectiveMap& ComputedStyle::accessCounterDirectives() 1228 CounterDirectiveMap& ComputedStyle::accessCounterDirectives()
1214 { 1229 {
1215 std::unique_ptr<CounterDirectiveMap>& map = m_rareNonInheritedData.access()- >m_counterDirectives; 1230 std::unique_ptr<CounterDirectiveMap>& map = m_rareNonInheritedData.access()- >m_counterDirectives;
1216 if (!map) 1231 if (!map)
1217 map = wrapUnique(new CounterDirectiveMap); 1232 map = wrapUnique(new CounterDirectiveMap);
(...skipping 740 matching lines...) Expand 10 before | Expand all | Expand 10 after
1958 if (value < 0) 1973 if (value < 0)
1959 fvalue -= 0.5f; 1974 fvalue -= 0.5f;
1960 else 1975 else
1961 fvalue += 0.5f; 1976 fvalue += 0.5f;
1962 } 1977 }
1963 1978
1964 return roundForImpreciseConversion<int>(fvalue / zoomFactor); 1979 return roundForImpreciseConversion<int>(fvalue / zoomFactor);
1965 } 1980 }
1966 1981
1967 } // namespace blink 1982 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698