Title: [195306] trunk
Revision
195306
Author
za...@apple.com
Date
2016-01-19 12:32:01 -0800 (Tue, 19 Jan 2016)

Log Message

outline-offset does not work for inlines.
https://bugs.webkit.org/show_bug.cgi?id=153238

Reviewed by Simon Fraser.

Adjust outline box width/height with outline-offset.

Test: fast/inline/inlines-with-outline-offset.html

Source/WebCore:

* rendering/RenderInline.cpp:
(WebCore::RenderInline::paintOutline):
(WebCore::RenderInline::paintOutlineForLine):

LayoutTests:

* fast/inline/inlines-with-outline-offset-expected.html: Added.
* fast/inline/inlines-with-outline-offset.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (195305 => 195306)


--- trunk/LayoutTests/ChangeLog	2016-01-19 20:20:53 UTC (rev 195305)
+++ trunk/LayoutTests/ChangeLog	2016-01-19 20:32:01 UTC (rev 195306)
@@ -1,3 +1,17 @@
+2016-01-19  Zalan Bujtas  <za...@apple.com>
+
+        outline-offset does not work for inlines.
+        https://bugs.webkit.org/show_bug.cgi?id=153238
+
+        Reviewed by Simon Fraser.
+
+        Adjust outline box width/height with outline-offset.
+
+        Test: fast/inline/inlines-with-outline-offset.html
+
+        * fast/inline/inlines-with-outline-offset-expected.html: Added.
+        * fast/inline/inlines-with-outline-offset.html: Added.
+
 2016-01-19  Nikita Vasilyev  <nvasil...@apple.com>
 
         Web Inspector: WebInspector.Object.addEventListener is O(n), make it O(1)

Added: trunk/LayoutTests/fast/inline/inline-with-outline-offset-expected.html (0 => 195306)


--- trunk/LayoutTests/fast/inline/inline-with-outline-offset-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/inline/inline-with-outline-offset-expected.html	2016-01-19 20:32:01 UTC (rev 195306)
@@ -0,0 +1,18 @@
+<!doctype html>
+<html>
+<head>
+<title>This tests that outline-offset is applied properly on inline elements</title>
+<style>
+  div {
+    width: 120px;
+	outline-offset: 50px;
+  	outline: solid red 1px;
+  	color: white;
+  	font-family: ahem;
+  	font-size: 20px;
+  }
+</style>
+<body>
+<div>foobar</div>
+</body>
+</html>

Added: trunk/LayoutTests/fast/inline/inline-with-outline-offset.html (0 => 195306)


--- trunk/LayoutTests/fast/inline/inline-with-outline-offset.html	                        (rev 0)
+++ trunk/LayoutTests/fast/inline/inline-with-outline-offset.html	2016-01-19 20:32:01 UTC (rev 195306)
@@ -0,0 +1,17 @@
+<!doctype html>
+<html>
+<head>
+<title>This tests that outline-offset is applied properly on inline elements</title>
+<style>
+  span {
+	outline-offset: 50px;
+  	outline: solid red 1px;
+  	color: white;
+  	font-family: ahem;
+  	font-size: 20px;
+  }
+</style>
+<body>
+<span>foobar</span>
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (195305 => 195306)


--- trunk/Source/WebCore/ChangeLog	2016-01-19 20:20:53 UTC (rev 195305)
+++ trunk/Source/WebCore/ChangeLog	2016-01-19 20:32:01 UTC (rev 195306)
@@ -1,3 +1,18 @@
+2016-01-19  Zalan Bujtas  <za...@apple.com>
+
+        outline-offset does not work for inlines.
+        https://bugs.webkit.org/show_bug.cgi?id=153238
+
+        Reviewed by Simon Fraser.
+
+        Adjust outline box width/height with outline-offset.
+
+        Test: fast/inline/inlines-with-outline-offset.html
+
+        * rendering/RenderInline.cpp:
+        (WebCore::RenderInline::paintOutline):
+        (WebCore::RenderInline::paintOutlineForLine):
+
 2016-01-19  Chris Dumez  <cdu...@apple.com>
 
         Unreviewed, rolling out r195141.

Modified: trunk/Source/WebCore/rendering/RenderInline.cpp (195305 => 195306)


--- trunk/Source/WebCore/rendering/RenderInline.cpp	2016-01-19 20:20:53 UTC (rev 195305)
+++ trunk/Source/WebCore/rendering/RenderInline.cpp	2016-01-19 20:32:01 UTC (rev 195306)
@@ -1609,11 +1609,10 @@
     if (graphicsContext.paintingDisabled())
         return;
 
-    if (styleToUse.outlineStyleIsAuto() || styleToUse.outlineStyle() == BNONE)
+    if (styleToUse.outlineStyleIsAuto() || !styleToUse.hasOutline())
         return;
 
     Vector<LayoutRect> rects;
-
     rects.append(LayoutRect());
     for (InlineFlowBox* curr = firstLineBox(); curr; curr = curr->nextLineBox()) {
         const RootInlineBox& rootBox = curr->root();
@@ -1643,14 +1642,14 @@
 {
     const RenderStyle& styleToUse = style();
     float outlineWidth = styleToUse.outlineWidth();
+    float outlineOffset = style().outlineOffset();
     EBorderStyle outlineStyle = styleToUse.outlineStyle();
 
     bool antialias = shouldAntialiasLines(graphicsContext);
 
-    float offset = style().outlineOffset();
 
-    LayoutRect box(LayoutPoint(paintOffset.x() + thisline.x() - offset, paintOffset.y() + thisline.y() - offset),
-        LayoutSize(thisline.width() + offset, thisline.height() + offset));
+    LayoutRect box(LayoutPoint(paintOffset.x() + thisline.x() - outlineOffset, paintOffset.y() + thisline.y() - outlineOffset),
+        LayoutSize(thisline.width() + 2 * outlineOffset, thisline.height() + 2 * outlineOffset));
 
     IntRect pixelSnappedBox = snappedIntRect(box);
     if (pixelSnappedBox.isEmpty())
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to