Bug 133132 - [test case] Link selection is offset from mouse pointer
Summary: [test case] Link selection is offset from mouse pointer
Status: RESOLVED FIXED
Alias: None
Product: konqueror
Classification: Applications
Component: khtml renderer (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
: 134819 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-08-28 15:21 UTC by Sonja Krause-Harder
Modified: 2006-09-29 00:53 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
testcase (539 bytes, text/html)
2006-08-28 15:21 UTC, Sonja Krause-Harder
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sonja Krause-Harder 2006-08-28 15:21:13 UTC
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.
Comment 1 Sonja Krause-Harder 2006-08-28 15:21:47 UTC
Created attachment 17528 [details]
testcase
Comment 2 Allan Sandfeld 2006-09-20 18:40:00 UTC
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;

Comment 3 Germain Garand 2006-09-20 22:49:33 UTC
> 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.
Comment 4 Allan Sandfeld 2006-09-24 18:31:13 UTC
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(); */
 }
 
Comment 5 Maksim Orlovich 2006-09-29 00:53:22 UTC
*** Bug 134819 has been marked as a duplicate of this bug. ***