<!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>[199247] 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/199247">199247</a></dd>
<dt>Author</dt> <dd>zalan@apple.com</dd>
<dt>Date</dt> <dd>2016-04-08 14:01:50 -0700 (Fri, 08 Apr 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Focus ring drawn at incorrect location on image map with CSS transform.
https://bugs.webkit.org/show_bug.cgi?id=143527
<rdar://problem/21908735>
Reviewed by Simon Fraser.
Source/WebCore:
Implement pathForFocusRing for HTMLAreaElement. It follows the logic of RenderObject::addFocusRingRects().
Tests: fast/images/image-map-outline-in-positioned-container.html
fast/images/image-map-outline-with-paint-root-offset.html
fast/images/image-map-outline-with-scale-transform.html
fast/images/image-map-outline.html
* html/HTMLAreaElement.cpp:
(WebCore::HTMLAreaElement::pathForFocusRing):
* html/HTMLAreaElement.h:
* rendering/RenderElement.cpp:
(WebCore::RenderElement::paintFocusRing): Move addFocusRingRects() out of focus ring painting.
(WebCore::RenderElement::paintOutline):
* rendering/RenderElement.h:
* rendering/RenderImage.cpp:
(WebCore::RenderImage::paint):
(WebCore::RenderImage::paintAreaElementFocusRing):
* rendering/RenderImage.h:
* rendering/RenderInline.cpp:
(WebCore::RenderInline::paintOutline):
LayoutTests:
Implement pathForFocusRing for HTMLAreaElement.
* fast/images/image-map-outline-in-positioned-container-expected.html: Added.
* fast/images/image-map-outline-in-positioned-container.html: Added.
* fast/images/image-map-outline-with-paint-root-offset-expected.html: Added.
* fast/images/image-map-outline-with-paint-root-offset.html: Added.
* fast/images/image-map-outline-with-scale-transform-expected.html: Added.
* fast/images/image-map-outline-with-scale-transform.html: Added.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsplatformiossimulatorTestExpectations">trunk/LayoutTests/platform/ios-simulator/TestExpectations</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLAreaElementcpp">trunk/Source/WebCore/html/HTMLAreaElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLAreaElementh">trunk/Source/WebCore/html/HTMLAreaElement.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderElementcpp">trunk/Source/WebCore/rendering/RenderElement.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderElementh">trunk/Source/WebCore/rendering/RenderElement.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderImagecpp">trunk/Source/WebCore/rendering/RenderImage.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderImageh">trunk/Source/WebCore/rendering/RenderImage.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderInlinecpp">trunk/Source/WebCore/rendering/RenderInline.cpp</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastimagesimagemapoutlineinpositionedcontainerexpectedhtml">trunk/LayoutTests/fast/images/image-map-outline-in-positioned-container-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastimagesimagemapoutlineinpositionedcontainerhtml">trunk/LayoutTests/fast/images/image-map-outline-in-positioned-container.html</a></li>
<li><a href="#trunkLayoutTestsfastimagesimagemapoutlinewithpaintrootoffsetexpectedhtml">trunk/LayoutTests/fast/images/image-map-outline-with-paint-root-offset-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastimagesimagemapoutlinewithpaintrootoffsethtml">trunk/LayoutTests/fast/images/image-map-outline-with-paint-root-offset.html</a></li>
<li><a href="#trunkLayoutTestsfastimagesimagemapoutlinewithscaletransformexpectedhtml">trunk/LayoutTests/fast/images/image-map-outline-with-scale-transform-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastimagesimagemapoutlinewithscaletransformhtml">trunk/LayoutTests/fast/images/image-map-outline-with-scale-transform.html</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (199246 => 199247)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-04-08 20:59:51 UTC (rev 199246)
+++ trunk/LayoutTests/ChangeLog        2016-04-08 21:01:50 UTC (rev 199247)
</span><span class="lines">@@ -1,3 +1,20 @@
</span><ins>+2016-04-08 Zalan Bujtas <zalan@apple.com>
+
+ Focus ring drawn at incorrect location on image map with CSS transform.
+ https://bugs.webkit.org/show_bug.cgi?id=143527
+ <rdar://problem/21908735>
+
+ Reviewed by Simon Fraser.
+
+ Implement pathForFocusRing for HTMLAreaElement.
+
+ * fast/images/image-map-outline-in-positioned-container-expected.html: Added.
+ * fast/images/image-map-outline-in-positioned-container.html: Added.
+ * fast/images/image-map-outline-with-paint-root-offset-expected.html: Added.
+ * fast/images/image-map-outline-with-paint-root-offset.html: Added.
+ * fast/images/image-map-outline-with-scale-transform-expected.html: Added.
+ * fast/images/image-map-outline-with-scale-transform.html: Added.
+
</ins><span class="cx"> 2016-04-08 Filip Pizlo <fpizlo@apple.com>
</span><span class="cx">
</span><span class="cx"> Add IC support for arguments.length
</span></span></pre></div>
<a id="trunkLayoutTestsfastimagesimagemapoutlineinpositionedcontainerexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/images/image-map-outline-in-positioned-container-expected.html (0 => 199247)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/images/image-map-outline-in-positioned-container-expected.html         (rev 0)
+++ trunk/LayoutTests/fast/images/image-map-outline-in-positioned-container-expected.html        2016-04-08 21:01:50 UTC (rev 199247)
</span><span class="lines">@@ -0,0 +1,26 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<title>This tests that we paint area outline properly when the image is inside positioned containers.</title>
+<style>
+img {
+ position: absolute;
+ top: 30px;
+ left: 30px;
+}
+
+div {
+ position: absolute;
+ top: 35px;
+ left: 35px;
+ width: 20px;
+ height: 20px;
+        outline: auto;
+}
+</style>
+</head>
+<body>
+<img src="./resources/green.jpg" width=50 height=50>
+<div></div>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsfastimagesimagemapoutlineinpositionedcontainerhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/images/image-map-outline-in-positioned-container.html (0 => 199247)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/images/image-map-outline-in-positioned-container.html         (rev 0)
+++ trunk/LayoutTests/fast/images/image-map-outline-in-positioned-container.html        2016-04-08 21:01:50 UTC (rev 199247)
</span><span class="lines">@@ -0,0 +1,32 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<title>This tests that we paint area outline properly when the image is inside positioned containers.</title>
+<style>
+.container {
+ position: absolute;
+ left: 20px;
+ top: 20px;
+}
+
+.inner {
+ position: absolute;
+ left: 10px;
+ top: 10px;
+}
+</style>
+<script>
+window.onload = function() {
+ document.getElementById("area").focus();
+}
+</script>
+</head>
+<body>
+<div class=container>
+ <div class=inner>
+ <img src="./resources/green.jpg" width=50 height=50 usemap="#map"/>
+ <map name="map"><area id=area shape="rectangle" coords="5, 5, 25, 25" href="#"></map>
+ </div>
+</div>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsfastimagesimagemapoutlinewithpaintrootoffsetexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/images/image-map-outline-with-paint-root-offset-expected.html (0 => 199247)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/images/image-map-outline-with-paint-root-offset-expected.html         (rev 0)
+++ trunk/LayoutTests/fast/images/image-map-outline-with-paint-root-offset-expected.html        2016-04-08 21:01:50 UTC (rev 199247)
</span><span class="lines">@@ -0,0 +1,25 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<title>This tests that we paint area outline properly when the paintroot is shifted.</title>
+<style>
+img {
+ position: absolute;
+ top: 5px;
+ left: 5px;
+}
+div {
+ position: absolute;
+ top: 10px;
+ left: 10px;
+ width: 20px;
+ height: 20px;
+        outline: auto;
+}
+</style>
+</head>
+<body>
+<img src="./resources/green.jpg" width=50 height=50>
+<div></div>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsfastimagesimagemapoutlinewithpaintrootoffsethtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/images/image-map-outline-with-paint-root-offset.html (0 => 199247)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/images/image-map-outline-with-paint-root-offset.html         (rev 0)
+++ trunk/LayoutTests/fast/images/image-map-outline-with-paint-root-offset.html        2016-04-08 21:01:50 UTC (rev 199247)
</span><span class="lines">@@ -0,0 +1,25 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<title>This tests that we paint area outline properly when the paintroot is shifted.</title>
+<style>
+.paintroot {
+ transform: translateZ(0);
+ position: absolute;
+ left: 5px;
+ top: 5px;
+}
+</style>
+<script>
+window.onload = function() {
+ document.getElementById("area").focus();
+}
+</script>
+</head>
+<body>
+<div class=paintroot>
+ <img src="./resources/green.jpg" width=50 height=50 usemap="#map"/>
+ <map name="map"><area id=area shape="rectangle" coords="5, 5, 25, 25" href="#"></map>
+</div>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsfastimagesimagemapoutlinewithscaletransformexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/images/image-map-outline-with-scale-transform-expected.html (0 => 199247)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/images/image-map-outline-with-scale-transform-expected.html         (rev 0)
+++ trunk/LayoutTests/fast/images/image-map-outline-with-scale-transform-expected.html        2016-04-08 21:01:50 UTC (rev 199247)
</span><span class="lines">@@ -0,0 +1,26 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<title>This tests that we paint area outline properly when the image's container is scaled.</title>
+<style>
+img {
+ position: absolute;
+ top: 23px;
+ left: 25px;
+}
+
+div {
+ position: absolute;
+ top: 33px;
+ left: 35px;
+ width: 40px;
+ height: 40px;
+        outline: auto;
+}
+</style>
+</head>
+<body>
+<img src="./resources/green.jpg" width=100 height=100>
+<div></div>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsfastimagesimagemapoutlinewithscaletransformhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/images/image-map-outline-with-scale-transform.html (0 => 199247)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/images/image-map-outline-with-scale-transform.html         (rev 0)
+++ trunk/LayoutTests/fast/images/image-map-outline-with-scale-transform.html        2016-04-08 21:01:50 UTC (rev 199247)
</span><span class="lines">@@ -0,0 +1,25 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<title>This tests that we paint area outline properly when the image's container is scaled.</title>
+<style>
+.container {
+ transform: scale(2);
+ position: absolute;
+ left: 50px;
+ top: 50px;
+}
+</style>
+<script>
+window.onload = function() {
+ document.getElementById("area").focus();
+}
+</script>
+</head>
+<body>
+<div class=container>
+ <img src="./resources/green.jpg" width=50 height=50 usemap="#map"/>
+ <map name="map"><area id=area shape="rectangle" coords="5, 5, 25, 25" href="#"></map>
+</div>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformiossimulatorTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/ios-simulator/TestExpectations (199246 => 199247)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-simulator/TestExpectations        2016-04-08 20:59:51 UTC (rev 199246)
+++ trunk/LayoutTests/platform/ios-simulator/TestExpectations        2016-04-08 21:01:50 UTC (rev 199247)
</span><span class="lines">@@ -3022,3 +3022,9 @@
</span><span class="cx"> # iOS list box controls are not drawn in the standard way.
</span><span class="cx"> fast/forms/listbox-padding-clip.html [ ImageOnlyFailure ]
</span><span class="cx"> fast/forms/listbox-padding-clip-overlay.html [ ImageOnlyFailure ]
</span><ins>+
+# No focusring on iOS.
+fast/images/image-map-outline-in-positioned-container.html [ Pass ImageOnlyFailure ]
+fast/images/image-map-outline-with-paint-root-offset.html [ Pass ImageOnlyFailure ]
+fast/images/image-map-outline-with-scale-transform.html [ Pass ImageOnlyFailure ]
+
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (199246 => 199247)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-04-08 20:59:51 UTC (rev 199246)
+++ trunk/Source/WebCore/ChangeLog        2016-04-08 21:01:50 UTC (rev 199247)
</span><span class="lines">@@ -1,3 +1,32 @@
</span><ins>+2016-04-08 Zalan Bujtas <zalan@apple.com>
+
+ Focus ring drawn at incorrect location on image map with CSS transform.
+ https://bugs.webkit.org/show_bug.cgi?id=143527
+ <rdar://problem/21908735>
+
+ Reviewed by Simon Fraser.
+
+ Implement pathForFocusRing for HTMLAreaElement. It follows the logic of RenderObject::addFocusRingRects().
+
+ Tests: fast/images/image-map-outline-in-positioned-container.html
+ fast/images/image-map-outline-with-paint-root-offset.html
+ fast/images/image-map-outline-with-scale-transform.html
+ fast/images/image-map-outline.html
+
+ * html/HTMLAreaElement.cpp:
+ (WebCore::HTMLAreaElement::pathForFocusRing):
+ * html/HTMLAreaElement.h:
+ * rendering/RenderElement.cpp:
+ (WebCore::RenderElement::paintFocusRing): Move addFocusRingRects() out of focus ring painting.
+ (WebCore::RenderElement::paintOutline):
+ * rendering/RenderElement.h:
+ * rendering/RenderImage.cpp:
+ (WebCore::RenderImage::paint):
+ (WebCore::RenderImage::paintAreaElementFocusRing):
+ * rendering/RenderImage.h:
+ * rendering/RenderInline.cpp:
+ (WebCore::RenderInline::paintOutline):
+
</ins><span class="cx"> 2016-04-08 Brent Fulgham <bfulgham@apple.com>
</span><span class="cx">
</span><span class="cx"> [WK1] Wheel event callback removing the window causes crash in WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLAreaElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLAreaElement.cpp (199246 => 199247)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLAreaElement.cpp        2016-04-08 20:59:51 UTC (rev 199246)
+++ trunk/Source/WebCore/html/HTMLAreaElement.cpp        2016-04-08 21:01:50 UTC (rev 199247)
</span><span class="lines">@@ -116,6 +116,11 @@
</span><span class="cx"> return p;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+Path HTMLAreaElement::computePathForFocusRing(const LayoutSize& elementSize) const
+{
+ return getRegion(m_shape == Default ? elementSize : m_lastSize);
+}
+
</ins><span class="cx"> // FIXME: Use RenderElement* instead of RenderObject* once we upstream iOS's DOMUIKitExtensions.{h, mm}.
</span><span class="cx"> LayoutRect HTMLAreaElement::computeRect(RenderObject* obj) const
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLAreaElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLAreaElement.h (199246 => 199247)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLAreaElement.h        2016-04-08 20:59:51 UTC (rev 199246)
+++ trunk/Source/WebCore/html/HTMLAreaElement.h        2016-04-08 21:01:50 UTC (rev 199247)
</span><span class="lines">@@ -44,6 +44,7 @@
</span><span class="cx"> // FIXME: Use RenderElement* instead of RenderObject* once we upstream iOS's DOMUIKitExtensions.{h, mm}.
</span><span class="cx"> LayoutRect computeRect(RenderObject*) const;
</span><span class="cx"> Path computePath(RenderObject*) const;
</span><ins>+ Path computePathForFocusRing(const LayoutSize& elementSize) const;
</ins><span class="cx">
</span><span class="cx"> // The parent map's image.
</span><span class="cx"> HTMLImageElement* imageElement() const;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderElement.cpp (199246 => 199247)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderElement.cpp        2016-04-08 20:59:51 UTC (rev 199246)
+++ trunk/Source/WebCore/rendering/RenderElement.cpp        2016-04-08 21:01:50 UTC (rev 199247)
</span><span class="lines">@@ -2040,12 +2040,9 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void RenderElement::paintFocusRing(PaintInfo& paintInfo, const LayoutPoint& paintOffset, const RenderStyle& style)
</del><ins>+void RenderElement::paintFocusRing(PaintInfo& paintInfo, const RenderStyle& style, const Vector<LayoutRect>& focusRingRects)
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(style.outlineStyleIsAuto());
</span><del>-
- Vector<LayoutRect> focusRingRects;
- addFocusRingRects(focusRingRects, paintOffset, paintInfo.paintContainer);
</del><span class="cx"> float outlineOffset = style.outlineOffset();
</span><span class="cx"> Vector<FloatRect> pixelSnappedFocusRingRects;
</span><span class="cx"> float deviceScaleFactor = document().deviceScaleFactor();
</span><span class="lines">@@ -2086,8 +2083,11 @@
</span><span class="cx"> float outlineOffset = floorToDevicePixel(styleToUse.outlineOffset(), document().deviceScaleFactor());
</span><span class="cx">
</span><span class="cx"> // Only paint the focus ring by hand if the theme isn't able to draw it.
</span><del>- if (styleToUse.outlineStyleIsAuto() && !theme().supportsFocusRing(styleToUse))
- paintFocusRing(paintInfo, paintRect.location(), styleToUse);
</del><ins>+ if (styleToUse.outlineStyleIsAuto() && !theme().supportsFocusRing(styleToUse)) {
+ Vector<LayoutRect> focusRingRects;
+ addFocusRingRects(focusRingRects, paintRect.location(), paintInfo.paintContainer);
+ paintFocusRing(paintInfo, styleToUse, focusRingRects);
+ }
</ins><span class="cx">
</span><span class="cx"> if (hasOutlineAnnotation() && !styleToUse.outlineStyleIsAuto() && !theme().supportsFocusRing(styleToUse))
</span><span class="cx"> addPDFURLRect(paintInfo, paintRect.location());
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderElement.h (199246 => 199247)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderElement.h        2016-04-08 20:59:51 UTC (rev 199246)
+++ trunk/Source/WebCore/rendering/RenderElement.h        2016-04-08 21:01:50 UTC (rev 199247)
</span><span class="lines">@@ -267,7 +267,7 @@
</span><span class="cx"> unsigned renderBlockFlowLineLayoutPath() const { return m_renderBlockFlowLineLayoutPath; }
</span><span class="cx"> bool renderBlockFlowHasMarkupTruncation() const { return m_renderBlockFlowHasMarkupTruncation; }
</span><span class="cx">
</span><del>- void paintFocusRing(PaintInfo&, const LayoutPoint&, const RenderStyle&);
</del><ins>+ void paintFocusRing(PaintInfo&, const RenderStyle&, const Vector<LayoutRect>& focusRingRects);
</ins><span class="cx"> void paintOutline(PaintInfo&, const LayoutRect&);
</span><span class="cx"> void updateOutlineAutoAncestor(bool hasOutlineAuto) const;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderImagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderImage.cpp (199246 => 199247)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderImage.cpp        2016-04-08 20:59:51 UTC (rev 199246)
+++ trunk/Source/WebCore/rendering/RenderImage.cpp        2016-04-08 21:01:50 UTC (rev 199247)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx">
</span><span class="cx"> #include "BitmapImage.h"
</span><span class="cx"> #include "CachedImage.h"
</span><ins>+#include "FocusController.h"
</ins><span class="cx"> #include "FontCache.h"
</span><span class="cx"> #include "FontCascade.h"
</span><span class="cx"> #include "Frame.h"
</span><span class="lines">@@ -484,13 +485,14 @@
</span><span class="cx"> RenderReplaced::paint(paintInfo, paintOffset);
</span><span class="cx">
</span><span class="cx"> if (paintInfo.phase == PaintPhaseOutline)
</span><del>- paintAreaElementFocusRing(paintInfo);
</del><ins>+ paintAreaElementFocusRing(paintInfo, paintOffset);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void RenderImage::paintAreaElementFocusRing(PaintInfo& paintInfo)
</del><ins>+void RenderImage::paintAreaElementFocusRing(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
</ins><span class="cx"> {
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx"> UNUSED_PARAM(paintInfo);
</span><ins>+ UNUSED_PARAM(paintOffset);
</ins><span class="cx"> #else
</span><span class="cx"> if (document().printing() || !frame().selection().isFocusedAndActive())
</span><span class="cx"> return;
</span><span class="lines">@@ -498,6 +500,9 @@
</span><span class="cx"> if (paintInfo.context().paintingDisabled() && !paintInfo.context().updatingControlTints())
</span><span class="cx"> return;
</span><span class="cx">
</span><ins>+ if (!document().page())
+ return;
+
</ins><span class="cx"> Element* focusedElement = document().focusedElement();
</span><span class="cx"> if (!is<HTMLAreaElement>(focusedElement))
</span><span class="cx"> return;
</span><span class="lines">@@ -506,24 +511,37 @@
</span><span class="cx"> if (areaElement.imageElement() != element())
</span><span class="cx"> return;
</span><span class="cx">
</span><ins>+ auto* areaElementStyle = areaElement.computedStyle();
+ if (!areaElementStyle)
+ return;
+
+ float outlineWidth = areaElementStyle->outlineWidth();
+ if (!outlineWidth)
+ return;
+
</ins><span class="cx"> // Even if the theme handles focus ring drawing for entire elements, it won't do it for
</span><span class="cx"> // an area within an image, so we don't call RenderTheme::supportsFocusRing here.
</span><del>-
- Path path = areaElement.computePath(this);
</del><ins>+ auto path = areaElement.computePathForFocusRing(size());
</ins><span class="cx"> if (path.isEmpty())
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- // FIXME: Do we need additional code to clip the path to the image's bounding box?
</del><ins>+ AffineTransform zoomTransform;
+ zoomTransform.scale(style().effectiveZoom());
+ path.transform(zoomTransform);
</ins><span class="cx">
</span><del>- RenderStyle* areaElementStyle = areaElement.computedStyle();
- float outlineWidth = areaElementStyle->outlineWidth();
- if (!outlineWidth)
- return;
</del><ins>+ auto adjustedOffset = paintOffset;
+ adjustedOffset.moveBy(location());
+ path.translate(toFloatSize(adjustedOffset));
</ins><span class="cx">
</span><del>- paintInfo.context().drawFocusRing(path, outlineWidth,
- areaElementStyle->outlineOffset(),
- areaElementStyle->visitedDependentColor(CSSPropertyOutlineColor));
</del><ins>+#if PLATFORM(MAC)
+ bool needsRepaint;
+ paintInfo.context().drawFocusRing(path, document().page()->focusController().timeSinceFocusWasSet(), needsRepaint);
+ if (needsRepaint)
+ document().page()->focusController().setFocusedElementNeedsRepaint();
+#else
+ paintInfo.context().drawFocusRing(path, outlineWidth, areaElementStyle->outlineOffset(), areaElementStyle->visitedDependentColor(CSSPropertyOutlineColor));
</ins><span class="cx"> #endif
</span><ins>+#endif
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void RenderImage::areaElementFocusChanged(HTMLAreaElement* element)
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderImageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderImage.h (199246 => 199247)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderImage.h        2016-04-08 20:59:51 UTC (rev 199246)
+++ trunk/Source/WebCore/rendering/RenderImage.h        2016-04-08 21:01:50 UTC (rev 199247)
</span><span class="lines">@@ -117,7 +117,7 @@
</span><span class="cx"> // Update the size of the image to be rendered. Object-fit may cause this to be different from the CSS box's content rect.
</span><span class="cx"> void updateInnerContentRect();
</span><span class="cx">
</span><del>- void paintAreaElementFocusRing(PaintInfo&);
</del><ins>+ void paintAreaElementFocusRing(PaintInfo&, const LayoutPoint& paintOffset);
</ins><span class="cx">
</span><span class="cx"> void layoutShadowControls(const LayoutSize& oldSize);
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderInlinecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderInline.cpp (199246 => 199247)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderInline.cpp        2016-04-08 20:59:51 UTC (rev 199246)
+++ trunk/Source/WebCore/rendering/RenderInline.cpp        2016-04-08 21:01:50 UTC (rev 199247)
</span><span class="lines">@@ -1603,8 +1603,11 @@
</span><span class="cx">
</span><span class="cx"> RenderStyle& styleToUse = style();
</span><span class="cx"> // Only paint the focus ring by hand if the theme isn't able to draw it.
</span><del>- if (styleToUse.outlineStyleIsAuto() && !theme().supportsFocusRing(styleToUse))
- paintFocusRing(paintInfo, paintOffset, styleToUse);
</del><ins>+ if (styleToUse.outlineStyleIsAuto() && !theme().supportsFocusRing(styleToUse)) {
+ Vector<LayoutRect> focusRingRects;
+ addFocusRingRects(focusRingRects, paintOffset, paintInfo.paintContainer);
+ paintFocusRing(paintInfo, styleToUse, focusRingRects);
+ }
</ins><span class="cx">
</span><span class="cx"> if (hasOutlineAnnotation() && !styleToUse.outlineStyleIsAuto() && !theme().supportsFocusRing(styleToUse))
</span><span class="cx"> addPDFURLRect(paintInfo, paintOffset);
</span></span></pre>
</div>
</div>
</body>
</html>