Rect-based hittesting doesn't work in tables.
https://bugs.webkit.org/show_bug.cgi?id=86605
Patch by Allan Sandfeld Jensen <allan.jensen@nokia.com> on 2012-06-11
Reviewed by Julien Chaffraix.
Source/WebCore:
The existing code only performed a single binary lookup for the central
hit-test point. This meant area-based hit-testing did not work across
table-cell borders. All cells spanned by a hit-test area must be hit
tested.
This patch introduces three auxilary functions to help calculate rows
and columns spanned by an rect. These are intended to also be used by
repaint logic in a later patch.
For point-based hit-testing we maintain unchanged behavior and still
only hit test a single column in a single row.
Test: fast/dom/nodesFromRect-table.html
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::logicalRectForWritingModeAndDirection):
(WebCore::RenderTableSection::spannedRows):
(WebCore::RenderTableSection::spannedColumns):
(WebCore::RenderTableSection::nodeAtPoint):
* rendering/RenderTableSection.h:
(RenderTableSection):
LayoutTests:
Test nodesFromRect on tables.
* fast/dom/nodesFromRect-table-expected.txt: Added.
* fast/dom/nodesFromRect-table.html: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119967 268f45cc-cd09-0410-ab3c-d52691b4dbfc
6 files changed