Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 static bool allLayersAreLocal(const FillLayer& layer) | |
|
chrishtr
2016/08/12 17:03:00
Seems to be cleaner to inline this in hasEntirelyL
flackr
2016/08/16 17:52:51
Done.
trchen
2016/08/17 01:22:55
Did you forget to git add?
| |
| 1210 { | |
| 1211 for (const FillLayer* currLayer = &layer; currLayer; currLayer = currLayer-> next()) { | |
| 1212 // TODO(flackr): We can handle other fill boxes with solid colors as lon g as they | |
| 1213 // are essentially the same (i.e. PaddingFillBox == ContentFillBox when padding = 0). | |
| 1214 if (currLayer->attachment() != LocalBackgroundAttachment | |
| 1215 && (currLayer->image() || currLayer->clip() != PaddingFillBox)) | |
|
chrishtr
2016/08/12 17:03:00
I don't understand the PaddingFillBox parts, could
trchen
2016/08/13 00:06:42
I think he is making an exception for solid color
flackr
2016/08/16 17:52:51
Done.
| |
| 1216 return false; | |
| 1217 } | |
| 1218 | |
| 1219 return true; | |
| 1220 } | |
| 1221 | |
| 1222 bool ComputedStyle::hasEntirelyLocalBackground() const | |
| 1223 { | |
| 1224 return allLayersAreLocal(backgroundLayers()); | |
| 1225 } | |
| 1226 | |
| 1209 const CounterDirectiveMap* ComputedStyle::counterDirectives() const | 1227 const CounterDirectiveMap* ComputedStyle::counterDirectives() const |
| 1210 { | 1228 { |
| 1211 return m_rareNonInheritedData->m_counterDirectives.get(); | 1229 return m_rareNonInheritedData->m_counterDirectives.get(); |
| 1212 } | 1230 } |
| 1213 | 1231 |
| 1214 CounterDirectiveMap& ComputedStyle::accessCounterDirectives() | 1232 CounterDirectiveMap& ComputedStyle::accessCounterDirectives() |
| 1215 { | 1233 { |
| 1216 std::unique_ptr<CounterDirectiveMap>& map = m_rareNonInheritedData.access()- >m_counterDirectives; | 1234 std::unique_ptr<CounterDirectiveMap>& map = m_rareNonInheritedData.access()- >m_counterDirectives; |
| 1217 if (!map) | 1235 if (!map) |
| 1218 map = wrapUnique(new CounterDirectiveMap); | 1236 map = wrapUnique(new CounterDirectiveMap); |
| (...skipping 747 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1966 if (value < 0) | 1984 if (value < 0) |
| 1967 fvalue -= 0.5f; | 1985 fvalue -= 0.5f; |
| 1968 else | 1986 else |
| 1969 fvalue += 0.5f; | 1987 fvalue += 0.5f; |
| 1970 } | 1988 } |
| 1971 | 1989 |
| 1972 return roundForImpreciseConversion<int>(fvalue / zoomFactor); | 1990 return roundForImpreciseConversion<int>(fvalue / zoomFactor); |
| 1973 } | 1991 } |
| 1974 | 1992 |
| 1975 } // namespace blink | 1993 } // namespace blink |
| OLD | NEW |