Title: [102526] trunk
Revision
102526
Author
[email protected]
Date
2011-12-10 12:30:35 -0800 (Sat, 10 Dec 2011)

Log Message

CSS 2.1 failure: outline-color-* tests fail
https://bugs.webkit.org/show_bug.cgi?id=71931

Source/WebCore:

Reviewed by Julien Chaffraix.

Test: css2.1/20110323/outline-color-001.html

WebKit didn't paint the top block in this series of tests because it ignored the outline
of objects with a zero size. Fix this by taking account of both offset and width of the
outline when deciding whether to paint it.

* rendering/RenderObject.cpp:
(WebCore::RenderObject::paintOutline): paint the outline even when the block has zero size

LayoutTests:

Add outline-color-001.htm to catch regressions against displaying outlines
on objects with zero size. The rest of the outline-color-* test series will
be landed separately.

Reviewed by Julien Chaffraix.

* css2.1/20110323/outline-color-001-expected.html: Added.
* css2.1/20110323/outline-color-001.htm: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (102525 => 102526)


--- trunk/LayoutTests/ChangeLog	2011-12-10 19:45:56 UTC (rev 102525)
+++ trunk/LayoutTests/ChangeLog	2011-12-10 20:30:35 UTC (rev 102526)
@@ -1,3 +1,17 @@
+2011-11-09  Robert Hogan  <[email protected]>
+
+        CSS 2.1 failure: outline-color-* tests fail
+        https://bugs.webkit.org/show_bug.cgi?id=71931
+
+        Add outline-color-001.htm to catch regressions against displaying outlines
+        on objects with zero size. The rest of the outline-color-* test series will
+        be landed separately.
+
+        Reviewed by Julien Chaffraix.
+
+        * css2.1/20110323/outline-color-001-expected.html: Added.
+        * css2.1/20110323/outline-color-001.htm: Added.
+
 2011-12-10  Alan Stearns  <[email protected]>
 
         Update test_expectations for chromium

Added: trunk/LayoutTests/css2.1/20110323/outline-color-001-expected.html (0 => 102526)


--- trunk/LayoutTests/css2.1/20110323/outline-color-001-expected.html	                        (rev 0)
+++ trunk/LayoutTests/css2.1/20110323/outline-color-001-expected.html	2011-12-10 20:30:35 UTC (rev 102526)
@@ -0,0 +1,20 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+    <head>
+        <title>CSS Test: Outline-color set to '#00000'</title>
+        <style type="text/css">
+            #reference
+            {
+                background-color: black;
+                height: 100px;
+                width: 100px;
+                margin: 50px 0 0 50px;
+            }
+        </style>
+    </head>
+    <body>
+        <p>Test passes if the two boxes below are the same color.</p>
+        <div id="reference"></div>
+        <div id="reference"></div>
+    </body>
+</html>
\ No newline at end of file
Property changes on: trunk/LayoutTests/css2.1/20110323/outline-color-001-expected.html
___________________________________________________________________

Added: svn:eol-style

Added: trunk/LayoutTests/css2.1/20110323/outline-color-001.htm (0 => 102526)


--- trunk/LayoutTests/css2.1/20110323/outline-color-001.htm	                        (rev 0)
+++ trunk/LayoutTests/css2.1/20110323/outline-color-001.htm	2011-12-10 20:30:35 UTC (rev 102526)
@@ -0,0 +1,33 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+    <head>
+        <title>CSS Test: Outline-color set to '#00000'</title>
+        <link rel="author" title="Microsoft" href=""
+        <link rel="help" href=""
+        <link rel="help" href=""
+        <meta name="flags" content="invalid">
+        <meta name="assert" content="Outline color #00000 (invalid) falls back to a default color.">
+        <style type="text/css">
+            #div1
+            {
+                outline-color: #00000;
+                outline-style: solid;
+                outline-width: 50px;
+                margin: 100px 0 0 100px;
+                width: 0;
+            }
+            #reference
+            {
+                background-color: black;
+                height: 100px;
+                margin: 200px 0 0 50px;
+                width: 100px;
+            }
+        </style>
+    </head>
+    <body>
+        <p>Test passes if the two boxes below are the same color.</p>
+        <div id="div1"></div>
+        <div id="reference"></div>
+    </body>
+</html>
\ No newline at end of file
Property changes on: trunk/LayoutTests/css2.1/20110323/outline-color-001.htm
___________________________________________________________________

Added: svn:eol-style

Modified: trunk/Source/WebCore/ChangeLog (102525 => 102526)


--- trunk/Source/WebCore/ChangeLog	2011-12-10 19:45:56 UTC (rev 102525)
+++ trunk/Source/WebCore/ChangeLog	2011-12-10 20:30:35 UTC (rev 102526)
@@ -1,3 +1,19 @@
+2011-11-09  Robert Hogan  <[email protected]>
+
+        CSS 2.1 failure: outline-color-* tests fail
+        https://bugs.webkit.org/show_bug.cgi?id=71931
+
+        Reviewed by Julien Chaffraix.
+
+        Test: css2.1/20110323/outline-color-001.html
+
+        WebKit didn't paint the top block in this series of tests because it ignored the outline
+        of objects with a zero size. Fix this by taking account of both offset and width of the
+        outline when deciding whether to paint it. 
+
+        * rendering/RenderObject.cpp:
+        (WebCore::RenderObject::paintOutline): paint the outline even when the block has zero size
+
 2011-12-10   Arko Saha  <[email protected]>
 
         Microdata: Fix compilation error in MICRODATA enabled build.

Modified: trunk/Source/WebCore/rendering/RenderObject.cpp (102525 => 102526)


--- trunk/Source/WebCore/rendering/RenderObject.cpp	2011-12-10 19:45:56 UTC (rev 102525)
+++ trunk/Source/WebCore/rendering/RenderObject.cpp	2011-12-10 20:30:35 UTC (rev 102526)
@@ -1130,7 +1130,7 @@
 
     Color outlineColor = styleToUse->visitedDependentColor(CSSPropertyOutlineColor);
 
-    LayoutUnit offset = styleToUse->outlineOffset();
+    LayoutUnit outlineOffset = styleToUse->outlineOffset();
 
     if (styleToUse->outlineStyleIsAuto() || hasOutlineAnnotation()) {
         if (!theme()->supportsFocusRing(styleToUse)) {
@@ -1143,14 +1143,15 @@
         return;
 
     LayoutRect inner = paintRect;
-    inner.inflate(offset);
+    inner.inflate(outlineOffset);
 
-    if (inner.isEmpty())
-        return;
-
     LayoutRect outer = inner;
     outer.inflate(outlineWidth);
 
+    // FIXME: This prevents outlines from painting inside the object. See bug 12042
+    if (outer.isEmpty())
+        return;
+
     bool useTransparencyLayer = outlineColor.hasAlpha();
     if (useTransparencyLayer) {
         if (outlineStyle == SOLID) {
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to