Skip to content
  • robert@webkit.org's avatar
    Avoid painting every non-edge collapsed border twice over · db937eab
    robert@webkit.org authored
    https://bugs.webkit.org/show_bug.cgi?id=119759
    
    Reviewed by David Hyatt.
    
    Source/WebCore:
    
    Every collapsed border that isn't on the edge of a table gets painted at least twice, once by each
    adjacent cell. The joins are painted four times. This is unnecessary and results in tables with semi-transparent
    borders getting rendered incorrectly - each border adjoing two cells is painted twice and ends up darker than it should be.
    
    Fixing the overpainting at joins is another day's work. This patch ensures each collapsed border inside a table is only
    painted once. It does this by only allowing cells at the top and left edge of the table to paint their top and left collapsed borders.
    All the others can only paint their right and bottom collapsed border. This works because the borders are painted from bottom right to top left.
    
    Tests: fast/table/border-collapsing/collapsed-borders-adjoining-sections-vertical-rl.html
           fast/table/border-collapsing/collapsed-borders-adjoining-sections.html
    
    * rendering/RenderTableCell.cpp:
    (WebCore::RenderTableCell::paintCollapsedBorders):
    
    LayoutTests:
    
    * fast/table/border-collapsing/collapsed-borders-adjoining-sections-expected.html: Added.
    * fast/table/border-collapsing/collapsed-borders-adjoining-sections-vertical-rl-expected.png: Added.
    * fast/table/border-collapsing/collapsed-borders-adjoining-sections-vertical-rl-expected.txt: Added.
        The painting here, though still wrong, is a progression on the behaviour prior to bug 11759 where
        the left border was painted twice. The painting can be resolved completely when we no longer paint
        twice at the border joins.
    * fast/table/border-collapsing/collapsed-borders-adjoining-sections-vertical-rl.html: Added.
    * fast/table/border-collapsing/collapsed-borders-adjoining-sections.html: Added.
    * fast/table/border-collapsing/collapsed-borders-painted-once-on-inner-cells-expected.png: Added.
    * fast/table/border-collapsing/collapsed-borders-painted-once-on-inner-cells-expected.txt: Added.
    * fast/table/border-collapsing/collapsed-borders-painted-once-on-inner-cells.html: Added.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154622 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    db937eab