<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[160451] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/160451">160451</a></dd>
<dt>Author</dt> <dd>betravis@adobe.com</dd>
<dt>Date</dt> <dd>2013-12-11 13:33:08 -0800 (Wed, 11 Dec 2013)</dd>
</dl>

<h3>Log Message</h3>
<pre>Web Inspector: [CSS Shapes] Highlight margin-shape for shape-outside
https://bugs.webkit.org/show_bug.cgi?id=125175

Reviewed by Darin Adler.

Source/WebCore:

In addition to highlighting the shape, also highlight the shape created
by shape-margin with a slightly more transparent color. This patch modifies
the shape info passed to the Inspector Overlay to include a path for both
the raw shape and the shape with margin.

Test: inspector-protocol/model/highlight-shape-outside-margin.html

* inspector/InspectorOverlay.cpp:
(WebCore::buildObjectForShapeOutside): Call Shape::buildDisplayPaths rather than
Shape::buildPath, and pass along any relevant paths to the Inspector overlay.
* inspector/InspectorOverlayPage.js:
(_drawShapeHighlight): Draw the margin shape in addition to the raw shape.
* rendering/shapes/BoxShape.cpp:
(WebCore::addRoundedRect): Add a rounded rect to the path.
(WebCore::BoxShape::buildDisplayPaths): Create the applicable [margin/padding/raw] shapes.
* rendering/shapes/BoxShape.h:
* rendering/shapes/PolygonShape.cpp:
(WebCore::addPolygon): Add a set of vertices as a polygon to the path.
(WebCore::PolygonShape::buildDisplayPaths): Create the applicable [margin/padding/raw] shapes.
* rendering/shapes/PolygonShape.h:
* rendering/shapes/RasterShape.h:
(WebCore::RasterShape::buildDisplayPaths): Ditto.
* rendering/shapes/RectangleShape.cpp:
(WebCore::RectangleShape::buildDisplayPaths): Ditto.
* rendering/shapes/RectangleShape.h:
* rendering/shapes/Shape.h:

LayoutTests:

Test that the shape and margin-shape are properly passed to the Inspector Overlay.
Arcs for rounded rectangles, circles, and ellipses are approximated using the same
bezier curve method present in Path.cpp.

* inspector-protocol/model/highlight-shape-outside-margin.html: Added.
* inspector-protocol/model/highlight-shape-outside.html: Updating shape-outside info model.
* inspector-protocol/resources/shape-info-helper.js: Adding utilities to compare alternate
  path formats.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsinspectorprotocolmodelhighlightshapeoutsidehtml">trunk/LayoutTests/inspector-protocol/model/highlight-shape-outside.html</a></li>
