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) |
| 1210 { |
| 1211 for (; layer; layer = layer->next()) { |
| 1212 if (layer->attachment() == LocalBackgroundAttachment) |
| 1213 continue; |
| 1214 // Solid color layers with a background clip of the padding box can be t
reated |
| 1215 // as local. |
| 1216 // TODO(flackr): We can handle other fill boxes with solid colors as lon
g as they |
| 1217 // are essentially the same (i.e. PaddingFillBox == ContentFillBox when
padding = 0). |
| 1218 if (!layer->image() && !layer->next() && layer->clip() == PaddingFillBox
) |
| 1219 continue; |
| 1220 return false; |
| 1221 } |
| 1222 |
| 1223 return true; |
| 1224 } |
| 1225 |
| 1226 bool ComputedStyle::hasEntirelyLocalBackground() const |
| 1227 { |
| 1228 const FillLayer& layer = backgroundLayers(); |
| 1229 return allLayersAreLocal(&layer); |
| 1230 } |
| 1231 |
1209 const CounterDirectiveMap* ComputedStyle::counterDirectives() const | 1232 const CounterDirectiveMap* ComputedStyle::counterDirectives() const |
1210 { | 1233 { |
1211 return m_rareNonInheritedData->m_counterDirectives.get(); | 1234 return m_rareNonInheritedData->m_counterDirectives.get(); |
1212 } | 1235 } |
1213 | 1236 |
1214 CounterDirectiveMap& ComputedStyle::accessCounterDirectives() | 1237 CounterDirectiveMap& ComputedStyle::accessCounterDirectives() |
1215 { | 1238 { |
1216 std::unique_ptr<CounterDirectiveMap>& map = m_rareNonInheritedData.access()-
>m_counterDirectives; | 1239 std::unique_ptr<CounterDirectiveMap>& map = m_rareNonInheritedData.access()-
>m_counterDirectives; |
1217 if (!map) | 1240 if (!map) |
1218 map = wrapUnique(new CounterDirectiveMap); | 1241 map = wrapUnique(new CounterDirectiveMap); |
(...skipping 747 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1966 if (value < 0) | 1989 if (value < 0) |
1967 fvalue -= 0.5f; | 1990 fvalue -= 0.5f; |
1968 else | 1991 else |
1969 fvalue += 0.5f; | 1992 fvalue += 0.5f; |
1970 } | 1993 } |
1971 | 1994 |
1972 return roundForImpreciseConversion<int>(fvalue / zoomFactor); | 1995 return roundForImpreciseConversion<int>(fvalue / zoomFactor); |
1973 } | 1996 } |
1974 | 1997 |
1975 } // namespace blink | 1998 } // namespace blink |
OLD | NEW |