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 | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights |
4 * reserved. | 4 * reserved. |
5 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. | 5 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. |
6 * | 6 * |
7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 | 63 |
64 struct SameSizeAsBorderValue { | 64 struct SameSizeAsBorderValue { |
65 RGBA32 m_color; | 65 RGBA32 m_color; |
66 unsigned m_bitfield; | 66 unsigned m_bitfield; |
67 }; | 67 }; |
68 | 68 |
69 ASSERT_SIZE(BorderValue, SameSizeAsBorderValue); | 69 ASSERT_SIZE(BorderValue, SameSizeAsBorderValue); |
70 | 70 |
71 // Since different compilers/architectures pack ComputedStyle differently, | 71 // Since different compilers/architectures pack ComputedStyle differently, |
72 // re-create the same structure for an accurate size comparison. | 72 // re-create the same structure for an accurate size comparison. |
73 struct SameSizeAsComputedStyle : public ComputedStyleBase, | 73 struct SameSizeAsComputedStyle : public RefCounted<SameSizeAsComputedStyle> { |
74 public RefCounted<ComputedStyle> { | 74 struct ComputedStyleBase { |
| 75 unsigned m_bitfields[3]; |
| 76 } m_base; |
| 77 |
75 void* dataRefs[7]; | 78 void* dataRefs[7]; |
76 void* ownPtrs[1]; | 79 void* ownPtrs[1]; |
77 void* dataRefSvgStyle; | 80 void* dataRefSvgStyle; |
78 | 81 |
79 struct InheritedData { | 82 struct InheritedData { |
80 unsigned m_bitfields[1]; | 83 unsigned m_bitfields[1]; |
81 } m_inheritedData; | 84 } m_inheritedData; |
82 | 85 |
83 struct NonInheritedData { | 86 struct NonInheritedData { |
84 unsigned m_bitfields[2]; | 87 unsigned m_bitfields[2]; |
85 } m_nonInheritedData; | 88 } m_nonInheritedData; |
86 }; | 89 }; |
87 | 90 |
| 91 // If this assert fails, it means that size of ComputedStyle has changed. Please |
| 92 // check that you really *do* what to increase the size of ComputedStyle, then |
| 93 // update the SameSizeAsComputedStyle struct to match the updated storage of |
| 94 // ComputedStyle. |
88 ASSERT_SIZE(ComputedStyle, SameSizeAsComputedStyle); | 95 ASSERT_SIZE(ComputedStyle, SameSizeAsComputedStyle); |
89 | 96 |
90 PassRefPtr<ComputedStyle> ComputedStyle::create() { | 97 PassRefPtr<ComputedStyle> ComputedStyle::create() { |
91 return adoptRef(new ComputedStyle()); | 98 return adoptRef(new ComputedStyle()); |
92 } | 99 } |
93 | 100 |
94 PassRefPtr<ComputedStyle> ComputedStyle::createInitialStyle() { | 101 PassRefPtr<ComputedStyle> ComputedStyle::createInitialStyle() { |
95 return adoptRef(new ComputedStyle(InitialStyle)); | 102 return adoptRef(new ComputedStyle(InitialStyle)); |
96 } | 103 } |
97 | 104 |
(...skipping 2373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2471 if (value < 0) | 2478 if (value < 0) |
2472 fvalue -= 0.5f; | 2479 fvalue -= 0.5f; |
2473 else | 2480 else |
2474 fvalue += 0.5f; | 2481 fvalue += 0.5f; |
2475 } | 2482 } |
2476 | 2483 |
2477 return roundForImpreciseConversion<int>(fvalue / zoomFactor); | 2484 return roundForImpreciseConversion<int>(fvalue / zoomFactor); |
2478 } | 2485 } |
2479 | 2486 |
2480 } // namespace blink | 2487 } // namespace blink |
OLD | NEW |