Shrink some style-related classes and enums
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 15 Jul 2018 00:29:28 +0000 (00:29 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 15 Jul 2018 00:29:28 +0000 (00:29 +0000)
commit77e298ac966942766616029ba8a9355004fa4073
treefff23c9cd82b689e4f3a2eb8699bf98941f8beeb
parent14a0ffd604c26227ffed47eb353ab1a4ddbb1d2c
Shrink some style-related classes and enums
https://bugs.webkit.org/show_bug.cgi?id=187680

Reviewed by Antti Koivisto.

Make all the enum classes in RenderStyleConstants be one byte big (all have less
than 256 values).

Shrink DocumentRuleSet from 384 to 368 bytes by re-ordering, which also helps shrink
StyleResolver from 1024 to 952 bytes.

Shrink BorderValue by re-ordering (now that the layout of Color has changed) which
shrinks BorderData from 168 to 136 bytes.

Convert a couple of other enums to enum class so that they can have explicit size.

* css/DocumentRuleSets.h:
* css/MediaQueryMatcher.cpp:
(WebCore::MediaQueryMatcher::documentElementUserAgentStyle const):
* css/StyleMedia.cpp:
(WebCore::StyleMedia::matchMedium const):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::StyleResolver):
(WebCore::StyleResolver::State::State):
(WebCore::StyleResolver::styleForElement):
(WebCore::StyleResolver::cascadedPropertiesForRollback):
(WebCore::StyleResolver::applyProperty):
(WebCore::cascadeLevelForIndex):
* css/StyleResolver.h:
* rendering/style/BorderValue.h:
* rendering/style/RenderStyle.cpp:
* rendering/style/RenderStyleConstants.h:
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::styleForElement):
* svg/SVGElementRareData.h:
(WebCore::SVGElementRareData::overrideComputedStyle):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233838 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/css/DocumentRuleSets.h
Source/WebCore/css/MediaQueryMatcher.cpp
Source/WebCore/css/StyleMedia.cpp
Source/WebCore/css/StyleResolver.cpp
Source/WebCore/css/StyleResolver.h
Source/WebCore/rendering/style/BorderValue.h
Source/WebCore/rendering/style/RenderStyle.cpp
Source/WebCore/rendering/style/RenderStyleConstants.h
Source/WebCore/style/StyleTreeResolver.cpp
Source/WebCore/svg/SVGElementRareData.h