[webkit-changes] cvs commit: WebCore/manual-tests
onclick_in_noncontent.html
David
harrison at opensource.apple.com
Fri Aug 19 16:38:40 PDT 2005
harrison 05/08/19 16:38:40
Modified: . ChangeLog
khtml/rendering render_block.cpp
Added: manual-tests onclick_in_noncontent.html
Log:
Reviewed by Maciej.
Landed by David Harrison.
Test cases added: Manual test because Darin saw no way to exercise the hit testing code from JavaScript.
manual-tests/onclick_in_noncontent.html: Added.
- fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3662
onClick event for TD element doesn't fire unless its contents are clicked
* khtml/rendering/render_block.cpp:
(khtml::RenderBlock::nodeAtPoint):
Take the border extra into account when hit testing just as we do when
painting the background of a table cell. OK for other renderers because
they have a border extra of 0.
Revision Changes Path
1.4607 +17 -0 WebCore/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvs/root/WebCore/ChangeLog,v
retrieving revision 1.4606
retrieving revision 1.4607
diff -u -r1.4606 -r1.4607
--- ChangeLog 19 Aug 2005 23:09:09 -0000 1.4606
+++ ChangeLog 19 Aug 2005 23:38:33 -0000 1.4607
@@ -1,3 +1,20 @@
+2005-08-19 Darin Adler <darin at apple.com>
+
+ Reviewed by Maciej.
+ Landed by David Harrison.
+
+ Test cases added: Manual test because Darin saw no way to exercise the hit testing code from JavaScript.
+ manual-tests/onclick_in_noncontent.html: Added.
+
+ - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3662
+ onClick event for TD element doesn't fire unless its contents are clicked
+
+ * khtml/rendering/render_block.cpp:
+ (khtml::RenderBlock::nodeAtPoint):
+ Take the border extra into account when hit testing just as we do when
+ painting the background of a table cell. OK for other renderers because
+ they have a border extra of 0.
+
2005-08-19 Anders Carlsson <andersca at mac.com>
Reviewed by Darin.
1.198 +2 -1 WebCore/khtml/rendering/render_block.cpp
Index: render_block.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/rendering/render_block.cpp,v
retrieving revision 1.197
retrieving revision 1.198
diff -u -r1.197 -r1.198
--- render_block.cpp 11 Aug 2005 21:37:02 -0000 1.197
+++ render_block.cpp 19 Aug 2005 23:38:39 -0000 1.198
@@ -2530,7 +2530,8 @@
// Now hit test our background.
if (!inlineFlow && (hitTestAction == HitTestBlockBackground || hitTestAction == HitTestChildBlockBackground)) {
- QRect boundsRect(tx, ty, m_width, m_height);
+ int topExtra = borderTopExtra();
+ QRect boundsRect(tx, ty - topExtra, m_width, m_height + topExtra + borderBottomExtra());
if (isRoot() || (style()->visibility() == VISIBLE && boundsRect.contains(_x, _y))) {
setInnerNode(info);
return true;
1.1 WebCore/manual-tests/onclick_in_noncontent.html
Index: onclick_in_noncontent.html
===================================================================
<html>
<head>
<script>
function displayAlert(element)
{
alert('You clicked '+element.nodeName);
}
</script>
</head>
<body>
<table style="width:100px;height:100px;border:inset">
<tr>
<td onclick="displayAlert(this)">Content.</td>
</tr>
</table>
<p>Click anywhere inside the table element and you should get an alert telling you so.</p>
<p>Bugzilla 3662 was that clicking in non-content did not fire onclick handler.</p>
</body>
</html>
More information about the webkit-changes
mailing list