Changeset 45570 in webkit


Ignore:
Timestamp:
Jul 6, 2009 3:42:38 PM (15 years ago)
Author:
eric@webkit.org
Message:

2009-07-06 Roland Steiner <rolandsteiner@google.com>

Reviewed by Maciej Stachowiak.

generalize the special height treatment for SVG (to be re-used for ruby):

renamed InlineBox::m_isSVG to m_hasVirtualHeight
renamed InlineBox::isSVG() to hasVirtualHeight()
renamed InlineBox::setIsSVG() to setHasVirtualHeight()

  • rendering/InlineBox.cpp: (WebCore::InlineBox::height):
  • rendering/InlineBox.h: (WebCore::InlineBox::InlineBox): (WebCore::InlineBox::isText): (WebCore::InlineBox::setIsText): (WebCore::InlineBox::isSVGRootInlineBox): (WebCore::InlineBox::hasVirtualHeight): (WebCore::InlineBox::setHasVirtualHeight): (WebCore::InlineBox::virtualHeight):
  • rendering/RenderSVGInline.cpp: (WebCore::RenderSVGInline::createFlowBox):
  • rendering/RenderSVGInlineText.cpp: (WebCore::RenderSVGInlineText::createTextBox):
  • rendering/RenderSVGText.cpp: (WebCore::RenderSVGText::createRootBox):
  • rendering/SVGInlineFlowBox.h: (WebCore::SVGInlineFlowBox::virtualHeight):
  • rendering/SVGInlineTextBox.h: (WebCore::SVGInlineTextBox::virtualHeight):
  • rendering/SVGRootInlineBox.h: (WebCore::SVGRootInlineBox::virtualHeight):
