<!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" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { 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, #msg p { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul { overflow: auto; }
#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>
<title>[28423] trunk</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/28423">28423</a></dd>
<dt>Author</dt> <dd>adele@apple.com</dd>
<dt>Date</dt> <dd>2007-12-04 17:08:54 -0800 (Tue, 04 Dec 2007)</dd>
</dl>

<h3>Log Message</h3>
<pre>WebCore:

        Reviewed by Darin.

        Fix for &lt;rdar://problem/5499918&gt; REGRESSION: insertion point in input field with custom border cuts holes in focus ring interior edges

        * rendering/RenderTextControl.cpp: (WebCore::RenderTextControl::setStyle):
        Adjust outline-offset so it doesn't extend beyond the border to interfere with typing

LayoutTests:

        Reviewed by Darin.

        Test for &lt;rdar://problem/5499918&gt; REGRESSION: insertion point in input field with custom border cuts holes in focus ring interior edges

        * fast/forms/textfield-outline.html: Added.
        * platform/mac/fast/forms/textfield-outline-expected.checksum: Added.
        * platform/mac/fast/forms/textfield-outline-expected.png: Added.
        * platform/mac/fast/forms/textfield-outline-expected.txt: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkWebCoreChangeLog">trunk/WebCore/ChangeLog</a></li>
