Changeset 119492 in webkit


Ignore:
Timestamp:
Jun 5, 2012 8:37:20 AM (12 years ago)
Author:
commit-queue@webkit.org
Message:

CSS 2.1 failure: border-conflict-element-021a
https://bugs.webkit.org/show_bug.cgi?id=86885

Patch by Arpita Bahuguna <arpitabahuguna@gmail.com> on 2012-06-05
Reviewed by Julien Chaffraix.

Source/WebCore:

When two adjacent table row groups (thead, tbody, tfoot) have the same border-width
and the same border-style in a 'border-collapse: collapse' table the color of the border
from the top-most table row wins.

Tests: fast/table/border-collapsing/adjacent-row-groups-multi.html

fast/table/border-collapsing/adjacent-row-groups.html

  • rendering/RenderTable.cpp:

(WebCore::RenderTable::paintObject):
Currently each row group is sent for paint from top (firstChild) to bottom thereby causing
the borders of the bottom-most row group (which is painted last) to overlap over the
previous row-group. This breaks the precedence for collapsed borders between adjacent cells.

This fix thus reverses the order in which the row-groups/sections are passed for painting.
Additional change has been done to iterate over the RenderTableSections directly.

(WebCore):
(WebCore::RenderTable::bottomSection):

  • rendering/RenderTable.h:

New function has been added to obtain the last section of the table.

(RenderTable):

  • rendering/RenderTableSection.h:

(RenderTableSection):
RenderTableSection's paint() method has now been made public so as to make it accessible
from RenderTable.

LayoutTests:

  • css2.1/20110323/border-conflict-element-021a-expected.html: Added.
  • css2.1/20110323/border-conflict-element-021a.htm: Added.

Added ref test under the css2.1 test-suite for border-conflict-element-021a.

  • fast/table/border-collapsing/adjacent-row-groups-expected.html: Added.
  • fast/table/border-collapsing/adjacent-row-groups.html: Added.

Added ref test for verifying 'border-collapse: collapse' table rendering when two
adjacent table row-groups have the same border-width and the same border-style. In
such a case the color of the border from the top-most table row-group wins.

  • fast/table/border-collapsing/adjacent-row-groups-multi.html: Added.
  • fast/table/border-collapsing/adjacent-row-groups-multi-expected.html: Added.

Additional ref test added for verifying 'border-collapse: collapse' table rendering
for adjacent table row-groups when more than one table headers and/or footers are specified.