<li><a href="#trunkLayoutTestsinspectorprotocolresourcesshapeinfohelperjs">trunk/LayoutTests/inspector-protocol/resources/shape-info-helper.js</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorOverlaycpp">trunk/Source/WebCore/inspector/InspectorOverlay.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorOverlayPagejs">trunk/Source/WebCore/inspector/InspectorOverlayPage.js</a></li>
<li><a href="#trunkSourceWebCorerenderingshapesBoxShapecpp">trunk/Source/WebCore/rendering/shapes/BoxShape.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingshapesBoxShapeh">trunk/Source/WebCore/rendering/shapes/BoxShape.h</a></li>
<li><a href="#trunkSourceWebCorerenderingshapesPolygonShapecpp">trunk/Source/WebCore/rendering/shapes/PolygonShape.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingshapesPolygonShapeh">trunk/Source/WebCore/rendering/shapes/PolygonShape.h</a></li>
<li><a href="#trunkSourceWebCorerenderingshapesRasterShapeh">trunk/Source/WebCore/rendering/shapes/RasterShape.h</a></li>
<li><a href="#trunkSourceWebCorerenderingshapesRectangleShapecpp">trunk/Source/WebCore/rendering/shapes/RectangleShape.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingshapesRectangleShapeh">trunk/Source/WebCore/rendering/shapes/RectangleShape.h</a></li>
<li><a href="#trunkSourceWebCorerenderingshapesShapeh">trunk/Source/WebCore/rendering/shapes/Shape.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsinspectorprotocolmodelhighlightshapeoutsidemarginexpectedtxt">trunk/LayoutTests/inspector-protocol/model/highlight-shape-outside-margin-expected.txt</a></li>
<li><a href="#trunkLayoutTestsinspectorprotocolmodelhighlightshapeoutsidemarginhtml">trunk/LayoutTests/inspector-protocol/model/highlight-shape-outside-margin.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (160450 => 160451)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2013-12-11 19:49:39 UTC (rev 160450)
+++ trunk/LayoutTests/ChangeLog        2013-12-11 21:33:08 UTC (rev 160451)
</span><span class="lines">@@ -1,3 +1,19 @@
</span><ins>+2013-12-11  Bear Travis  &lt;betravis@adobe.com&gt;
+
+        Web Inspector: [CSS Shapes] Highlight margin-shape for shape-outside
+        https://bugs.webkit.org/show_bug.cgi?id=125175
+
+        Reviewed by Darin Adler.
+
+        Test that the shape and margin-shape are properly passed to the Inspector Overlay.
+        Arcs for rounded rectangles, circles, and ellipses are approximated using the same
+        bezier curve method present in Path.cpp.
+
+        * inspector-protocol/model/highlight-shape-outside-margin.html: Added.
+        * inspector-protocol/model/highlight-shape-outside.html: Updating shape-outside info model.
+        * inspector-protocol/resources/shape-info-helper.js: Adding utilities to compare alternate
+          path formats.
+
</ins><span class="cx"> 2013-12-11  Mario Sanchez Prada  &lt;mario.prada@samsung.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [ATK] Expose accessibility objects WAI-ARIA landmark roles
</span></span></pre></div>
<a id="trunkLayoutTestsinspectorprotocolmodelhighlightshapeoutsidemarginexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector-protocol/model/highlight-shape-outside-margin-expected.txt (0 => 160451)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector-protocol/model/highlight-shape-outside-margin-expected.txt                                (rev 0)
+++ trunk/LayoutTests/inspector-protocol/model/highlight-shape-outside-margin-expected.txt        2013-12-11 21:33:08 UTC (rev 160451)
</span><span class="lines">@@ -0,0 +1,7 @@
</span><ins>+PASS: Shape roughly equals [M 60 50 L 90 50 C 95.52 50 100 54.48 100 60 L 100 90 C 100 95.52 95.52 100 90 100 L 60 100 C 54.48 100 50 95.52 50 90 L 50 60 C 50 54.48 54.48 50 60 50 Z]
+PASS: Margin shape roughly equals [M 60 40 L 90 40 C 101.05 40 110 48.95 110 60 L 110 90 C 110 101.05 101.05 110 90 110 L 60 110 C 48.95 110 40 101.05 40 90 L 40 60 C 40 48.95 48.95 40 60 40 Z]
+PASS: Shape roughly equals [M 75 25 L 75 25 C 102.61 25 125 47.39 125 75 L 125 75 C 125 102.61 102.61 125 75 125 L 75 125 C 47.39 125 25 102.61 25 75 L 25 75 C 25 47.39 47.39 25 75 25 Z]
+PASS: Margin shape roughly equals [M 75 15 L 75 15 C 108.14 15 135 41.86 135 75 L 135 75 C 135 108.14 108.14 135 75 135 L 75 135 C 41.86 135 15 108.14 15 75 L 15 75 C 15 41.86 41.86 15 75 15 Z]
+PASS: Shape roughly equals [M 50 50 L 100 50 L 100 100 L 50 100 L 50 50 Z]
+PASS: Margin shape roughly equals [M 50 49 L 100 49 L 100 50 L 50 50 L 50 49 Z M 49 50 L 101 50 L 101 100 L 49 100 L 49 50 Z M 50 100 L 100 100 L 100 101 L 50 101 L 50 100 Z]
+
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectorprotocolmodelhighlightshapeoutsidemarginhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector-protocol/model/highlight-shape-outside-margin.html (0 => 160451)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector-protocol/model/highlight-shape-outside-margin.html                                (rev 0)
+++ trunk/LayoutTests/inspector-protocol/model/highlight-shape-outside-margin.html        2013-12-11 21:33:08 UTC (rev 160451)
</span><span class="lines">@@ -0,0 +1,114 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;style&gt;
+body {
+    margin: 0;
+}
+.shape {
+    float: left;
+    width: 100px;
+    height: 100px;
+    padding: 25px 75px 75px 25px;
+    margin-right: -200px;
+    -webkit-shape-margin: 10px;
+}
+.inset {
+    -webkit-shape-outside: inset(25px 25px 25px 25px round 10px 10px) content-box;
+}
+.circle {
+    -webkit-shape-outside: circle(50px) content-box;
+}
+.svg {
+    -webkit-shape-outside: url(&quot;data:image/svg+xml;utf8,&lt;svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none' width='100px' height='100px'&gt;&lt;rect x='25' y='25' width='50' height='50' fill='blue' /&gt;&lt;/svg&gt;&quot;);
+    -webkit-shape-margin: 1px;
+}
+&lt;/style&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../../http/tests/inspector-protocol/resources/protocol-test.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../resources/shape-info-helper.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+function shapeTests() {
+    var tests = [
+    {
+        'selector' : '.inset',
+        'shape' : roundedRectCommands(50, 50, 50, 50, 10),
+        'marginShape' : roundedRectCommands(40, 40, 70, 70, 20)
+    },
+    {
+        'selector' : '.circle',
+        'shape' : roundedRectCommands(25, 25, 100, 100, 50),
+        'marginShape' : roundedRectCommands(15, 15, 120, 120, 60)
+    },
+    {
+        'selector' : '.svg',
+        'shape' : roundedRectCommands(50, 50, 50, 50, 0),
+        'marginShape' : [].concat(roundedRectCommands(50, 49, 50, 1, 0),
+            roundedRectCommands(49, 50, 52, 50, 0),
+            roundedRectCommands(50, 100, 50, 1, 0))
+    }
+    ];
+
+    function roundedRectCommands(x, y, w, h, r) {
+        if (!r)
+            return ['M', x, y, 'L', x + w, y, 'L', x + w, y + h, 'L', x, y + h, 'L', x, y, 'Z'];
+
+        // Approximate 1 - kappa, see Path.cpp
+        var control = .447715;
+
+        var commands = [];
+
+        commands.push('M', x + r, y);
+        commands.push('L', x + w - r, y);
+        commands.push('C', x + w - control * r, y, x + w, y + control * r, x + w, y + r);
+
+        commands.push('L', x + w, y + h - r);
+        commands.push('C', x + w, y + h - control * r, x + w - control * r, y + h, x + w - r, y + h);
+
+        commands.push('L', x + r, y + h);
+        commands.push('C', x + control * r, y + h, x, y + h - control * r, x, y + h - r);
+
+        commands.push('L', x, y + r);
+        commands.push('C', x, y + control * r, x + control * r, y, x + r, y);
+        commands.push('Z');
+
+        return commands;
+    }
+
+    function testPath(actual, expected, msg) {
+        var result = InspectorTest.pathsRoughlyEqual(actual, expected);
+        expectedString = expected.map(function(item) {
+            if (typeof item === 'number')
+                return +item.toFixed(2);
+            return item;
+        }).join(' ');
+        InspectorTest.assert(result, msg + &quot; [&quot; + expectedString + &quot;]&quot;);
+        if (!result)
+            InspectorTest.log(&quot;Actual shape was [&quot; + actual.join(&quot; &quot;) + &quot;]&quot;);
+    }
+
+    function doTests(tests) {
+        if (!tests.length) {
+            InspectorTest.completeTest();
+            return;
+        }
+        var test = tests[0];
+        tests = tests.splice(1);
+        InspectorTest.shapeOutsideInfo(test.selector, function(shapeOutside) {
+            testPath(shapeOutside.shape, test.shape, &quot;Shape roughly equals&quot;);
+            testPath(shapeOutside.marginShape, test.marginShape, &quot;Margin shape roughly equals&quot;);
+
+            doTests(tests);
+        });
+    }
+
+    doTests(tests);
+}
+window.onload = function() { ShapeInfoHelper.runShapeTest(shapeTests); }
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;div class='shape inset'&gt;&lt;/div&gt;
+    &lt;div class='shape circle'&gt;&lt;/div&gt;
+    &lt;div class='shape svg'&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectorprotocolmodelhighlightshapeoutsidehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector-protocol/model/highlight-shape-outside.html (160450 => 160451)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector-protocol/model/highlight-shape-outside.html        2013-12-11 19:49:39 UTC (rev 160450)
+++ trunk/LayoutTests/inspector-protocol/model/highlight-shape-outside.html        2013-12-11 21:33:08 UTC (rev 160451)
</span><span class="lines">@@ -113,7 +113,7 @@
</span><span class="cx">         var test = tests[0];
</span><span class="cx">         tests = tests.splice(1);
</span><span class="cx">         InspectorTest.shapeOutsideInfo(test.selector, function(shapeOutside) {
</span><del>-            var actual = shapeOutside.path.join(' ');
</del><ins>+            var actual = shapeOutside.shape.join(' ');
</ins><span class="cx">             var expected = test.path.join(' ');
</span><span class="cx">             InspectorTest.assert(actual === expected, &quot;Actual [&quot; + actual + &quot;] Expected [&quot; + expected + &quot;]&quot;);
</span><span class="cx">             doTests(tests);
</span></span></pre></div>
<a id="trunkLayoutTestsinspectorprotocolresourcesshapeinfohelperjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector-protocol/resources/shape-info-helper.js (160450 => 160451)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector-protocol/resources/shape-info-helper.js        2013-12-11 19:49:39 UTC (rev 160450)
+++ trunk/LayoutTests/inspector-protocol/resources/shape-info-helper.js        2013-12-11 21:33:08 UTC (rev 160451)
</span><span class="lines">@@ -47,9 +47,44 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    function pathsRoughlyEqual(actual, expected) {
+        function coordinatesRoughlyEqual(actual, expected) {
+            // Some platforms may only store integer path points, so the potential
+            // differences between correct paths can be roughly half a unit
+            return (typeof actual === 'number'
+                &amp;&amp; typeof expected === 'number'
+                &amp;&amp; Math.abs(actual - expected) &lt; 0.5);
+        }
+
+        var expectedSubpathStart = 0, ei, ai;
+        for (var ei = 0, ai = 0; ai &lt; actual.length &amp;&amp; ei &lt; expected.length; ai++, ei++) {
+            if (expected[ei] === 'M')
+                expectedSubpathStart = ei;
+
+            if (actual[ai] === expected[ei]
+                || coordinatesRoughlyEqual(actual[ai], expected[ei]))
+                continue;
+
+            // Extrapolate the missing line to command if it is missing from actual.
+            // The choice to close the path with an explicit line to command is
+            // platform dependent.
+            if (actual[ai] === 'Z'
+                &amp;&amp; expected[ei] === 'L'
+                &amp;&amp; coordinatesRoughlyEqual(expected[expectedSubpathStart + 1], expected[ei + 1])
+                &amp;&amp; coordinatesRoughlyEqual(expected[expectedSubpathStart + 2], expected[ei + 2])) {
+                ei += 2;
+                ai--;
+                continue;
+            }
+            return false;
+        }
+        return true;
+    }
+
</ins><span class="cx">     function runShapeTest(testfn) {
</span><span class="cx">         var body = [
</span><span class="cx">             &quot;InspectorTest.shapeOutsideInfo = &quot; + shapeOutsideInfo.toString(),
</span><ins>+            &quot;InspectorTest.pathsRoughlyEqual = &quot; + pathsRoughlyEqual.toString(),
</ins><span class="cx">             &quot;(&quot; + testfn.toString() + &quot;)()&quot;
</span><span class="cx">         ];
</span><span class="cx">         window.test = new Function(
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (160450 => 160451)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2013-12-11 19:49:39 UTC (rev 160450)
+++ trunk/Source/WebCore/ChangeLog        2013-12-11 21:33:08 UTC (rev 160451)
</span><span class="lines">@@ -1,3 +1,37 @@
</span><ins>+2013-12-11  Bear Travis  &lt;betravis@adobe.com&gt;
+
+        Web Inspector: [CSS Shapes] Highlight margin-shape for shape-outside
+        https://bugs.webkit.org/show_bug.cgi?id=125175
+
+        Reviewed by Darin Adler.
+
+        In addition to highlighting the shape, also highlight the shape created
+        by shape-margin with a slightly more transparent color. This patch modifies
+        the shape info passed to the Inspector Overlay to include a path for both
+        the raw shape and the shape with margin.
+
+        Test: inspector-protocol/model/highlight-shape-outside-margin.html
+
+        * inspector/InspectorOverlay.cpp:
+        (WebCore::buildObjectForShapeOutside): Call Shape::buildDisplayPaths rather than
+        Shape::buildPath, and pass along any relevant paths to the Inspector overlay.
+        * inspector/InspectorOverlayPage.js:
+        (_drawShapeHighlight): Draw the margin shape in addition to the raw shape.
+        * rendering/shapes/BoxShape.cpp:
+        (WebCore::addRoundedRect): Add a rounded rect to the path.
+        (WebCore::BoxShape::buildDisplayPaths): Create the applicable [margin/padding/raw] shapes.
+        * rendering/shapes/BoxShape.h:
+        * rendering/shapes/PolygonShape.cpp:
+        (WebCore::addPolygon): Add a set of vertices as a polygon to the path.
+        (WebCore::PolygonShape::buildDisplayPaths): Create the applicable [margin/padding/raw] shapes.
+        * rendering/shapes/PolygonShape.h:
+        * rendering/shapes/RasterShape.h:
+        (WebCore::RasterShape::buildDisplayPaths): Ditto.
+        * rendering/shapes/RectangleShape.cpp:
+        (WebCore::RectangleShape::buildDisplayPaths): Ditto.
+        * rendering/shapes/RectangleShape.h:
+        * rendering/shapes/Shape.h:
+
</ins><span class="cx"> 2013-12-11  Mario Sanchez Prada  &lt;mario.prada@samsung.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [ATK] Expose accessibility objects WAI-ARIA landmark roles
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorOverlaycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorOverlay.cpp (160450 => 160451)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorOverlay.cpp        2013-12-11 19:49:39 UTC (rev 160450)
+++ trunk/Source/WebCore/inspector/InspectorOverlay.cpp        2013-12-11 21:33:08 UTC (rev 160451)
</span><span class="lines">@@ -595,12 +595,12 @@
</span><span class="cx">     LayoutRect shapeBounds = shapeOutsideInfo-&gt;computedShapePhysicalBoundingBox();
</span><span class="cx">     FloatQuad shapeQuad = renderer-&gt;localToAbsoluteQuad(FloatRect(shapeBounds));
</span><span class="cx">     contentsQuadToPage(containingFrame-&gt;page()-&gt;mainFrame().view(), containingFrame-&gt;view(), shapeQuad);
</span><del>-    shapeObject-&gt;setArray(&quot;bounds&quot;, buildArrayForQuad(shapeQuad));
</del><ins>+    shapeObject-&gt;setArray(ASCIILiteral(&quot;bounds&quot;), buildArrayForQuad(shapeQuad));
</ins><span class="cx"> 
</span><del>-    Path path;
-    shapeOutsideInfo-&gt;computedShape().buildPath(path);
</del><ins>+    Shape::DisplayPaths paths;
+    shapeOutsideInfo-&gt;computedShape().buildDisplayPaths(paths);
</ins><span class="cx"> 
</span><del>-    if (path.length()) {
</del><ins>+    if (paths.shape.length()) {
</ins><span class="cx">         RefPtr&lt;InspectorArray&gt; shapePath = InspectorArray::create();
</span><span class="cx">         PathApplyInfo info;
</span><span class="cx">         info.rootView = containingFrame-&gt;page()-&gt;mainFrame().view();
</span><span class="lines">@@ -609,9 +609,18 @@
</span><span class="cx">         info.renderer = renderer;
</span><span class="cx">         info.shapeOutsideInfo = shapeOutsideInfo;
</span><span class="cx"> 
</span><del>-        path.apply(&amp;info, &amp;appendPathSegment);
</del><ins>+        paths.shape.apply(&amp;info, &amp;appendPathSegment);
</ins><span class="cx"> 
</span><del>-        shapeObject-&gt;setArray(&quot;path&quot;, shapePath.release());
</del><ins>+        shapeObject-&gt;setArray(ASCIILiteral(&quot;shape&quot;), shapePath.release());
+
+        if (paths.marginShape.length()) {
+            shapePath = InspectorArray::create();
+            info.array = shapePath.get();
+
+            paths.marginShape.apply(&amp;info, &amp;appendPathSegment);
+
+            shapeObject-&gt;setArray(ASCIILiteral(&quot;marginShape&quot;), shapePath.release());
+        }
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     return shapeObject.release();
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorOverlayPagejs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorOverlayPage.js (160450 => 160451)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorOverlayPage.js        2013-12-11 19:49:39 UTC (rev 160450)
+++ trunk/Source/WebCore/inspector/InspectorOverlayPage.js        2013-12-11 21:33:08 UTC (rev 160451)
</span><span class="lines">@@ -19,7 +19,8 @@
</span><span class="cx"> const regionNumberStrokeColor = &quot;rgb(61, 127, 204)&quot;;
</span><span class="cx"> 
</span><span class="cx"> // CSS Shapes highlight colors
</span><del>-const shapeHighlightColor = &quot;rgb(255, 105, 180)&quot;;
</del><ins>+const shapeHighlightColor = &quot;rgba(96, 82, 127, 0.8)&quot;;
+const shapeMarginHighlightColor = &quot;rgba(96, 82, 127, 0.6)&quot;;
</ins><span class="cx"> 
</span><span class="cx"> function drawPausedInDebuggerMessage(message)
</span><span class="cx"> {
</span><span class="lines">@@ -562,9 +563,13 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function _drawShapeHighlight(shapeInfo) {
</span><del>-    if (shapeInfo.path)
-        drawPath(context, shapeInfo.path, shapeHighlightColor);
-    else
</del><ins>+    if (shapeInfo.marginShape)
+        drawPath(context, shapeInfo.marginShape, shapeMarginHighlightColor);
+
+    if (shapeInfo.shape)
+        drawPath(context, shapeInfo.shape, shapeHighlightColor);
+
+    if (!(shapeInfo.shape || shapeInfo.marginShape))
</ins><span class="cx">         drawOutlinedQuad(shapeInfo.bounds, shapeHighlightColor, shapeHighlightColor);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingshapesBoxShapecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/shapes/BoxShape.cpp (160450 => 160451)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/shapes/BoxShape.cpp        2013-12-11 19:49:39 UTC (rev 160450)
+++ trunk/Source/WebCore/rendering/shapes/BoxShape.cpp        2013-12-11 21:33:08 UTC (rev 160451)
</span><span class="lines">@@ -108,11 +108,16 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void BoxShape::buildPath(Path&amp; path) const
</del><ins>+static void addRoundedRect(Path&amp; path, const FloatRect&amp; rect, const FloatRoundedRect::Radii&amp; radii)
</ins><span class="cx"> {
</span><del>-    const FloatRect&amp; rect = m_bounds.rect();
-    const FloatRoundedRect::Radii&amp; radii = m_bounds.radii();
</del><span class="cx">     path.addRoundedRect(rect, radii.topLeft(), radii.topRight(), radii.bottomLeft(), radii.bottomRight(), Path::PreferBezierRoundedRect);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void BoxShape::buildDisplayPaths(DisplayPaths&amp; paths) const
+{
+    addRoundedRect(paths.shape, m_bounds.rect(), m_bounds.radii());
+    if (shapeMargin())
+        addRoundedRect(paths.marginShape, m_marginBounds.rect(), m_marginBounds.radii());
+}
+
</ins><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingshapesBoxShapeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/shapes/BoxShape.h (160450 => 160451)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/shapes/BoxShape.h        2013-12-11 19:49:39 UTC (rev 160450)
+++ trunk/Source/WebCore/rendering/shapes/BoxShape.h        2013-12-11 21:33:08 UTC (rev 160451)
</span><span class="lines">@@ -46,7 +46,7 @@
</span><span class="cx">     virtual void getIncludedIntervals(LayoutUnit logicalTop, LayoutUnit logicalHeight, SegmentList&amp;) const OVERRIDE;
</span><span class="cx">     virtual bool firstIncludedIntervalLogicalTop(LayoutUnit minLogicalIntervalTop, const LayoutSize&amp; minLogicalIntervalSize, LayoutUnit&amp;) const OVERRIDE;
</span><span class="cx"> 
</span><del>-    virtual void buildPath(Path&amp;) const OVERRIDE;
</del><ins>+    virtual void buildDisplayPaths(DisplayPaths&amp;) const OVERRIDE;
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     FloatRoundedRect m_bounds;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingshapesPolygonShapecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/shapes/PolygonShape.cpp (160450 => 160451)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/shapes/PolygonShape.cpp        2013-12-11 19:49:39 UTC (rev 160450)
+++ trunk/Source/WebCore/rendering/shapes/PolygonShape.cpp        2013-12-11 21:33:08 UTC (rev 160451)
</span><span class="lines">@@ -523,19 +523,24 @@
</span><span class="cx">     return firstFitFound;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void PolygonShape::buildPath(Path&amp; path) const
</del><ins>+static void addPolygon(Path&amp; path, const FloatPolygon&amp; polygon)
</ins><span class="cx"> {
</span><del>-    FloatPoint vertex;
-
-    if (!m_polygon.numberOfVertices())
</del><ins>+    if (!polygon.numberOfVertices())
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    path.moveTo(m_polygon.vertexAt(0));
</del><ins>+    path.moveTo(polygon.vertexAt(0));
</ins><span class="cx"> 
</span><del>-    for (size_t i = 1; i &lt; m_polygon.numberOfVertices(); i++)
-        path.addLineTo(m_polygon.vertexAt(i));
</del><ins>+    for (size_t i = 1; i &lt; polygon.numberOfVertices(); i++)
+        path.addLineTo(polygon.vertexAt(i));
</ins><span class="cx"> 
</span><span class="cx">     path.closeSubpath();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void PolygonShape::buildDisplayPaths(DisplayPaths&amp; paths) const
+{
+    addPolygon(paths.shape, m_polygon);
+    if (shapeMargin())
+        addPolygon(paths.marginShape, shapeMarginBounds());
+}
+
</ins><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingshapesPolygonShapeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/shapes/PolygonShape.h (160450 => 160451)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/shapes/PolygonShape.h        2013-12-11 19:49:39 UTC (rev 160450)
+++ trunk/Source/WebCore/rendering/shapes/PolygonShape.h        2013-12-11 21:33:08 UTC (rev 160451)
</span><span class="lines">@@ -97,7 +97,7 @@
</span><span class="cx">     virtual void getIncludedIntervals(LayoutUnit logicalTop, LayoutUnit logicalHeight, SegmentList&amp;) const OVERRIDE;
</span><span class="cx">     virtual bool firstIncludedIntervalLogicalTop(LayoutUnit minLogicalIntervalTop, const LayoutSize&amp; minLogicalIntervalSize, LayoutUnit&amp;) const OVERRIDE;
</span><span class="cx"> 
</span><del>-    virtual void buildPath(Path&amp;) const OVERRIDE;
</del><ins>+    virtual void buildDisplayPaths(DisplayPaths&amp;) const OVERRIDE;
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     const FloatPolygon&amp; shapeMarginBounds() const;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingshapesRasterShapeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/shapes/RasterShape.h (160450 => 160451)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/shapes/RasterShape.h        2013-12-11 19:49:39 UTC (rev 160450)
+++ trunk/Source/WebCore/rendering/shapes/RasterShape.h        2013-12-11 21:33:08 UTC (rev 160451)
</span><span class="lines">@@ -103,7 +103,12 @@
</span><span class="cx">     virtual void getIncludedIntervals(LayoutUnit logicalTop, LayoutUnit logicalHeight, SegmentList&amp;) const OVERRIDE;
</span><span class="cx">     virtual bool firstIncludedIntervalLogicalTop(LayoutUnit minLogicalIntervalTop, const LayoutSize&amp; minLogicalIntervalSize, LayoutUnit&amp;) const OVERRIDE;
</span><span class="cx"> 
</span><del>-    virtual void buildPath(Path&amp; path) const OVERRIDE { m_intervals-&gt;buildBoundsPath(path); }
</del><ins>+    virtual void buildDisplayPaths(DisplayPaths&amp; paths) const OVERRIDE
+    {
+        m_intervals-&gt;buildBoundsPath(paths.shape);
+        if (shapeMargin())
+            marginIntervals().buildBoundsPath(paths.marginShape);
+    }
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     const RasterShapeIntervals&amp; marginIntervals() const;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingshapesRectangleShapecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/shapes/RectangleShape.cpp (160450 => 160451)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/shapes/RectangleShape.cpp        2013-12-11 19:49:39 UTC (rev 160450)
+++ trunk/Source/WebCore/rendering/shapes/RectangleShape.cpp        2013-12-11 21:33:08 UTC (rev 160451)
</span><span class="lines">@@ -228,9 +228,11 @@
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RectangleShape::buildPath(Path&amp; path) const
</del><ins>+void RectangleShape::buildDisplayPaths(DisplayPaths&amp; paths) const
</ins><span class="cx"> {
</span><del>-    path.addRoundedRect(m_bounds, FloatSize(m_bounds.rx(), m_bounds.ry()), Path::PreferBezierRoundedRect);
</del><ins>+    paths.shape.addRoundedRect(m_bounds, FloatSize(m_bounds.rx(), m_bounds.ry()), Path::PreferBezierRoundedRect);
+    if (shapeMargin())
+        paths.marginShape.addRoundedRect(shapeMarginBounds(), FloatSize(shapeMarginBounds().rx(), shapeMarginBounds().ry()), Path::PreferBezierRoundedRect);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingshapesRectangleShapeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/shapes/RectangleShape.h (160450 => 160451)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/shapes/RectangleShape.h        2013-12-11 19:49:39 UTC (rev 160450)
+++ trunk/Source/WebCore/rendering/shapes/RectangleShape.h        2013-12-11 21:33:08 UTC (rev 160451)
</span><span class="lines">@@ -56,7 +56,7 @@
</span><span class="cx">     virtual void getIncludedIntervals(LayoutUnit logicalTop, LayoutUnit logicalHeight, SegmentList&amp;) const OVERRIDE;
</span><span class="cx">     virtual bool firstIncludedIntervalLogicalTop(LayoutUnit minLogicalIntervalTop, const LayoutSize&amp; minLogicalIntervalSize, LayoutUnit&amp;) const OVERRIDE;
</span><span class="cx"> 
</span><del>-    virtual void buildPath(Path&amp;) const OVERRIDE;
</del><ins>+    virtual void buildDisplayPaths(DisplayPaths&amp;) const OVERRIDE;
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     class ShapeBounds : public FloatRect {
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingshapesShapeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/shapes/Shape.h (160450 => 160451)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/shapes/Shape.h        2013-12-11 19:49:39 UTC (rev 160450)
+++ trunk/Source/WebCore/rendering/shapes/Shape.h        2013-12-11 21:33:08 UTC (rev 160451)
</span><span class="lines">@@ -62,6 +62,11 @@
</span><span class="cx"> 
</span><span class="cx"> class Shape {
</span><span class="cx"> public:
</span><ins>+    struct DisplayPaths {
+        Path shape;
+        Path marginShape;
+    };
+
</ins><span class="cx">     static PassOwnPtr&lt;Shape&gt; createShape(const BasicShape*, const LayoutSize&amp; logicalBoxSize, WritingMode, Length margin, Length padding);
</span><span class="cx">     static PassOwnPtr&lt;Shape&gt; createShape(const StyleImage*, float threshold, const LayoutSize&amp; logicalBoxSize, WritingMode, Length margin, Length padding);
</span><span class="cx">     static PassOwnPtr&lt;Shape&gt; createShape(const RoundedRect&amp;, WritingMode, Length margin, Length padding);
</span><span class="lines">@@ -77,7 +82,7 @@
</span><span class="cx">     bool lineOverlapsShapeMarginBounds(LayoutUnit lineTop, LayoutUnit lineHeight) const { return lineOverlapsBoundingBox(lineTop, lineHeight, shapeMarginLogicalBoundingBox()); }
</span><span class="cx">     bool lineOverlapsShapePaddingBounds(LayoutUnit lineTop, LayoutUnit lineHeight) const { return lineOverlapsBoundingBox(lineTop, lineHeight, shapePaddingLogicalBoundingBox()); }
</span><span class="cx"> 
</span><del>-    virtual void buildPath(Path&amp;) const = 0;
</del><ins>+    virtual void buildDisplayPaths(DisplayPaths&amp;) const = 0;
</ins><span class="cx"> 
</span><span class="cx"> protected:
</span><span class="cx">     float shapeMargin() const { return m_margin; }
</span></span></pre>
</div>
</div>

</body>
</html>