Show
Ignore:
Timestamp:
05/14/06 21:42:09 (3 years ago)
Author:
darin
Message:

LayoutTests:

Reviewed by Hyatt.


  • fast/repaint/table-collapsed-border-expected.checksum: Added.
  • fast/repaint/table-collapsed-border-expected.png: Added.
  • fast/repaint/table-collapsed-border-expected.txt: Added.
  • fast/repaint/table-collapsed-border.html: Added.

WebCore:

Reviewed by Hyatt.


This patch updates the implementation of collapsing borders to match
the current spec.

Test: fast/repaint/table-collapsed-border.html

  • rendering/RenderTable.cpp: (WebCore::RenderTable::RenderTable): (WebCore::RenderTable::layout): Calculate horizontal overflows. (WebCore::RenderTable::calcMinMaxWidth): Added call to recalcHorizontalBorders. (WebCore::RenderTable::colElement): Made const. (WebCore::RenderTable::calcBorderLeft): Calculates the left border. In the collapsing borders model, this is the left border of the leftmost cell of the first row. (WebCore::RenderTable::calcBorderRight): Ditto for the right border. (WebCore::RenderTable::recalcHorizontalBorders): Added. (WebCore::RenderTable::borderTop): Changed to return outerBorderTop in the collapsing case. (WebCore::RenderTable::borderBottom): Changed to return outerBorderBottom in the collapsing case. (WebCore::RenderTable::outerBorderTop): Added. Returns the table half of the top border, which is half the widest top border on the first row. (WebCore::RenderTable::outerBorderBottom): Added. Returns the table half of the bottom border, which is half the widest bottom border on the last row. (WebCore::RenderTable::outerBorderLeft): Added. Returns the table half of the left border, which is half the widest left border on the leftmost column. (WebCore::RenderTable::outerBorderRight): Added. Returns the table half of the right border, which is half the widest right border on the rightmost column. (WebCore::RenderTable::cellAbove): Return 0 if the cell is in the first row of the header. (WebCore::RenderTable::cellBelow): Return 0 if the cell is in the last row of the footer.
  • rendering/RenderTable.h: (WebCore::RenderTable::borderLeft): (WebCore::RenderTable::borderRight): (WebCore::RenderTable::overflowHeight):
  • rendering/RenderTableCell.cpp: (WebCore::RenderTableCell::borderLeft): Removed unnecessary use of floats. (WebCore::RenderTableCell::borderTop): Ditto. (WebCore::RenderTableCell::paint): Account for the table half of the vertical borders. (WebCore::RenderTableCell::paintCollapsedBorder): Removed unnecessary use of floats.
  • rendering/RenderTableSection.cpp: (WebCore::RenderTableSection::RenderTableSection): (WebCore::RenderTableSection::layoutRows): Added call to recalcOuterBorder. (WebCore::RenderTableSection::calcOuterBorderTop): Added. Calculates the outer half of the section's top border, which is half the widest top border on the first row. (WebCore::RenderTableSection::calcOuterBorderBottom): Ditto for the bottom border. (WebCore::RenderTableSection::calcOuterBorderLeft): Ditto for the left border. (WebCore::RenderTableSection::calcOuterBorderRight): Ditto for the right border. (WebCore::RenderTableSection::recalcOuterBorder): Added. (WebCore::RenderTableSection::paint): Account for the table half of the borders.
  • rendering/RenderTableSection.h: (WebCore::RenderTableSection::outerBorderTop): (WebCore::RenderTableSection::outerBorderBottom): (WebCore::RenderTableSection::outerBorderLeft): (WebCore::RenderTableSection::outerBorderRight):
  • rendering/render_style.cpp: (WebCore::RenderStyle::diff): Changed to return Layout if a border style changed from 'hidden' to 'none' or vice versa in the collapsing borders model, since 'hidden' suppresses other borders.
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/rendering/RenderTable.h

    r14274 r14372  
    7575     
    7676    bool collapseBorders() const { return style()->borderCollapse(); } 
    77     int borderLeft() const; 
    78     int borderRight() const; 
     77    int borderLeft() const { return m_borderLeft; } 
     78    int borderRight() const { return m_borderRight; } 
    7979    int borderTop() const; 
    8080    int borderBottom() const; 
     
    8787    void setCellPadding(unsigned p) { padding = p; } 
    8888 
     89    int outerBorderTop() const; 
     90    int outerBorderBottom() const; 
     91    int outerBorderLeft() const; 
     92    int outerBorderRight() const; 
     93     
     94    int calcBorderLeft() const; 
     95    int calcBorderRight() const; 
     96    void recalcHorizontalBorders(); 
     97 
    8998    // overrides 
    9099    virtual int overflowHeight(bool includeInterior = true) const { return height(); } 
    91     virtual int overflowWidth(bool includeInterior = true) const { return width(); } 
    92100    virtual void addChild(RenderObject* child, RenderObject* beforeChild = 0); 
    93101    virtual void paint(PaintInfo&, int tx, int ty); 
     
    146154    } 
    147155 
    148     RenderTableCol* colElement(int col); 
     156    RenderTableCol* colElement(int col) const; 
    149157 
    150158    void setNeedSectionRecalc() { needSectionRecalc = true; } 
     
    189197    short hspacing; 
    190198    short vspacing; 
     199    int m_borderRight; 
     200    int m_borderLeft; 
    191201}; 
    192202