Ignore:
Timestamp:
Jul 24, 2013, 11:02:13 AM (12 years ago)
Author:
[email protected]
Message:

Border drawing incorrect when using both border-collapse: collapse and overflow: hidden on a table
https://bugs.webkit.org/show_bug.cgi?id=18305

Reviewed by David Hyatt.

Source/WebCore:

overflowClipRect() clips out the table's half of a collapsed border when there is an overflow clip
on the table. This prevents the table's half of the border ever getting painted.

To fix this, clip to the border box of tables when we're in the paint phase that gets the sections to draw the collapsed borders
or when we're self painting. This will allow the table's half of the border to get painted. In the case where the table is self
painting we ensure that content gets clipped to cell's side of the collapsed border by ensuring the clip passed to child layers
from the table clips to the inside of the collapsed border.

It's worth noting that a table's collapsed borders are painted by the table's layer using functions in
RenderTableSection and RenderTableCell. So if a table section has a self-painting layer this patch still works, because
the borders aren't painted by the section's layer.

Tests: fast/table/overflow-table-collapsed-borders-cell-painting-table-self-painting-layer.html

fast/table/overflow-table-collapsed-borders-cell-painting.html
fast/table/overflow-table-collapsed-borders-section-layer-painting.html
fast/table/overflow-table-collapsed-borders-section-layer-table-self-painting-layer.html
fast/table/overflow-table-collapsed-borders-section-self-painting-layer-painting.html
fast/table/overflow-table-collapsed-borders-section-self-painting-layer-table-self-painting-layer.html
fast/table/table-overflow.html

  • rendering/RenderBox.cpp:

(WebCore::RenderBox::pushContentsClip):
(WebCore::RenderBox::overflowClipRect):

  • rendering/RenderBox.h:

(WebCore::RenderBox::overflowClipRectForChildLayers):

  • rendering/RenderLayer.cpp:

(WebCore::RenderLayer::calculateClipRects):

  • rendering/RenderTable.cpp:

(WebCore::RenderTable::overflowClipRect):

  • rendering/RenderTable.h:

(WebCore::RenderTable::overflowClipRectForChildLayers):

LayoutTests:

  • fast/table/overflow-table-collapsed-borders-cell-painting-expected.png: Added.
  • fast/table/overflow-table-collapsed-borders-cell-painting-expected.txt: Added.
  • fast/table/overflow-table-collapsed-borders-cell-painting-table-self-painting-layer-expected.png: Added.
  • fast/table/overflow-table-collapsed-borders-cell-painting-table-self-painting-layer-expected.txt: Added.
  • fast/table/overflow-table-collapsed-borders-cell-painting-table-self-painting-layer.html: Added.
  • fast/table/overflow-table-collapsed-borders-cell-painting.html: Added.
  • fast/table/overflow-table-collapsed-borders-section-layer-painting-expected.png: Added.
  • fast/table/overflow-table-collapsed-borders-section-layer-painting-expected.txt: Added.
  • fast/table/overflow-table-collapsed-borders-section-layer-painting.html: Added.
  • fast/table/overflow-table-collapsed-borders-section-layer-table-self-painting-layer-expected.png: Added.
  • fast/table/overflow-table-collapsed-borders-section-layer-table-self-painting-layer-expected.txt: Added.
  • fast/table/overflow-table-collapsed-borders-section-layer-table-self-painting-layer.html: Added.
  • fast/table/overflow-table-collapsed-borders-section-self-painting-layer-painting-expected.png: Added.
  • fast/table/overflow-table-collapsed-borders-section-self-painting-layer-painting-expected.txt: Added.
  • fast/table/overflow-table-collapsed-borders-section-self-painting-layer-painting.html: Added.
  • fast/table/overflow-table-collapsed-borders-section-self-painting-layer-table-self-painting-layer-expected.png: Added.
  • fast/table/overflow-table-collapsed-borders-section-self-painting-layer-table-self-painting-layer-expected.txt: Added.
  • fast/table/overflow-table-collapsed-borders-section-self-painting-layer-table-self-painting-layer.html: Added.
  • fast/table/table-overflow-expected.html: Added.
  • fast/table/table-overflow.html: Added.
  • platform/qt/fast/table/overflowHidden-expected.txt:
File:
1 edited

Legend:

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

    r150312 r153089  
    300300    LayoutUnit convertStyleLogicalHeightToComputedHeight(const Length& styleLogicalHeight);
    301301
    302     virtual LayoutRect overflowClipRect(const LayoutPoint& location, RenderRegion*, OverlayScrollbarSizeRelevancy = IgnoreOverlayScrollbarSize);
     302    virtual LayoutRect overflowClipRect(const LayoutPoint& location, RenderRegion*, OverlayScrollbarSizeRelevancy = IgnoreOverlayScrollbarSize, PaintPhase = PaintPhaseBlockBackground);
     303    virtual LayoutRect overflowClipRectForChildLayers(const LayoutPoint& location, RenderRegion* region, OverlayScrollbarSizeRelevancy relevancy) { return RenderBox::overflowClipRect(location, region, relevancy); }
    303304
    304305    virtual void addOverflowFromChildren();
Note: See TracChangeset for help on using the changeset viewer.