Version: (using KDE KDE 3.5.4) Installed from: SuSE RPMs OS: Linux In the attached test case, not the link over which the mouse pointer is hovering is selected, but the one about two list items further down. If I remove the "border-bottom: 30px solid #FFF;" from the styles, the problem disappears.
Created attachment 17528 [details] testcase
The following patch fixes it, but the code was put in there by ggarand. Germain what is the intend of adding borderBottom? Index: render_layer.cpp =================================================================== --- render_layer.cpp (revision 581756) +++ render_layer.cpp (working copy) @@ -1039,8 +1039,8 @@ // Next we want to see if the mouse pos is inside the child RenderObjects of the layer. if (containsPoint(xMousePos, yMousePos, fgRect) && renderer()->nodeAtPoint(info, xMousePos, yMousePos, - layerBounds.x() - renderer()->xPos() + m_object->borderLeft(), - layerBounds.y() - renderer()->yPos() + m_object->borderTopExtra() - m_object->borderBottom(), + layerBounds.x() - renderer()->xPos() + m_object->borderLeft(), + layerBounds.y() - renderer()->yPos() + m_object->borderTopExtra(), HitTestChildrenOnly)) { if (info.innerNode() != m_object->element()) return this; @@ -1060,8 +1060,8 @@ // Next we want to see if the mouse pos is inside this layer but not any of its children. if (containsPoint(xMousePos, yMousePos, bgRect) && renderer()->nodeAtPoint(info, xMousePos, yMousePos, - layerBounds.x() - renderer()->xPos() + m_object->borderLeft(), - layerBounds.y() - renderer()->yPos() + m_object->borderTopExtra() - m_object->borderBottom(), + layerBounds.x() - renderer()->xPos() + m_object->borderLeft(), + layerBounds.y() - renderer()->yPos() + m_object->borderTopExtra(), HitTestSelfOnly)) return this;
> Germain what is the intend of adding borderBottom? none, it's a mistake. This came straight from WC/r10566/ which I recall contained other approximations - I'm afraid this one just slipped in (and I see it's been reverted since in WC/r11343/). So you can remove m_object->borderLeft() too.
SVN commit 587994 by carewolf: Don't add these borders. It's wrong. BUG:133132 M +9 -9 render_layer.cpp --- branches/KDE/3.5/kdelibs/khtml/rendering/render_layer.cpp #587993:587994 @@ -902,9 +902,9 @@ setClip(p, paintDirtyRect, clipRectToApply); RenderObject::PaintInfo paintInfo(p, clipRectToApply, PaintActionSelection); - + int tx = x - renderer()->xPos(); - int ty = y - renderer()->yPos() + renderer()->borderTopExtra(); + int ty = y - renderer()->yPos() + renderer()->borderTopExtra(); if (selectionOnly) renderer()->paint(paintInfo, tx, ty); @@ -1039,8 +1039,8 @@ // Next we want to see if the mouse pos is inside the child RenderObjects of the layer. if (containsPoint(xMousePos, yMousePos, fgRect) && renderer()->nodeAtPoint(info, xMousePos, yMousePos, - layerBounds.x() - renderer()->xPos() + m_object->borderLeft(), - layerBounds.y() - renderer()->yPos() + m_object->borderTopExtra() - m_object->borderBottom(), + layerBounds.x() - renderer()->xPos(), + layerBounds.y() - renderer()->yPos() + m_object->borderTopExtra(), HitTestChildrenOnly)) { if (info.innerNode() != m_object->element()) return this; @@ -1060,8 +1060,8 @@ // Next we want to see if the mouse pos is inside this layer but not any of its children. if (containsPoint(xMousePos, yMousePos, bgRect) && renderer()->nodeAtPoint(info, xMousePos, yMousePos, - layerBounds.x() - renderer()->xPos() + m_object->borderLeft(), - layerBounds.y() - renderer()->yPos() + m_object->borderTopExtra() - m_object->borderBottom(), + layerBounds.x() - renderer()->xPos(), + layerBounds.y() - renderer()->yPos() + m_object->borderTopExtra(), HitTestSelfOnly)) return this; @@ -1352,7 +1352,7 @@ { if (!m_overflowListDirty) return; - + for (RenderLayer* child = firstChild(); child; child = child->nextSibling()) { if (child->isOverflowOnly()) { if (!m_overflowList) @@ -1488,8 +1488,8 @@ bool RenderLayer::shouldBeOverflowOnly() const { - return renderer()->style() && renderer()->hasOverflowClip() && - !renderer()->isPositioned() && !renderer()->isRelPositioned(); + return renderer()->style() && renderer()->hasOverflowClip() && + !renderer()->isPositioned() && !renderer()->isRelPositioned(); /* && !isTransparent(); */ }
*** Bug 134819 has been marked as a duplicate of this bug. ***