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 22:33:48 +0000 (22:33 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 20 Sep 2011 22:33:48 +0000 (22:33 +0000)
commit5f2bfe9a491d48f4d2fe5df77a924e31c0b1bdf6
treed516636081deaddf3fb368734f250f418f366f50
parent23109ee112922e2f944174b4fd2723a5aecfa593
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 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@95574 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