Incorrect rect-based hit-test result when hit-test region includes culled inlines
authorallan.jensen@digia.com <allan.jensen@digia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 27 Nov 2012 11:03:23 +0000 (11:03 +0000)
committerallan.jensen@digia.com <allan.jensen@digia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 27 Nov 2012 11:03:23 +0000 (11:03 +0000)
commit0e24a86d640d04221ea216938ae96e940736d733
tree0833b2c18cdd37dbd60c12088ff40a7ade997a7d
parentb44e22ab96614b9f0a45f7b3080ecc9c54633bcc
Incorrect rect-based hit-test result when hit-test region includes culled inlines
https://bugs.webkit.org/show_bug.cgi?id=88376

Patch by Allan Sandfeld Jensen <allan.jensen@nokia.com> on 2012-09-17
Reviewed by Dave Hyatt.

Source/WebCore:

Move the handling of culled inlines from HitTestResult::addNodeToRectBasedTestResult to
InlineFlowBox::nodeAtPoint. This makes it possible to fix a number of bugs with how
culled inlines were handled. They are now checked after all their children, and may
terminate area-based hit-testing if they contain the whole area.

Tests: fast/dom/nodesFromRect/nodesFromRect-culled-inlines.html
       fast/dom/nodesFromRect/nodesFromRect-culled-inline-with-linebreak.html

* rendering/HitTestResult.cpp:
(WebCore::HitTestLocation::HitTestLocation):
(WebCore::HitTestResult::addNodeToRectBasedTestResult):
* rendering/HitTestResult.h:
(HitTestLocation):
* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::nodeAtPoint):
* rendering/RenderInline.cpp:
(WebCore::RenderInline::hitTestCulledInline):
* rendering/RenderInline.h:
(RenderInline):

LayoutTests:

Renames the existing nodesFromRect-culled-inlines.html test to nodesFromRect-inline-image.html,
because it did not test any culled inlines anymore, and replace it with two new tests that does
test culled inlines.

* fast/dom/nodesFromRect/nodesFromRect-culled-inline-with-linebreak-expected.txt: Copied from LayoutTests/fast/dom/nodesFromRect/nodesFromRect-culled-inlines-expected.txt.
* fast/dom/nodesFromRect/nodesFromRect-culled-inline-with-linebreak.html: Added.
* fast/dom/nodesFromRect/nodesFromRect-culled-inlines-expected.txt:
* fast/dom/nodesFromRect/nodesFromRect-culled-inlines.html:
* fast/dom/nodesFromRect/nodesFromRect-inline-image-expected.txt: Added.
* fast/dom/nodesFromRect/nodesFromRect-inline-image.html: Added.
* fast/dom/nodesFromRect/resources/nodesFromRect.js:
(checkRect):
(nodesFromRectAsString):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@135841 268f45cc-cd09-0410-ab3c-d52691b4dbfc
14 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/dom/nodesFromRect/nodesFromRect-culled-inline-with-linebreak-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/nodesFromRect/nodesFromRect-culled-inline-with-linebreak.html [new file with mode: 0644]
LayoutTests/fast/dom/nodesFromRect/nodesFromRect-culled-inlines-expected.txt
LayoutTests/fast/dom/nodesFromRect/nodesFromRect-culled-inlines.html
LayoutTests/fast/dom/nodesFromRect/nodesFromRect-inline-image-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/nodesFromRect/nodesFromRect-inline-image.html [new file with mode: 0644]
LayoutTests/fast/dom/nodesFromRect/resources/nodesFromRect.js
Source/WebCore/ChangeLog
Source/WebCore/rendering/HitTestResult.cpp
Source/WebCore/rendering/HitTestResult.h
Source/WebCore/rendering/InlineFlowBox.cpp
Source/WebCore/rendering/RenderInline.cpp
Source/WebCore/rendering/RenderInline.h