Title: [87387] trunk
Revision
87387
Author
[email protected]
Date
2011-05-26 08:34:48 -0700 (Thu, 26 May 2011)

Log Message

2011-05-25  Simon Fraser  <[email protected]>

        Reviewed by Dan Bernstein.

        Always antialias borders, outlines and rules when scaling
        https://bugs.webkit.org/show_bug.cgi?id=61502

        r84273 changed the behavior of drawLineForBoxSide() to never antialias by default.
        This actually disabled antialiasing in some circumstances where it used to be enabled,
        for example collapsed table border drawing.

        Fix by allowing antialiasing for collapsed table borders, column rules and span
        outlines when the context is scaled.

        Test: fast/borders/border-antialiasing.html

        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::paintColumnRules):
        * rendering/RenderInline.cpp:
        (WebCore::RenderInline::paintOutline):
        (WebCore::RenderInline::paintOutlineForLine):
        * rendering/RenderTableCell.cpp:
        (WebCore::RenderTableCell::paintCollapsedBorder):

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (87386 => 87387)


--- trunk/LayoutTests/ChangeLog	2011-05-26 15:01:44 UTC (rev 87386)
+++ trunk/LayoutTests/ChangeLog	2011-05-26 15:34:48 UTC (rev 87387)
@@ -1,3 +1,17 @@
+2011-05-25  Simon Fraser  <[email protected]>
+
+        Reviewed by Dan Bernstein.
+
+        Always antialias table borders when scaling
+        https://bugs.webkit.org/show_bug.cgi?id=61502
+        
+        Pixel tests for the drawing of collapsed table borders, column rules
+        and inline outlines when scaled.
+
+        * fast/borders/border-antialiasing.html: Added.
+        * platform/mac/fast/borders/border-antialiasing-expected.png: Added.
+        * platform/mac/fast/borders/border-antialiasing-expected.txt: Added.
+
 2011-05-26  Csaba Osztrogonác  <[email protected]>
 
         [Qt][WK2] Update expected files after r87320.

Added: trunk/LayoutTests/fast/borders/border-antialiasing.html (0 => 87387)


--- trunk/LayoutTests/fast/borders/border-antialiasing.html	                        (rev 0)
+++ trunk/LayoutTests/fast/borders/border-antialiasing.html	2011-05-26 15:34:48 UTC (rev 87387)
@@ -0,0 +1,71 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+  <style>
+    div {
+      -webkit-transform-origin: top left;
+      margin: 10px;
+    }
+    table {
+      margin: 20px;
+    }
+    table.collapsed {
+      border-collapse: collapse;
+    }
+    td {
+      height: 10px;
+      width: 10px;
+      border: 1px solid black;
+    }
+    
+    .shrunk {
+      -webkit-transform: scale(0.35);
+    }
+
+    .columns {
+      -webkit-column-width: 10px;
+      width: 600px;
+      height: 100px;
+      -webkit-column-rule: 1px solid black;
+    }
+    
+    .outlines span {
+      outline: 1px solid black;
+      margin: 4px;
+      padding: 2px;
+    }
+  </style>
+</head>
+<body>
+
+<!-- Both tables should render with antialiased borders. -->
+<div class="shrunk">
+  <table class="collapsed">
+    <tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
+    <tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
+    <tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
+    <tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
+  </table>
+  <table>
+    <tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
+    <tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
+    <tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
+    <tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
+  </table>
+
+  <!-- Column rules should be antialiased -->
+  <div class="columns">
+   _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
+  </div>
+  
+  <div class="outlines">
+    <span>I am a span<br>I am</span> <span>I am<br>a span I am</span>
+    <span>I am a span<br>I am</span> <span>I am<br>a span I am</span>
+    <span>I am a span<br>I am</span> <span>I am<br>a span I am</span>
+    <span>I am a span<br>I am</span> <span>I am<br>a span I am</span>
+  </div>
+</div>
+
+</body>
+</html>

Added: trunk/LayoutTests/platform/mac/fast/borders/border-antialiasing-expected.png


(Binary files differ)
Property changes on: trunk/LayoutTests/platform/mac/fast/borders/border-antialiasing-expected.png ___________________________________________________________________

