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 28 matching lines...) Expand all Loading... |
39 #include "platform/LengthFunctions.h" | 39 #include "platform/LengthFunctions.h" |
40 #include "platform/RuntimeEnabledFeatures.h" | 40 #include "platform/RuntimeEnabledFeatures.h" |
41 #include "platform/fonts/Font.h" | 41 #include "platform/fonts/Font.h" |
42 #include "platform/fonts/FontSelector.h" | 42 #include "platform/fonts/FontSelector.h" |
43 #include "platform/geometry/FloatRoundedRect.h" | 43 #include "platform/geometry/FloatRoundedRect.h" |
44 #include "platform/graphics/GraphicsContext.h" | 44 #include "platform/graphics/GraphicsContext.h" |
45 #include "platform/transforms/RotateTransformOperation.h" | 45 #include "platform/transforms/RotateTransformOperation.h" |
46 #include "platform/transforms/ScaleTransformOperation.h" | 46 #include "platform/transforms/ScaleTransformOperation.h" |
47 #include "platform/transforms/TranslateTransformOperation.h" | 47 #include "platform/transforms/TranslateTransformOperation.h" |
48 #include "wtf/MathExtras.h" | 48 #include "wtf/MathExtras.h" |
| 49 #include "wtf/SizeAssertions.h" |
49 | 50 |
50 #include <algorithm> | 51 #include <algorithm> |
51 | 52 |
52 namespace blink { | 53 namespace blink { |
53 | 54 |
54 struct SameSizeAsBorderValue { | 55 ASSERT_SIZE(BorderValue, 8, 8); |
55 RGBA32 m_color; | 56 ASSERT_SIZE(ComputedStyle, 56, 96); |
56 unsigned m_width; | |
57 }; | |
58 | |
59 static_assert(sizeof(BorderValue) == sizeof(SameSizeAsBorderValue), "BorderValue
should stay small"); | |
60 | |
61 struct SameSizeAsComputedStyle : public RefCounted<SameSizeAsComputedStyle> { | |
62 void* dataRefs[7]; | |
63 void* ownPtrs[1]; | |
64 void* dataRefSvgStyle; | |
65 | |
66 struct InheritedFlags { | |
67 unsigned m_bitfields[2]; | |
68 } inherited_flags; | |
69 | |
70 struct NonInheritedFlags { | |
71 unsigned m_bitfields[2]; | |
72 } noninherited_flags; | |
73 }; | |
74 | |
75 static_assert(sizeof(ComputedStyle) == sizeof(SameSizeAsComputedStyle), "Compute
dStyle should stay small"); | |
76 | 57 |
77 PassRefPtr<ComputedStyle> ComputedStyle::create() | 58 PassRefPtr<ComputedStyle> ComputedStyle::create() |
78 { | 59 { |
79 return adoptRef(new ComputedStyle()); | 60 return adoptRef(new ComputedStyle()); |
80 } | 61 } |
81 | 62 |
82 PassRefPtr<ComputedStyle> ComputedStyle::createInitialStyle() | 63 PassRefPtr<ComputedStyle> ComputedStyle::createInitialStyle() |
83 { | 64 { |
84 return adoptRef(new ComputedStyle(InitialStyle)); | 65 return adoptRef(new ComputedStyle(InitialStyle)); |
85 } | 66 } |
(...skipping 1713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1799 } | 1780 } |
1800 | 1781 |
1801 void ComputedStyle::copyChildDependentFlagsFrom(const ComputedStyle& other) | 1782 void ComputedStyle::copyChildDependentFlagsFrom(const ComputedStyle& other) |
1802 { | 1783 { |
1803 setEmptyState(other.emptyState()); | 1784 setEmptyState(other.emptyState()); |
1804 if (other.hasExplicitlyInheritedProperties()) | 1785 if (other.hasExplicitlyInheritedProperties()) |
1805 setHasExplicitlyInheritedProperties(); | 1786 setHasExplicitlyInheritedProperties(); |
1806 } | 1787 } |
1807 | 1788 |
1808 } // namespace blink | 1789 } // namespace blink |
OLD | NEW |