After copy and paste, cursor may appear to be above the bottom of content
authormmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 22 Feb 2014 03:14:13 +0000 (03:14 +0000)
committermmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 22 Feb 2014 03:14:13 +0000 (03:14 +0000)
commitee2ed0a61550e328b43af6cbbe0f8c2a1532af29
tree3889fdd00d57b53ea3310be89cdb3861ac7d1373
parentbcadf243ef06bb029dea99ff5b79fa1530af673c
After copy and paste, cursor may appear to be above the bottom of content
https://bugs.webkit.org/show_bug.cgi?id=129167

Reviewed by Ryosuke Niwa.

Source/WebCore:

Adding a clear:both to the end of content.

I can't handle the case of the cursor appearing above the bottom of
absolutely positioned divs (of the case of floats inside absolutely
positioned divs) because you can't know where the bottom of a div
will end up being rendered (it is affected by things like browser
window width and text size settings). Therefore, the only case I
can handle is the case where there is a floating div in the same
level as the document itself.

Test: editing/pasteboard/copy-paste-inserts-clearing-div.html

* editing/EditingStyle.cpp:
(WebCore::EditingStyle::isFloating):
* editing/EditingStyle.h:
* editing/markup.cpp:
(WebCore::StyledMarkupAccumulator::StyledMarkupAccumulator):
(WebCore::StyledMarkupAccumulator::appendElement):
(WebCore::createMarkupInternal):

LayoutTests:

Makes sure that the clearing div is inserted.

* editing/pasteboard/copy-paste-inserts-clearing-div-expected.txt: Added.
* editing/pasteboard/copy-paste-inserts-clearing-div.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@164521 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/editing/pasteboard/copy-paste-inserts-clearing-div-expected.txt [new file with mode: 0644]
LayoutTests/editing/pasteboard/copy-paste-inserts-clearing-div.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/editing/EditingStyle.cpp
Source/WebCore/editing/EditingStyle.h
Source/WebCore/editing/markup.cpp