Changeset 106900 in webkit


Ignore:
Timestamp:
Feb 6, 2012 8:26:17 PM (12 years ago)
Author:
eae@chromium.org
Message:

Change baselinePosition and lineHeight to LayoutUnit
https://bugs.webkit.org/show_bug.cgi?id=77905

Reviewed by Eric Seidel.

Change the virtual baselinePosition and lineHeight methods to return
LayoutUnits as they are both computed from the height and top/bottom
margins (or width and left/right margins for vertical text), all of
which are LayoutUnits.

No new tests.

  • platform/efl/RenderThemeEfl.cpp:

(WebCore::RenderThemeEfl::baselinePosition):

  • platform/efl/RenderThemeEfl.h:

(RenderThemeEfl):

  • platform/gtk/RenderThemeGtk.cpp:

(WebCore::RenderThemeGtk::baselinePosition):

  • platform/gtk/RenderThemeGtk.h:

(RenderThemeGtk):

  • platform/qt/RenderThemeQt.cpp:

(WebCore::RenderThemeQt::baselinePosition):

  • platform/qt/RenderThemeQt.h:

(RenderThemeQt):

  • rendering/RenderListMarker.cpp:

(WebCore::RenderListMarker::lineHeight):
(WebCore::RenderListMarker::baselinePosition):

  • rendering/RenderListMarker.h:

(RenderListMarker):

  • rendering/RenderSlider.cpp:

(WebCore::RenderSlider::baselinePosition):

  • rendering/RenderSlider.h:

(RenderSlider):

  • rendering/RootInlineBox.h:

(WebCore::RootInlineBox::baselinePosition):
(WebCore::RootInlineBox::lineHeight):

  • rendering/mathml/RenderMathMLFraction.cpp:

(WebCore::RenderMathMLFraction::baselinePosition):

  • rendering/mathml/RenderMathMLFraction.h:

(RenderMathMLFraction):

  • rendering/mathml/RenderMathMLOperator.cpp:

(WebCore::RenderMathMLOperator::baselinePosition):

  • rendering/mathml/RenderMathMLOperator.h:

(RenderMathMLOperator):

  • rendering/mathml/RenderMathMLRow.cpp:

(WebCore::RenderMathMLRow::baselinePosition):

  • rendering/mathml/RenderMathMLRow.h:

(RenderMathMLRow):

  • rendering/mathml/RenderMathMLSubSup.cpp:

(WebCore::RenderMathMLSubSup::baselinePosition):

  • rendering/mathml/RenderMathMLSubSup.h:

(RenderMathMLSubSup):

  • rendering/mathml/RenderMathMLUnderOver.cpp:

(WebCore::RenderMathMLUnderOver::baselinePosition):

  • rendering/mathml/RenderMathMLUnderOver.h:

(RenderMathMLUnderOver):

