| 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 struct SameSizeAsComputedStyle : public RefCounted<SameSizeAsComputedStyle> { | 61 struct SameSizeAsComputedStyle : public RefCounted<SameSizeAsComputedStyle> { |
| 62 void* dataRefs[7]; | 62 void* dataRefs[7]; |
| 63 void* ownPtrs[1]; | 63 void* ownPtrs[1]; |
| 64 void* dataRefSvgStyle; | 64 void* dataRefSvgStyle; |
| 65 | 65 |
| 66 struct InheritedFlags { | 66 struct InheritedFlags { |
| 67 unsigned m_bitfields[2]; | 67 unsigned m_bitfields[2]; |
| 68 } inherited_flags; | 68 } inherited_flags; |
| 69 | 69 |
| 70 struct NonInheritedFlags { | 70 struct NonInheritedFlags { |
| 71 unsigned m_bitfields[2]; | 71 unsigned m_bitfields[3]; // at most 96 bits |
| 72 } noninherited_flags; | 72 } noninherited_flags; |
| 73 }; | 73 }; |
| 74 | 74 |
| 75 static_assert(sizeof(ComputedStyle) == sizeof(SameSizeAsComputedStyle), "Compute
dStyle should stay small"); | 75 static_assert(sizeof(ComputedStyle) <= sizeof(SameSizeAsComputedStyle), "Compute
dStyle should stay small"); |
| 76 | 76 |
| 77 PassRefPtr<ComputedStyle> ComputedStyle::create() | 77 PassRefPtr<ComputedStyle> ComputedStyle::create() |
| 78 { | 78 { |
| 79 return adoptRef(new ComputedStyle()); | 79 return adoptRef(new ComputedStyle()); |
| 80 } | 80 } |
| 81 | 81 |
| 82 PassRefPtr<ComputedStyle> ComputedStyle::createInitialStyle() | 82 PassRefPtr<ComputedStyle> ComputedStyle::createInitialStyle() |
| 83 { | 83 { |
| 84 return adoptRef(new ComputedStyle(InitialStyle)); | 84 return adoptRef(new ComputedStyle(InitialStyle)); |
| 85 } | 85 } |
| (...skipping 17 matching lines...) Expand all Loading... |
| 103 , visual(initialStyle()->visual) | 103 , visual(initialStyle()->visual) |
| 104 , m_background(initialStyle()->m_background) | 104 , m_background(initialStyle()->m_background) |
| 105 , surround(initialStyle()->surround) | 105 , surround(initialStyle()->surround) |
| 106 , rareNonInheritedData(initialStyle()->rareNonInheritedData) | 106 , rareNonInheritedData(initialStyle()->rareNonInheritedData) |
| 107 , rareInheritedData(initialStyle()->rareInheritedData) | 107 , rareInheritedData(initialStyle()->rareInheritedData) |
| 108 , inherited(initialStyle()->inherited) | 108 , inherited(initialStyle()->inherited) |
| 109 , m_svgStyle(initialStyle()->m_svgStyle) | 109 , m_svgStyle(initialStyle()->m_svgStyle) |
| 110 { | 110 { |
| 111 setBitDefaults(); // Would it be faster to copy this from the default style? | 111 setBitDefaults(); // Would it be faster to copy this from the default style? |
| 112 static_assert((sizeof(InheritedFlags) <= 8), "InheritedFlags should not grow
"); | 112 static_assert((sizeof(InheritedFlags) <= 8), "InheritedFlags should not grow
"); |
| 113 static_assert((sizeof(NonInheritedFlags) <= 8), "NonInheritedFlags should no
t grow"); | 113 static_assert((sizeof(NonInheritedFlags) <= 12), "NonInheritedFlags should n
ot grow"); |
| 114 } | 114 } |
| 115 | 115 |
| 116 ALWAYS_INLINE ComputedStyle::ComputedStyle(InitialStyleTag) | 116 ALWAYS_INLINE ComputedStyle::ComputedStyle(InitialStyleTag) |
| 117 { | 117 { |
| 118 setBitDefaults(); | 118 setBitDefaults(); |
| 119 | 119 |
| 120 m_box.init(); | 120 m_box.init(); |
| 121 visual.init(); | 121 visual.init(); |
| 122 m_background.init(); | 122 m_background.init(); |
| 123 surround.init(); | 123 surround.init(); |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 noninherited_flags.position = other.noninherited_flags.position; | 249 noninherited_flags.position = other.noninherited_flags.position; |
| 250 noninherited_flags.floating = other.noninherited_flags.floating; | 250 noninherited_flags.floating = other.noninherited_flags.floating; |
| 251 noninherited_flags.tableLayout = other.noninherited_flags.tableLayout; | 251 noninherited_flags.tableLayout = other.noninherited_flags.tableLayout; |
| 252 noninherited_flags.unicodeBidi = other.noninherited_flags.unicodeBidi; | 252 noninherited_flags.unicodeBidi = other.noninherited_flags.unicodeBidi; |
| 253 noninherited_flags.hasViewportUnits = other.noninherited_flags.hasViewportUn
its; | 253 noninherited_flags.hasViewportUnits = other.noninherited_flags.hasViewportUn
its; |
| 254 noninherited_flags.pageBreakBefore = other.noninherited_flags.pageBreakBefor
e; | 254 noninherited_flags.pageBreakBefore = other.noninherited_flags.pageBreakBefor
e; |
| 255 noninherited_flags.pageBreakAfter = other.noninherited_flags.pageBreakAfter; | 255 noninherited_flags.pageBreakAfter = other.noninherited_flags.pageBreakAfter; |
| 256 noninherited_flags.pageBreakInside = other.noninherited_flags.pageBreakInsid
e; | 256 noninherited_flags.pageBreakInside = other.noninherited_flags.pageBreakInsid
e; |
| 257 noninherited_flags.hasRemUnits = other.noninherited_flags.hasRemUnits; | 257 noninherited_flags.hasRemUnits = other.noninherited_flags.hasRemUnits; |
| 258 | 258 |
| 259 noninherited_flags.OnclickQoSType = other.noninherited_flags.OnclickQoSType; |
| 260 noninherited_flags.OnclickQoSVduration= other.noninherited_flags.OnclickQoSV
duration; |
| 261 noninherited_flags.OnscrollQoSType = other.noninherited_flags.OnscrollQoSTyp
e; |
| 262 noninherited_flags.OnscrollQoSVduration= other.noninherited_flags.OnscrollQo
SVduration; |
| 263 noninherited_flags.OntouchstartQoSType = other.noninherited_flags.Ontouchsta
rtQoSType; |
| 264 noninherited_flags.OntouchstartQoSVduration= other.noninherited_flags.Ontouc
hstartQoSVduration; |
| 265 noninherited_flags.OntouchendQoSType = other.noninherited_flags.OntouchendQo
SType; |
| 266 noninherited_flags.OntouchendQoSVduration= other.noninherited_flags.Ontouche
ndQoSVduration; |
| 267 noninherited_flags.OntouchmoveQoSType = other.noninherited_flags.Ontouchmove
QoSType; |
| 268 noninherited_flags.OntouchmoveQoSVduration= other.noninherited_flags.Ontouch
moveQoSVduration; |
| 269 |
| 259 // Correctly set during selector matching: | 270 // Correctly set during selector matching: |
| 260 // noninherited_flags.styleType | 271 // noninherited_flags.styleType |
| 261 // noninherited_flags.pseudoBits | 272 // noninherited_flags.pseudoBits |
| 262 | 273 |
| 263 // Set correctly while computing style for children: | 274 // Set correctly while computing style for children: |
| 264 // noninherited_flags.explicitInheritance | 275 // noninherited_flags.explicitInheritance |
| 265 | 276 |
| 266 // unique() styles are not cacheable. | 277 // unique() styles are not cacheable. |
| 267 ASSERT(!other.noninherited_flags.unique); | 278 ASSERT(!other.noninherited_flags.unique); |
| 268 | 279 |
| (...skipping 1530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1799 } | 1810 } |
| 1800 | 1811 |
| 1801 void ComputedStyle::copyChildDependentFlagsFrom(const ComputedStyle& other) | 1812 void ComputedStyle::copyChildDependentFlagsFrom(const ComputedStyle& other) |
| 1802 { | 1813 { |
| 1803 setEmptyState(other.emptyState()); | 1814 setEmptyState(other.emptyState()); |
| 1804 if (other.hasExplicitlyInheritedProperties()) | 1815 if (other.hasExplicitlyInheritedProperties()) |
| 1805 setHasExplicitlyInheritedProperties(); | 1816 setHasExplicitlyInheritedProperties(); |
| 1806 } | 1817 } |
| 1807 | 1818 |
| 1808 } // namespace blink | 1819 } // namespace blink |
| OLD | NEW |