Title: [95242] trunk
Revision
95242
Author
hy...@apple.com
Date
2011-09-15 16:45:25 -0700 (Thu, 15 Sep 2011)

Log Message

https://bugs.webkit.org/show_bug.cgi?id=27579
        
Make sure that the border shorthand also resets border-image.

Reviewed by Beth Dakin.

Source/WebCore: 

Added fast/borders/border-image-reset-by-border-shorthand.html.

* css/CSSParser.cpp:
(WebCore::CSSParser::parseValue):

LayoutTests: 

* fast/borders/border-image-reset-by-border-shorthand-expected.txt: Added.
* fast/borders/border-image-reset-by-border-shorthand.html: Added.
* fast/borders/border-image-scaled-gradient.html:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (95241 => 95242)


--- trunk/LayoutTests/ChangeLog	2011-09-15 23:35:53 UTC (rev 95241)
+++ trunk/LayoutTests/ChangeLog	2011-09-15 23:45:25 UTC (rev 95242)
@@ -1,3 +1,15 @@
+2011-09-15  David Hyatt  <hy...@apple.com>
+
+        https://bugs.webkit.org/show_bug.cgi?id=27579
+        
+        Make sure that the border shorthand also resets border-image.
+
+        Reviewed by Beth Dakin.
+
+        * fast/borders/border-image-reset-by-border-shorthand-expected.txt: Added.
+        * fast/borders/border-image-reset-by-border-shorthand.html: Added.
+        * fast/borders/border-image-scaled-gradient.html:
+
 2011-09-15  David Levin  <le...@chromium.org>
 
         [chromium] Rebaselines due to r95203 and r95207.

Added: trunk/LayoutTests/fast/borders/border-image-reset-by-border-shorthand-expected.txt (0 => 95242)


--- trunk/LayoutTests/fast/borders/border-image-reset-by-border-shorthand-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/borders/border-image-reset-by-border-shorthand-expected.txt	2011-09-15 23:45:25 UTC (rev 95242)
@@ -0,0 +1 @@
+PASS

Added: trunk/LayoutTests/fast/borders/border-image-reset-by-border-shorthand.html (0 => 95242)


--- trunk/LayoutTests/fast/borders/border-image-reset-by-border-shorthand.html	                        (rev 0)
+++ trunk/LayoutTests/fast/borders/border-image-reset-by-border-shorthand.html	2011-09-15 23:45:25 UTC (rev 95242)
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+  <style>
+    div {
+      width: 300px;
+      height: 300px;
+      border-image: -webkit-linear-gradient(30deg, black, white) 1 fill repeat;
+      border: 2px solid green;
+    }
+  </style>
+<script>
+if (window.layoutTestController)
+    window.layoutTestController.dumpAsText();
+
+function runTest()
+{
+    var testChild = document.getElementById('test');
+    var s = getComputedStyle(testChild);
+    var text = s.getPropertyValue("border-image-source");
+    if (text == "none")
+        testChild.innerHTML = "PASS";
+    else
+        testCHild.innerHTML = "FAIL";
+    
+}
+</script>
+</head>
+<body _onload_="runTest()">
+  <div id="test">FAIL
+  </div>
+</body>
+</html>

Modified: trunk/LayoutTests/fast/borders/border-image-scaled-gradient.html (95241 => 95242)


--- trunk/LayoutTests/fast/borders/border-image-scaled-gradient.html	2011-09-15 23:35:53 UTC (rev 95241)
+++ trunk/LayoutTests/fast/borders/border-image-scaled-gradient.html	2011-09-15 23:45:25 UTC (rev 95242)
@@ -6,9 +6,8 @@
     div {
       width: 300px;
       height: 300px;
-      -webkit-border-image: -webkit-linear-gradient(30deg, black, white) 1 repeat;
-      border-image: -webkit-linear-gradient(30deg, black, white) 1 fill repeat;
       border: 2px solid red;
+      border-image: -webkit-linear-gradient(30deg, black, white) 1 fill repeat;
     }
       
   </style>

Modified: trunk/Source/WebCore/ChangeLog (95241 => 95242)


--- trunk/Source/WebCore/ChangeLog	2011-09-15 23:35:53 UTC (rev 95241)
+++ trunk/Source/WebCore/ChangeLog	2011-09-15 23:45:25 UTC (rev 95242)
@@ -1,5 +1,18 @@
 2011-09-15  David Hyatt  <hy...@apple.com>
 
+        https://bugs.webkit.org/show_bug.cgi?id=27579
+        
+        Make sure that the border shorthand also resets border-image.
+
+        Reviewed by Beth Dakin.
+
+        Added fast/borders/border-image-reset-by-border-shorthand.html.
+
+        * css/CSSParser.cpp:
+        (WebCore::CSSParser::parseValue):
+
+2011-09-15  David Hyatt  <hy...@apple.com>
+
         https://bugs.webkit.org/show_bug.cgi?id=50072
         
         Make overflow clipping to border-radius work across layers. This patch makes painting

Modified: trunk/Source/WebCore/css/CSSParser.cpp (95241 => 95242)


--- trunk/Source/WebCore/css/CSSParser.cpp	2011-09-15 23:35:53 UTC (rev 95241)
+++ trunk/Source/WebCore/css/CSSParser.cpp	2011-09-15 23:45:25 UTC (rev 95242)
@@ -1965,7 +1965,13 @@
     {
         const int properties[3] = { CSSPropertyBorderWidth, CSSPropertyBorderStyle,
                                     CSSPropertyBorderColor };
-        return parseShorthand(propId, properties, 3, important);
+        if (parseShorthand(propId, properties, 3, important)) {
+            // The CSS3 Borders and Backgrounds specification says that border also resets border-image. It's as
+            // though a value of none was specified for the image.
+            addProperty(CSSPropertyBorderImage, CSSInitialValue::createImplicit(), important);
+            return true;
+        }
+        return false;
     }
     case CSSPropertyBorderTop:
         // [ 'border-top-width' || 'border-style' || <color> ] | inherit
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to