Location:
trunk/WebCore
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r45569 r45570  
     12009-07-06  Roland Steiner  <rolandsteiner@google.com>
     2
     3        Reviewed by Maciej Stachowiak.
     4
     5        generalize the special height treatment for SVG (to be re-used for ruby):
     6            renamed InlineBox::m_isSVG to m_hasVirtualHeight
     7            renamed InlineBox::isSVG() to hasVirtualHeight()
     8            renamed InlineBox::setIsSVG() to setHasVirtualHeight()
     9
     10        * rendering/InlineBox.cpp:
     11        (WebCore::InlineBox::height):
     12        * rendering/InlineBox.h:
     13        (WebCore::InlineBox::InlineBox):
     14        (WebCore::InlineBox::isText):
     15        (WebCore::InlineBox::setIsText):
     16        (WebCore::InlineBox::isSVGRootInlineBox):
     17        (WebCore::InlineBox::hasVirtualHeight):
     18        (WebCore::InlineBox::setHasVirtualHeight):
     19        (WebCore::InlineBox::virtualHeight):
     20        * rendering/RenderSVGInline.cpp:
     21        (WebCore::RenderSVGInline::createFlowBox):
     22        * rendering/RenderSVGInlineText.cpp:
     23        (WebCore::RenderSVGInlineText::createTextBox):
     24        * rendering/RenderSVGText.cpp:
     25        (WebCore::RenderSVGText::createRootBox):
     26        * rendering/SVGInlineFlowBox.h:
     27        (WebCore::SVGInlineFlowBox::virtualHeight):
     28        * rendering/SVGInlineTextBox.h:
     29        (WebCore::SVGInlineTextBox::virtualHeight):
     30        * rendering/SVGRootInlineBox.h:
     31        (WebCore::SVGRootInlineBox::virtualHeight):
     32
    1332009-07-06  Alice Liu  <alice.liu@apple.com>
    234
  • trunk/WebCore/rendering/InlineBox.cpp

    r43664 r45570  
    8989{
    9090#if ENABLE(SVG)
    91     if (isSVG())
    92         return svgBoxHeight();
    93 #endif
    94 
     91    if (hasVirtualHeight())
     92        return virtualHeight();
     93#endif
     94   
    9595    if (renderer()->isText())
    9696        return m_isText ? renderer()->style(m_firstLine)->font().height() : 0;
  • trunk/WebCore/rendering/InlineBox.h

    r43664 r45570  
    5050        , m_extracted(false)
    5151#if ENABLE(SVG)
    52         , m_isSVG(false)
     52        , m_hasVirtualHeight(false)
    5353#endif
    5454        , m_endsWithBreak(false)
     
    8383        , m_extracted(extracted)
    8484#if ENABLE(SVG)
    85         , m_isSVG(false)
     85        , m_hasVirtualHeight(false)
    8686#endif
    8787        , m_endsWithBreak(false)
     
    130130    void showTreeForThis() const;
    131131#endif
     132
     133    bool isText() const { return m_isText; }
     134    void setIsText(bool b) { m_isText = b; }
     135 
    132136    virtual bool isInlineBox() { return false; }
    133137    virtual bool isInlineFlowBox() const { return false; }
     
    136140#if ENABLE(SVG)
    137141    virtual bool isSVGRootInlineBox() { return false; }
    138     bool isSVG() const { return m_isSVG; }
    139     void setIsSVG(bool b) { m_isSVG = b; }
    140 #endif
    141     bool isText() const { return m_isText; }
    142     void setIsText(bool b) { m_isText = b; }
    143 
     142
     143    bool hasVirtualHeight() const { return m_hasVirtualHeight; }
     144    void setHasVirtualHeight() { m_hasVirtualHeight = true; }
     145    virtual int virtualHeight() const { ASSERT_NOT_REACHED(); return 0; }
     146#endif
     147   
    144148    bool isConstructed() { return m_constructed; }
    145149    virtual void setConstructed()
     
    243247        return 0;
    244248    }
    245 
    246 protected:
    247 #if ENABLE(SVG)
    248     virtual int svgBoxHeight() const { return 0; }
    249 #endif
    250249
    251250private:
     
    273272    bool m_dirty : 1;
    274273    bool m_extracted : 1;
    275 
    276 #if ENABLE(SVG)
    277     bool m_isSVG : 1;
    278 #endif
     274    bool m_hasVirtualHeight : 1;
    279275
    280276    // for RootInlineBox
  • trunk/WebCore/rendering/RenderSVGInline.cpp

    r45517 r45570  
    4343{
    4444    InlineFlowBox* box = new (renderArena()) SVGInlineFlowBox(this);
    45     box->setIsSVG(true);
     45    box->setHasVirtualHeight();
    4646    return box;
    4747}
  • trunk/WebCore/rendering/RenderSVGInlineText.cpp

    r43177 r45570  
    135135{
    136136    InlineTextBox* box = new (renderArena()) SVGInlineTextBox(this);
    137     box->setIsSVG(true);
     137    box->setHasVirtualHeight();
    138138    return box;
    139139}
  • trunk/WebCore/rendering/RenderSVGText.cpp

    r45517 r45570  
    9393{
    9494    RootInlineBox* box = new (renderArena()) SVGRootInlineBox(this);
    95     box->setIsSVG(true);
     95    box->setHasVirtualHeight();
    9696    return box;
    9797}
  • trunk/WebCore/rendering/SVGInlineFlowBox.h

    r42846 r45570  
    3838    }
    3939
    40     virtual int svgBoxHeight() const { return m_height; }
     40    virtual int virtualHeight() const { return m_height; }
    4141    void setHeight(int h) { m_height = h; }
    4242
  • trunk/WebCore/rendering/SVGInlineTextBox.h

    r43526 r45570  
    3939        SVGInlineTextBox(RenderObject* obj);
    4040
    41         virtual int svgBoxHeight() const { return m_height; }
     41        virtual int virtualHeight() const { return m_height; }
    4242        void setHeight(int h) { m_height = h; }
    4343
  • trunk/WebCore/rendering/SVGRootInlineBox.h

    r42846 r45570  
    5454    virtual bool isSVGRootInlineBox() { return true; }
    5555
    56     virtual int svgBoxHeight() const { return m_height; }
     56    virtual int virtualHeight() const { return m_height; }
    5757    void setHeight(int h) { m_height = h; }
    5858   
Note: See TracChangeset for help on using the changeset viewer.