sizeof(CSSRule) is 20 instead of 12 on Windows
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 6 Jan 2012 01:19:42 +0000 (01:19 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 6 Jan 2012 01:19:42 +0000 (01:19 +0000)
commitb84de35904622ed122e9ff10461bb5609042a09c
treeba18d9bd810571105797bfb20e8365732866bb5f
parenta80305ff4907b61155aca3efa97eecf6e2ce17d4
sizeof(CSSRule) is 20 instead of 12 on Windows
https://bugs.webkit.org/show_bug.cgi?id=75665

Reviewed by Darin Fisher.

Unlike gcc and clang, MSVC pads each consecutive member variables of the same type
in bitfields. e.g. if you have:

sturct AB {
unsigned m_1 : 31;
bool m_2 : 1;
}

then MSVC pads m_1 and allocates sizeof(unsigned) * 2 for AB whereas gcc and clang
only allocate sizeof(unsigned) * 1 for AB.

Fix the bloat by turning all bitfields in CSSRule either signed or unsigned integers.

* css/CSSRule.cpp:
* css/CSSRule.h:
(WebCore::CSSRule::sourceLine):
(WebCore::CSSRule::setSourceLine):
(WebCore::CSSRule::hasCachedSelectorText):
(WebCore::CSSRule::setHasCachedSelectorText):
* css/CSSStyleRule.cpp:
(WebCore::CSSStyleRule::CSSStyleRule):
(WebCore::CSSStyleRule::cleanup):
(WebCore::CSSStyleRule::selectorText):
(WebCore::CSSStyleRule::setSelectorText):
* css/CSSStyleRule.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@104254 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/css/CSSRule.cpp
Source/WebCore/css/CSSRule.h
Source/WebCore/css/CSSStyleRule.cpp
Source/WebCore/css/CSSStyleRule.h