Version: 3.1.94 (using KDE 3.1.94 (3.2 Beta 2), compiled sources) Compiler: gcc version 3.2.3 OS: Linux (i686) release 2.4.23 In tables, where rows have onmouseover="this.background.color='#(something)'" property konqueror doesn't react when mouse cursor is over the row. But if there's a link in a cell of the row some rectangular area around the link changes it's color to the desired colour, but it's still not the whole row...
Can you provide a simple test case? On what other browsers/versions does this construct work?
Here's a simple example: <table border=1> <tr onmouseover="this.style.backgroundColor='#00FF00'" onmouseout="this.style.backgroundColor='#FFFFFF'" height="100"> <td>something<td>something<td> <a href=whatever>link</a><td>something else </table> I've seen how it looks on Mozilla and IE - both highlight whole row on green when a cursor is over it. As You'll see KOnqueror will highlight only the "link" word when the mouse cursor is over it, and often won't change background of the link even when the cursor is out! That's also very important thing.
Confirmed for HEAD 20031201.
Created attachment 4205 [details] test case
This bug is still active in 3.2.2. The same goes for <TD> tags where there is linked text within. Only within the area of text does the colour change, whereas the whole TD colour should change.
*** Bug 85462 has been marked as a duplicate of this bug. ***
*** Bug 86149 has been marked as a duplicate of this bug. ***
*** Bug 89979 has been marked as a duplicate of this bug. ***
This is a regression introduced about the time of 3.2 beta2. It's still valid in 3.3.0.
This bug is still active in 3.3.1. Another example of this happening is on http://stayingslim.com in the menu on the left. In 3.3.1 the onmouseover seems to work on <td> just not on <tr>. This problem was hightlighted by some recent development work I have been involved in.
*** Bug 50921 has been marked as a duplicate of this bug. ***
*** Bug 55005 has been marked as a duplicate of this bug. ***
I think this is a bug in khtml/render/render_table The css style property is set, so from what I gather the table row merely forgets to have its child TDs repaint themselves (this is further evidenced by how the cells get their color changed when you cause a paintevent over those cells. I write this because I'm taking an interest in khtml but realise that I won't be able to fix this in just one go. Here's hoping someone gets to it first!
Created attachment 8861 [details] Patch Based on Charles description here is a crude patch that fixes the problem (and #57605 as well). Although I believe it should be done more generically and efficiently in render_container.
Created attachment 8866 [details] Another solution This patch also fixes this bug, and also 57605. It works in a totally different way
due to popular demand, I will explain my patch. When painting the Row, the Row's parent Box gets asked to do the painting. When asked to repaint itself, a Box just invalidates its whole rectangle Anyway, the Row's parent Box is the Section. And the section never sets its width, so it stays to its default of 0. This results in the invalidated rectangle being 0 width. The one inefficiency of my patch is that it repaints the entire table, not just the row that was invalidated. But OTOH, it would also fix the hypothetical state of onmouseover on the TBODY. -Charles
CVS commit by charles: fix bug: problems with displaying <tr onmouseover="this.background.color=..."> BUG:70326 BUG:57605 Allan claims this is the 3rd most "popular" khtml bug. M +7 -1 render_table.cpp 1.269 M +3 -1 render_table.h 1.109 --- kdelibs/khtml/rendering/render_table.cpp #1.268:1.269 @@ -1135,4 +1135,9 @@ void RenderTableSection::setCellWidths() } +short RenderTableSection::width() const +{ + return table()->width(); +} + void RenderTableSection::calcRowHeight() @@ -1753,4 +1758,5 @@ void RenderTableRow::layout() RenderObject *child = firstChild(); + while( child ) { if ( child->isTableCell() ) { --- kdelibs/khtml/rendering/render_table.h #1.108:1.109 @@ -229,4 +229,6 @@ public: virtual void position(InlineBox*, int, int, bool) {} + virtual short width() const; + virtual FindSelectionResult checkSelectionPoint( int _x, int _y, int _tx, int _ty, DOM::NodeImpl*& node, int & offset,
Are you sure it is really fixed? The attached test in Comment #4 still behaves differently in firefox: if you hover over a table cell the background changes to green. In khtml the background only changes if the mouse hovers over text. (Allan's and Charles' patch have the same behavior) I don't know the right behavior, so maybe this is a ff bug - dunno.
CVS commit by dhaumann: backport charles fix for bug: problems with displaying <tr onmouseover="this.background.color=..."> CCBUG:70326 CCBUG:57605 M +4 -0 render_table.cpp 1.258.2.6 M +2 -0 render_table.h 1.105.2.4 --- kdelibs/khtml/rendering/render_table.cpp #1.258.2.5:1.258.2.6 @@ -1130,4 +1130,8 @@ void RenderTableSection::setCellWidths() } +short RenderTableSection::width() const +{ + return table()->width(); +} void RenderTableSection::calcRowHeight() --- kdelibs/khtml/rendering/render_table.h #1.105.2.3:1.105.2.4 @@ -229,4 +229,6 @@ public: virtual void position(InlineBox*, int, int, bool) {} + virtual short width() const; + virtual FindSelectionResult checkSelectionPoint( int _x, int _y, int _tx, int _ty, DOM::NodeImpl*& node, int & offset,
Hmm. The reason mouseover is not activated outside "the text" is because that area is margin. Centering in table-cells is accomplished by setting the two margins to "auto". Since the margin is not part of the object, no event is generated when hovering over it. The question is then if a row should be larger the sum of its cells and include their margins?
This bug exists in HEAD as of Jan 17. The test case in comment #4 fails - note that the onmouseover and onmouseout should be activated as soon as you enter the table row - currently they only fire once you mouse over the text node. Possibly a regression? Did this work before? Note, it is likely closely tied to bug #72804
Did you read my comment? The margin of a HTML object is not treated as part of the object. You do not get mouseover event when entering the margin of any other object so why should you for table-rows?
I've studied it closer. There seems to be no official definition of a table-row besides being a container table-cells. I've even seen a test that suggest tr:hover should activate when hovering over borders between cells.
This bug is fixed in 3.4 Beta1 for me :) Glad to see a year old bug finally getting fixed.
For the margin event stuff, please see bug #72804. No need to overload this if there are already ~3 bugs specifically about that
Created attachment 9672 [details] testcase exhibiting border space handling Though [1] makes the onmouse* events react on the whole area of table cells, it still does not work in the cell spacing. Mozilla exhibits the same bug, fwiw. [1] http://webcvs.kde.org/kdelibs/khtml/rendering/render_table.cpp?r1=1.272&r2=1.273