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 14 matching lines...) Expand all Loading... |
25 #include "core/animation/css/CSSAnimationData.h" | 25 #include "core/animation/css/CSSAnimationData.h" |
26 #include "core/animation/css/CSSTransitionData.h" | 26 #include "core/animation/css/CSSTransitionData.h" |
27 #include "core/css/CSSPaintValue.h" | 27 #include "core/css/CSSPaintValue.h" |
28 #include "core/css/CSSPrimitiveValue.h" | 28 #include "core/css/CSSPrimitiveValue.h" |
29 #include "core/css/CSSPropertyEquality.h" | 29 #include "core/css/CSSPropertyEquality.h" |
30 #include "core/css/resolver/StyleResolver.h" | 30 #include "core/css/resolver/StyleResolver.h" |
31 #include "core/layout/LayoutTheme.h" | 31 #include "core/layout/LayoutTheme.h" |
32 #include "core/layout/TextAutosizer.h" | 32 #include "core/layout/TextAutosizer.h" |
33 #include "core/style/AppliedTextDecoration.h" | 33 #include "core/style/AppliedTextDecoration.h" |
34 #include "core/style/BorderEdge.h" | 34 #include "core/style/BorderEdge.h" |
| 35 #include "core/style/ContentData.h" |
| 36 #include "core/style/DataEquivalency.h" |
35 #include "core/style/ComputedStyleConstants.h" | 37 #include "core/style/ComputedStyleConstants.h" |
36 #include "core/style/ContentData.h" | |
37 #include "core/style/CursorData.h" | 38 #include "core/style/CursorData.h" |
38 #include "core/style/DataEquivalency.h" | |
39 #include "core/style/QuotesData.h" | 39 #include "core/style/QuotesData.h" |
40 #include "core/style/ShadowList.h" | 40 #include "core/style/ShadowList.h" |
41 #include "core/style/StyleImage.h" | 41 #include "core/style/StyleImage.h" |
42 #include "core/style/StyleInheritedData.h" | 42 #include "core/style/StyleInheritedData.h" |
43 #include "core/style/StyleVariableData.h" | 43 #include "core/style/StyleVariableData.h" |
44 #include "platform/LengthFunctions.h" | 44 #include "platform/LengthFunctions.h" |
45 #include "platform/RuntimeEnabledFeatures.h" | 45 #include "platform/RuntimeEnabledFeatures.h" |
46 #include "platform/fonts/Font.h" | 46 #include "platform/fonts/Font.h" |
47 #include "platform/fonts/FontSelector.h" | 47 #include "platform/fonts/FontSelector.h" |
48 #include "platform/geometry/FloatRoundedRect.h" | 48 #include "platform/geometry/FloatRoundedRect.h" |
49 #include "platform/graphics/GraphicsContext.h" | 49 #include "platform/graphics/GraphicsContext.h" |
50 #include "platform/transforms/RotateTransformOperation.h" | 50 #include "platform/transforms/RotateTransformOperation.h" |
51 #include "platform/transforms/ScaleTransformOperation.h" | 51 #include "platform/transforms/ScaleTransformOperation.h" |
52 #include "platform/transforms/TranslateTransformOperation.h" | 52 #include "platform/transforms/TranslateTransformOperation.h" |
53 #include "wtf/MathExtras.h" | 53 #include "wtf/MathExtras.h" |
54 #include "wtf/PtrUtil.h" | 54 #include "wtf/PtrUtil.h" |
| 55 |
55 #include <algorithm> | 56 #include <algorithm> |
56 #include <memory> | |
57 | 57 |
58 namespace blink { | 58 namespace blink { |
59 | 59 |
60 struct SameSizeAsBorderValue { | 60 struct SameSizeAsBorderValue { |
61 RGBA32 m_color; | 61 RGBA32 m_color; |
62 unsigned m_width; | 62 unsigned m_width; |
63 }; | 63 }; |
64 | 64 |
65 static_assert(sizeof(BorderValue) == sizeof(SameSizeAsBorderValue), "BorderValue
should stay small"); | 65 static_assert(sizeof(BorderValue) == sizeof(SameSizeAsBorderValue), "BorderValue
should stay small"); |
66 | 66 |
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 ComputedStyle* ComputedStyle::addCachedPseudoStyle(PassRefPtr<ComputedStyle> pse
udo) | 399 ComputedStyle* ComputedStyle::addCachedPseudoStyle(PassRefPtr<ComputedStyle> pse
udo) |
400 { | 400 { |
401 if (!pseudo) | 401 if (!pseudo) |
402 return 0; | 402 return 0; |
403 | 403 |
404 ASSERT(pseudo->styleType() > PseudoIdNone); | 404 ASSERT(pseudo->styleType() > PseudoIdNone); |
405 | 405 |
406 ComputedStyle* result = pseudo.get(); | 406 ComputedStyle* result = pseudo.get(); |
407 | 407 |
408 if (!m_cachedPseudoStyles) | 408 if (!m_cachedPseudoStyles) |
409 m_cachedPseudoStyles = wrapUnique(new PseudoStyleCache); | 409 m_cachedPseudoStyles = adoptPtr(new PseudoStyleCache); |
410 | 410 |
411 m_cachedPseudoStyles->append(pseudo); | 411 m_cachedPseudoStyles->append(pseudo); |
412 | 412 |
413 return result; | 413 return result; |
414 } | 414 } |
415 | 415 |
416 void ComputedStyle::removeCachedPseudoStyle(PseudoId pid) | 416 void ComputedStyle::removeCachedPseudoStyle(PseudoId pid) |
417 { | 417 { |
418 if (!m_cachedPseudoStyles) | 418 if (!m_cachedPseudoStyles) |
419 return; | 419 return; |
(...skipping 722 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1142 return allLayersAreFixed(backgroundLayers()); | 1142 return allLayersAreFixed(backgroundLayers()); |
1143 } | 1143 } |
1144 | 1144 |
1145 const CounterDirectiveMap* ComputedStyle::counterDirectives() const | 1145 const CounterDirectiveMap* ComputedStyle::counterDirectives() const |
1146 { | 1146 { |
1147 return rareNonInheritedData->m_counterDirectives.get(); | 1147 return rareNonInheritedData->m_counterDirectives.get(); |
1148 } | 1148 } |
1149 | 1149 |
1150 CounterDirectiveMap& ComputedStyle::accessCounterDirectives() | 1150 CounterDirectiveMap& ComputedStyle::accessCounterDirectives() |
1151 { | 1151 { |
1152 std::unique_ptr<CounterDirectiveMap>& map = rareNonInheritedData.access()->m
_counterDirectives; | 1152 OwnPtr<CounterDirectiveMap>& map = rareNonInheritedData.access()->m_counterD
irectives; |
1153 if (!map) | 1153 if (!map) |
1154 map = wrapUnique(new CounterDirectiveMap); | 1154 map = adoptPtr(new CounterDirectiveMap); |
1155 return *map; | 1155 return *map; |
1156 } | 1156 } |
1157 | 1157 |
1158 const CounterDirectives ComputedStyle::getCounterDirectives(const AtomicString&
identifier) const | 1158 const CounterDirectives ComputedStyle::getCounterDirectives(const AtomicString&
identifier) const |
1159 { | 1159 { |
1160 if (const CounterDirectiveMap* directives = counterDirectives()) | 1160 if (const CounterDirectiveMap* directives = counterDirectives()) |
1161 return directives->get(identifier); | 1161 return directives->get(identifier); |
1162 return CounterDirectives(); | 1162 return CounterDirectives(); |
1163 } | 1163 } |
1164 | 1164 |
(...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1873 if (value < 0) | 1873 if (value < 0) |
1874 fvalue -= 0.5f; | 1874 fvalue -= 0.5f; |
1875 else | 1875 else |
1876 fvalue += 0.5f; | 1876 fvalue += 0.5f; |
1877 } | 1877 } |
1878 | 1878 |
1879 return roundForImpreciseConversion<int>(fvalue / zoomFactor); | 1879 return roundForImpreciseConversion<int>(fvalue / zoomFactor); |
1880 } | 1880 } |
1881 | 1881 |
1882 } // namespace blink | 1882 } // namespace blink |
OLD | NEW |