Title: [233838] trunk/Source/WebCore
Revision
233838
Author
[email protected]
Date
2018-07-14 17:29:28 -0700 (Sat, 14 Jul 2018)

Log Message

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):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (233837 => 233838)


--- trunk/Source/WebCore/ChangeLog	2018-07-14 23:44:42 UTC (rev 233837)
+++ trunk/Source/WebCore/ChangeLog	2018-07-15 00:29:28 UTC (rev 233838)
@@ -1,3 +1,42 @@
+2018-07-14  Simon Fraser  <[email protected]>
+
+        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):
+
 2018-07-14  Kocsen Chung  <[email protected]>
 
         Ensure WebKit stack is ad-hoc signed

Modified: trunk/Source/WebCore/css/DocumentRuleSets.h (233837 => 233838)


--- trunk/Source/WebCore/css/DocumentRuleSets.h	2018-07-14 23:44:42 UTC (rev 233837)
+++ trunk/Source/WebCore/css/DocumentRuleSets.h	2018-07-15 00:29:28 UTC (rev 233838)
@@ -81,22 +81,25 @@
     void collectRulesFromUserStyleSheets(const Vector<RefPtr<CSSStyleSheet>>&, RuleSet& userStyle, const MediaQueryEvaluator&, StyleResolver&);
     void updateUserAgentMediaQueryStyleIfNeeded() const;
 
-    bool m_isForShadowScope { false };
-    bool m_isAuthorStyleDefined { false };
     std::unique_ptr<RuleSet> m_authorStyle;
     mutable std::unique_ptr<RuleSet> m_userAgentMediaQueryStyle;
     std::unique_ptr<RuleSet> m_userStyle;
-    bool m_usesSharedUserStyle { false };
 
     StyleResolver& m_styleResolver;
     mutable RuleFeatureSet m_features;
-    mutable unsigned m_defaultStyleVersionOnFeatureCollection { 0 };
-    mutable unsigned m_userAgentMediaQueryRuleCountOnUpdate { 0 };
     mutable std::unique_ptr<RuleSet> m_siblingRuleSet;
     mutable std::unique_ptr<RuleSet> m_uncommonAttributeRuleSet;
     mutable HashMap<AtomicString, std::unique_ptr<Vector<InvalidationRuleSet>>> m_classInvalidationRuleSets;
     mutable HashMap<AtomicString, std::unique_ptr<Vector<InvalidationRuleSet>>> m_attributeInvalidationRuleSets;
+
     mutable std::optional<bool> m_cachedHasComplexSelectorsForStyleAttribute;
+
+    mutable unsigned m_defaultStyleVersionOnFeatureCollection { 0 };
+    mutable unsigned m_userAgentMediaQueryRuleCountOnUpdate { 0 };
+
+    bool m_usesSharedUserStyle { false };
+    bool m_isForShadowScope { false };
+    bool m_isAuthorStyleDefined { false };
 };
 
 inline const RuleFeatureSet& DocumentRuleSets::features() const

Modified: trunk/Source/WebCore/css/MediaQueryMatcher.cpp (233837 => 233838)


--- trunk/Source/WebCore/css/MediaQueryMatcher.cpp	2018-07-14 23:44:42 UTC (rev 233837)
+++ trunk/Source/WebCore/css/MediaQueryMatcher.cpp	2018-07-15 00:29:28 UTC (rev 233838)
@@ -67,7 +67,7 @@
     if (!documentElement)
         return nullptr;
 
-    return m_document->styleScope().resolver().styleForElement(*documentElement, m_document->renderStyle(), nullptr, MatchOnlyUserAgentRules).renderStyle;
+    return m_document->styleScope().resolver().styleForElement(*documentElement, m_document->renderStyle(), nullptr, RuleMatchingBehavior::MatchOnlyUserAgentRules).renderStyle;
 }
 
 bool MediaQueryMatcher::evaluate(const MediaQuerySet& media)

Modified: trunk/Source/WebCore/css/StyleMedia.cpp (233837 => 233838)


--- trunk/Source/WebCore/css/StyleMedia.cpp	2018-07-14 23:44:42 UTC (rev 233837)
+++ trunk/Source/WebCore/css/StyleMedia.cpp	2018-07-15 00:29:28 UTC (rev 233838)
@@ -64,7 +64,7 @@
     if (!documentElement)
         return false;
 
-    auto rootStyle = document->styleScope().resolver().styleForElement(*documentElement, document->renderStyle(), nullptr, MatchOnlyUserAgentRules).renderStyle;
+    auto rootStyle = document->styleScope().resolver().styleForElement(*documentElement, document->renderStyle(), nullptr, RuleMatchingBehavior::MatchOnlyUserAgentRules).renderStyle;
 
     auto media = MediaQuerySet::create(query, MediaQueryParserContext(*document));
 

Modified: trunk/Source/WebCore/css/StyleResolver.cpp (233837 => 233838)