Location:
trunk
Files:
6 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r119491 r119492  
     12012-06-05  Arpita Bahuguna  <arpitabahuguna@gmail.com>
     2
     3        CSS 2.1 failure: border-conflict-element-021a
     4        https://bugs.webkit.org/show_bug.cgi?id=86885
     5
     6        Reviewed by Julien Chaffraix.
     7
     8        * css2.1/20110323/border-conflict-element-021a-expected.html: Added.
     9        * css2.1/20110323/border-conflict-element-021a.htm: Added.
     10        Added ref test under the css2.1 test-suite for border-conflict-element-021a.
     11
     12        * fast/table/border-collapsing/adjacent-row-groups-expected.html: Added.
     13        * fast/table/border-collapsing/adjacent-row-groups.html: Added.
     14        Added ref test for verifying 'border-collapse: collapse' table rendering when two
     15        adjacent table row-groups have the same border-width and the same border-style. In
     16        such a case the color of the border from the top-most table row-group wins.
     17
     18        * fast/table/border-collapsing/adjacent-row-groups-multi.html: Added.
     19        * fast/table/border-collapsing/adjacent-row-groups-multi-expected.html: Added.
     20        Additional ref test added for verifying 'border-collapse: collapse' table rendering
     21        for adjacent table row-groups when more than one table headers and/or footers are specified.
     22
    1232012-06-05  Ilya Tikhonovsky  <loislo@chromium.org>
    224
  • trunk/Source/WebCore/ChangeLog

    r119490 r119492  
     12012-06-05  Arpita Bahuguna  <arpitabahuguna@gmail.com>
     2
     3        CSS 2.1 failure: border-conflict-element-021a
     4        https://bugs.webkit.org/show_bug.cgi?id=86885
     5
     6        Reviewed by Julien Chaffraix.
     7
     8        When two adjacent table row groups (thead, tbody, tfoot) have the same border-width
     9        and the same border-style in a 'border-collapse: collapse' table the color of the border
     10        from the top-most table row wins.
     11
     12        Tests: fast/table/border-collapsing/adjacent-row-groups-multi.html
     13               fast/table/border-collapsing/adjacent-row-groups.html
     14
     15        * rendering/RenderTable.cpp:
     16        (WebCore::RenderTable::paintObject):
     17        Currently each row group is sent for paint from top (firstChild) to bottom thereby causing
     18        the borders of the bottom-most row group (which is painted last) to overlap over the
     19        previous row-group. This breaks the precedence for collapsed borders between adjacent cells.
     20
     21        This fix thus reverses the order in which the row-groups/sections are passed for painting.
     22        Additional change has been done to iterate over the RenderTableSections directly.
     23
     24        (WebCore):
     25        (WebCore::RenderTable::bottomSection):
     26        * rendering/RenderTable.h:
     27        New function has been added to obtain the last section of the table.
     28
     29        (RenderTable):
     30        * rendering/RenderTableSection.h:
     31        (RenderTableSection):
     32        RenderTableSection's paint() method has now been made public so as to make it accessible
     33        from RenderTable.
     34
    1352012-06-05  Csaba Osztrogonác  <ossy@webkit.org>
    236
  • trunk/Source/WebCore/rendering/RenderTable.cpp

    r119272 r119492  
    593593        for (size_t i = 0; i < count; ++i) {
    594594            m_currentBorder = &m_collapsedBorders[i];
    595             for (RenderObject* child = firstChild(); child; child = child->nextSibling())
    596                 if (child->isTableSection()) {
    597                     LayoutPoint childPoint = flipForWritingModeForChild(toRenderTableSection(child), paintOffset);
    598                     child->paint(info, childPoint);
    599                 }
     595            for (RenderTableSection* section = bottomSection(); section; section = sectionAbove(section)) {
     596                LayoutPoint childPoint = flipForWritingModeForChild(section, paintOffset);
     597                section->paint(info, childPoint);
     598            }
    600599        }
    601600        m_currentBorder = 0;
     
    11131112}
    11141113
     1114RenderTableSection* RenderTable::bottomSection() const
     1115{
     1116    recalcSectionsIfNeeded();
     1117
     1118    if (m_foot)
     1119        return m_foot;
     1120
     1121    for (RenderObject* child = lastChild(); child; child = child->previousSibling()) {
     1122        if (child->isTableSection())
     1123            return toRenderTableSection(child);
     1124    }
     1125
     1126    return 0;
     1127}
     1128
    11151129RenderTableCell* RenderTable::cellAbove(const RenderTableCell* cell) const
    11161130{
  • trunk/Source/WebCore/rendering/RenderTable.h

    r117988 r119492  
    144144    // This function returns 0 if the table has no section.
    145145    RenderTableSection* topSection() const;
     146    RenderTableSection* bottomSection() const;
    146147
    147148    // This function returns 0 if the table has no non-empty sections.
  • trunk/Source/WebCore/rendering/RenderTableSection.h

    r119272 r119492  
    179179        return createAnonymousWithParentRenderer(parent);
    180180    }
     181   
     182    virtual void paint(PaintInfo&, const LayoutPoint&) OVERRIDE;
    181183
    182184protected:
     
    197199    virtual void removeChild(RenderObject* oldChild);
    198200
    199     virtual void paint(PaintInfo&, const LayoutPoint&);
    200201    virtual void paintCell(RenderTableCell*, PaintInfo&, const LayoutPoint&);
    201202    virtual void paintObject(PaintInfo&, const LayoutPoint&);
Note: See TracChangeset for help on using the changeset viewer.