Changeset 109642 in webkit


Ignore:
Timestamp:
Mar 2, 2012 5:47:46 PM (12 years ago)
Author:
eae@chromium.org
Message:

Revert borders to integers for subpixel layout
https://bugs.webkit.org/show_bug.cgi?id=80175

Reviewed by Eric Seidel.

Change border representation and calculation back to integers to ensure
that borders given the same width are rendered with the same actual width.

This will also avoid unnecessary type conversions when we switch over
to subpixel precision.

No new tests.

  • rendering/LayoutTypes.h:

(WebCore::pixelSnappedIntRect):
(WebCore):

  • rendering/RenderBoxModelObject.h:

(WebCore::RenderBoxModelObject::borderTop):
(WebCore::RenderBoxModelObject::borderBottom):
(WebCore::RenderBoxModelObject::borderLeft):
(WebCore::RenderBoxModelObject::borderRight):
(WebCore::RenderBoxModelObject::borderBefore):
(WebCore::RenderBoxModelObject::borderAfter):
(WebCore::RenderBoxModelObject::borderStart):
(WebCore::RenderBoxModelObject::borderEnd):

  • rendering/RenderTable.cpp:

(WebCore::RenderTable::convertStyleLogicalWidthToComputedWidth):
(WebCore::RenderTable::calcBorderStart):
(WebCore::RenderTable::calcBorderEnd):
(WebCore::RenderTable::borderBefore):
(WebCore::RenderTable::borderAfter):
(WebCore::RenderTable::outerBorderBefore):
(WebCore::RenderTable::outerBorderAfter):
(WebCore::RenderTable::outerBorderStart):
(WebCore::RenderTable::outerBorderEnd):

  • rendering/RenderTable.h:

(WebCore::RenderTable::borderStart):
(WebCore::RenderTable::borderEnd):
(RenderTable):
(WebCore::RenderTable::borderLeft):
(WebCore::RenderTable::borderRight):
(WebCore::RenderTable::borderTop):
(WebCore::RenderTable::borderBottom):
(WebCore::RenderTable::outerBorderLeft):
(WebCore::RenderTable::outerBorderRight):
(WebCore::RenderTable::outerBorderTop):
(WebCore::RenderTable::outerBorderBottom):

  • rendering/RenderTableCell.cpp:

(WebCore::RenderTableCell::clippedOverflowRectForRepaint):
(WebCore::RenderTableCell::borderLeft):
(WebCore::RenderTableCell::borderRight):
(WebCore::RenderTableCell::borderTop):
(WebCore::RenderTableCell::borderBottom):
(WebCore::RenderTableCell::borderStart):
(WebCore::RenderTableCell::borderEnd):
(WebCore::RenderTableCell::borderBefore):
(WebCore::RenderTableCell::borderAfter):
(WebCore::RenderTableCell::borderHalfLeft):
(WebCore::RenderTableCell::borderHalfRight):
(WebCore::RenderTableCell::borderHalfTop):
(WebCore::RenderTableCell::borderHalfBottom):
(WebCore::RenderTableCell::borderHalfStart):
(WebCore::RenderTableCell::borderHalfEnd):
(WebCore::RenderTableCell::borderHalfBefore):
(WebCore::RenderTableCell::borderHalfAfter):
(WebCore::RenderTableCell::paintCollapsedBorders):

  • rendering/RenderTableCell.h:

(RenderTableCell):

