Title: [167694] trunk
Revision
167694
Author
za...@apple.com
Date
2014-04-22 19:44:25 -0700 (Tue, 22 Apr 2014)

Log Message

Do not paint border image when the border rect is empty.
https://bugs.webkit.org/show_bug.cgi?id=131988

Reviewed by Darin Adler.

http://trac.webkit.org/changeset/167351 introduced an early return when border
rect is empty. This patch ensures that border image is not painted either in that case.

Source/WebCore:
Modified padding-margin-negative-border.html to cover border-image case.

* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::paintBorder):

LayoutTests:
* fast/css/padding-margin-negative-border-expected.html: Borders in -expected.html does not get painted either, just
ensure that they are explicitly different colors.
* fast/css/padding-margin-negative-border.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (167693 => 167694)


--- trunk/LayoutTests/ChangeLog	2014-04-23 01:37:39 UTC (rev 167693)
+++ trunk/LayoutTests/ChangeLog	2014-04-23 02:44:25 UTC (rev 167694)
@@ -1,3 +1,17 @@
+2014-04-22  Zalan Bujtas  <za...@apple.com>
+
+        Do not paint border image when the border rect is empty.
+        https://bugs.webkit.org/show_bug.cgi?id=131988
+
+        Reviewed by Darin Adler.
+
+        http://trac.webkit.org/changeset/167351 introduced an early return when border
+        rect is empty. This patch ensures that border image is not painted either in that case.
+
+        * fast/css/padding-margin-negative-border-expected.html: Borders in -expected.html does not get painted either, just
+        ensure that they are explicitly different colors.
+        * fast/css/padding-margin-negative-border.html:
+
 2014-04-22  Ryosuke Niwa  <rn...@webkit.org>
 
         REGRESSION (r157328): popover to check into flight ba.com dismisses instantly when focusing form

Modified: trunk/LayoutTests/fast/css/padding-margin-negative-border-expected.html (167693 => 167694)


--- trunk/LayoutTests/fast/css/padding-margin-negative-border-expected.html	2014-04-23 01:37:39 UTC (rev 167693)
+++ trunk/LayoutTests/fast/css/padding-margin-negative-border-expected.html	2014-04-23 02:44:25 UTC (rev 167694)
@@ -1,13 +1,22 @@
 <!DOCTYPE html>
 <html>
+  <head>
+    <style>
+      table { width: 700px; }
+      td { width: 400px; }
+      b {  border: solid blue; }
+      i { background-color: green; }
+      .nonBlueBorder { border-color: red; }
+      .borderImage { border-image:url("resources/greenbox.png") 3 3 repeat; }
+    </style>
+  </head>
   <body>
-    <table style="width:700px">
+    <table>
       <tr>
         <td>top</td>
-        <td style="width:400px">
-          <b style="border:solid;">
+        <td>
+          <b>
             <i style="
-                background-color:green;
                 margin: -30px 0px 0px 0px;
                 padding: 1px 0px 0px 0px;">
                 Here is some text.
@@ -17,14 +26,12 @@
       </tr>
     </table>
 
-    <table style="width:700px">
+    <table>
       <tr>
         <td>right</td>
-        <td style="width:400px">
-          <b style="border:solid;
-                    border-color:white">
+        <td>
+          <b class=nonBlueBorder>
             <i style="
-                background-color:green;
                 margin: 0px -208px 0px 0px;
                 padding: 0px 1px 0px 0px;">
                 Here is some text.
@@ -34,13 +41,12 @@
       </tr>
     </table>
 
-    <table style="width:700px">
+    <table>
       <tr>
         <td>bottom</td>
-        <td style="width:400px">
-          <b style="border:solid;">
+        <td>
+          <b>
             <i style="
-                background-color:green;
                 margin: 0px 0px -30px 0px;
                 padding: 0px 0px 1px 0px;">
                 Here is some text.
@@ -50,13 +56,12 @@
       </tr>
     </table>
 
-    <table style="width:700px">
+    <table>
+      <tr>
         <td>left</td>
-        <td style="width:400px">
-          <b style="border:solid;
-                    border-color:white">
+        <td>
+          <b class=nonBlueBorder>
             <i style="
-                background-color:green;
                 margin: 0px 0px 0px -208px;
                 padding: 0px 0px 0px 31px;">
                 Here is some text.
@@ -65,5 +70,20 @@
         </td>
       </tr>
     </table>
+
+    <table>
+      <tr>
+        <td>left</td>
+        <td>
+          <b class=borderImage>
+            <i style="
+                margin: 0px 0px 0px -208px;
+                padding: 0px 0px 0px 31px;">
+                Here is some text.
+            </i>
+          </b>
+        </td>
+      </tr>
+    </table>
   </body>
 </html>

Modified: trunk/LayoutTests/fast/css/padding-margin-negative-border.html (167693 => 167694)


--- trunk/LayoutTests/fast/css/padding-margin-negative-border.html	2014-04-23 01:37:39 UTC (rev 167693)
+++ trunk/LayoutTests/fast/css/padding-margin-negative-border.html	2014-04-23 02:44:25 UTC (rev 167694)
@@ -1,13 +1,21 @@
 <!DOCTYPE html>
 <html>
