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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 struct SameSizeAsComputedStyle : public RefCounted<SameSizeAsComputedStyle> { | 60 struct SameSizeAsComputedStyle : public RefCounted<SameSizeAsComputedStyle> { |
61 void* dataRefs[7]; | 61 void* dataRefs[7]; |
62 void* ownPtrs[1]; | 62 void* ownPtrs[1]; |
63 void* dataRefSvgStyle; | 63 void* dataRefSvgStyle; |
64 | 64 |
65 struct InheritedFlags { | 65 struct InheritedFlags { |
66 unsigned m_bitfields[2]; | 66 unsigned m_bitfields[2]; |
67 } inherited_flags; | 67 } inherited_flags; |
68 | 68 |
69 struct NonInheritedFlags { | 69 struct NonInheritedFlags { |
70 unsigned m_bitfields[2]; | 70 unsigned m_bitfields[3]; |
71 } noninherited_flags; | 71 } noninherited_flags; |
72 }; | 72 }; |
73 | 73 |
74 static_assert(sizeof(ComputedStyle) == sizeof(SameSizeAsComputedStyle), "Compute
dStyle should stay small"); | 74 static_assert(sizeof(ComputedStyle) == sizeof(SameSizeAsComputedStyle), "Compute
dStyle should stay small"); |
75 | 75 |
76 PassRefPtr<ComputedStyle> ComputedStyle::create() | 76 PassRefPtr<ComputedStyle> ComputedStyle::create() |
77 { | 77 { |
78 return adoptRef(new ComputedStyle()); | 78 return adoptRef(new ComputedStyle()); |
79 } | 79 } |
80 | 80 |
(...skipping 21 matching lines...) Expand all Loading... |
102 , visual(initialStyle()->visual) | 102 , visual(initialStyle()->visual) |
103 , m_background(initialStyle()->m_background) | 103 , m_background(initialStyle()->m_background) |
104 , surround(initialStyle()->surround) | 104 , surround(initialStyle()->surround) |
105 , rareNonInheritedData(initialStyle()->rareNonInheritedData) | 105 , rareNonInheritedData(initialStyle()->rareNonInheritedData) |
106 , rareInheritedData(initialStyle()->rareInheritedData) | 106 , rareInheritedData(initialStyle()->rareInheritedData) |
107 , inherited(initialStyle()->inherited) | 107 , inherited(initialStyle()->inherited) |
108 , m_svgStyle(initialStyle()->m_svgStyle) | 108 , m_svgStyle(initialStyle()->m_svgStyle) |
109 { | 109 { |
110 setBitDefaults(); // Would it be faster to copy this from the default style? | 110 setBitDefaults(); // Would it be faster to copy this from the default style? |
111 static_assert((sizeof(InheritedFlags) <= 8), "InheritedFlags should not grow
"); | 111 static_assert((sizeof(InheritedFlags) <= 8), "InheritedFlags should not grow
"); |
112 static_assert((sizeof(NonInheritedFlags) <= 8), "NonInheritedFlags should no
t grow"); | 112 static_assert((sizeof(NonInheritedFlags) <= 12), "NonInheritedFlags should n
ot grow"); |
113 } | 113 } |
114 | 114 |
115 ALWAYS_INLINE ComputedStyle::ComputedStyle(InitialStyleTag) | 115 ALWAYS_INLINE ComputedStyle::ComputedStyle(InitialStyleTag) |
116 { | 116 { |
117 setBitDefaults(); | 117 setBitDefaults(); |
118 | 118 |
119 m_box.init(); | 119 m_box.init(); |
120 visual.init(); | 120 visual.init(); |
121 m_background.init(); | 121 m_background.init(); |
122 surround.init(); | 122 surround.init(); |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 noninherited_flags.originalDisplay = other.noninherited_flags.originalDispla
y; | 253 noninherited_flags.originalDisplay = other.noninherited_flags.originalDispla
y; |
254 noninherited_flags.overflowX = other.noninherited_flags.overflowX; | 254 noninherited_flags.overflowX = other.noninherited_flags.overflowX; |
255 noninherited_flags.overflowY = other.noninherited_flags.overflowY; | 255 noninherited_flags.overflowY = other.noninherited_flags.overflowY; |
256 noninherited_flags.verticalAlign = other.noninherited_flags.verticalAlign; | 256 noninherited_flags.verticalAlign = other.noninherited_flags.verticalAlign; |
257 noninherited_flags.clear = other.noninherited_flags.clear; | 257 noninherited_flags.clear = other.noninherited_flags.clear; |
258 noninherited_flags.position = other.noninherited_flags.position; | 258 noninherited_flags.position = other.noninherited_flags.position; |
259 noninherited_flags.floating = other.noninherited_flags.floating; | 259 noninherited_flags.floating = other.noninherited_flags.floating; |
260 noninherited_flags.tableLayout = other.noninherited_flags.tableLayout; | 260 noninherited_flags.tableLayout = other.noninherited_flags.tableLayout; |
261 noninherited_flags.unicodeBidi = other.noninherited_flags.unicodeBidi; | 261 noninherited_flags.unicodeBidi = other.noninherited_flags.unicodeBidi; |
262 noninherited_flags.hasViewportUnits = other.noninherited_flags.hasViewportUn
its; | 262 noninherited_flags.hasViewportUnits = other.noninherited_flags.hasViewportUn
its; |
263 noninherited_flags.pageBreakBefore = other.noninherited_flags.pageBreakBefor
e; | 263 noninherited_flags.breakBefore = other.noninherited_flags.breakBefore; |
264 noninherited_flags.pageBreakAfter = other.noninherited_flags.pageBreakAfter; | 264 noninherited_flags.breakAfter = other.noninherited_flags.breakAfter; |
265 noninherited_flags.pageBreakInside = other.noninherited_flags.pageBreakInsid
e; | 265 noninherited_flags.breakInside = other.noninherited_flags.breakInside; |
266 noninherited_flags.hasRemUnits = other.noninherited_flags.hasRemUnits; | 266 noninherited_flags.hasRemUnits = other.noninherited_flags.hasRemUnits; |
267 | 267 |
268 // Correctly set during selector matching: | 268 // Correctly set during selector matching: |
269 // noninherited_flags.styleType | 269 // noninherited_flags.styleType |
270 // noninherited_flags.pseudoBits | 270 // noninherited_flags.pseudoBits |
271 | 271 |
272 // Set correctly while computing style for children: | 272 // Set correctly while computing style for children: |
273 // noninherited_flags.explicitInheritance | 273 // noninherited_flags.explicitInheritance |
274 | 274 |
275 // unique() styles are not cacheable. | 275 // unique() styles are not cacheable. |
(...skipping 1568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1844 if (!shadowList) | 1844 if (!shadowList) |
1845 return false; | 1845 return false; |
1846 for (size_t i = shadowList->shadows().size(); i--; ) { | 1846 for (size_t i = shadowList->shadows().size(); i--; ) { |
1847 if (shadowList->shadows()[i].color().isCurrentColor()) | 1847 if (shadowList->shadows()[i].color().isCurrentColor()) |
1848 return true; | 1848 return true; |
1849 } | 1849 } |
1850 return false; | 1850 return false; |
1851 } | 1851 } |
1852 | 1852 |
1853 } // namespace blink | 1853 } // namespace blink |
OLD | NEW |