[Webkit-unassigned] [Bug 40197] Enhance the hit testing to take a rectangle instead of a point

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jun 9 20:31:59 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=40197





--- Comment #7 from Antonio Gomes (tonikitoo) <tonikitoo at webkit.org>  2010-06-09 20:31:56 PST ---
Created an attachment (id=58324)
 --> (https://bugs.webkit.org/attachment.cgi?id=58324)
rect-based hitTest prototype patch

Hi Grace. Since I also starting to look at the same problem (last Monday), I ended up with a similar patch/prototype, but whose approach is different enough that I think it might be good to upload it so we could compare the differences and decide the way to go.

Summary of my prototype patch: main idea is to really have a rect-based HitTest system. So all revelant XXXAtPoint methods were modified to receive a Rect as parameter, instead of pointer, and renamed accordingly to XXXAtArea.

Details:
- EventHandler::hitTestResultAtPoint was also the codepath start point for my approach.

- EventHandler::hitTestResultAtArea method was added, and the previosly existing hitTestResultAtPoint just falls back to it.

- nodeAtPoint methods throughout the rendering code were renamed to nodeAtArea,
and changed to take a rect ("hitTestArea") as parameter, instead of a point ("x" and "y"). Method bodies were also adapted accordingly where needed.

- Base rendering classes like RenderObject and InlineBox still have nodeAtPoint
methods, but falling back to nodeAtArea, and of course, passing something like IntRect(x, y, 1, 1) as the hit area to it.

- The various updateHitTestResult methods were changed so that each Node whose render bounds intersects the hit test area are added into a Vector in the HitTestResult class.

- A new constructor was added HitTestResult class, receiving a IntRect as parameter.Previous existing constructors that receive a IntPoint now fallback to the new one passing IntRect(point, IntSize(1, 1)).

Limitations:
- SVG classes were not modified yet.

I ran layout tests on a Mac with the patch applied and there was no regressions. However, I have not had time to think of a good testing infrastructure for it, so no new tests were added so far.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list