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

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 and fix test expectations. Created 4 years, 3 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 1250 matching lines...) Expand 10 before | Expand all | Expand 10 after
1261 } 1261 }
1262 1262
1263 return true; 1263 return true;
1264 } 1264 }
1265 1265
1266 bool ComputedStyle::hasEntirelyFixedBackground() const 1266 bool ComputedStyle::hasEntirelyFixedBackground() const
1267 { 1267 {
1268 return allLayersAreFixed(backgroundLayers()); 1268 return allLayersAreFixed(backgroundLayers());
1269 } 1269 }
1270 1270
1271 bool ComputedStyle::hasEntirelyLocalBackground() const
1272 {
1273 const FillLayer* layer = &backgroundLayers();
1274 for (; layer; layer = layer->next()) {
1275 if (layer->attachment() == LocalBackgroundAttachment)
1276 continue;
1277 // Solid color layers with a background clip of the padding box can be t reated
1278 // as local.
1279 // TODO(flackr): We can handle other fill boxes with solid colors as lon g as they
1280 // are essentially the same (i.e. PaddingFillBox == ContentFillBox when padding = 0).
1281 if (!layer->image() && !layer->next() && layer->clip() == PaddingFillBox )
1282 continue;
1283 return false;
1284 }
1285 return true;
1286 }
1287
1271 const CounterDirectiveMap* ComputedStyle::counterDirectives() const 1288 const CounterDirectiveMap* ComputedStyle::counterDirectives() const
1272 { 1289 {
1273 return m_rareNonInheritedData->m_counterDirectives.get(); 1290 return m_rareNonInheritedData->m_counterDirectives.get();
1274 } 1291 }
1275 1292
1276 CounterDirectiveMap& ComputedStyle::accessCounterDirectives() 1293 CounterDirectiveMap& ComputedStyle::accessCounterDirectives()
1277 { 1294 {
1278 std::unique_ptr<CounterDirectiveMap>& map = m_rareNonInheritedData.access()- >m_counterDirectives; 1295 std::unique_ptr<CounterDirectiveMap>& map = m_rareNonInheritedData.access()- >m_counterDirectives;
1279 if (!map) 1296 if (!map)
1280 map = wrapUnique(new CounterDirectiveMap); 1297 map = wrapUnique(new CounterDirectiveMap);
(...skipping 746 matching lines...) Expand 10 before | Expand all | Expand 10 after
2027 if (value < 0) 2044 if (value < 0)
2028 fvalue -= 0.5f; 2045 fvalue -= 0.5f;
2029 else 2046 else
2030 fvalue += 0.5f; 2047 fvalue += 0.5f;
2031 } 2048 }
2032 2049
2033 return roundForImpreciseConversion<int>(fvalue / zoomFactor); 2050 return roundForImpreciseConversion<int>(fvalue / zoomFactor);
2034 } 2051 }
2035 2052
2036 } // namespace blink 2053 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/style/ComputedStyle.h ('k') | third_party/WebKit/Source/core/style/ComputedStyleConstants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698