Hit testing on margins of body and head elements doesn't recur
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 20 Sep 2011 02:48:04 +0000 (02:48 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 20 Sep 2011 02:48:04 +0000 (02:48 +0000)
commitb03eb35f21fa0075c527f148fffeb43132e46733
treeb340dba200f38918ae7e11ad494bbe6b732c67a7
parent04cac32960dfc707b0bffaebf5aadf215d96ae9f
Hit testing on margins of body and head elements doesn't recur
https://bugs.webkit.org/show_bug.cgi?id=40753

Reviewed by Darin Adler.

Source/WebCore:

The bug was caused by positionForPointRespectingEditingBoundaries's comparing the editability
of head/body and html elements when hit testing was done inside margins of head and body elements.

Fixed the bug by special-casing html element (any immediate child of render view with a render layer)
since margins of head and body elements are special.

Tests: editing/selection/click-on-body-margin.html
       editing/selection/click-on-head-margin.html

* rendering/RenderBlock.cpp:
(WebCore::positionForPointRespectingEditingBoundaries):

LayoutTests:

Add tests to click on margins of head and body elements. WebKit should not
(attempt to) place the caret after or before head and body elements.

* editing/selection/click-on-body-margin-expected.txt: Added.
* editing/selection/click-on-body-margin.html: Added.
* editing/selection/click-on-head-margin-expected.txt: Added.
* editing/selection/click-on-head-margin.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@95509 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/editing/selection/click-on-body-margin-expected.txt [new file with mode: 0644]
LayoutTests/editing/selection/click-on-body-margin.html [new file with mode: 0644]
LayoutTests/editing/selection/click-on-head-margin-expected.txt [new file with mode: 0644]
LayoutTests/editing/selection/click-on-head-margin.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderBlock.cpp