+  <head>
+    <style>
+      table { width: 700px; }
+      td { width: 400px; }
+      b {  border: solid blue; }
+      i { background-color: green; }
+      .borderImage { border-image:url("resources/red-box.png") 3 3 repeat; }
+    </style>
+  </head>
   <body>
-    <table style="width:700px">
+    <table>
       <tr>
         <td>top</td>
-        <td style="width:400px">
-          <b style="border:solid;">
+        <td>
+          <b>
             <i style="
-                background-color:green;
                 margin: -30px 0px 0px 0px;
                 padding: 1px 0px 0px 0px;">
                 Here is some text.
@@ -17,13 +25,12 @@
       </tr>
     </table>
 
-    <table style="width:700px">
+    <table>
       <tr>
         <td>right</td>
-        <td style="width:400px">
-          <b style="border:solid;">
+        <td>
+          <b>
             <i style="
-                background-color:green;
                 margin: 0px -208px 0px 0px;
                 padding: 0px 1px 0px 0px;">
                 Here is some text.
@@ -33,13 +40,12 @@
       </tr>
     </table>
 
-    <table style="width:700px">
+    <table>
       <tr>
         <td>bottom</td>
-        <td style="width:400px">
-          <b style="border:solid;">
+        <td>
+          <b>
             <i style="
-                background-color:green;
                 margin: 0px 0px -30px 0px;
                 padding: 0px 0px 1px 0px;">
                 Here is some text.
@@ -49,12 +55,11 @@
       </tr>
     </table>
 
-    <table style="width:700px">
+    <table>
         <td>left</td>
-        <td style="width:400px">
-          <b style="border:solid;">
+        <td>
+          <b>
             <i style="
-                background-color:green;
                 margin: 0px 0px 0px -208px;
                 padding: 0px 0px 0px 31px;">
                 Here is some text.
@@ -63,5 +68,20 @@
         </td>
       </tr>
     </table>
+
+    <table>
+      <tr>
+        <td>left</td>
+        <td>
+          <b class=borderImage>
+            <i style="
+                margin: 0px 0px 0px -208px;
+                padding: 0px 0px 0px 31px;">
+                Here is some text.
+            </i>
+          </b>
+        </td>
+      </tr>
+    </table>
   </body>
 </html>

Modified: trunk/Source/WebCore/ChangeLog (167693 => 167694)


--- trunk/Source/WebCore/ChangeLog	2014-04-23 01:37:39 UTC (rev 167693)
+++ trunk/Source/WebCore/ChangeLog	2014-04-23 02:44:25 UTC (rev 167694)
@@ -1,3 +1,18 @@
+2014-04-22  Zalan Bujtas  <za...@apple.com>
+
+        Do not paint border image when the border rect is empty.
+        https://bugs.webkit.org/show_bug.cgi?id=131988
+
+        Reviewed by Darin Adler.
+
+        http://trac.webkit.org/changeset/167351 introduced an early return when border
+        rect is empty. This patch ensures that border image is not painted either in that case.
+
+        Modified padding-margin-negative-border.html to cover border-image case.
+
+        * rendering/RenderBoxModelObject.cpp:
+        (WebCore::RenderBoxModelObject::paintBorder):
+
 2014-04-22  Tim Horton  <timothy_hor...@apple.com>
 
         ASSERTION FAILED: scrollerImp == scrollbarPainterForScrollbar(_scrollbar) on two API tests

Modified: trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp (167693 => 167694)


--- trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp	2014-04-23 01:37:39 UTC (rev 167693)
+++ trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp	2014-04-23 02:44:25 UTC (rev 167694)
@@ -1711,21 +1711,22 @@
                                        BackgroundBleedAvoidance bleedAvoidance, bool includeLogicalLeftEdge, bool includeLogicalRightEdge)
 {
     GraphicsContext* graphicsContext = info.context;
+
+    if (graphicsContext->paintingDisabled())
+        return;
+
+    if (rect.isEmpty())
+        return;
+
     // border-image is not affected by border-radius.
     if (paintNinePieceImage(graphicsContext, rect, style, style.borderImage()))
         return;
 
-    if (graphicsContext->paintingDisabled())
-        return;
-
     BorderEdge edges[4];
     BorderEdge::getBorderEdgeInfo(edges, style, document().deviceScaleFactor(), includeLogicalLeftEdge, includeLogicalRightEdge);
     RoundedRect outerBorder = style.getRoundedBorderFor(rect, &view(), includeLogicalLeftEdge, includeLogicalRightEdge);
     RoundedRect innerBorder = style.getRoundedInnerBorderFor(borderInnerRectAdjustedForBleedAvoidance(*graphicsContext, rect, bleedAvoidance), includeLogicalLeftEdge, includeLogicalRightEdge);
 
-    if (outerBorder.rect().isEmpty())
-        return;
-
     bool haveAlphaColor = false;
     bool haveAllSolidEdges = true;
     bool haveAllDoubleEdges = true;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to