Reviewed by Maciej.
Test for REGRESSION: misplaced selection ring remains after link is no longer focused.
<rdar://problem/
5205580>
* 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.
<rdar://problem/
5205580>
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.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@23944
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2007-07-03 Antti Koivisto <antti@apple.com>
+
+ Reviewed by Maciej.
+
+ Test for REGRESSION: misplaced selection ring remains after link is no longer focused.
+ <rdar://problem/5205580>
+
+ * 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.
+
2007-07-02 Adam Roben <aroben@apple.com>
Update the Windows Skipped list.
--- /dev/null
+7d91c4650b664bb938a6a77525b68797
\ No newline at end of file
--- /dev/null
+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: "Both "
+ 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: "this and"
+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: "this should have correctly placed focus rings"
--- /dev/null
+<html>
+<head>
+<style type="text/css">
+a {
+ border: 2px solid red;
+ position:relative;
+}
+a span{
+ border: 2px solid blue;
+ white-space:nowrap;
+ position:absolute;
+ top:10em;
+ left:0;
+}
+</style>
+
+</head>
+<body>
+<div>
+
+Both <a href="#" id=link>this and<span>this should have correctly placed focus rings</span></a>
+</div>
+
+<script>
+document.getElementById('link').focus();
+</script>
+</div>
+</body>
+</html>
+2007-07-03 Antti Koivisto <antti@apple.com>
+
+ Reviewed by Maciej.
+
+ REGRESSION: misplaced selection ring remains after link is no longer focused.
+ <rdar://problem/5205580>
+
+ 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.
+
2007-07-03 Antti Koivisto <antti@apple.com>
Reviewed by Maciej.
graphicsContext->addFocusRingRect(IntRect(tx + curr->xPos(), ty + curr->yPos(), curr->width(), curr->height()));
for (RenderObject* curr = firstChild(); curr; curr = curr->nextSibling())
- if (!curr->isText() && !curr->isListMarker())
- curr->addFocusRingRects(graphicsContext, tx + curr->xPos(), ty + curr->yPos());
+ if (!curr->isText() && !curr->isListMarker()) {
+ int x = 0;
+ int y = 0;
+ if (curr->layer())
+ curr->absolutePosition(x, y);
+ else {
+ x = tx + curr->xPos();
+ y = ty + curr->yPos();
+ }
+ curr->addFocusRingRects(graphicsContext, x, y);
+ }
}
if (continuation()) {
&& parent() && (parent()->isBlockFlow() || parent()->isInlineFlow());
// reset style flags
- m_floating = false;
- m_positioned = false;
- m_relPositioned = false;
+ if (d == RenderStyle::Layout) {
+ m_floating = false;
+ m_positioned = false;
+ m_relPositioned = false;
+ }
m_paintBackground = false;
m_hasOverflowClip = false;
}