Streamline use of TextIterator, cutting down includes and use of soon-to-be-deleted...
authordarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 3 Mar 2014 02:30:37 +0000 (02:30 +0000)
committerdarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 3 Mar 2014 02:30:37 +0000 (02:30 +0000)
commitf46a09233c74c93d199368fe484c51108ca40fdb
tree708ef5786c0dcde6344289bd630c901c03b458bf
parent12ecd29aae39818f272181fdcf790e16a2cfbb94
Streamline use of TextIterator, cutting down includes and use of soon-to-be-deleted functions
https://bugs.webkit.org/show_bug.cgi?id=129592

Reviewed by Sam Weinig.

Source/WebCore:

* WebCore.exp.in: Re-sorted this file. Not sure how it got unsorted.

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::stringForVisiblePositionRange): Call TextIterator::text
instead of TextIterator::length. Also removed unneeded special case for empty string
and exception code.
(WebCore::AccessibilityObject::lengthForVisiblePositionRange): Ditto.

* accessibility/AccessibilityObject.h: Include TextIteratorBehavior.h instead of
TextIterator.h.

* accessibility/AccessibilityRenderObject.cpp: Include TextIterator.h.

* accessibility/mac/WebAccessibilityObjectWrapperBase.mm: Removed unneeded
TextIterator.h include.

* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper doAXAttributedStringForTextMarkerRange:]): Call
TextIterator::text instead of TextIterator::length.

* dom/Element.cpp: Include TextIterator.h.

* dom/Node.cpp: Include Range.h.

* dom/Position.cpp:
(WebCore::Position::isCandidate): Cast to RenderBlockFlow since that's what the
type check above does. Use a return statement instead of an else for better flow.
(WebCore::Position::leadingWhitespacePosition): Call
deprecatedIsCollapsibleWhitespace by its new name (newly deprecated).
(WebCore::Position::trailingWhitespacePosition): Ditto.

* dom/Range.cpp:
(WebCore::Range::firstNode): Added a FIXME about code that clearly does not
belong. This is something we really need to fix.

* editing/AlternativeTextController.cpp: Include TextIterator.h.
* editing/ApplyStyleCommand.cpp: Ditto.

* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::prepareWhitespaceAtPositionForSplit): Call
deprecatedIsCollapsibleWhitespace by its new name (newly deprecated).

* editing/Editor.h: Include TextIteratorBehavior.h instead of TextIterator.h.

* editing/HTMLInterchange.cpp:
(WebCore::convertHTMLTextToInterchangeFormat): Call
deprecatedIsCollapsibleWhitespace by its new name (newly deprecated).

* editing/SpellingCorrectionCommand.cpp: Include TextIterator.h.

* editing/TextIterator.h: Moved isCollapsibleWhitespace from here into
htmlediting.h and renamed it deprecatedIsCollapsibleWhitespace.

* editing/TextIterator.cpp: Call
deprecatedIsCollapsibleWhitespace by its new name (newly deprecated).

* editing/TypingCommand.cpp: Include TextIterator.h.

* editing/VisibleUnits.cpp:
(WebCore::previousBoundary): Call TextIterator::text instead of
TextIterator::length.
(WebCore::nextBoundary): Ditto.

* editing/htmlediting.cpp: Include TextIterator.h.

* editing/htmlediting.h: Removed non-helpful section comments.
Added FIXME about isWhitespace. Added deprecatedIsCollapsibleWhitespace,
formerly not deprecated and in TextIterator.h.

* editing/markup.cpp: Include TextIterator.h.

* html/HTMLTextAreaElement.cpp: Include TextIterator.h.

* page/ContextMenuController.cpp:
(WebCore::selectionContainsPossibleWord): Call TextIterator::text
instead of TextIterator::length and TextIterator::characterAt.

* page/EventHandler.cpp: Sorted conditional includes alphabetically by condition.

* platform/mac/HTMLConverter.mm:
(+[WebHTMLConverter editingAttributedStringFromRange:]): Call TextIterator::text
instead of TextIterator::length.

Source/WebKit/win:

* WebCoreSupport/WebEditorClient.cpp: Added now-needed include.

Source/WebKit2:

* UIProcess/WebPageProxy.cpp: Added now-needed include.
* WebProcess/WebPage/WebPage.cpp: Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@164964 268f45cc-cd09-0410-ab3c-d52691b4dbfc
33 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/accessibility/AccessibilityObject.cpp
Source/WebCore/accessibility/AccessibilityObject.h
Source/WebCore/accessibility/AccessibilityRenderObject.cpp
Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperBase.mm
Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm
Source/WebCore/dom/Element.cpp
Source/WebCore/dom/Node.cpp
Source/WebCore/dom/Position.cpp
Source/WebCore/dom/Range.cpp
Source/WebCore/editing/AlternativeTextController.cpp
Source/WebCore/editing/ApplyStyleCommand.cpp
Source/WebCore/editing/CompositeEditCommand.cpp
Source/WebCore/editing/Editor.h
Source/WebCore/editing/HTMLInterchange.cpp
Source/WebCore/editing/SpellingCorrectionCommand.cpp
Source/WebCore/editing/TextIterator.cpp
Source/WebCore/editing/TextIterator.h
Source/WebCore/editing/TypingCommand.cpp
Source/WebCore/editing/VisibleUnits.cpp
Source/WebCore/editing/htmlediting.cpp
Source/WebCore/editing/htmlediting.h
Source/WebCore/editing/markup.cpp
Source/WebCore/html/HTMLTextAreaElement.cpp
Source/WebCore/page/ContextMenuController.cpp
Source/WebCore/page/EventHandler.cpp
Source/WebCore/platform/mac/HTMLConverter.mm
Source/WebKit/win/ChangeLog
Source/WebKit/win/WebCoreSupport/WebEditorClient.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.cpp