<li><a href="#trunkWebCorerenderingRenderTextControlcpp">trunk/WebCore/rendering/RenderTextControl.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastformstextfieldoutlinehtml">trunk/LayoutTests/fast/forms/textfield-outline.html</a></li>
<li><a href="#trunkLayoutTestsplatformmacfastformstextfieldoutlineexpectedchecksum">trunk/LayoutTests/platform/mac/fast/forms/textfield-outline-expected.checksum</a></li>
<li><a href="#trunkLayoutTestsplatformmacfastformstextfieldoutlineexpectedpng">trunk/LayoutTests/platform/mac/fast/forms/textfield-outline-expected.png</a></li>
<li><a href="#trunkLayoutTestsplatformmacfastformstextfieldoutlineexpectedtxt">trunk/LayoutTests/platform/mac/fast/forms/textfield-outline-expected.txt</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (28422 => 28423)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2007-12-05 01:05:00 UTC (rev 28422)
+++ trunk/LayoutTests/ChangeLog        2007-12-05 01:08:54 UTC (rev 28423)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2007-12-04  Adele Peterson  &lt;adele@apple.com&gt;
+
+        Reviewed by Darin.
+
+        Test for &lt;rdar://problem/5499918&gt; REGRESSION: insertion point in input field with custom border cuts holes in focus ring interior edges
+
+        * fast/forms/textfield-outline.html: Added.
+        * platform/mac/fast/forms/textfield-outline-expected.checksum: Added.
+        * platform/mac/fast/forms/textfield-outline-expected.png: Added.
+        * platform/mac/fast/forms/textfield-outline-expected.txt: Added.
+
</ins><span class="cx"> 2007-12-04  Sam Weinig  &lt;sam@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Reviewed by Adam Roben.
</span></span></pre></div>
<a id="trunkLayoutTestsfastformstextfieldoutlinehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/forms/textfield-outline.html (0 => 28423)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/forms/textfield-outline.html                                (rev 0)
+++ trunk/LayoutTests/fast/forms/textfield-outline.html        2007-12-05 01:08:54 UTC (rev 28423)
</span><span class="lines">@@ -0,0 +1,20 @@
</span><ins>+&lt;html&gt;
+    &lt;head&gt;
+        &lt;script&gt;
+        function test()
+        {
+            var tf = document.getElementById('tf');
+            tf.focus();
+            if (window.layoutTestController) {
+                eventSender.keyDown(&quot;a&quot;);
+                eventSender.keyDown(&quot;b&quot;);
+                eventSender.keyDown(&quot;c&quot;);
+            }
+        }
+        &lt;/script&gt;
+    &lt;/head&gt;
+    &lt;body onload=&quot;test()&quot;&gt;
+        This tests that a negative outline-offset won't get in the way of a cursor in a text control.&lt;br&gt;
+        &lt;input id=&quot;tf&quot; style=&quot;font-size: 20px; border: solid thin black;&quot; value=&quot;This tests that typing doesn't cut holes in the focus outline&quot;&gt;&lt;/input&gt;
+    &lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformmacfastformstextfieldoutlineexpectedchecksum"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/mac/fast/forms/textfield-outline-expected.checksum (0 => 28423)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/fast/forms/textfield-outline-expected.checksum                                (rev 0)
+++ trunk/LayoutTests/platform/mac/fast/forms/textfield-outline-expected.checksum        2007-12-05 01:08:54 UTC (rev 28423)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+a4130e3ca141dfe0181212ace7c1f1bf
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacfastformstextfieldoutlineexpectedpng"></a>
<div class="binary"><h4>Added: trunk/LayoutTests/platform/mac/fast/forms/textfield-outline-expected.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Property changes on: trunk/LayoutTests/platform/mac/fast/forms/textfield-outline-expected.png
</span><span class="cx">___________________________________________________________________
</span><span class="cx">Name: svn:mime-type
</span><span class="cx">   + application/octet-stream
</span><a id="trunkLayoutTestsplatformmacfastformstextfieldoutlineexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/mac/fast/forms/textfield-outline-expected.txt (0 => 28423)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/fast/forms/textfield-outline-expected.txt                                (rev 0)
+++ trunk/LayoutTests/platform/mac/fast/forms/textfield-outline-expected.txt        2007-12-05 01:08:54 UTC (rev 28423)
</span><span class="lines">@@ -0,0 +1,17 @@
</span><ins>+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x584
+      RenderText {#text} at (0,0) size 550x18
+        text run at (0,0) width 550: &quot;This tests that a negative outline-offset won't get in the way of a cursor in a text control.&quot;
+      RenderBR {BR} at (550,14) size 0x0
+      RenderTextControl {INPUT} at (2,20) size 259x27 [bgcolor=#FFFFFF] [border: (1px solid #000000)]
+      RenderText {#text} at (0,0) size 0x0
+      RenderText {#text} at (0,0) size 0x0
+      RenderText {#text} at (0,0) size 0x0
+layer at (12,30) size 255x23
+  RenderBlock {DIV} at (2,2) size 255x23
+    RenderText {#text} at (1,0) size 34x23
+      text run at (1,0) width 34: &quot;abc&quot;
+caret: position 3 of child 0 {#text} of child 0 {DIV} of child 3 {INPUT} of child 1 {BODY} of child 0 {HTML} of document
</ins></span></pre></div>
<a id="trunkWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/ChangeLog (28422 => 28423)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/ChangeLog        2007-12-05 01:05:00 UTC (rev 28422)
+++ trunk/WebCore/ChangeLog        2007-12-05 01:08:54 UTC (rev 28423)
</span><span class="lines">@@ -1,3 +1,12 @@
</span><ins>+2007-12-04  Adele Peterson  &lt;adele@apple.com&gt;
+
+        Reviewed by Darin.
+
+        Fix for &lt;rdar://problem/5499918&gt; REGRESSION: insertion point in input field with custom border cuts holes in focus ring interior edges
+
+        * rendering/RenderTextControl.cpp: (WebCore::RenderTextControl::setStyle):
+        Adjust outline-offset so it doesn't extend beyond the border to interfere with typing
+
</ins><span class="cx"> 2007-12-04  Anders Carlsson  &lt;andersca@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Reviewed by Jon.
</span></span></pre></div>
<a id="trunkWebCorerenderingRenderTextControlcpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/rendering/RenderTextControl.cpp (28422 => 28423)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/rendering/RenderTextControl.cpp        2007-12-05 01:05:00 UTC (rev 28422)
+++ trunk/WebCore/rendering/RenderTextControl.cpp        2007-12-05 01:08:54 UTC (rev 28423)
</span><span class="lines">@@ -129,6 +129,11 @@
</span><span class="cx">     if (m_cancelButton)
</span><span class="cx">         m_cancelButton-&gt;renderer()-&gt;setStyle(createCancelButtonStyle(style));
</span><span class="cx"> 
</span><ins>+    // Adjust outline-offset so it doesn't extend beyond the border to interfere with typing
+    int maxBorderWidth = max(style-&gt;borderLeftWidth(), max(style-&gt;borderRightWidth(), max(style-&gt;borderTopWidth(), style-&gt;borderBottomWidth())));
+    if (style-&gt;outlineOffset() &lt; -maxBorderWidth)
+        style-&gt;setOutlineOffset(-maxBorderWidth);
+
</ins><span class="cx">     setHasOverflowClip(false);
</span><span class="cx">     setReplaced(isInline());
</span><span class="cx"> }
</span></span></pre>
</div>
</div>

</body>
</html>