Bug 74876 - sizeof(RenderStyle) is 64 instead of 56 on Windows (x86)
Summary: sizeof(RenderStyle) is 64 instead of 56 on Windows (x86)
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Tony Chang
URL:
Keywords:
Depends on: 74880
Blocks:
  Show dependency treegraph
 
Reported: 2011-12-19 11:58 PST by Tony Chang
Modified: 2011-12-20 14:37 PST (History)
2 users (show)

See Also:


Attachments
Patch (16.70 KB, patch)
2011-12-20 11:04 PST, Tony Chang
rniwa: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tony Chang 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/
Comment 1 Tony Chang 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.
Comment 2 Tony Chang 2011-12-20 11:04:14 PST
Created attachment 120045 [details]
Patch
Comment 3 Ryosuke Niwa 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.
Comment 4 Ryosuke Niwa 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.
Comment 5 Tony Chang 2011-12-20 14:37:27 PST
Committed r103353: <http://trac.webkit.org/changeset/103353>