Location:
trunk/Source/WebCore
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r109635 r109642  
     12012-03-02  Emil A Eklund  <eae@chromium.org>
     2
     3        Revert borders to integers for subpixel layout
     4        https://bugs.webkit.org/show_bug.cgi?id=80175
     5
     6        Reviewed by Eric Seidel.
     7
     8        Change border representation and calculation back to integers to ensure
     9        that borders given the same width are rendered with the same actual width.
     10
     11        This will also avoid unnecessary type conversions when we switch over
     12        to subpixel precision.
     13
     14        No new tests.
     15
     16        * rendering/LayoutTypes.h:
     17        (WebCore::pixelSnappedIntRect):
     18        (WebCore):
     19        * rendering/RenderBoxModelObject.h:
     20        (WebCore::RenderBoxModelObject::borderTop):
     21        (WebCore::RenderBoxModelObject::borderBottom):
     22        (WebCore::RenderBoxModelObject::borderLeft):
     23        (WebCore::RenderBoxModelObject::borderRight):
     24        (WebCore::RenderBoxModelObject::borderBefore):
     25        (WebCore::RenderBoxModelObject::borderAfter):
     26        (WebCore::RenderBoxModelObject::borderStart):
     27        (WebCore::RenderBoxModelObject::borderEnd):
     28        * rendering/RenderTable.cpp:
     29        (WebCore::RenderTable::convertStyleLogicalWidthToComputedWidth):
     30        (WebCore::RenderTable::calcBorderStart):
     31        (WebCore::RenderTable::calcBorderEnd):
     32        (WebCore::RenderTable::borderBefore):
     33        (WebCore::RenderTable::borderAfter):
     34        (WebCore::RenderTable::outerBorderBefore):
     35        (WebCore::RenderTable::outerBorderAfter):
     36        (WebCore::RenderTable::outerBorderStart):
     37        (WebCore::RenderTable::outerBorderEnd):
     38        * rendering/RenderTable.h:
     39        (WebCore::RenderTable::borderStart):
     40        (WebCore::RenderTable::borderEnd):
     41        (RenderTable):
     42        (WebCore::RenderTable::borderLeft):
     43        (WebCore::RenderTable::borderRight):
     44        (WebCore::RenderTable::borderTop):
     45        (WebCore::RenderTable::borderBottom):
     46        (WebCore::RenderTable::outerBorderLeft):
     47        (WebCore::RenderTable::outerBorderRight):
     48        (WebCore::RenderTable::outerBorderTop):
     49        (WebCore::RenderTable::outerBorderBottom):
     50        * rendering/RenderTableCell.cpp:
     51        (WebCore::RenderTableCell::clippedOverflowRectForRepaint):
     52        (WebCore::RenderTableCell::borderLeft):
     53        (WebCore::RenderTableCell::borderRight):
     54        (WebCore::RenderTableCell::borderTop):
     55        (WebCore::RenderTableCell::borderBottom):
     56        (WebCore::RenderTableCell::borderStart):
     57        (WebCore::RenderTableCell::borderEnd):
     58        (WebCore::RenderTableCell::borderBefore):
     59        (WebCore::RenderTableCell::borderAfter):
     60        (WebCore::RenderTableCell::borderHalfLeft):
     61        (WebCore::RenderTableCell::borderHalfRight):
     62        (WebCore::RenderTableCell::borderHalfTop):
     63        (WebCore::RenderTableCell::borderHalfBottom):
     64        (WebCore::RenderTableCell::borderHalfStart):
     65        (WebCore::RenderTableCell::borderHalfEnd):
     66        (WebCore::RenderTableCell::borderHalfBefore):
     67        (WebCore::RenderTableCell::borderHalfAfter):
     68        (WebCore::RenderTableCell::paintCollapsedBorders):
     69        * rendering/RenderTableCell.h:
     70        (RenderTableCell):
     71
    1722012-03-01  Eric Seidel  <eric@webkit.org>
    273
  • trunk/Source/WebCore/rendering/LayoutTypes.h

    r109378 r109642  
    5757{
    5858    return rect;
     59}
     60
     61inline IntRect pixelSnappedIntRect(LayoutUnit left, LayoutUnit top, LayoutUnit width, LayoutUnit height)
     62{
     63    return IntRect(left, top, width, height);
    5964}
    6065
  • trunk/Source/WebCore/rendering/RenderBoxModelObject.h

    r109383 r109642  
    8888    virtual LayoutUnit paddingEnd(bool includeIntrinsicPadding = true) const;
    8989
    90     virtual LayoutUnit borderTop() const { return style()->borderTopWidth(); }
    91     virtual LayoutUnit borderBottom() const { return style()->borderBottomWidth(); }
    92     virtual LayoutUnit borderLeft() const { return style()->borderLeftWidth(); }
    93     virtual LayoutUnit borderRight() const { return style()->borderRightWidth(); }
    94     virtual LayoutUnit borderBefore() const { return style()->borderBeforeWidth(); }
    95     virtual LayoutUnit borderAfter() const { return style()->borderAfterWidth(); }
    96     virtual LayoutUnit borderStart() const { return style()->borderStartWidth(); }
    97     virtual LayoutUnit borderEnd() const { return style()->borderEndWidth(); }
     90    virtual int borderTop() const { return style()->borderTopWidth(); }
     91    virtual int borderBottom() const { return style()->borderBottomWidth(); }
     92    virtual int borderLeft() const { return style()->borderLeftWidth(); }
     93    virtual int borderRight() const { return style()->borderRightWidth(); }
     94    virtual int borderBefore() const { return style()->borderBeforeWidth(); }
     95    virtual int borderAfter() const { return style()->borderAfterWidth(); }
     96    virtual int borderStart() const { return style()->borderStartWidth(); }
     97    virtual int borderEnd() const { return style()->borderEndWidth(); }
    9898
    9999    LayoutUnit borderAndPaddingHeight() const { return borderTop() + borderBottom() + paddingTop() + paddingBottom(); }
  • trunk/Source/WebCore/rendering/RenderTable.cpp

    r108364 r109642  
    271271{
    272272    // HTML tables' width styles already include borders and paddings, but CSS tables' width styles do not.
    273     LayoutUnit borders = 0;
     273    int borders = 0;
    274274    bool isCSSTable = !node() || !node()->hasTagName(tableTag);
    275275    if (isCSSTable && styleLogicalWidth.isFixed() && styleLogicalWidth.isPositive()) {
    276276        recalcBordersInRowDirection();
    277         borders = borderStart() + borderEnd() + (collapseBorders() ? zeroLayoutUnit : paddingStart() + paddingEnd());
     277        borders = borderStart() + borderEnd() + (collapseBorders() ? 0 : paddingStart() + paddingEnd());
    278278    }
    279279    return styleLogicalWidth.calcMinValue(availableWidth) + borders;
     
    841841}
    842842
    843 LayoutUnit RenderTable::calcBorderStart() const
     843int RenderTable::calcBorderStart() const
    844844{
    845845    if (collapseBorders()) {
     
    848848            return 0;
    849849
    850         LayoutUnit borderWidth = 0;
     850        unsigned borderWidth = 0;
    851851
    852852        const BorderValue& tb = style()->borderStart();
     
    861861                return 0;
    862862            if (gb.style() > BHIDDEN)
    863                 borderWidth = max<LayoutUnit>(borderWidth, gb.width());
     863                borderWidth = max(borderWidth, gb.width());
    864864        }
    865865       
     
    870870
    871871            if (sb.style() > BHIDDEN)
    872                 borderWidth = max<LayoutUnit>(borderWidth, sb.width());
     872                borderWidth = max(borderWidth, sb.width());
    873873
    874874            const RenderTableSection::CellStruct& cs = topNonEmptySection->cellAt(0, 0);
     
    884884
    885885                if (cb.style() > BHIDDEN)
    886                     borderWidth = max<LayoutUnit>(borderWidth, cb.width());
     886                    borderWidth = max(borderWidth, cb.width());
    887887                if (rb.style() > BHIDDEN)
    888                     borderWidth = max<LayoutUnit>(borderWidth, rb.width());
     888                    borderWidth = max(borderWidth, rb.width());
    889889            }
    890890        }
     
    894894}
    895895
    896 LayoutUnit RenderTable::calcBorderEnd() const
     896int RenderTable::calcBorderEnd() const
    897897{
    898898    if (collapseBorders()) {
     
    901901            return 0;
    902902
    903         LayoutUnit borderWidth = 0;
     903        unsigned borderWidth = 0;
    904904
    905905        const BorderValue& tb = style()->borderEnd();
     
    915915                return 0;
    916916            if (gb.style() > BHIDDEN)
    917                 borderWidth = max<LayoutUnit>(borderWidth, gb.width());
     917                borderWidth = max(borderWidth, gb.width());
    918918        }
    919919
     
    924924
    925925            if (sb.style() > BHIDDEN)
    926                 borderWidth = max<LayoutUnit>(borderWidth, sb.width());
     926                borderWidth = max(borderWidth, sb.width());
    927927
    928928            const RenderTableSection::CellStruct& cs = topNonEmptySection->cellAt(0, endColumn);
     
    938938
    939939                if (cb.style() > BHIDDEN)
    940                     borderWidth = max<LayoutUnit>(borderWidth, cb.width());
     940                    borderWidth = max(borderWidth, cb.width());
    941941                if (rb.style() > BHIDDEN)
    942                     borderWidth = max<LayoutUnit>(borderWidth, rb.width());
     942                    borderWidth = max(borderWidth, rb.width());
    943943            }
    944944        }
     
    954954}
    955955
    956 LayoutUnit RenderTable::borderBefore() const
     956int RenderTable::borderBefore() const
    957957{
    958958    if (collapseBorders()) {
     
    963963}
    964964
    965 LayoutUnit RenderTable::borderAfter() const
     965int RenderTable::borderAfter() const
    966966{
    967967    if (collapseBorders()) {
     
    972972}
    973973
    974 LayoutUnit RenderTable::outerBorderBefore() const
     974int RenderTable::outerBorderBefore() const
    975975{
    976976    if (!collapseBorders())
    977977        return 0;
    978     LayoutUnit borderWidth = 0;
     978    int borderWidth = 0;
    979979    if (RenderTableSection* topSection = this->topSection()) {
    980980        borderWidth = topSection->outerBorderBefore();
     
    986986        return 0;
    987987    if (tb.style() > BHIDDEN)
    988         borderWidth = max<LayoutUnit>(borderWidth, tb.width() / 2);
     988        borderWidth = max<int>(borderWidth, tb.width() / 2);
    989989    return borderWidth;
    990990}
    991991
    992 LayoutUnit RenderTable::outerBorderAfter() const
     992int RenderTable::outerBorderAfter() const
    993993{
    994994    if (!collapseBorders())
    995995        return 0;
    996     LayoutUnit borderWidth = 0;
     996    int borderWidth = 0;
    997997    RenderTableSection* bottomSection;
    998998    if (m_foot)
     
    10121012        return 0;
    10131013    if (tb.style() > BHIDDEN)
    1014         borderWidth = max<LayoutUnit>(borderWidth, (tb.width() + 1) / 2);
     1014        borderWidth = max<int>(borderWidth, (tb.width() + 1) / 2);
    10151015    return borderWidth;
    10161016}
    10171017
    1018 LayoutUnit RenderTable::outerBorderStart() const
     1018int RenderTable::outerBorderStart() const
    10191019{
    10201020    if (!collapseBorders())
    10211021        return 0;
    10221022
    1023     LayoutUnit borderWidth = 0;
     1023    int borderWidth = 0;
    10241024
    10251025    const BorderValue& tb = style()->borderStart();
     
    10331033        if (!child->isTableSection())
    10341034            continue;
    1035         LayoutUnit sw = toRenderTableSection(child)->outerBorderStart();
     1035        int sw = toRenderTableSection(child)->outerBorderStart();
    10361036        if (sw < 0)
    10371037            continue;
     
    10451045}
    10461046
    1047 LayoutUnit RenderTable::outerBorderEnd() const
     1047int RenderTable::outerBorderEnd() const
    10481048{
    10491049    if (!collapseBorders())
    10501050        return 0;
    10511051
    1052     LayoutUnit borderWidth = 0;
     1052    int borderWidth = 0;
    10531053
    10541054    const BorderValue& tb = style()->borderEnd();
     
    10621062        if (!child->isTableSection())
    10631063            continue;
    1064         LayoutUnit sw = toRenderTableSection(child)->outerBorderEnd();
     1064        int sw = toRenderTableSection(child)->outerBorderEnd();
    10651065        if (sw < 0)
    10661066            continue;
  • trunk/Source/WebCore/rendering/RenderTable.h

    r107880 r109642  
    5353    bool collapseBorders() const { return style()->borderCollapse(); }
    5454
    55     LayoutUnit borderStart() const { return m_borderStart; }
    56     LayoutUnit borderEnd() const { return m_borderEnd; }
    57     LayoutUnit borderBefore() const;
    58     LayoutUnit borderAfter() const;
    59 
    60     LayoutUnit borderLeft() const
     55    int borderStart() const { return m_borderStart; }
     56    int borderEnd() const { return m_borderEnd; }
     57    int borderBefore() const;
     58    int borderAfter() const;
     59
     60    int borderLeft() const
    6161    {
    6262        if (style()->isHorizontalWritingMode())
     
    6565    }
    6666
    67     LayoutUnit borderRight() const
     67    int borderRight() const
    6868    {
    6969        if (style()->isHorizontalWritingMode())
     
    7272    }
    7373
    74     LayoutUnit borderTop() const
     74    int borderTop() const
    7575    {
    7676        if (style()->isHorizontalWritingMode())
     
    7979    }
    8080
    81     LayoutUnit borderBottom() const
     81    int borderBottom() const
    8282    {
    8383        if (style()->isHorizontalWritingMode())
     
    8888    Color bgColor() const { return style()->visitedDependentColor(CSSPropertyBackgroundColor); }
    8989
    90     LayoutUnit outerBorderBefore() const;
    91     LayoutUnit outerBorderAfter() const;
    92     LayoutUnit outerBorderStart() const;
    93     LayoutUnit outerBorderEnd() const;
    94 
    95     LayoutUnit outerBorderLeft() const
     90    int outerBorderBefore() const;
     91    int outerBorderAfter() const;
     92    int outerBorderStart() const;
     93    int outerBorderEnd() const;
     94
     95    int outerBorderLeft() const
    9696    {
    9797        if (style()->isHorizontalWritingMode())
     
    100100    }
    101101
    102     LayoutUnit outerBorderRight() const
     102    int outerBorderRight() const
    103103    {
    104104        if (style()->isHorizontalWritingMode())
     
    107107    }
    108108
    109     LayoutUnit outerBorderTop() const
     109    int outerBorderTop() const
    110110    {
    111111        if (style()->isHorizontalWritingMode())
     
    114114    }
    115115
    116     LayoutUnit outerBorderBottom() const
     116    int outerBorderBottom() const
    117117    {
    118118        if (style()->isHorizontalWritingMode())
     
    121121    }
    122122
    123     LayoutUnit calcBorderStart() const;
    124     LayoutUnit calcBorderEnd() const;
     123    int calcBorderStart() const;
     124    int calcBorderEnd() const;
    125125    void recalcBordersInRowDirection();
    126126
     
    272272    short m_hSpacing;
    273273    short m_vSpacing;
    274     LayoutUnit m_borderStart;
    275     LayoutUnit m_borderEnd;
     274    int m_borderStart;
     275    int m_borderEnd;
    276276};
    277277
  • trunk/Source/WebCore/rendering/RenderTableCell.cpp

    r109246 r109642  
    268268
    269269    bool rtl = !table()->style()->isLeftToRightDirection();
    270     LayoutUnit outlineSize = style()->outlineSize();
    271     LayoutUnit left = max(borderHalfLeft(true), outlineSize);
    272     LayoutUnit right = max(borderHalfRight(true), outlineSize);
    273     LayoutUnit top = max(borderHalfTop(true), outlineSize);
    274     LayoutUnit bottom = max(borderHalfBottom(true), outlineSize);
     270    int outlineSize = style()->outlineSize();
     271    int left = max(borderHalfLeft(true), outlineSize);
     272    int right = max(borderHalfRight(true), outlineSize);
     273    int top = max(borderHalfTop(true), outlineSize);
     274    int bottom = max(borderHalfBottom(true), outlineSize);
    275275    if ((left && !rtl) || (right && rtl)) {
    276276        if (RenderTableCell* before = table()->cellBefore(this)) {
     
    748748}
    749749
    750 LayoutUnit RenderTableCell::borderLeft() const
     750int RenderTableCell::borderLeft() const
    751751{
    752752    return table()->collapseBorders() ? borderHalfLeft(false) : RenderBlock::borderLeft();
    753753}
    754754
    755 LayoutUnit RenderTableCell::borderRight() const
     755int RenderTableCell::borderRight() const
    756756{
    757757    return table()->collapseBorders() ? borderHalfRight(false) : RenderBlock::borderRight();
    758758}
    759759
    760 LayoutUnit RenderTableCell::borderTop() const
     760int RenderTableCell::borderTop() const
    761761{
    762762    return table()->collapseBorders() ? borderHalfTop(false) : RenderBlock::borderTop();
    763763}
    764764
    765 LayoutUnit RenderTableCell::borderBottom() const
     765int RenderTableCell::borderBottom() const
    766766{
    767767    return table()->collapseBorders() ? borderHalfBottom(false) : RenderBlock::borderBottom();
     
    770770// FIXME: https://bugs.webkit.org/show_bug.cgi?id=46191, make the collapsed border drawing
    771771// work with different block flow values instead of being hard-coded to top-to-bottom.
    772 LayoutUnit RenderTableCell::borderStart() const
     772int RenderTableCell::borderStart() const
    773773{
    774774    return table()->collapseBorders() ? borderHalfStart(false) : RenderBlock::borderStart();
    775775}
    776776
    777 LayoutUnit RenderTableCell::borderEnd() const
     777int RenderTableCell::borderEnd() const
    778778{
    779779    return table()->collapseBorders() ? borderHalfEnd(false) : RenderBlock::borderEnd();
    780780}
    781781
    782 LayoutUnit RenderTableCell::borderBefore() const
     782int RenderTableCell::borderBefore() const
    783783{
    784784    return table()->collapseBorders() ? borderHalfBefore(false) : RenderBlock::borderBefore();
    785785}
    786786
    787 LayoutUnit RenderTableCell::borderAfter() const
     787int RenderTableCell::borderAfter() const
    788788{
    789789    return table()->collapseBorders() ? borderHalfAfter(false) : RenderBlock::borderAfter();
    790790}
    791791
    792 LayoutUnit RenderTableCell::borderHalfLeft(bool outer) const
     792int RenderTableCell::borderHalfLeft(bool outer) const
    793793{
    794794    RenderStyle* tableStyle = table()->style();
     
    798798}
    799799
    800 LayoutUnit RenderTableCell::borderHalfRight(bool outer) const
     800int RenderTableCell::borderHalfRight(bool outer) const
    801801{
    802802    RenderStyle* tableStyle = table()->style();
     
    806806}
    807807
    808 LayoutUnit RenderTableCell::borderHalfTop(bool outer) const
     808int RenderTableCell::borderHalfTop(bool outer) const
    809809{
    810810    RenderStyle* tableStyle = table()->style();
     
    814814}
    815815
    816 LayoutUnit RenderTableCell::borderHalfBottom(bool outer) const
     816int RenderTableCell::borderHalfBottom(bool outer) const
    817817{
    818818    RenderStyle* tableStyle = table()->style();
     
    822822}
    823823
    824 LayoutUnit RenderTableCell::borderHalfStart(bool outer) const
     824int RenderTableCell::borderHalfStart(bool outer) const
    825825{
    826826    CollapsedBorderValue border = collapsedStartBorder(DoNotIncludeBorderColor);
     
    830830}
    831831   
    832 LayoutUnit RenderTableCell::borderHalfEnd(bool outer) const
     832int RenderTableCell::borderHalfEnd(bool outer) const
    833833{
    834834    CollapsedBorderValue border = collapsedEndBorder(DoNotIncludeBorderColor);
     
    838838}
    839839
    840 LayoutUnit RenderTableCell::borderHalfBefore(bool outer) const
     840int RenderTableCell::borderHalfBefore(bool outer) const
    841841{
    842842    CollapsedBorderValue border = collapsedBeforeBorder(DoNotIncludeBorderColor);
     
    846846}
    847847
    848 LayoutUnit RenderTableCell::borderHalfAfter(bool outer) const
     848int RenderTableCell::borderHalfAfter(bool outer) const
    849849{
    850850    CollapsedBorderValue border = collapsedAfterBorder(DoNotIncludeBorderColor);
     
    982982     
    983983    // Adjust our x/y/width/height so that we paint the collapsed borders at the correct location.
    984     LayoutUnit topWidth = topVal.width();
    985     LayoutUnit bottomWidth = bottomVal.width();
    986     LayoutUnit leftWidth = leftVal.width();
    987     LayoutUnit rightWidth = rightVal.width();
    988    
    989     LayoutUnit x = paintRect.x() - leftWidth / 2;
    990     LayoutUnit y = paintRect.y() - topWidth / 2;
    991     LayoutUnit w = paintRect.width() + leftWidth / 2 + (rightWidth + 1) / 2;
    992     LayoutUnit h = paintRect.height() + topWidth / 2 + (bottomWidth + 1) / 2;
    993    
     984    int topWidth = topVal.width();
     985    int bottomWidth = bottomVal.width();
     986    int leftWidth = leftVal.width();
     987    int rightWidth = rightVal.width();
     988
     989    IntRect borderRect = pixelSnappedIntRect(paintRect.x() - leftWidth / 2,
     990            paintRect.y() - topWidth / 2,
     991            paintRect.width() + leftWidth / 2 + (rightWidth + 1) / 2,
     992            paintRect.height() + topWidth / 2 + (bottomWidth + 1) / 2);
     993
    994994    EBorderStyle topStyle = collapsedBorderStyle(topVal.style());
    995995    EBorderStyle bottomStyle = collapsedBorderStyle(bottomVal.style());
     
    10051005    // precedence paint on top of borders with lower precedence. 
    10061006    CollapsedBorders borders;
    1007     borders.addBorder(topVal, BSTop, renderTop, x, y, x + w, y + topWidth, topStyle);
    1008     borders.addBorder(bottomVal, BSBottom, renderBottom, x, y + h - bottomWidth, x + w, y + h, bottomStyle);
    1009     borders.addBorder(leftVal, BSLeft, renderLeft, x, y, x + leftWidth, y + h, leftStyle);
    1010     borders.addBorder(rightVal, BSRight, renderRight, x + w - rightWidth, y, x + w, y + h, rightStyle);
     1007    borders.addBorder(topVal, BSTop, renderTop, borderRect.x(), borderRect.y(), borderRect.maxX(), borderRect.y() + topWidth, topStyle);
     1008    borders.addBorder(bottomVal, BSBottom, renderBottom, borderRect.x(), borderRect.maxY() - bottomWidth, borderRect.maxX(), borderRect.maxY(), bottomStyle);
     1009    borders.addBorder(leftVal, BSLeft, renderLeft, borderRect.x(), borderRect.y(), borderRect.x() + leftWidth, borderRect.maxY(), leftStyle);
     1010    borders.addBorder(rightVal, BSRight, renderRight, borderRect.maxX() - rightWidth, borderRect.y(), borderRect.maxX(), borderRect.maxY(), rightStyle);
    10111011
    10121012    bool antialias = shouldAntialiasLines(graphicsContext);
  • trunk/Source/WebCore/rendering/RenderTableCell.h

    r108914 r109642  
    9292    void updateLogicalWidth(LayoutUnit);
    9393
    94     virtual LayoutUnit borderLeft() const;
    95     virtual LayoutUnit borderRight() const;
    96     virtual LayoutUnit borderTop() const;
    97     virtual LayoutUnit borderBottom() const;
    98     virtual LayoutUnit borderStart() const;
    99     virtual LayoutUnit borderEnd() const;
    100     virtual LayoutUnit borderBefore() const;
    101     virtual LayoutUnit borderAfter() const;
     94    virtual int borderLeft() const;
     95    virtual int borderRight() const;
     96    virtual int borderTop() const;
     97    virtual int borderBottom() const;
     98    virtual int borderStart() const;
     99    virtual int borderEnd() const;
     100    virtual int borderBefore() const;
     101    virtual int borderAfter() const;
    102102
    103103    void collectBorderValues(RenderTable::CollapsedBorderValues&) const;
     
    160160    virtual void computeRectForRepaint(RenderBoxModelObject* repaintContainer, LayoutRect&, bool fixed = false) const;
    161161
    162     LayoutUnit borderHalfLeft(bool outer) const;
    163     LayoutUnit borderHalfRight(bool outer) const;
    164     LayoutUnit borderHalfTop(bool outer) const;
    165     LayoutUnit borderHalfBottom(bool outer) const;
    166 
    167     LayoutUnit borderHalfStart(bool outer) const;
    168     LayoutUnit borderHalfEnd(bool outer) const;
    169     LayoutUnit borderHalfBefore(bool outer) const;
    170     LayoutUnit borderHalfAfter(bool outer) const;
     162    int borderHalfLeft(bool outer) const;
     163    int borderHalfRight(bool outer) const;
     164    int borderHalfTop(bool outer) const;
     165    int borderHalfBottom(bool outer) const;
     166
     167    int borderHalfStart(bool outer) const;
     168    int borderHalfEnd(bool outer) const;
     169    int borderHalfBefore(bool outer) const;
     170    int borderHalfAfter(bool outer) const;
    171171
    172172    CollapsedBorderValue collapsedStartBorder(IncludeBorderColorOrNot = IncludeBorderColor) const;
Note: See TracChangeset for help on using the changeset viewer.