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

Side by Side Diff: third_party/WebKit/Source/core/style/ComputedStyle.cpp

Issue 2264663002: Paint solid color backgrounds which are equivalent to locally attached into scrolling contents layer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@scrollcontent-paint-bg
Patch Set: Add test and only skip local equivalence if outline enters padding-box 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
« no previous file with comments | « third_party/WebKit/Source/core/style/ComputedStyle.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
1288 const CounterDirectiveMap* ComputedStyle::counterDirectives() const 1271 const CounterDirectiveMap* ComputedStyle::counterDirectives() const
1289 { 1272 {
1290 return m_rareNonInheritedData->m_counterDirectives.get(); 1273 return m_rareNonInheritedData->m_counterDirectives.get();
1291 } 1274 }
1292 1275
1293 CounterDirectiveMap& ComputedStyle::accessCounterDirectives() 1276 CounterDirectiveMap& ComputedStyle::accessCounterDirectives()
1294 { 1277 {
1295 std::unique_ptr<CounterDirectiveMap>& map = m_rareNonInheritedData.access()- >m_counterDirectives; 1278 std::unique_ptr<CounterDirectiveMap>& map = m_rareNonInheritedData.access()- >m_counterDirectives;
1296 if (!map) 1279 if (!map)
1297 map = wrapUnique(new CounterDirectiveMap); 1280 map = wrapUnique(new CounterDirectiveMap);
(...skipping 746 matching lines...) Expand 10 before | Expand all | Expand 10 after
2044 if (value < 0) 2027 if (value < 0)
2045 fvalue -= 0.5f; 2028 fvalue -= 0.5f;
2046 else 2029 else
2047 fvalue += 0.5f; 2030 fvalue += 0.5f;
2048 } 2031 }
2049 2032
2050 return roundForImpreciseConversion<int>(fvalue / zoomFactor); 2033 return roundForImpreciseConversion<int>(fvalue / zoomFactor);
2051 } 2034 }
2052 2035
2053 } // namespace blink 2036 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/style/ComputedStyle.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698