Stop calling node() and deprecatedEditingOffset() in comparePositions
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 27 Jun 2012 00:00:52 +0000 (00:00 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 27 Jun 2012 00:00:52 +0000 (00:00 +0000)
commit3810effbb5fd2237f9d4b9ae6ccd2387278e0b74
treefa9ff2ea16ab873303ae79fd7a9b1e7be81cabd6
parentbda52d7d7aa8adc0c8ce19fe505eca15e1288327
Stop calling node() and deprecatedEditingOffset() in comparePositions
https://bugs.webkit.org/show_bug.cgi?id=54535

Reviewed by Enrica Casucci.

Source/WebCore:

Replaced deprecatedNode() and deprecatedEditingOffset() by containerNode() and computeOffsetInContainerNode()
in comparePositions().

In addition, fixed a bunch of bugs in DeleteSelectionCommand::handleSpecialCaseBRDelete revealed by this change:
- Use node after position instead of deprecated node in determinig whether start and end positions at a br.
- Don't set m_startsAtEmptyLine true when BR is wrapped in a block element. The only reason this code had worked
was positions like (div, offset, 0) and (br, before) in <div><br> were treated differently, which we no longer do.

* editing/DeleteSelectionCommand.cpp:
(WebCore::DeleteSelectionCommand::handleSpecialCaseBRDelete):
* editing/htmlediting.cpp:
(WebCore::comparePositions):

LayoutTests:

Rebaselined existing tests. There are no user-visible changes.

* editing/inseting/font-size-clears-from-typing-style-expected.txt: No longer keeps div's around
when merging paragraphs.
* platform/mac/editing/deleting/delete-br-002-expected.txt:
* platform/mac/editing/deleting/delete-br-004-expected.txt:
* platform/mac/editing/deleting/delete-br-005-expected.txt:
* platform/mac/editing/deleting/delete-br-006-expected.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@121303 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/editing/inserting/font-size-clears-from-typing-style-expected.txt
LayoutTests/platform/mac/editing/deleting/delete-br-002-expected.txt
LayoutTests/platform/mac/editing/deleting/delete-br-004-expected.txt
LayoutTests/platform/mac/editing/deleting/delete-br-005-expected.txt
LayoutTests/platform/mac/editing/deleting/delete-br-006-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/editing/DeleteSelectionCommand.cpp
Source/WebCore/editing/htmlediting.cpp