Incorrect selection with absolutely positioned div
https://bugs.webkit.org/show_bug.cgi?id=39503
Reviewed by Kenneth Rohde Christiansen.
Source/WebCore:
The bug was caused by a false assumption in RenderBlock::positionForPoint. Because the last child box
can be positioned, floated, invisible, etc..., we can't always trust last child's logicalTop to tell us
whether a given point is inside or below the last child box.
Fixed the bug by using the last hit-test candidate instead.
Test: editing/selection/block-with-positioned-lastchild.html
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::positionForPoint):
LayoutTests:
Added a regression test for placing the caret inside a block with multiple logical lines
with an absolutely positioned last child. WebKit should place the caret on the left of the first line
(instead of after the last line) when the user clicks on the left of the first line.
* editing/selection/block-with-positioned-lastchild-expected.txt: Added.
* editing/selection/block-with-positioned-lastchild.html: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@95478
268f45cc-cd09-0410-ab3c-
d52691b4dbfc