Replace every use of Node::offsetInCharacters() by Node::isCharacterDataNode()
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 28 Sep 2018 19:47:22 +0000 (19:47 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 28 Sep 2018 19:47:22 +0000 (19:47 +0000)
commit0424553f17e8841bfc0623cb11984ffc1a018258
tree504d9d18ba70d65ccd11c154163a7952bd99d0f4
parent0cc2633abba4ae4f0013717553264eb6c80c9838
Replace every use of Node::offsetInCharacters() by Node::isCharacterDataNode()
https://bugs.webkit.org/show_bug.cgi?id=190069

Reviewed by Zalan Bujtas.

Removed Node::offsetInCharacters() and replaced every use of it by isCharacterDataNode()
because their implementations are identical.

Note that offsetInCharacters() sounds like a function which returns some kind of an offset
but it doesn't. It returns true when called on a CharacterData and false elsewhere.

* accessibility/AXObjectCache.cpp:
(WebCore::characterOffsetsInOrder):
(WebCore::AXObjectCache::startOrEndCharacterOffsetForRange):
(WebCore::AXObjectCache::characterOffsetFromVisiblePosition):
* dom/CharacterData.cpp:
(WebCore::CharacterData::offsetInCharacters const): Deleted.
* dom/CharacterData.h:
* dom/Node.cpp:
(WebCore::Node::offsetInCharacters const): Deleted.
* dom/Node.h:
* dom/Position.cpp:
(WebCore::Position::parentAnchoredEquivalent const):
* dom/Position.h:
(WebCore::lastOffsetInNode):
(WebCore::minOffsetForNode):
(WebCore::offsetIsBeforeLastNodeOffset):
* dom/Range.cpp:
(WebCore::Range::firstNode const):
(WebCore::Range::pastLastNode const):
* dom/RangeBoundaryPoint.h:
(WebCore::RangeBoundaryPoint::setOffset):
(WebCore::RangeBoundaryPoint::setToEndOfNode):
* editing/Editing.cpp:
(WebCore::lastOffsetForEditing):
* editing/TextIterator.cpp:
(WebCore::nextInPreOrderCrossingShadowBoundaries):
(WebCore::TextIterator::node const):
(WebCore::SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator):
* page/DOMSelection.cpp:
(WebCore::DOMSelection::extend):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236607 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AXObjectCache.cpp
Source/WebCore/dom/CharacterData.cpp
Source/WebCore/dom/CharacterData.h
Source/WebCore/dom/Node.cpp
Source/WebCore/dom/Node.h
Source/WebCore/dom/Position.cpp
Source/WebCore/dom/Position.h
Source/WebCore/dom/Range.cpp
Source/WebCore/dom/RangeBoundaryPoint.h
Source/WebCore/editing/Editing.cpp
Source/WebCore/editing/TextIterator.cpp
Source/WebCore/page/DOMSelection.cpp