Added: svn:mime-type

Added: trunk/LayoutTests/platform/mac/fast/borders/border-antialiasing-expected.txt (0 => 87387)


--- trunk/LayoutTests/platform/mac/fast/borders/border-antialiasing-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/fast/borders/border-antialiasing-expected.txt	2011-05-26 15:34:48 UTC (rev 87387)
@@ -0,0 +1,226 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x461
+  RenderBlock {HTML} at (0,0) size 800x461
+    RenderBody {BODY} at (8,20) size 784x431
+layer at (18,20) size 764x431
+  RenderBlock {DIV} at (10,0) size 764x431
+    RenderTable {TABLE} at (20,0) size 131x53 [border: none]
+      RenderTableSection {TBODY} at (0,0) size 130x52
+        RenderTableRow {TR} at (0,0) size 130x13
+          RenderTableCell {TD} at (0,5) size 13x3 [border: (1px solid #000000)] [r=0 c=0 rs=1 cs=1]
+          RenderTableCell {TD} at (13,5) size 13x3 [border: (1px solid #000000)] [r=0 c=1 rs=1 cs=1]
+          RenderTableCell {TD} at (26,5) size 13x3 [border: (1px solid #000000)] [r=0 c=2 rs=1 cs=1]
+          RenderTableCell {TD} at (39,5) size 13x3 [border: (1px solid #000000)] [r=0 c=3 rs=1 cs=1]
+          RenderTableCell {TD} at (52,5) size 13x3 [border: (1px solid #000000)] [r=0 c=4 rs=1 cs=1]
+          RenderTableCell {TD} at (65,5) size 13x3 [border: (1px solid #000000)] [r=0 c=5 rs=1 cs=1]
+          RenderTableCell {TD} at (78,5) size 13x3 [border: (1px solid #000000)] [r=0 c=6 rs=1 cs=1]
+          RenderTableCell {TD} at (91,5) size 13x3 [border: (1px solid #000000)] [r=0 c=7 rs=1 cs=1]
+          RenderTableCell {TD} at (104,5) size 13x3 [border: (1px solid #000000)] [r=0 c=8 rs=1 cs=1]
+          RenderTableCell {TD} at (117,5) size 13x3 [border: (1px solid #000000)] [r=0 c=9 rs=1 cs=1]
+        RenderTableRow {TR} at (0,13) size 130x13
+          RenderTableCell {TD} at (0,18) size 13x3 [border: (1px solid #000000)] [r=1 c=0 rs=1 cs=1]
+          RenderTableCell {TD} at (13,18) size 13x3 [border: (1px solid #000000)] [r=1 c=1 rs=1 cs=1]
+          RenderTableCell {TD} at (26,18) size 13x3 [border: (1px solid #000000)] [r=1 c=2 rs=1 cs=1]
+          RenderTableCell {TD} at (39,18) size 13x3 [border: (1px solid #000000)] [r=1 c=3 rs=1 cs=1]
+          RenderTableCell {TD} at (52,18) size 13x3 [border: (1px solid #000000)] [r=1 c=4 rs=1 cs=1]
+          RenderTableCell {TD} at (65,18) size 13x3 [border: (1px solid #000000)] [r=1 c=5 rs=1 cs=1]
+          RenderTableCell {TD} at (78,18) size 13x3 [border: (1px solid #000000)] [r=1 c=6 rs=1 cs=1]
+          RenderTableCell {TD} at (91,18) size 13x3 [border: (1px solid #000000)] [r=1 c=7 rs=1 cs=1]
+          RenderTableCell {TD} at (104,18) size 13x3 [border: (1px solid #000000)] [r=1 c=8 rs=1 cs=1]
+          RenderTableCell {TD} at (117,18) size 13x3 [border: (1px solid #000000)] [r=1 c=9 rs=1 cs=1]
+        RenderTableRow {TR} at (0,26) size 130x13
+          RenderTableCell {TD} at (0,31) size 13x3 [border: (1px solid #000000)] [r=2 c=0 rs=1 cs=1]
+          RenderTableCell {TD} at (13,31) size 13x3 [border: (1px solid #000000)] [r=2 c=1 rs=1 cs=1]
+          RenderTableCell {TD} at (26,31) size 13x3 [border: (1px solid #000000)] [r=2 c=2 rs=1 cs=1]
+          RenderTableCell {TD} at (39,31) size 13x3 [border: (1px solid #000000)] [r=2 c=3 rs=1 cs=1]
+          RenderTableCell {TD} at (52,31) size 13x3 [border: (1px solid #000000)] [r=2 c=4 rs=1 cs=1]
+          RenderTableCell {TD} at (65,31) size 13x3 [border: (1px solid #000000)] [r=2 c=5 rs=1 cs=1]
+          RenderTableCell {TD} at (78,31) size 13x3 [border: (1px solid #000000)] [r=2 c=6 rs=1 cs=1]
+          RenderTableCell {TD} at (91,31) size 13x3 [border: (1px solid #000000)] [r=2 c=7 rs=1 cs=1]
+          RenderTableCell {TD} at (104,31) size 13x3 [border: (1px solid #000000)] [r=2 c=8 rs=1 cs=1]
+          RenderTableCell {TD} at (117,31) size 13x3 [border: (1px solid #000000)] [r=2 c=9 rs=1 cs=1]
+        RenderTableRow {TR} at (0,39) size 130x13
+          RenderTableCell {TD} at (0,44) size 13x3 [border: (1px solid #000000)] [r=3 c=0 rs=1 cs=1]
+          RenderTableCell {TD} at (13,44) size 13x3 [border: (1px solid #000000)] [r=3 c=1 rs=1 cs=1]
+          RenderTableCell {TD} at (26,44) size 13x3 [border: (1px solid #000000)] [r=3 c=2 rs=1 cs=1]
+          RenderTableCell {TD} at (39,44) size 13x3 [border: (1px solid #000000)] [r=3 c=3 rs=1 cs=1]
+          RenderTableCell {TD} at (52,44) size 13x3 [border: (1px solid #000000)] [r=3 c=4 rs=1 cs=1]
+          RenderTableCell {TD} at (65,44) size 13x3 [border: (1px solid #000000)] [r=3 c=5 rs=1 cs=1]
+          RenderTableCell {TD} at (78,44) size 13x3 [border: (1px solid #000000)] [r=3 c=6 rs=1 cs=1]
+          RenderTableCell {TD} at (91,44) size 13x3 [border: (1px solid #000000)] [r=3 c=7 rs=1 cs=1]
+          RenderTableCell {TD} at (104,44) size 13x3 [border: (1px solid #000000)] [r=3 c=8 rs=1 cs=1]
+          RenderTableCell {TD} at (117,44) size 13x3 [border: (1px solid #000000)] [r=3 c=9 rs=1 cs=1]
+    RenderTable {TABLE} at (20,73) size 162x66
+      RenderTableSection {TBODY} at (0,0) size 162x66
+        RenderTableRow {TR} at (0,2) size 162x14
+          RenderTableCell {TD} at (2,7) size 14x4 [border: (1px solid #000000)] [r=0 c=0 rs=1 cs=1]
+          RenderTableCell {TD} at (18,7) size 14x4 [border: (1px solid #000000)] [r=0 c=1 rs=1 cs=1]
+          RenderTableCell {TD} at (34,7) size 14x4 [border: (1px solid #000000)] [r=0 c=2 rs=1 cs=1]
+          RenderTableCell {TD} at (50,7) size 14x4 [border: (1px solid #000000)] [r=0 c=3 rs=1 cs=1]
+          RenderTableCell {TD} at (66,7) size 14x4 [border: (1px solid #000000)] [r=0 c=4 rs=1 cs=1]
+          RenderTableCell {TD} at (82,7) size 14x4 [border: (1px solid #000000)] [r=0 c=5 rs=1 cs=1]
+          RenderTableCell {TD} at (98,7) size 14x4 [border: (1px solid #000000)] [r=0 c=6 rs=1 cs=1]
+          RenderTableCell {TD} at (114,7) size 14x4 [border: (1px solid #000000)] [r=0 c=7 rs=1 cs=1]
+          RenderTableCell {TD} at (130,7) size 14x4 [border: (1px solid #000000)] [r=0 c=8 rs=1 cs=1]
+          RenderTableCell {TD} at (146,7) size 14x4 [border: (1px solid #000000)] [r=0 c=9 rs=1 cs=1]
+        RenderTableRow {TR} at (0,18) size 162x14
+          RenderTableCell {TD} at (2,23) size 14x4 [border: (1px solid #000000)] [r=1 c=0 rs=1 cs=1]
+          RenderTableCell {TD} at (18,23) size 14x4 [border: (1px solid #000000)] [r=1 c=1 rs=1 cs=1]
+          RenderTableCell {TD} at (34,23) size 14x4 [border: (1px solid #000000)] [r=1 c=2 rs=1 cs=1]
+          RenderTableCell {TD} at (50,23) size 14x4 [border: (1px solid #000000)] [r=1 c=3 rs=1 cs=1]
+          RenderTableCell {TD} at (66,23) size 14x4 [border: (1px solid #000000)] [r=1 c=4 rs=1 cs=1]
+          RenderTableCell {TD} at (82,23) size 14x4 [border: (1px solid #000000)] [r=1 c=5 rs=1 cs=1]
+          RenderTableCell {TD} at (98,23) size 14x4 [border: (1px solid #000000)] [r=1 c=6 rs=1 cs=1]
+          RenderTableCell {TD} at (114,23) size 14x4 [border: (1px solid #000000)] [r=1 c=7 rs=1 cs=1]
+          RenderTableCell {TD} at (130,23) size 14x4 [border: (1px solid #000000)] [r=1 c=8 rs=1 cs=1]
+          RenderTableCell {TD} at (146,23) size 14x4 [border: (1px solid #000000)] [r=1 c=9 rs=1 cs=1]
+        RenderTableRow {TR} at (0,34) size 162x14
+          RenderTableCell {TD} at (2,39) size 14x4 [border: (1px solid #000000)] [r=2 c=0 rs=1 cs=1]
+          RenderTableCell {TD} at (18,39) size 14x4 [border: (1px solid #000000)] [r=2 c=1 rs=1 cs=1]
+          RenderTableCell {TD} at (34,39) size 14x4 [border: (1px solid #000000)] [r=2 c=2 rs=1 cs=1]
+          RenderTableCell {TD} at (50,39) size 14x4 [border: (1px solid #000000)] [r=2 c=3 rs=1 cs=1]
+          RenderTableCell {TD} at (66,39) size 14x4 [border: (1px solid #000000)] [r=2 c=4 rs=1 cs=1]
+          RenderTableCell {TD} at (82,39) size 14x4 [border: (1px solid #000000)] [r=2 c=5 rs=1 cs=1]
+          RenderTableCell {TD} at (98,39) size 14x4 [border: (1px solid #000000)] [r=2 c=6 rs=1 cs=1]
+          RenderTableCell {TD} at (114,39) size 14x4 [border: (1px solid #000000)] [r=2 c=7 rs=1 cs=1]
+          RenderTableCell {TD} at (130,39) size 14x4 [border: (1px solid #000000)] [r=2 c=8 rs=1 cs=1]
+          RenderTableCell {TD} at (146,39) size 14x4 [border: (1px solid #000000)] [r=2 c=9 rs=1 cs=1]
+        RenderTableRow {TR} at (0,50) size 162x14
+          RenderTableCell {TD} at (2,55) size 14x4 [border: (1px solid #000000)] [r=3 c=0 rs=1 cs=1]
+          RenderTableCell {TD} at (18,55) size 14x4 [border: (1px solid #000000)] [r=3 c=1 rs=1 cs=1]
+          RenderTableCell {TD} at (34,55) size 14x4 [border: (1px solid #000000)] [r=3 c=2 rs=1 cs=1]
+          RenderTableCell {TD} at (50,55) size 14x4 [border: (1px solid #000000)] [r=3 c=3 rs=1 cs=1]
+          RenderTableCell {TD} at (66,55) size 14x4 [border: (1px solid #000000)] [r=3 c=4 rs=1 cs=1]
+          RenderTableCell {TD} at (82,55) size 14x4 [border: (1px solid #000000)] [r=3 c=5 rs=1 cs=1]
+          RenderTableCell {TD} at (98,55) size 14x4 [border: (1px solid #000000)] [r=3 c=6 rs=1 cs=1]
+          RenderTableCell {TD} at (114,55) size 14x4 [border: (1px solid #000000)] [r=3 c=7 rs=1 cs=1]
+          RenderTableCell {TD} at (130,55) size 14x4 [border: (1px solid #000000)] [r=3 c=8 rs=1 cs=1]
+          RenderTableCell {TD} at (146,55) size 14x4 [border: (1px solid #000000)] [r=3 c=9 rs=1 cs=1]
+    RenderBlock {DIV} at (10,269) size 744x162
+      RenderInline {SPAN} at (0,0) size 78x40
+        RenderText {#text} at (6,0) size 72x18
+          text run at (6,0) width 72: "I am a span"
+        RenderBR {BR} at (78,0) size 0x18
+        RenderText {#text} at (0,18) size 28x18
+          text run at (0,18) width 28: "I am"
+      RenderText {#text} at (34,18) size 4x18
+        text run at (34,18) width 4: " "
+      RenderInline {SPAN} at (0,0) size 74x40
+        RenderText {#text} at (44,18) size 28x18
+          text run at (44,18) width 28: "I am"
+        RenderBR {BR} at (72,18) size 0x18
+        RenderText {#text} at (0,36) size 72x18
+          text run at (0,36) width 72: "a span I am"
+      RenderText {#text} at (78,36) size 4x18
+        text run at (78,36) width 4: " "
+      RenderInline {SPAN} at (0,0) size 160x40
+        RenderText {#text} at (88,36) size 72x18
+          text run at (88,36) width 72: "I am a span"
+        RenderBR {BR} at (160,36) size 0x18
+        RenderText {#text} at (0,54) size 28x18
+          text run at (0,54) width 28: "I am"
+      RenderText {#text} at (34,54) size 4x18
+        text run at (34,54) width 4: " "
+      RenderInline {SPAN} at (0,0) size 74x40
+        RenderText {#text} at (44,54) size 28x18
+          text run at (44,54) width 28: "I am"
+        RenderBR {BR} at (72,54) size 0x18
+        RenderText {#text} at (0,72) size 72x18
+          text run at (0,72) width 72: "a span I am"
+      RenderText {#text} at (78,72) size 4x18
+        text run at (78,72) width 4: " "
+      RenderInline {SPAN} at (0,0) size 160x40
+        RenderText {#text} at (88,72) size 72x18
+          text run at (88,72) width 72: "I am a span"
+        RenderBR {BR} at (160,72) size 0x18
+        RenderText {#text} at (0,90) size 28x18
+          text run at (0,90) width 28: "I am"
+      RenderText {#text} at (34,90) size 4x18
+        text run at (34,90) width 4: " "
+      RenderInline {SPAN} at (0,0) size 74x40
+        RenderText {#text} at (44,90) size 28x18
+          text run at (44,90) width 28: "I am"
+        RenderBR {BR} at (72,90) size 0x18
+        RenderText {#text} at (0,108) size 72x18
+          text run at (0,108) width 72: "a span I am"
+      RenderText {#text} at (78,108) size 4x18
+        text run at (78,108) width 4: " "
+      RenderInline {SPAN} at (0,0) size 160x40
+        RenderText {#text} at (88,108) size 72x18
+          text run at (88,108) width 72: "I am a span"
+        RenderBR {BR} at (160,108) size 0x18
+        RenderText {#text} at (0,126) size 28x18
+          text run at (0,126) width 28: "I am"
+      RenderText {#text} at (34,126) size 4x18
+        text run at (34,126) width 4: " "
+      RenderInline {SPAN} at (0,0) size 74x40
+        RenderText {#text} at (44,126) size 28x18
+          text run at (44,126) width 28: "I am"
+        RenderBR {BR} at (72,126) size 0x18
+        RenderText {#text} at (0,144) size 72x18
+          text run at (0,144) width 72: "a span I am"
+      RenderText {#text} at (0,0) size 0x0
+layer at (28,179) size 600x100
+  RenderBlock {DIV} at (10,159) size 600x100
+    RenderText {#text} at (0,0) size 8x1190
+      text run at (0,0) width 8: "_"
+      text run at (0,18) width 8: "_"
+      text run at (0,36) width 8: "_"
+      text run at (0,54) width 8: "_"
+      text run at (0,72) width 8: "_"
+      text run at (0,100) width 8: "_"
+      text run at (0,118) width 8: "_"
+      text run at (0,136) width 8: "_"
+      text run at (0,154) width 8: "_"
+      text run at (0,172) width 8: "_"
+      text run at (0,200) width 8: "_"
+      text run at (0,218) width 8: "_"
+      text run at (0,236) width 8: "_"
+      text run at (0,254) width 8: "_"
+      text run at (0,272) width 8: "_"
+      text run at (0,300) width 8: "_"
+      text run at (0,318) width 8: "_"
+      text run at (0,336) width 8: "_"
+      text run at (0,354) width 8: "_"
+      text run at (0,372) width 8: "_"
+      text run at (0,400) width 8: "_"
+      text run at (0,418) width 8: "_"
+      text run at (0,436) width 8: "_"
+      text run at (0,454) width 8: "_"
+      text run at (0,472) width 8: "_"
+      text run at (0,500) width 8: "_"
+      text run at (0,518) width 8: "_"
+      text run at (0,536) width 8: "_"
+      text run at (0,554) width 8: "_"
+      text run at (0,572) width 8: "_"
+      text run at (0,600) width 8: "_"
+      text run at (0,618) width 8: "_"
+      text run at (0,636) width 8: "_"
+      text run at (0,654) width 8: "_"
+      text run at (0,672) width 8: "_"
+      text run at (0,700) width 8: "_"
+      text run at (0,718) width 8: "_"
+      text run at (0,736) width 8: "_"
+      text run at (0,754) width 8: "_"
+      text run at (0,772) width 8: "_"
+      text run at (0,800) width 8: "_"
+      text run at (0,818) width 8: "_"
+      text run at (0,836) width 8: "_"
+      text run at (0,854) width 8: "_"
+      text run at (0,872) width 8: "_"
+      text run at (0,900) width 8: "_"
+      text run at (0,918) width 8: "_"
+      text run at (0,936) width 8: "_"
+      text run at (0,954) width 8: "_"
+      text run at (0,972) width 8: "_"
+      text run at (0,1000) width 8: "_"
+      text run at (0,1018) width 8: "_"
+      text run at (0,1036) width 8: "_"
+      text run at (0,1054) width 8: "_"
+      text run at (0,1072) width 8: "_"
+      text run at (0,1100) width 8: "_"
+      text run at (0,1118) width 8: "_"
+      text run at (0,1136) width 8: "_"
+      text run at (0,1154) width 8: "_"
+      text run at (0,1172) width 8: "_"

Modified: trunk/Source/WebCore/ChangeLog (87386 => 87387)


--- trunk/Source/WebCore/ChangeLog	2011-05-26 15:01:44 UTC (rev 87386)
+++ trunk/Source/WebCore/ChangeLog	2011-05-26 15:34:48 UTC (rev 87387)
@@ -1,3 +1,27 @@
+2011-05-25  Simon Fraser  <[email protected]>
+
+        Reviewed by Dan Bernstein.
+
+        Always antialias borders, outlines and rules when scaling
+        https://bugs.webkit.org/show_bug.cgi?id=61502
+        
+        r84273 changed the behavior of drawLineForBoxSide() to never antialias by default.
+        This actually disabled antialiasing in some circumstances where it used to be enabled,
+        for example collapsed table border drawing.
+        
+        Fix by allowing antialiasing for collapsed table borders, column rules and span
+        outlines when the context is scaled.
+
+        Test: fast/borders/border-antialiasing.html
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::paintColumnRules):
+        * rendering/RenderInline.cpp:
+        (WebCore::RenderInline::paintOutline):
+        (WebCore::RenderInline::paintOutlineForLine):
+        * rendering/RenderTableCell.cpp:
+        (WebCore::RenderTableCell::paintCollapsedBorder):
+
 2011-05-26  Vsevolod Vlasov  <[email protected]>
 
         Reviewed by Yury Semikhatsky.

Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (87386 => 87387)


--- trunk/Source/WebCore/rendering/RenderBlock.cpp	2011-05-26 15:01:44 UTC (rev 87386)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp	2011-05-26 15:34:48 UTC (rev 87387)
@@ -2273,6 +2273,9 @@
 
 void RenderBlock::paintColumnRules(PaintInfo& paintInfo, int tx, int ty)
 {
+    if (paintInfo.context->paintingDisabled())
+        return;
+
     const Color& ruleColor = style()->visitedDependentColor(CSSPropertyWebkitColumnRuleColor);
     bool ruleTransparent = style()->columnRuleIsTransparent();
     EBorderStyle ruleStyle = style()->columnRuleStyle();
@@ -2288,6 +2291,10 @@
     int currLogicalLeftOffset = style()->isLeftToRightDirection() ? 0 : contentLogicalWidth();
     int ruleAdd = logicalLeftOffsetForContent();
     int ruleLogicalLeft = style()->isLeftToRightDirection() ? 0 : contentLogicalWidth();
+
+    const AffineTransform& currentCTM = paintInfo.context->getCTM();
+    bool antialias = !currentCTM.isIdentityOrTranslationOrFlipped();
+
     for (unsigned i = 0; i < colCount; i++) {
         IntRect colRect = columnRectAt(colInfo, i);
 
@@ -2309,7 +2316,7 @@
             int ruleTop = isHorizontalWritingMode() ? ty + borderTop() + paddingTop() : ty + ruleLogicalLeft - ruleWidth / 2 + ruleAdd;
             int ruleBottom = isHorizontalWritingMode() ? ruleTop + contentHeight() : ruleTop + ruleWidth;
             drawLineForBoxSide(paintInfo.context, ruleLeft, ruleTop, ruleRight, ruleBottom,
-                               style()->isLeftToRightDirection() ? BSLeft : BSRight, ruleColor, ruleStyle, 0, 0);
+                               style()->isLeftToRightDirection() ? BSLeft : BSRight, ruleColor, ruleStyle, 0, 0, antialias);
         }
         
         ruleLogicalLeft = currLogicalLeftOffset;

Modified: trunk/Source/WebCore/rendering/RenderInline.cpp (87386 => 87387)


--- trunk/Source/WebCore/rendering/RenderInline.cpp	2011-05-26 15:01:44 UTC (rev 87386)
+++ trunk/Source/WebCore/rendering/RenderInline.cpp	2011-05-26 15:34:48 UTC (rev 87387)
@@ -1379,6 +1379,9 @@
         }
     }
 
+    if (graphicsContext->paintingDisabled())
+        return;
+
     if (styleToUse->outlineStyleIsAuto() || styleToUse->outlineStyle() == BNONE)
         return;
 
@@ -1423,6 +1426,9 @@
     int ow = styleToUse->outlineWidth();
     EBorderStyle os = styleToUse->outlineStyle();
 
+    const AffineTransform& currentCTM = graphicsContext->getCTM();
+    bool antialias = !currentCTM.isIdentityOrTranslationOrFlipped();
+
     int offset = style()->outlineOffset();
 
     int t = ty + thisline.y() - offset;
@@ -1439,7 +1445,8 @@
                BSLeft,
                outlineColor, os,
                (lastline.isEmpty() || thisline.x() < lastline.x() || (lastline.maxX() - 1) <= thisline.x() ? ow : -ow),
-               (nextline.isEmpty() || thisline.x() <= nextline.x() || (nextline.maxX() - 1) <= thisline.x() ? ow : -ow));
+               (nextline.isEmpty() || thisline.x() <= nextline.x() || (nextline.maxX() - 1) <= thisline.x() ? ow : -ow),
+               antialias);
     
     // right edge
     drawLineForBoxSide(graphicsContext,
@@ -1450,27 +1457,29 @@
                BSRight,
                outlineColor, os,
                (lastline.isEmpty() || lastline.maxX() < thisline.maxX() || (thisline.maxX() - 1) <= lastline.x() ? ow : -ow),
-               (nextline.isEmpty() || nextline.maxX() <= thisline.maxX() || (thisline.maxX() - 1) <= nextline.x() ? ow : -ow));
+               (nextline.isEmpty() || nextline.maxX() <= thisline.maxX() || (thisline.maxX() - 1) <= nextline.x() ? ow : -ow),
+               antialias);
     // upper edge
     if (thisline.x() < lastline.x())
         drawLineForBoxSide(graphicsContext,
                    l - ow,
                    t - ow,
                    min(r+ow, (lastline.isEmpty() ? 1000000 : tx + lastline.x())),
-                   t ,
+                   t,
                    BSTop, outlineColor, os,
                    ow,
-                   (!lastline.isEmpty() && tx + lastline.x() + 1 < r + ow) ? -ow : ow);
+                   (!lastline.isEmpty() && tx + lastline.x() + 1 < r + ow) ? -ow : ow,
+                   antialias);
     
     if (lastline.maxX() < thisline.maxX())
         drawLineForBoxSide(graphicsContext,
                    max(lastline.isEmpty() ? -1000000 : tx + lastline.maxX(), l - ow),
                    t - ow,
                    r + ow,
-                   t ,
+                   t,
                    BSTop, outlineColor, os,
                    (!lastline.isEmpty() && l - ow < tx + lastline.maxX()) ? -ow : ow,
-                   ow);
+                   ow, antialias);
     
     // lower edge
     if (thisline.x() < nextline.x())
@@ -1481,7 +1490,8 @@
                    b + ow,
                    BSBottom, outlineColor, os,
                    ow,
-                   (!nextline.isEmpty() && tx + nextline.x() + 1 < r + ow) ? -ow : ow);
+                   (!nextline.isEmpty() && tx + nextline.x() + 1 < r + ow) ? -ow : ow,
+                   antialias);
     
     if (nextline.maxX() < thisline.maxX())
         drawLineForBoxSide(graphicsContext,
@@ -1491,7 +1501,7 @@
                    b + ow,
                    BSBottom, outlineColor, os,
                    (!nextline.isEmpty() && l - ow < tx + nextline.maxX()) ? -ow : ow,
-                   ow);
+                   ow, antialias);
 }
 
 #if ENABLE(DASHBOARD_SUPPORT)

Modified: trunk/Source/WebCore/rendering/RenderTableCell.cpp (87386 => 87387)


--- trunk/Source/WebCore/rendering/RenderTableCell.cpp	2011-05-26 15:01:44 UTC (rev 87386)
+++ trunk/Source/WebCore/rendering/RenderTableCell.cpp	2011-05-26 15:34:48 UTC (rev 87387)
@@ -914,7 +914,7 @@
 
 void RenderTableCell::paintCollapsedBorder(GraphicsContext* graphicsContext, const IntRect& paintRect)
 {
-    if (!table()->currentBorderStyle())
+    if (!table()->currentBorderStyle() || graphicsContext->paintingDisabled())
         return;
     
     CollapsedBorderValue leftVal = collapsedLeftBorder();
@@ -950,11 +950,14 @@
     borders.addBorder(bottomVal, BSBottom, renderBottom, x, y + h - bottomWidth, x + w, y + h, bottomStyle);
     borders.addBorder(leftVal, BSLeft, renderLeft, x, y, x + leftWidth, y + h, leftStyle);
     borders.addBorder(rightVal, BSRight, renderRight, x + w - rightWidth, y, x + w, y + h, rightStyle);
+
+    const AffineTransform& currentCTM = graphicsContext->getCTM();
+    bool antialias = !currentCTM.isIdentityOrTranslationOrFlipped();
     
     for (CollapsedBorder* border = borders.nextBorder(); border; border = borders.nextBorder()) {
         if (border->borderValue == *table()->currentBorderStyle())
             drawLineForBoxSide(graphicsContext, border->x1, border->y1, border->x2, border->y2, border->side, 
-                               border->borderValue.color(), border->style, 0, 0);
+                               border->borderValue.color(), border->style, 0, 0, antialias);
     }
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to