<!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 { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul, pre { 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>[23944] trunk</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/23944">23944</a></dd>
<dt>Author</dt> <dd>antti</dd>
<dt>Date</dt> <dd>2007-07-03 06:42:11 -0700 (Tue, 03 Jul 2007)</dd>
</dl>

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

        Reviewed by Maciej.
        
        Test for REGRESSION: misplaced selection ring remains after link is no longer focused.
        &lt;rdar://problem/5205580&gt;

        * fast/repaint/focus-layers-expected.checksum: Added.
        * fast/repaint/focus-layers-expected.png: Added.
        * fast/repaint/focus-layers-expected.txt: Added.
        * fast/repaint/focus-layers.html: Added.

WebCore:

        Reviewed by Maciej.
        
        REGRESSION: misplaced selection ring remains after link is no longer focused.
        &lt;rdar://problem/5205580&gt;
        
        Fix placement of selection ring when part of the ring is in a different layer.

        * rendering/RenderFlow.cpp:
        (WebCore::RenderFlow::addFocusRingRects): Get coordinates right when moving to a different layer.
        * rendering/RenderObject.cpp:
        (WebCore::RenderObject::setStyle): 
        Don't reset state variables when not necessary.  When repaint() was called at the end of setSyle() it would
        get repaint rects wrong in some cases.</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="#trunkWebCorerenderingRenderFlowcpp">trunk/WebCore/rendering/RenderFlow.cpp</a></li>
<li><a href="#trunkWebCorerenderingRenderObjectcpp">trunk/WebCore/rendering/RenderObject.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastrepaintfocuslayersexpectedchecksum">trunk/LayoutTests/fast/repaint/focus-layers-expected.checksum</a></li>
<li><a href="#trunkLayoutTestsfastrepaintfocuslayersexpectedpng">trunk/LayoutTests/fast/repaint/focus-layers-expected.png</a></li>
<li><a href="#trunkLayoutTestsfastrepaintfocuslayersexpectedtxt">trunk/LayoutTests/fast/repaint/focus-layers-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastrepaintfocuslayershtml">trunk/LayoutTests/fast/repaint/focus-layers.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (23943 => 23944)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2007-07-03 13:31:11 UTC (rev 23943)
+++ trunk/LayoutTests/ChangeLog        2007-07-03 13:42:11 UTC (rev 23944)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2007-07-03  Antti Koivisto  &lt;antti@apple.com&gt;
+
+        Reviewed by Maciej.
+        
+        Test for REGRESSION: misplaced selection ring remains after link is no longer focused.
+        &lt;rdar://problem/5205580&gt;
+
+        * fast/repaint/focus-layers-expected.checksum: Added.
+        * fast/repaint/focus-layers-expected.png: Added.
+        * fast/repaint/focus-layers-expected.txt: Added.
+        * fast/repaint/focus-layers.html: Added.
+
</ins><span class="cx"> 2007-07-02  Adam Roben  &lt;aroben@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Update the Windows Skipped list.
</span></span></pre></div>
<a id="trunkLayoutTestsfastrepaintfocuslayersexpectedchecksum"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/repaint/focus-layers-expected.checksum (0 => 23944)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/repaint/focus-layers-expected.checksum                                (rev 0)
+++ trunk/LayoutTests/fast/repaint/focus-layers-expected.checksum        2007-07-03 13:42:11 UTC (rev 23944)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+7d91c4650b664bb938a6a77525b68797
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsfastrepaintfocuslayersexpectedpng"></a>
<div class="binary"><h4>Added: trunk/LayoutTests/fast/repaint/focus-layers-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/fast/repaint/focus-layers-expected.png
</span><span class="cx">___________________________________________________________________
</span><span class="cx">Name: svn:mime-type
</span><span class="cx">   + application/octet-stream
</span><a id="trunkLayoutTestsfastrepaintfocuslayersexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/repaint/focus-layers-expected.txt (0 => 23944)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/repaint/focus-layers-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/repaint/focus-layers-expected.txt        2007-07-03 13:42:11 UTC (rev 23944)
</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
+      RenderBlock {DIV} at (0,0) size 784x18
+        RenderText {#text} at (0,0) size 35x18
+          text run at (0,0) width 35: &quot;Both &quot;
+        RenderText {#text} at (0,0) size 0x0
+layer at (8,8) size 53x22
+  RenderInline (relative positioned) {A} at (0,0) size 53x22 [color=#0000EE] [border: (2px solid #FF0000)]
+    RenderText {#text} at (37,0) size 49x18
+      text run at (37,0) width 49: &quot;this and&quot;
+layer at (45,168) size 283x22
+  RenderBlock (positioned) {SPAN} at (2,162) size 283x22 [border: (2px solid #0000FF)]
+    RenderText {#text} at (2,2) size 279x18
+      text run at (2,2) width 279: &quot;this should have correctly placed focus rings&quot;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastrepaintfocuslayershtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/repaint/focus-layers.html (0 => 23944)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/repaint/focus-layers.html                                (rev 0)
+++ trunk/LayoutTests/fast/repaint/focus-layers.html        2007-07-03 13:42:11 UTC (rev 23944)
</span><span class="lines">@@ -0,0 +1,29 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+&lt;style type=&quot;text/css&quot;&gt;
+a {
+    border: 2px solid red;
+    position:relative;
+}
+a span{
+    border: 2px solid blue;
+    white-space:nowrap;
+    position:absolute;
+    top:10em;
+    left:0;
+}
+&lt;/style&gt;
+
+&lt;/head&gt;
+&lt;body&gt;
+&lt;div&gt;
+
+Both &lt;a href=&quot;#&quot; id=link&gt;this and&lt;span&gt;this should have correctly placed focus rings&lt;/span&gt;&lt;/a&gt;    
+&lt;/div&gt;
+
+&lt;script&gt;
+document.getElementById('link').focus();
+&lt;/script&gt;
+&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/ChangeLog (23943 => 23944)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/ChangeLog        2007-07-03 13:31:11 UTC (rev 23943)
+++ trunk/WebCore/ChangeLog        2007-07-03 13:42:11 UTC (rev 23944)
</span><span class="lines">@@ -1,7 +1,23 @@
</span><span class="cx"> 2007-07-03  Antti Koivisto  &lt;antti@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Reviewed by Maciej.
</span><ins>+        
+        REGRESSION: misplaced selection ring remains after link is no longer focused.
+        &lt;rdar://problem/5205580&gt;
+        
+        Fix placement of selection ring when part of the ring is in a different layer.
</ins><span class="cx"> 
</span><ins>+        * rendering/RenderFlow.cpp:
+        (WebCore::RenderFlow::addFocusRingRects): Get coordinates right when moving to a different layer.
+        * rendering/RenderObject.cpp:
+        (WebCore::RenderObject::setStyle): 
+        Don't reset state variables when not necessary.  When repaint() was called at the end of setSyle() it would
+        get repaint rects wrong in some cases.
+
+2007-07-03  Antti Koivisto  &lt;antti@apple.com&gt;
+
+        Reviewed by Maciej.
+
</ins><span class="cx">         Blind fix for CrashTracer: [USER] 25 crashes in Safari at com.apple.WebCore: WebCore::Frame::document const + 6
</span><span class="cx">         &lt;rdar://problem/5263939&gt;
</span><span class="cx">         
</span></span></pre></div>
<a id="trunkWebCorerenderingRenderFlowcpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/rendering/RenderFlow.cpp (23943 => 23944)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/rendering/RenderFlow.cpp        2007-07-03 13:31:11 UTC (rev 23943)
+++ trunk/WebCore/rendering/RenderFlow.cpp        2007-07-03 13:42:11 UTC (rev 23944)
</span><span class="lines">@@ -689,8 +689,17 @@
</span><span class="cx">             graphicsContext-&gt;addFocusRingRect(IntRect(tx + curr-&gt;xPos(), ty + curr-&gt;yPos(), curr-&gt;width(), curr-&gt;height()));
</span><span class="cx"> 
</span><span class="cx">         for (RenderObject* curr = firstChild(); curr; curr = curr-&gt;nextSibling())
</span><del>-            if (!curr-&gt;isText() &amp;&amp; !curr-&gt;isListMarker())
-                curr-&gt;addFocusRingRects(graphicsContext, tx + curr-&gt;xPos(), ty + curr-&gt;yPos());
</del><ins>+            if (!curr-&gt;isText() &amp;&amp; !curr-&gt;isListMarker()) {
+                int x = 0;
+                int y = 0;
+                if (curr-&gt;layer()) 
+                    curr-&gt;absolutePosition(x, y);
+                else {
+                    x = tx + curr-&gt;xPos();
+                    y = ty + curr-&gt;yPos();
+                }
+                curr-&gt;addFocusRingRects(graphicsContext, x, y);
+            }
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (continuation()) {
</span></span></pre></div>
<a id="trunkWebCorerenderingRenderObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/rendering/RenderObject.cpp (23943 => 23944)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/rendering/RenderObject.cpp        2007-07-03 13:31:11 UTC (rev 23943)
+++ trunk/WebCore/rendering/RenderObject.cpp        2007-07-03 13:42:11 UTC (rev 23944)
</span><span class="lines">@@ -2274,9 +2274,11 @@
</span><span class="cx">             &amp;&amp; parent() &amp;&amp; (parent()-&gt;isBlockFlow() || parent()-&gt;isInlineFlow());
</span><span class="cx"> 
</span><span class="cx">         // reset style flags
</span><del>-        m_floating = false;
-        m_positioned = false;
-        m_relPositioned = false;
</del><ins>+        if (d == RenderStyle::Layout) {
+            m_floating = false;
+            m_positioned = false;
+            m_relPositioned = false;
+        }
</ins><span class="cx">         m_paintBackground = false;
</span><span class="cx">         m_hasOverflowClip = false;
</span><span class="cx">     }
</span></span></pre>
</div>
</div>

</body>
</html>