Location:
trunk/Source/WebCore
Files:
22 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r106899 r106900  
     12012-02-06  Emil A Eklund  <eae@chromium.org>
     2
     3        Change baselinePosition and lineHeight to LayoutUnit
     4        https://bugs.webkit.org/show_bug.cgi?id=77905
     5
     6        Reviewed by Eric Seidel.
     7
     8        Change the virtual baselinePosition and lineHeight methods to return
     9        LayoutUnits as they are both computed from the height and top/bottom
     10        margins (or width and left/right margins for vertical text), all of
     11        which are LayoutUnits.
     12
     13        No new tests.
     14
     15        * platform/efl/RenderThemeEfl.cpp:
     16        (WebCore::RenderThemeEfl::baselinePosition):
     17        * platform/efl/RenderThemeEfl.h:
     18        (RenderThemeEfl):
     19        * platform/gtk/RenderThemeGtk.cpp:
     20        (WebCore::RenderThemeGtk::baselinePosition):
     21        * platform/gtk/RenderThemeGtk.h:
     22        (RenderThemeGtk):
     23        * platform/qt/RenderThemeQt.cpp:
     24        (WebCore::RenderThemeQt::baselinePosition):
     25        * platform/qt/RenderThemeQt.h:
     26        (RenderThemeQt):
     27        * rendering/RenderListMarker.cpp:
     28        (WebCore::RenderListMarker::lineHeight):
     29        (WebCore::RenderListMarker::baselinePosition):
     30        * rendering/RenderListMarker.h:
     31        (RenderListMarker):
     32        * rendering/RenderSlider.cpp:
     33        (WebCore::RenderSlider::baselinePosition):
     34        * rendering/RenderSlider.h:
     35        (RenderSlider):
     36        * rendering/RootInlineBox.h:
     37        (WebCore::RootInlineBox::baselinePosition):
     38        (WebCore::RootInlineBox::lineHeight):
     39        * rendering/mathml/RenderMathMLFraction.cpp:
     40        (WebCore::RenderMathMLFraction::baselinePosition):
     41        * rendering/mathml/RenderMathMLFraction.h:
     42        (RenderMathMLFraction):
     43        * rendering/mathml/RenderMathMLOperator.cpp:
     44        (WebCore::RenderMathMLOperator::baselinePosition):
     45        * rendering/mathml/RenderMathMLOperator.h:
     46        (RenderMathMLOperator):
     47        * rendering/mathml/RenderMathMLRow.cpp:
     48        (WebCore::RenderMathMLRow::baselinePosition):
     49        * rendering/mathml/RenderMathMLRow.h:
     50        (RenderMathMLRow):
     51        * rendering/mathml/RenderMathMLSubSup.cpp:
     52        (WebCore::RenderMathMLSubSup::baselinePosition):
     53        * rendering/mathml/RenderMathMLSubSup.h:
     54        (RenderMathMLSubSup):
     55        * rendering/mathml/RenderMathMLUnderOver.cpp:
     56        (WebCore::RenderMathMLUnderOver::baselinePosition):
     57        * rendering/mathml/RenderMathMLUnderOver.h:
     58        (RenderMathMLUnderOver):
     59
    1602012-02-06  Xianzhu Wang  <wangxianzhu@chromium.org>
    261
  • trunk/Source/WebCore/platform/efl/RenderThemeEfl.cpp

    r100408 r106900  
    823823}
    824824
    825 int RenderThemeEfl::baselinePosition(const RenderObject* object) const
     825LayoutUnit RenderThemeEfl::baselinePosition(const RenderObject* object) const
    826826{
    827827    if (!object->isBox())
  • trunk/Source/WebCore/platform/efl/RenderThemeEfl.h

    r95901 r106900  
    9292    // position cannot be determined by examining child content. Checkboxes and radio buttons are examples of
    9393    // controls that need to do this.
    94     virtual int baselinePosition(const RenderObject*) const;
     94    virtual LayoutUnit baselinePosition(const RenderObject*) const;
    9595
    9696    virtual Color platformActiveSelectionBackgroundColor() const { return m_activeSelectionBackgroundColor; }
  • trunk/Source/WebCore/platform/gtk/RenderThemeGtk.cpp

    r101920 r106900  
    162162}
    163163
    164 int RenderThemeGtk::baselinePosition(const RenderObject* o) const
     164LayoutUnit RenderThemeGtk::baselinePosition(const RenderObject* o) const
    165165{
    166166    if (!o->isBox())
  • trunk/Source/WebCore/platform/gtk/RenderThemeGtk.h

    r105286 r106900  
    6161    // position cannot be determined by examining child content. Checkboxes and radio buttons are examples of
    6262    // controls that need to do this.
    63     virtual int baselinePosition(const RenderObject*) const;
     63    virtual LayoutUnit baselinePosition(const RenderObject*) const;
    6464
    6565    // The platform selection color.
  • trunk/Source/WebCore/platform/qt/RenderThemeQt.cpp

    r102768 r106900  
    157157}
    158158
    159 int RenderThemeQt::baselinePosition(const RenderObject* o) const
     159LayoutUnit RenderThemeQt::baselinePosition(const RenderObject* o) const
    160160{
    161161    if (!o->isBox())
  • trunk/Source/WebCore/platform/qt/RenderThemeQt.h

    r102768 r106900  
    5454    virtual bool supportsFocusRing(const RenderStyle*) const;
    5555
    56     virtual int baselinePosition(const RenderObject*) const;
     56    virtual LayoutUnit baselinePosition(const RenderObject*) const;
    5757
    5858    // A method asking if the control changes its tint when the window has focus or not.
  • trunk/Source/WebCore/rendering/RenderListMarker.cpp

    r98852 r106900  
    15351535}
    15361536
    1537 int RenderListMarker::lineHeight(bool firstLine, LineDirectionMode direction, LinePositionMode linePositionMode) const
     1537LayoutUnit RenderListMarker::lineHeight(bool firstLine, LineDirectionMode direction, LinePositionMode linePositionMode) const
    15381538{
    15391539    if (!isImage())
     
    15421542}
    15431543
    1544 int RenderListMarker::baselinePosition(FontBaseline baselineType, bool firstLine, LineDirectionMode direction, LinePositionMode linePositionMode) const
     1544LayoutUnit RenderListMarker::baselinePosition(FontBaseline baselineType, bool firstLine, LineDirectionMode direction, LinePositionMode linePositionMode) const
    15451545{
    15461546    if (!isImage())
  • trunk/Source/WebCore/rendering/RenderListMarker.h

    r90596 r106900  
    5959    virtual InlineBox* createInlineBox();
    6060
    61     virtual int lineHeight(bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const;
    62     virtual int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const;
     61    virtual LayoutUnit lineHeight(bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const;
     62    virtual LayoutUnit baselinePosition(FontBaseline, bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const;
    6363
    6464    bool isImage() const;
  • trunk/Source/WebCore/rendering/RenderSlider.cpp

    r95502 r106900  
    6060}
    6161
    62 int RenderSlider::baselinePosition(FontBaseline, bool /*firstLine*/, LineDirectionMode, LinePositionMode) const
     62LayoutUnit RenderSlider::baselinePosition(FontBaseline, bool /*firstLine*/, LineDirectionMode, LinePositionMode) const
    6363{
    6464    // FIXME: Patch this function for writing-mode.
  • trunk/Source/WebCore/rendering/RenderSlider.h

    r88901 r106900  
    4141        virtual bool isSlider() const { return true; }
    4242
    43         virtual int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const;
     43        virtual LayoutUnit baselinePosition(FontBaseline, bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const;
    4444        virtual void computePreferredLogicalWidths();
    4545        virtual bool requiresForcedStyleRecalcPropagation() const { return true; }
  • trunk/Source/WebCore/rendering/RootInlineBox.h

    r105176 r106900  
    102102    bool isHyphenated() const;
    103103
    104     virtual int baselinePosition(FontBaseline baselineType) const { return boxModelObject()->baselinePosition(baselineType, m_firstLine, isHorizontal() ? HorizontalLine : VerticalLine, PositionOfInteriorLineBoxes); }
    105     virtual int lineHeight() const { return boxModelObject()->lineHeight(m_firstLine, isHorizontal() ? HorizontalLine : VerticalLine, PositionOfInteriorLineBoxes); }
     104    virtual LayoutUnit baselinePosition(FontBaseline baselineType) const { return boxModelObject()->baselinePosition(baselineType, m_firstLine, isHorizontal() ? HorizontalLine : VerticalLine, PositionOfInteriorLineBoxes); }
     105    virtual LayoutUnit lineHeight() const { return boxModelObject()->lineHeight(m_firstLine, isHorizontal() ? HorizontalLine : VerticalLine, PositionOfInteriorLineBoxes); }
    106106
    107107#if PLATFORM(MAC)
  • trunk/Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp

    r95901 r106900  
    166166}
    167167
    168 int RenderMathMLFraction::baselinePosition(FontBaseline, bool firstLine, LineDirectionMode lineDirection, LinePositionMode linePositionMode) const
     168LayoutUnit RenderMathMLFraction::baselinePosition(FontBaseline, bool firstLine, LineDirectionMode lineDirection, LinePositionMode linePositionMode) const
    169169{
    170170    if (firstChild() && firstChild()->isRenderMathMLBlock()) {
  • trunk/Source/WebCore/rendering/mathml/RenderMathMLFraction.h

    r95901 r106900  
    3939    virtual void addChild(RenderObject* child, RenderObject* beforeChild = 0);
    4040    virtual void updateFromElement();
    41     virtual int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const;
     41    virtual LayoutUnit baselinePosition(FontBaseline, bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const;
    4242    virtual void paint(PaintInfo&, const LayoutPoint&);
    4343protected:
  • trunk/Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp

    r95901 r106900  
    335335}
    336336
    337 int RenderMathMLOperator::baselinePosition(FontBaseline, bool firstLine, LineDirectionMode lineDirection, LinePositionMode linePositionMode) const
     337LayoutUnit RenderMathMLOperator::baselinePosition(FontBaseline, bool firstLine, LineDirectionMode lineDirection, LinePositionMode linePositionMode) const
    338338{
    339339    if (m_isStacked)
  • trunk/Source/WebCore/rendering/mathml/RenderMathMLOperator.h

    r95901 r106900  
    4242    virtual void updateFromElement();
    4343    virtual bool isChildAllowed(RenderObject*, RenderStyle*) const;
    44     virtual int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const;
     44    virtual LayoutUnit baselinePosition(FontBaseline, bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const;
    4545       
    4646protected:
  • trunk/Source/WebCore/rendering/mathml/RenderMathMLRow.cpp

    r95901 r106900  
    120120}   
    121121
    122 int RenderMathMLRow::baselinePosition(FontBaseline, bool firstLine, LineDirectionMode direction, LinePositionMode linePositionMode) const
     122LayoutUnit RenderMathMLRow::baselinePosition(FontBaseline, bool firstLine, LineDirectionMode direction, LinePositionMode linePositionMode) const
    123123{
    124124    if (firstChild() && firstChild()->isRenderMathMLBlock()) {
  • trunk/Source/WebCore/rendering/mathml/RenderMathMLRow.h

    r95901 r106900  
    3838    virtual bool isRenderMathMLRow() const { return true; }
    3939    virtual int nonOperatorHeight() const;
    40     virtual int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const;   
     40    virtual LayoutUnit baselinePosition(FontBaseline, bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const;   
    4141    virtual void stretchToHeight(int) {}
    4242protected:
  • trunk/Source/WebCore/rendering/mathml/RenderMathMLSubSup.cpp

    r103213 r106900  
    182182}
    183183
    184 int RenderMathMLSubSup::baselinePosition(FontBaseline, bool firstLine, LineDirectionMode direction, LinePositionMode linePositionMode) const
     184LayoutUnit RenderMathMLSubSup::baselinePosition(FontBaseline, bool firstLine, LineDirectionMode direction, LinePositionMode linePositionMode) const
    185185{
    186186    RenderObject* base = firstChild();
     
    188188        return offsetHeight();
    189189   
    190     int baseline = offsetHeight();
     190    LayoutUnit baseline = offsetHeight();
    191191    if (!base || !base->isBoxModelObject())
    192192        return baseline;
  • trunk/Source/WebCore/rendering/mathml/RenderMathMLSubSup.h

    r95901 r106900  
    4242    virtual int nonOperatorHeight() const;
    4343    virtual void stretchToHeight(int pixelHeight);
    44     virtual int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const;
     44    virtual LayoutUnit baselinePosition(FontBaseline, bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const;
    4545
    4646protected:
  • trunk/Source/WebCore/rendering/mathml/RenderMathMLUnderOver.cpp

    r103213 r106900  
    245245}
    246246
    247 int RenderMathMLUnderOver::baselinePosition(FontBaseline, bool firstLine, LineDirectionMode direction, LinePositionMode linePositionMode) const
     247LayoutUnit RenderMathMLUnderOver::baselinePosition(FontBaseline, bool firstLine, LineDirectionMode direction, LinePositionMode linePositionMode) const
    248248{
    249249    RenderObject* current = firstChild();
     
    251251        return RenderBlock::baselinePosition(AlphabeticBaseline, firstLine, direction, linePositionMode);
    252252
    253     int baseline = 0;
     253    LayoutUnit baseline = 0;
    254254    switch (m_kind) {
    255255    case UnderOver:
  • trunk/Source/WebCore/rendering/mathml/RenderMathMLUnderOver.h

    r95901 r106900  
    4141    virtual bool hasBase() const { return true; }
    4242    virtual int nonOperatorHeight() const;
    43     virtual int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const;   
     43    virtual LayoutUnit baselinePosition(FontBaseline, bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const;
    4444    virtual void stretchToHeight(int pixelHeight);
    4545private:
Note: See TracChangeset for help on using the changeset viewer.