RESOLVED FIXED 74876
sizeof(RenderStyle) is 64 instead of 56 on Windows (x86)
https://bugs.webkit.org/show_bug.cgi?id=74876
Summary sizeof(RenderStyle) is 64 instead of 56 on Windows (x86)
Tony Chang
Reported 2011-12-19 11:58:57 PST
Similar to the other bugs filed (e.g., bug 74646), this is because we're mixing bit packed types. http://randomascii.wordpress.com/2010/06/06/bit-field-packing-with-visual-c/
Attachments
Patch (16.70 KB, patch)
2011-12-20 11:04 PST, Tony Chang
rniwa: review+
Tony Chang
Comment 1 2011-12-19 12:40:12 PST
I'm going to split this into 2 patches since there are 2 structs in RenderStyle that also need to be fixed up.
Tony Chang
Comment 2 2011-12-20 11:04:14 PST
Ryosuke Niwa
Comment 3 2011-12-20 11:38:10 PST
Comment on attachment 120045 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=120045&action=review > Source/WebCore/rendering/style/RenderStyle.h:169 > + bool affectedByUncommonAttributeSelectors() const { return m_affectedByUncommonAttributeSelectors; } > + void setAffectedByUncommonAttributeSelectors(bool value) { m_affectedByUncommonAttributeSelectors = value; } > + bool unique() const { return m_unique; } > + void setUnique(bool value) { m_unique = value; } > + bool affectedByEmpty() const { return m_affectedByEmpty; } > + void setAffectedByEmpty(bool value) { m_affectedByEmpty = value; } > + bool emptyState() const { return m_emptyState; } > + void setEmptyState(bool value) { m_emptyState = value; } > + bool childrenAffectedByFirstChildRules() const { return m_childrenAffectedByFirstChildRules; } > + void setChildrenAffectedByFirstChildRules(bool value) { m_childrenAffectedByFirstChildRules = value; } > + bool childrenAffectedByLastChildRules() const { return m_childrenAffectedByLastChildRules; } > + void setChildrenAffectedByLastChildRules(bool value) { m_childrenAffectedByLastChildRules = value; } > + bool childrenAffectedByDirectAdjacentRules() const { return m_childrenAffectedByDirectAdjacentRules; } > + void setChildrenAffectedByDirectAdjacentRules(bool value) { m_childrenAffectedByDirectAdjacentRules = value; } > + bool childrenAffectedByForwardPositionalRules() const { return m_childrenAffectedByForwardPositionalRules; } > + void setChildrenAffectedByForwardPositionalRules(bool value) { m_childrenAffectedByForwardPositionalRules = value; } > + bool childrenAffectedByBackwardPositionalRules() const { return m_childrenAffectedByBackwardPositionalRules; } > + void setChildrenAffectedByBackwardPositionalRules(bool value) { m_childrenAffectedByBackwardPositionalRules = value; } > + bool firstChildState() const { return m_firstChildState; } > + void setFirstChildState(bool value) { m_firstChildState = value; } > + bool lastChildState() const { return m_lastChildState; } > + void setLastChildState(bool value) { m_lastChildState = value; } > + bool explicitInheritance() const { return m_explicitInheritance; } > + void setExplicitInheritance(bool value) { m_explicitInheritance = value; } Can we generate these with a macro? Also, since all these variables are only used within getters and setters, it might make more sense to make those getters and setters friends of this class instead.
Ryosuke Niwa
Comment 4 2011-12-20 13:44:28 PST
Comment on attachment 120045 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=120045&action=review >> Source/WebCore/rendering/style/RenderStyle.h:169 >> + void setExplicitInheritance(bool value) { m_explicitInheritance = value; } > > Can we generate these with a macro? Also, since all these variables are only used within getters and setters, it might make more sense to make those getters and setters friends of this class instead. Apparently we can't do this since RenderStyle hadn't be fully declared yet.
Tony Chang
Comment 5 2011-12-20 14:37:27 PST
Note You need to log in before you can comment on or make changes to this bug.