--- trunk/Source/WebCore/css/StyleResolver.cpp	2018-07-14 23:44:42 UTC (rev 233837)
+++ trunk/Source/WebCore/css/StyleResolver.cpp	2018-07-15 00:29:28 UTC (rev 233838)
@@ -193,14 +193,13 @@
 
 StyleResolver::StyleResolver(Document& document)
     : m_ruleSets(*this)
-    , m_matchedPropertiesCacheAdditionsSinceLastSweep(0)
     , m_matchedPropertiesCacheSweepTimer(*this, &StyleResolver::sweepMatchedPropertiesCache)
     , m_document(document)
-    , m_matchAuthorAndUserStyles(m_document.settings().authorAndUserStylesEnabled())
 #if ENABLE(CSS_DEVICE_ADAPTATION)
     , m_viewportStyleResolver(ViewportStyleResolver::create(&document))
 #endif
     , m_styleMap(this)
+    , m_matchAuthorAndUserStyles(m_document.settings().authorAndUserStylesEnabled())
 {
     Element* root = m_document.documentElement();
 
@@ -219,7 +218,7 @@
         m_mediaQueryEvaluator = MediaQueryEvaluator { "all" };
 
     if (root) {
-        m_rootDefaultStyle = styleForElement(*root, m_document.renderStyle(), nullptr, MatchOnlyUserAgentRules).renderStyle;
+        m_rootDefaultStyle = styleForElement(*root, m_document.renderStyle(), nullptr, RuleMatchingBehavior::MatchOnlyUserAgentRules).renderStyle;
         // Turn off assertion against font lookups during style resolver initialization. We may need root style font for media queries.
         m_document.fontSelector().incrementIsComputingRootStyleFont();
         m_rootDefaultStyle->fontCascade().update(&m_document.fontSelector());
@@ -300,8 +299,8 @@
 StyleResolver::State::State(const Element& element, const RenderStyle* parentStyle, const RenderStyle* documentElementStyle, const SelectorFilter* selectorFilter)
     : m_element(&element)
     , m_parentStyle(parentStyle)
+    , m_selectorFilter(selectorFilter)
     , m_elementLinkState(element.document().visitedLinkState().determineLinkState(element))
-    , m_selectorFilter(selectorFilter)
 {
     bool resetStyleInheritance = hasShadowRootParent(element) && downcast<ShadowRoot>(element.parentNode())->resetStyleInheritance();
     if (resetStyleInheritance)
@@ -379,10 +378,10 @@
     ElementRuleCollector collector(element, m_ruleSets, m_state.selectorFilter());
     collector.setMedium(&m_mediaQueryEvaluator);
 
-    if (matchingBehavior == MatchOnlyUserAgentRules)
+    if (matchingBehavior == RuleMatchingBehavior::MatchOnlyUserAgentRules)
         collector.matchUARules();
     else
-        collector.matchAllRules(m_matchAuthorAndUserStyles, matchingBehavior != MatchAllRulesExcludingSMIL);
+        collector.matchAllRules(m_matchAuthorAndUserStyles, matchingBehavior != RuleMatchingBehavior::MatchAllRulesExcludingSMIL);
 
     if (collector.matchedPseudoElementIds())
         style.setHasPseudoStyles(collector.matchedPseudoElementIds());
@@ -1564,13 +1563,13 @@
 
 StyleResolver::CascadedProperties* StyleResolver::cascadedPropertiesForRollback(const MatchResult& matchResult)
 {
-    ASSERT(cascadeLevel() != UserAgentLevel);
+    ASSERT(cascadeLevel() != CascadeLevel::UserAgentLevel);
 
     TextDirection direction;
     WritingMode writingMode;
     extractDirectionAndWritingMode(*state().style(), matchResult, direction, writingMode);
 
-    if (cascadeLevel() == AuthorLevel) {
+    if (cascadeLevel() == CascadeLevel::AuthorLevel) {
         CascadedProperties* authorRollback = state().authorRollback();
         if (authorRollback)
             return authorRollback;
@@ -1587,7 +1586,7 @@
         return state().authorRollback();
     }
 
-    if (cascadeLevel() == UserLevel) {
+    if (cascadeLevel() == CascadeLevel::UserLevel) {
         CascadedProperties* userRollback = state().userRollback();
         if (userRollback)
             return userRollback;
@@ -1644,7 +1643,7 @@
     bool isRevert = valueToCheckForInheritInitial->isRevertValue() || customPropertyValueID == CSSValueRevert;
 
     if (isRevert) {
-        if (cascadeLevel() == UserAgentLevel || !matchResult)
+        if (cascadeLevel() == CascadeLevel::UserAgentLevel || !matchResult)
             isUnset = true;
         else {
             // Fetch the correct rollback object from the state, building it if necessary.
@@ -2124,10 +2123,10 @@
 static CascadeLevel cascadeLevelForIndex(const StyleResolver::MatchResult& matchResult, int index)
 {
     if (index >= matchResult.ranges.firstUARule && index <= matchResult.ranges.lastUARule)
-        return UserAgentLevel;
+        return CascadeLevel::UserAgentLevel;
     if (index >= matchResult.ranges.firstUserRule && index <= matchResult.ranges.lastUserRule)
-        return UserLevel;
-    return AuthorLevel;
+        return CascadeLevel::UserLevel;
+    return CascadeLevel::AuthorLevel;
 }
 
 void StyleResolver::CascadedProperties::addMatch(const MatchResult& matchResult, unsigned index, bool isImportant, bool inheritedOnly)

Modified: trunk/Source/WebCore/css/StyleResolver.h (233837 => 233838)


--- trunk/Source/WebCore/css/StyleResolver.h	2018-07-14 23:44:42 UTC (rev 233837)
+++ trunk/Source/WebCore/css/StyleResolver.h	2018-07-15 00:29:28 UTC (rev 233838)
@@ -86,13 +86,13 @@
 // are interpreted according to the document root element style, and styled only
 // from the User Agent Stylesheet rules.
 
-enum RuleMatchingBehavior {
+enum class RuleMatchingBehavior: uint8_t {
     MatchAllRules,
     MatchAllRulesExcludingSMIL,
     MatchOnlyUserAgentRules,
 };
 
-enum CascadeLevel {
+enum class CascadeLevel: uint8_t {
     UserAgentLevel,
     AuthorLevel,
     UserLevel
@@ -129,7 +129,7 @@
     StyleResolver(Document&);
     ~StyleResolver();
 
-    ElementStyle styleForElement(const Element&, const RenderStyle* parentStyle, const RenderStyle* parentBoxStyle = nullptr, RuleMatchingBehavior = MatchAllRules, const SelectorFilter* = nullptr);
+    ElementStyle styleForElement(const Element&, const RenderStyle* parentStyle, const RenderStyle* parentBoxStyle = nullptr, RuleMatchingBehavior = RuleMatchingBehavior::MatchAllRules, const SelectorFilter* = nullptr);
 
     void keyframeStylesForAnimation(const Element&, const RenderStyle*, KeyframeList&);
 
@@ -408,27 +408,27 @@
         const RenderStyle* m_parentStyle { nullptr };
         std::unique_ptr<RenderStyle> m_ownedParentStyle;
         const RenderStyle* m_rootElementStyle { nullptr };
+        std::unique_ptr<CascadedProperties> m_authorRollback;
+        std::unique_ptr<CascadedProperties> m_userRollback;
 
-        InsideLink m_elementLinkState { InsideLink::NotInside };
+        const SelectorFilter* m_selectorFilter { nullptr };
 
-        bool m_applyPropertyToRegularStyle { true };
-        bool m_applyPropertyToVisitedLinkStyle { false };
-        bool m_fontDirty { false };
-        bool m_fontSizeHasViewportUnits { false };
-        bool m_hasUAAppearance { false };
-
         BorderData m_borderData;
         FillLayer m_backgroundData { FillLayerType::Background };
         Color m_backgroundColor;
 
         CSSToLengthConversionData m_cssToLengthConversionData;
-        
-        CascadeLevel m_cascadeLevel { UserAgentLevel };
+
         Style::ScopeOrdinal m_styleScopeOrdinal { Style::ScopeOrdinal::Element };
-        std::unique_ptr<CascadedProperties> m_authorRollback;
-        std::unique_ptr<CascadedProperties> m_userRollback;
 
-        const SelectorFilter* m_selectorFilter { nullptr };
+        InsideLink m_elementLinkState { InsideLink::NotInside };
+        CascadeLevel m_cascadeLevel { CascadeLevel::UserAgentLevel };
+
+        bool m_applyPropertyToRegularStyle { true };
+        bool m_applyPropertyToVisitedLinkStyle { false };
+        bool m_fontDirty { false };
+        bool m_fontSizeHasViewportUnits { false };
+        bool m_hasUAAppearance { false };
     };
 
     State& state() { return m_state; }
@@ -486,8 +486,6 @@
     // the last reference to a style declaration are garbage collected.
     void sweepMatchedPropertiesCache();
 
-    unsigned m_matchedPropertiesCacheAdditionsSinceLastSweep;
-
     typedef HashMap<unsigned, MatchedPropertiesCacheItem> MatchedPropertiesCache;
     MatchedPropertiesCache m_matchedPropertiesCache;
 
@@ -498,8 +496,6 @@
 
     Document& m_document;
 
-    bool m_matchAuthorAndUserStyles;
-
     RenderStyle* m_overrideDocumentElementStyle { nullptr };
 
     Vector<MediaQueryResult> m_viewportDependentMediaQueryResults;
@@ -514,6 +510,9 @@
 
     State m_state;
 
+    unsigned m_matchedPropertiesCacheAdditionsSinceLastSweep { 0 };
+
+    bool m_matchAuthorAndUserStyles { true };
     // See if we still have crashes where StyleResolver gets deleted early.
     bool m_isDeleted { false };
 

Modified: trunk/Source/WebCore/rendering/style/BorderValue.h (233837 => 233838)


--- trunk/Source/WebCore/rendering/style/BorderValue.h	2018-07-14 23:44:42 UTC (rev 233837)
+++ trunk/Source/WebCore/rendering/style/BorderValue.h	2018-07-15 00:29:28 UTC (rev 233838)
@@ -76,9 +76,10 @@
     float boxModelWidth() const;
 
 protected:
-    float m_width { 3 };
     Color m_color;
 
+    float m_width { 3 };
+
     unsigned m_style : 4; // BorderStyle
 
     // This is only used by OutlineValue but moved here to keep the bits packed.

Modified: trunk/Source/WebCore/rendering/style/RenderStyle.cpp (233837 => 233838)


--- trunk/Source/WebCore/rendering/style/RenderStyle.cpp	2018-07-14 23:44:42 UTC (rev 233837)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.cpp	2018-07-15 00:29:28 UTC (rev 233838)
@@ -58,8 +58,8 @@
 namespace WebCore {
 
 struct SameSizeAsBorderValue {
+    Color m_color;
     float m_width;
-    Color m_color;
     int m_restBits;
 };
 

Modified: trunk/Source/WebCore/rendering/style/RenderStyleConstants.h (233837 => 233838)


--- trunk/Source/WebCore/rendering/style/RenderStyleConstants.h	2018-07-14 23:44:42 UTC (rev 233837)
+++ trunk/Source/WebCore/rendering/style/RenderStyleConstants.h	2018-07-15 00:29:28 UTC (rev 233838)
@@ -34,7 +34,7 @@
 namespace WebCore {
 
 static const size_t PrintColorAdjustBits = 1;
-enum class PrintColorAdjust {
+enum class PrintColorAdjust : uint8_t {
     Economy,
     Exact
 };
@@ -77,7 +77,7 @@
 };
 
 // Static pseudo styles. Dynamic ones are produced on the fly.
-enum class PseudoId : unsigned char {
+enum class PseudoId : uint8_t {
     // The order must be None, public IDs, and then internal IDs.
     None,
 
@@ -169,17 +169,17 @@
     unsigned m_data;
 };
 
-enum class ColumnFill {
+enum class ColumnFill : uint8_t {
     Balance,
     Auto
 };
 
-enum class ColumnSpan {
+enum class ColumnSpan : uint8_t {
     None = 0,
     All
 };
 
-enum class BorderCollapse {
+enum class BorderCollapse : uint8_t {
     Separate = 0,
     Collapse
 };
@@ -186,7 +186,7 @@
 
 // These have been defined in the order of their precedence for border-collapsing. Do
 // not change this order! This order also must match the order in CSSValueKeywords.in.
-enum class BorderStyle {
+enum class BorderStyle : uint8_t {
     None,
     Hidden,
     Inset,
@@ -199,7 +199,7 @@
     Double
 };
 
-enum class BorderPrecedence {
+enum class BorderPrecedence : uint8_t {
     Off,
     Table,
     ColumnGroup,
@@ -209,12 +209,12 @@
     Cell
 };
 
-enum class OutlineIsAuto {
+enum class OutlineIsAuto : uint8_t {
     Off = 0,
     On
 };
 
-enum class PositionType {
+enum class PositionType : uint8_t {
     Static = 0,
     Relative = 1,
     Absolute = 2,
@@ -223,13 +223,13 @@
     Fixed = 6
 };
 
-enum class Float {
+enum class Float : uint8_t {
     No,
     Left,
     Right
 };
 
-enum class MarginCollapse {
+enum class MarginCollapse : uint8_t {
     Collapse,
     Separate,
     Discard
@@ -237,7 +237,7 @@
 
 // Box decoration attributes. Not inherited.
 
-enum class BoxDecorationBreak {
+enum class BoxDecorationBreak : uint8_t {
     Slice,
     Clone
 };
@@ -244,7 +244,7 @@
 
 // Box attributes. Not inherited.
 
-enum class BoxSizing {
+enum class BoxSizing : uint8_t {
     ContentBox,
     BorderBox
 };
@@ -251,7 +251,7 @@
 
 // Random visual rendering model attributes. Not inherited.
 
-enum class Overflow {
+enum class Overflow : uint8_t {
     Visible,
     Hidden,
     Scroll,
@@ -261,7 +261,7 @@
     PagedY
 };
 
-enum class VerticalAlign {
+enum class VerticalAlign : uint8_t {
     Baseline,
     Middle,
     Sub,
@@ -274,7 +274,7 @@
     Length
 };
 
-enum class Clear {
+enum class Clear : uint8_t {
     None = 0,
     Left = 1,
     Right = 2,
@@ -281,23 +281,23 @@
     Both = 3
 };
 
-enum class TableLayoutType {
+enum class TableLayoutType : uint8_t {
     Auto,
     Fixed
 };
 
-enum class TextCombine {
+enum class TextCombine : uint8_t {
     None,
     Horizontal
 };
 
-enum class FillAttachment {
+enum class FillAttachment : uint8_t {
     ScrollBackground,
     LocalBackground,
     FixedBackground
 };
 
-enum class FillBox {
+enum class FillBox : uint8_t {
     Border,
     Padding,
     Content,
@@ -304,7 +304,7 @@
     Text
 };
 
-enum class FillRepeat {
+enum class FillRepeat : uint8_t {
     Repeat,
     NoRepeat,
     Round,
@@ -311,13 +311,13 @@
     Space
 };
 
-enum class FillLayerType {
+enum class FillLayerType : uint8_t {
     Background,
     Mask
 };
 
 // CSS3 Background Values
-enum class FillSizeType {
+enum class FillSizeType : uint8_t {
     Contain,
     Cover,
     Size,
@@ -325,7 +325,7 @@
 };
 
 // CSS3 <position>
-enum class Edge {
+enum class Edge : uint8_t {
     Top,
     Right,
     Bottom,
@@ -334,7 +334,7 @@
 
 // CSS3 Mask Source Types
 
-enum class MaskSourceType {
+enum class MaskSourceType : uint8_t {
     Alpha,
     Luminance
 };
@@ -341,7 +341,7 @@
 
 // CSS3 Marquee Properties
 
-enum class MarqueeBehavior {
+enum class MarqueeBehavior : uint8_t {
     None,
     Scroll,
     Slide,
@@ -348,7 +348,7 @@
     Alternate
 };
 
-enum class MarqueeDirection {
+enum class MarqueeDirection : uint8_t {
     Auto,
     Left,
     Right,
@@ -360,7 +360,7 @@
 
 // Deprecated Flexible Box Properties
 
-enum class BoxPack {
+enum class BoxPack : uint8_t {
     Start,
     Center,
     End,
@@ -367,7 +367,7 @@
     Justify
 };
 
-enum class BoxAlignment {
+enum class BoxAlignment : uint8_t {
     Stretch,
     Start,
     Center,
@@ -375,17 +375,17 @@
     Baseline
 };
 
-enum class BoxOrient {
+enum class BoxOrient : uint8_t {
     Horizontal,
     Vertical
 };
 
-enum class BoxLines {
+enum class BoxLines : uint8_t {
     Single,
     Multiple
 };
 
-enum class BoxDirection {
+enum class BoxDirection : uint8_t {
     Normal,
     Reverse
 };
@@ -392,7 +392,7 @@
 
 // CSS3 Flexbox Properties
 
-enum class AlignContent {
+enum class AlignContent : uint8_t {
     FlexStart,
     FlexEnd,
     Center,
@@ -401,7 +401,7 @@
     Stretch
 };
 
-enum class FlexDirection {
+enum class FlexDirection : uint8_t {
     Row,
     RowReverse,
     Column,
@@ -408,13 +408,13 @@
     ColumnReverse
 };
 
-enum class FlexWrap {
+enum class FlexWrap : uint8_t {
     NoWrap,
     Wrap,
     Reverse
 };
 
-enum class ItemPosition {
+enum class ItemPosition : uint8_t {
     Legacy,
     Auto,
     Normal,
@@ -432,18 +432,18 @@
     Right
 };
 
-enum class OverflowAlignment {
+enum class OverflowAlignment : uint8_t {
     Default,
     Unsafe,
     Safe
 };
 
-enum class ItemPositionType {
+enum class ItemPositionType : uint8_t {
     NonLegacy,
     Legacy
 };
 
-enum class ContentPosition {
+enum class ContentPosition : uint8_t {
     Normal,
     Baseline,
     LastBaseline,
@@ -456,7 +456,7 @@
     Right
 };
 
-enum class ContentDistribution {
+enum class ContentDistribution : uint8_t {
     Default,
     SpaceBetween,
     SpaceAround,
@@ -465,7 +465,7 @@
 };
 
 
-enum class TextSecurity {
+enum class TextSecurity : uint8_t {
     None,
     Disc,
     Circle,
@@ -474,7 +474,7 @@
 
 // CSS3 User Modify Properties
 
-enum class UserModify {
+enum class UserModify : uint8_t {
     ReadOnly,
     ReadWrite,
     ReadWritePlaintextOnly
@@ -482,7 +482,7 @@
 
 // CSS3 User Drag Values
 
-enum class UserDrag {
+enum class UserDrag : uint8_t {
     Auto,
     None,
     Element
@@ -490,7 +490,7 @@
 
 // CSS3 User Select Values
 
-enum class UserSelect {
+enum class UserSelect : uint8_t {
     None,
     Text,
     All
@@ -497,7 +497,7 @@
 };
 
 // CSS3 Image Values
-enum class ObjectFit {
+enum class ObjectFit : uint8_t {
     Fill,
     Contain,
     Cover,
@@ -505,7 +505,7 @@
     ScaleDown
 };
 
-enum class AspectRatioType {
+enum class AspectRatioType : uint8_t {
     Auto,
     FromIntrinsic,
     FromDimensions,
@@ -512,7 +512,7 @@
     Specified
 };
 
-enum class WordBreak {
+enum class WordBreak : uint8_t {
     Normal,
     BreakAll,
     KeepAll,
@@ -519,17 +519,17 @@
     Break
 };
 
-enum class OverflowWrap {
+enum class OverflowWrap : uint8_t {
     Normal,
     Break
 };
 
-enum class NBSPMode {
+enum class NBSPMode : uint8_t {
     Normal,
     Space
 };
 
-enum class LineBreak {
+enum class LineBreak : uint8_t {
     Auto,
     Loose,
     Normal,
@@ -537,7 +537,7 @@
     AfterWhiteSpace
 };
 
-enum class Resize {
+enum class Resize : uint8_t {
     None,
     Both,
     Horizontal,
@@ -545,7 +545,7 @@
 };
 
 // The order of this enum must match the order of the list style types in CSSValueKeywords.in.
-enum class ListStyleType {
+enum class ListStyleType : uint8_t {
     Disc,
     Circle,
     Square,
@@ -629,7 +629,7 @@
     None
 };
 
-enum class QuoteType {
+enum class QuoteType : uint8_t {
     OpenQuote,
     CloseQuote,
     NoOpenQuote,
@@ -636,12 +636,12 @@
     NoCloseQuote
 };
 
-enum class BorderFit {
+enum class BorderFit : uint8_t {
     Border,
     Lines
 };
 
-enum class AnimationFillMode {
+enum class AnimationFillMode : uint8_t {
     None,
     Forwards,
     Backwards,
@@ -648,12 +648,12 @@
     Both
 };
 
-enum class AnimationPlayState {
+enum class AnimationPlayState : uint8_t {
     Playing = 0x0,
     Paused = 0x1
 };
 
-enum class WhiteSpace {
+enum class WhiteSpace : uint8_t {
     Normal,
     Pre,
     PreWrap,
@@ -663,7 +663,7 @@
 };
 
 // The order of this enum must match the order of the text align values in CSSValueKeywords.in.
-enum class TextAlignMode {
+enum class TextAlignMode : uint8_t {
     Left,
     Right,
     Center,
@@ -675,7 +675,7 @@
     End,
 };
 
-enum class TextTransform {
+enum class TextTransform : uint8_t {
     Capitalize,
     Uppercase,
     Lowercase,
@@ -687,7 +687,7 @@
 #else
 static const size_t TextDecorationBits = 4;
 #endif
-enum class TextDecoration {
+enum class TextDecoration : uint8_t {
     None          = 0,
     Underline     = 1 << 0,
     Overline      = 1 << 1,
@@ -698,7 +698,7 @@
 #endif
 };
 
-enum class TextDecorationStyle {
+enum class TextDecorationStyle : uint8_t {
     Solid,
     Double,
     Dotted,
@@ -707,7 +707,7 @@
 };
 
 #if ENABLE(CSS3_TEXT)
-enum class TextAlignLast {
+enum class TextAlignLast : uint8_t {
     Auto,
     Start,
     End,
@@ -717,7 +717,7 @@
     Justify
 };
 
-enum class TextJustify {
+enum class TextJustify : uint8_t {
     Auto,
     None,
     InterWord,
@@ -725,7 +725,7 @@
 };
 #endif // CSS3_TEXT
 
-enum class TextDecorationSkip {
+enum class TextDecorationSkip : uint8_t {
     None      = 0,
     Ink       = 1 << 0,
     Objects   = 1 << 1,
@@ -733,7 +733,7 @@
 };
 
 // FIXME: There is no reason for the values in the enum to be powers of two.
-enum class TextUnderlinePosition {
+enum class TextUnderlinePosition : uint8_t {
     // FIXME: Implement support for 'under left' and 'under right' values.
     Auto       = 1 << 0,
     Alphabetic = 1 << 1,
@@ -740,12 +740,12 @@
     Under      = 1 << 2
 };
 
-enum class TextZoom {
+enum class TextZoom : uint8_t {
     Normal,
     Reset
 };
 
-enum class BreakBetween {
+enum class BreakBetween : uint8_t {
     Auto,
     Avoid,
     AvoidColumn,
@@ -759,7 +759,7 @@
 };
 bool alwaysPageBreak(BreakBetween);
     
-enum class BreakInside {
+enum class BreakInside : uint8_t {
     Auto,
     Avoid,
     AvoidColumn,
@@ -766,7 +766,7 @@
     AvoidPage
 };
 
-enum class HangingPunctuation {
+enum class HangingPunctuation : uint8_t {
     None      = 0,
     First     = 1 << 0,
     Last      = 1 << 1,
@@ -774,12 +774,12 @@
     ForceEnd  = 1 << 3
 };
 
-enum class EmptyCell {
+enum class EmptyCell : uint8_t {
     Show,
     Hide
 };
 
-enum class CaptionSide {
+enum class CaptionSide : uint8_t {
     Top,
     Bottom,
     Left,
@@ -786,12 +786,12 @@
     Right
 };
 
-enum class ListStylePosition {
+enum class ListStylePosition : uint8_t {
     Outside,
     Inside
 };
 
-enum class Visibility {
+enum class Visibility : uint8_t {
     Visible,
     Hidden,
     Collapse
@@ -799,7 +799,7 @@
 
 WTF::TextStream& operator<<(WTF::TextStream&, Visibility);
 
-enum class CursorType {
+enum class CursorType : uint8_t {
     // The following must match the order in CSSValueKeywords.in.
     Auto,
     Default,
@@ -844,7 +844,7 @@
 };
 
 #if ENABLE(CURSOR_VISIBILITY)
-enum class CursorVisibility {
+enum class CursorVisibility : uint8_t {
     Auto,
     AutoHide,
 };
@@ -851,7 +851,7 @@
 #endif
 
 // The order of this enum must match the order of the display values in CSSValueKeywords.in.
-enum class DisplayType {
+enum class DisplayType : uint8_t {
     Inline,
     Block,
     ListItem,
@@ -879,13 +879,13 @@
     None
 };
 
-enum class InsideLink {
+enum class InsideLink : uint8_t {
     NotInside,
     InsideUnvisited,
     InsideVisited
 };
     
-enum class PointerEvents {
+enum class PointerEvents : uint8_t {
     None,
     Auto,
     Stroke,
@@ -898,34 +898,34 @@
     All
 };
 
-enum class TransformStyle3D {
+enum class TransformStyle3D : uint8_t {
     Flat,
     Preserve3D
 };
 
-enum class BackfaceVisibility {
+enum class BackfaceVisibility : uint8_t {
     Visible,
     Hidden
 };
 
-enum class TransformBox {
+enum class TransformBox : uint8_t {
     BorderBox,
     FillBox,
     ViewBox
 };
 
-enum class LineClamp {
+enum class LineClamp : uint8_t {
     LineCount,
     Percentage
 };
 
-enum class Hyphens {
+enum class Hyphens : uint8_t {
     None,
     Manual,
     Auto
 };
 
-enum class SpeakAs {
+enum class SpeakAs : uint8_t {
     Normal             = 0,
     SpellOut           = 1 << 0,
     Digits             = 1 << 1,
@@ -933,12 +933,12 @@
     NoPunctuation      = 1 << 3
 };
 
-enum class TextEmphasisFill {
+enum class TextEmphasisFill : uint8_t {
     Filled,
     Open
 };
 
-enum class TextEmphasisMark {
+enum class TextEmphasisMark : uint8_t {
     None,
     Auto,
     Dot,
@@ -949,7 +949,7 @@
     Custom
 };
 
-enum class TextEmphasisPosition {
+enum class TextEmphasisPosition : uint8_t {
     Over  = 1 << 0,
     Under = 1 << 1,
     Left  = 1 << 2,
@@ -956,18 +956,18 @@
     Right = 1 << 3
 };
 
-enum class TextOrientation {
+enum class TextOrientation : uint8_t {
     Mixed,
     Upright,
     Sideways
 };
 
-enum class TextOverflow {
+enum class TextOverflow : uint8_t {
     Clip = 0,
     Ellipsis
 };
 
-enum class ImageRendering {
+enum class ImageRendering : uint8_t {
     Auto = 0,
     OptimizeSpeed,
     OptimizeQuality,
@@ -977,44 +977,44 @@
 
 WTF::TextStream& operator<<(WTF::TextStream&, ImageRendering);
 
-enum class ImageResolutionSource {
+enum class ImageResolutionSource : uint8_t {
     Specified = 0,
     FromImage
 };
 
-enum class ImageResolutionSnap {
+enum class ImageResolutionSnap : uint8_t {
     None = 0,
     Pixels
 };
 
-enum class Order {
+enum class Order : uint8_t {
     Logical = 0,
     Visual
 };
 
-enum class ColumnAxis {
+enum class ColumnAxis : uint8_t {
     Horizontal,
     Vertical,
     Auto
 };
 
-enum class ColumnProgression {
+enum class ColumnProgression : uint8_t {
     Normal,
     Reverse
 };
 
-enum class LineSnap {
+enum class LineSnap : uint8_t {
     None,
     Baseline,
     Contain
 };
 
-enum class LineAlign {
+enum class LineAlign : uint8_t {
     None,
     Edges
 };
 
-enum class RubyPosition {
+enum class RubyPosition : uint8_t {
     Before,
     After,
     InterCharacter
@@ -1038,7 +1038,7 @@
     AutoFlowColumnDense = InternalAutoFlowAlgorithmDense | InternalAutoFlowDirectionColumn
 };
 
-enum class AutoRepeatType {
+enum class AutoRepeatType : uint8_t {
     None,
     Fill,
     Fit
@@ -1049,12 +1049,12 @@
 
 #if ENABLE(CSS3_TEXT)
 
-enum class TextIndentLine {
+enum class TextIndentLine : uint8_t {
     FirstLine,
     EachLine
 };
 
-enum class TextIndentType {
+enum class TextIndentType : uint8_t {
     Normal,
     Hanging
 };
@@ -1061,13 +1061,13 @@
 
 #endif
 
-enum class Isolation {
+enum class Isolation : uint8_t {
     Auto,
     Isolate
 };
 
 // Fill, Stroke, ViewBox are just used for SVG.
-enum class CSSBoxType {
+enum class CSSBoxType : uint8_t {
     BoxMissing = 0,
     MarginBox,
     BorderBox,
@@ -1079,7 +1079,7 @@
 };
 
 #if ENABLE(TOUCH_EVENTS)
-enum class TouchAction {
+enum class TouchAction : uint8_t {
     Auto,
     Manipulation
 };
@@ -1086,13 +1086,13 @@
 #endif
 
 #if ENABLE(CSS_SCROLL_SNAP)
-enum class ScrollSnapStrictness {
+enum class ScrollSnapStrictness : uint8_t {
     None,
     Proximity,
     Mandatory
 };
 
-enum class ScrollSnapAxis {
+enum class ScrollSnapAxis : uint8_t {
     XAxis,
     YAxis,
     Block,
@@ -1100,7 +1100,7 @@
     Both
 };
 
-enum class ScrollSnapAxisAlignType {
+enum class ScrollSnapAxisAlignType : uint8_t {
     None,
     Start,
     Center,
@@ -1109,7 +1109,7 @@
 #endif
 
 #if ENABLE(CSS_TRAILING_WORD)
-enum class TrailingWord {
+enum class TrailingWord : uint8_t {
     Auto,
     PartiallyBalanced
 };
@@ -1116,13 +1116,13 @@
 #endif
 
 #if ENABLE(APPLE_PAY)
-enum class ApplePayButtonStyle {
+enum class ApplePayButtonStyle : uint8_t {
     White,
     WhiteOutline,
     Black,
 };
 
-enum class ApplePayButtonType {
+enum class ApplePayButtonType : uint8_t {
     Plain,
     Buy,
     SetUp,
@@ -1138,7 +1138,7 @@
 WTF::TextStream& operator<<(WTF::TextStream&, Edge);
 
 // These are all minimized combinations of paint-order.
-enum class PaintOrder {
+enum class PaintOrder : uint8_t {
     Normal,
     Fill,
     FillMarkers,
@@ -1148,7 +1148,7 @@
     MarkersStroke
 };
 
-enum class PaintType {
+enum class PaintType : uint8_t {
     Fill,
     Stroke,
     Markers

Modified: trunk/Source/WebCore/style/StyleTreeResolver.cpp (233837 => 233838)


--- trunk/Source/WebCore/style/StyleTreeResolver.cpp	2018-07-14 23:44:42 UTC (rev 233837)
+++ trunk/Source/WebCore/style/StyleTreeResolver.cpp	2018-07-15 00:29:28 UTC (rev 233838)
@@ -128,7 +128,7 @@
     if (auto style = scope().sharingResolver.resolve(element, *m_update))
         return style;
 
-    auto elementStyle = scope().styleResolver.styleForElement(element, &inheritedStyle, parentBoxStyle(), MatchAllRules, &scope().selectorFilter);
+    auto elementStyle = scope().styleResolver.styleForElement(element, &inheritedStyle, parentBoxStyle(), RuleMatchingBehavior::MatchAllRules, &scope().selectorFilter);
 
     if (elementStyle.relations)
         commitRelations(WTFMove(elementStyle.relations), *m_update);

Modified: trunk/Source/WebCore/svg/SVGElementRareData.h (233837 => 233838)


--- trunk/Source/WebCore/svg/SVGElementRareData.h	2018-07-14 23:44:42 UTC (rev 233837)
+++ trunk/Source/WebCore/svg/SVGElementRareData.h	2018-07-15 00:29:28 UTC (rev 233838)
@@ -64,7 +64,7 @@
             return nullptr;
         if (!m_overrideComputedStyle || m_needsOverrideComputedStyleUpdate) {
             // The style computed here contains no CSS Animations/Transitions or SMIL induced rules - this is needed to compute the "base value" for the SMIL animation sandwhich model.
-            m_overrideComputedStyle = element.styleResolver().styleForElement(element, parentStyle, nullptr, MatchAllRulesExcludingSMIL).renderStyle;
+            m_overrideComputedStyle = element.styleResolver().styleForElement(element, parentStyle, nullptr, RuleMatchingBehavior::MatchAllRulesExcludingSMIL).renderStyle;
             m_needsOverrideComputedStyleUpdate = false;
         }
         ASSERT(m_overrideComputedStyle);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to