Changeset 194417 in webkit


Ignore:
Timestamp:
Dec 24, 2015, 9:37:22 PM (10 years ago)
Author:
Simon Fraser
Message:

Use an enum for RenderElement's baseTypeFlags
https://bugs.webkit.org/show_bug.cgi?id=152553

Reviewed by Zalan Bujtas.

Use an enum, rather than unsigned, for the BaseTypeFlags bit mask.

  • rendering/RenderBlock.cpp:

(WebCore::RenderBlock::RenderBlock):

  • rendering/RenderBlock.h:
  • rendering/RenderBox.cpp:

(WebCore::RenderBox::RenderBox):

  • rendering/RenderBox.h:
  • rendering/RenderBoxModelObject.cpp:

(WebCore::RenderBoxModelObject::RenderBoxModelObject):

  • rendering/RenderBoxModelObject.h:
  • rendering/RenderElement.cpp:

(WebCore::RenderElement::RenderElement):

  • rendering/RenderElement.h:
  • rendering/RenderLayerModelObject.cpp:

(WebCore::RenderLayerModelObject::RenderLayerModelObject):

  • rendering/RenderLayerModelObject.h:
Location:
trunk/Source/WebCore
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r194416 r194417  
     12015-12-24  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Use an enum for RenderElement's baseTypeFlags
     4        https://bugs.webkit.org/show_bug.cgi?id=152553
     5
     6        Reviewed by Zalan Bujtas.
     7
     8        Use an enum, rather than unsigned, for the BaseTypeFlags bit mask.
     9
     10        * rendering/RenderBlock.cpp:
     11        (WebCore::RenderBlock::RenderBlock):
     12        * rendering/RenderBlock.h:
     13        * rendering/RenderBox.cpp:
     14        (WebCore::RenderBox::RenderBox):
     15        * rendering/RenderBox.h:
     16        * rendering/RenderBoxModelObject.cpp:
     17        (WebCore::RenderBoxModelObject::RenderBoxModelObject):
     18        * rendering/RenderBoxModelObject.h:
     19        * rendering/RenderElement.cpp:
     20        (WebCore::RenderElement::RenderElement):
     21        * rendering/RenderElement.h:
     22        * rendering/RenderLayerModelObject.cpp:
     23        (WebCore::RenderLayerModelObject::RenderLayerModelObject):
     24        * rendering/RenderLayerModelObject.h:
     25
    1262015-12-24  Simon Fraser  <simon.fraser@apple.com>
    227
  • trunk/Source/WebCore/rendering/RenderBlock.cpp

    r194143 r194417  
    182182};
    183183
    184 RenderBlock::RenderBlock(Element& element, Ref<RenderStyle>&& style, unsigned baseTypeFlags)
     184RenderBlock::RenderBlock(Element& element, Ref<RenderStyle>&& style, BaseTypeFlags baseTypeFlags)
    185185    : RenderBox(element, WTF::move(style), baseTypeFlags | RenderBlockFlag)
    186186{
    187187}
    188188
    189 RenderBlock::RenderBlock(Document& document, Ref<RenderStyle>&& style, unsigned baseTypeFlags)
     189RenderBlock::RenderBlock(Document& document, Ref<RenderStyle>&& style, BaseTypeFlags baseTypeFlags)
    190190    : RenderBox(document, WTF::move(style), baseTypeFlags | RenderBlockFlag)
    191191{
  • trunk/Source/WebCore/rendering/RenderBlock.h

    r192054 r194417  
    6161
    6262protected:
    63     RenderBlock(Element&, Ref<RenderStyle>&&, unsigned baseTypeFlags);
    64     RenderBlock(Document&, Ref<RenderStyle>&&, unsigned baseTypeFlags);
     63    RenderBlock(Element&, Ref<RenderStyle>&&, BaseTypeFlags);
     64    RenderBlock(Document&, Ref<RenderStyle>&&, BaseTypeFlags);
    6565    virtual ~RenderBlock();
    6666
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r194405 r194417  
    118118}
    119119
    120 RenderBox::RenderBox(Element& element, Ref<RenderStyle>&& style, unsigned baseTypeFlags)
     120RenderBox::RenderBox(Element& element, Ref<RenderStyle>&& style, BaseTypeFlags baseTypeFlags)
    121121    : RenderBoxModelObject(element, WTF::move(style), baseTypeFlags)
    122122    , m_minPreferredLogicalWidth(-1)
     
    127127}
    128128
    129 RenderBox::RenderBox(Document& document, Ref<RenderStyle>&& style, unsigned baseTypeFlags)
     129RenderBox::RenderBox(Document& document, Ref<RenderStyle>&& style, BaseTypeFlags baseTypeFlags)
    130130    : RenderBoxModelObject(document, WTF::move(style), baseTypeFlags)
    131131    , m_minPreferredLogicalWidth(-1)
  • trunk/Source/WebCore/rendering/RenderBox.h

    r194404 r194417  
    629629
    630630protected:
    631     RenderBox(Element&, Ref<RenderStyle>&&, unsigned baseTypeFlags);
    632     RenderBox(Document&, Ref<RenderStyle>&&, unsigned baseTypeFlags);
     631    RenderBox(Element&, Ref<RenderStyle>&&, BaseTypeFlags);
     632    RenderBox(Document&, Ref<RenderStyle>&&, BaseTypeFlags);
    633633
    634634    virtual void styleWillChange(StyleDifference, const RenderStyle& newStyle) override;
  • trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp

    r194025 r194417  
    167167}
    168168
    169 RenderBoxModelObject::RenderBoxModelObject(Element& element, Ref<RenderStyle>&& style, unsigned baseTypeFlags)
     169RenderBoxModelObject::RenderBoxModelObject(Element& element, Ref<RenderStyle>&& style, BaseTypeFlags baseTypeFlags)
    170170    : RenderLayerModelObject(element, WTF::move(style), baseTypeFlags | RenderBoxModelObjectFlag)
    171171{
    172172}
    173173
    174 RenderBoxModelObject::RenderBoxModelObject(Document& document, Ref<RenderStyle>&& style, unsigned baseTypeFlags)
     174RenderBoxModelObject::RenderBoxModelObject(Document& document, Ref<RenderStyle>&& style, BaseTypeFlags baseTypeFlags)
    175175    : RenderLayerModelObject(document, WTF::move(style), baseTypeFlags | RenderBoxModelObjectFlag)
    176176{
  • trunk/Source/WebCore/rendering/RenderBoxModelObject.h

    r191049 r194417  
    237237
    238238protected:
    239     RenderBoxModelObject(Element&, Ref<RenderStyle>&&, unsigned baseTypeFlags);
    240     RenderBoxModelObject(Document&, Ref<RenderStyle>&&, unsigned baseTypeFlags);
     239    RenderBoxModelObject(Element&, Ref<RenderStyle>&&, BaseTypeFlags);
     240    RenderBoxModelObject(Document&, Ref<RenderStyle>&&, BaseTypeFlags);
    241241
    242242    virtual void willBeDestroyed() override;
  • trunk/Source/WebCore/rendering/RenderElement.cpp

    r194002 r194417  
    8282}
    8383
    84 inline RenderElement::RenderElement(ContainerNode& elementOrDocument, Ref<RenderStyle>&& style, unsigned baseTypeFlags)
     84inline RenderElement::RenderElement(ContainerNode& elementOrDocument, Ref<RenderStyle>&& style, BaseTypeFlags baseTypeFlags)
    8585    : RenderObject(elementOrDocument)
    8686    , m_baseTypeFlags(baseTypeFlags)
     
    104104}
    105105
    106 RenderElement::RenderElement(Element& element, Ref<RenderStyle>&& style, unsigned baseTypeFlags)
     106RenderElement::RenderElement(Element& element, Ref<RenderStyle>&& style, BaseTypeFlags baseTypeFlags)
    107107    : RenderElement(static_cast<ContainerNode&>(element), WTF::move(style), baseTypeFlags)
    108108{
    109109}
    110110
    111 RenderElement::RenderElement(Document& document, Ref<RenderStyle>&& style, unsigned baseTypeFlags)
     111RenderElement::RenderElement(Document& document, Ref<RenderStyle>&& style, BaseTypeFlags baseTypeFlags)
    112112    : RenderElement(static_cast<ContainerNode&>(document), WTF::move(style), baseTypeFlags)
    113113{
  • trunk/Source/WebCore/rendering/RenderElement.h

    r192966 r194417  
    219219
    220220protected:
    221     enum BaseTypeFlags {
    222         RenderLayerModelObjectFlag = 1 << 0,
    223         RenderBoxModelObjectFlag = 1 << 1,
    224         RenderInlineFlag = 1 << 2,
    225         RenderReplacedFlag = 1 << 3,
    226         RenderBlockFlag = 1 << 4,
    227         RenderBlockFlowFlag = 1 << 5,
     221    enum BaseTypeFlag {
     222        RenderLayerModelObjectFlag  = 1 << 0,
     223        RenderBoxModelObjectFlag    = 1 << 1,
     224        RenderInlineFlag            = 1 << 2,
     225        RenderReplacedFlag          = 1 << 3,
     226        RenderBlockFlag             = 1 << 4,
     227        RenderBlockFlowFlag         = 1 << 5,
    228228    };
    229 
    230     RenderElement(Element&, Ref<RenderStyle>&&, unsigned baseTypeFlags);
    231     RenderElement(Document&, Ref<RenderStyle>&&, unsigned baseTypeFlags);
     229   
     230    typedef unsigned BaseTypeFlags;
     231
     232    RenderElement(Element&, Ref<RenderStyle>&&, BaseTypeFlags);
     233    RenderElement(Document&, Ref<RenderStyle>&&, BaseTypeFlags);
    232234
    233235    bool layerCreationAllowedForSubtree() const;
     
    277279
    278280private:
    279     RenderElement(ContainerNode&, Ref<RenderStyle>&&, unsigned baseTypeFlags);
     281    RenderElement(ContainerNode&, Ref<RenderStyle>&&, BaseTypeFlags);
    280282    void node() const = delete;
    281283    void nonPseudoNode() const = delete;
  • trunk/Source/WebCore/rendering/RenderLayerModelObject.cpp

    r190834 r194417  
    3737bool RenderLayerModelObject::s_layerWasSelfPainting = false;
    3838
    39 RenderLayerModelObject::RenderLayerModelObject(Element& element, Ref<RenderStyle>&& style, unsigned baseTypeFlags)
     39RenderLayerModelObject::RenderLayerModelObject(Element& element, Ref<RenderStyle>&& style, BaseTypeFlags baseTypeFlags)
    4040    : RenderElement(element, WTF::move(style), baseTypeFlags | RenderLayerModelObjectFlag)
    4141{
    4242}
    4343
    44 RenderLayerModelObject::RenderLayerModelObject(Document& document, Ref<RenderStyle>&& style, unsigned baseTypeFlags)
     44RenderLayerModelObject::RenderLayerModelObject(Document& document, Ref<RenderStyle>&& style, BaseTypeFlags baseTypeFlags)
    4545    : RenderElement(document, WTF::move(style), baseTypeFlags | RenderLayerModelObjectFlag)
    4646{
  • trunk/Source/WebCore/rendering/RenderLayerModelObject.h

    r177259 r194417  
    5353
    5454protected:
    55     RenderLayerModelObject(Element&, Ref<RenderStyle>&&, unsigned baseTypeFlags);
    56     RenderLayerModelObject(Document&, Ref<RenderStyle>&&, unsigned baseTypeFlags);
     55    RenderLayerModelObject(Element&, Ref<RenderStyle>&&, BaseTypeFlags);
     56    RenderLayerModelObject(Document&, Ref<RenderStyle>&&, BaseTypeFlags);
    5757
    5858    void createLayer();
Note: See TracChangeset for help on using the changeset viewer.