Remove inline member functions of FrameSelection that access m_selection
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 1 Feb 2014 04:10:43 +0000 (04:10 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 1 Feb 2014 04:10:43 +0000 (04:10 +0000)
commit6faa490c2dd0dfe12c7aa5d2b8723d9e394b7581
treebb22b5b53ca4b49c62a083ed483c9c4b090d5869
parentf72d975dfa9e5277151510aa17b8e13acf17d556
Remove inline member functions of FrameSelection that access m_selection
https://bugs.webkit.org/show_bug.cgi?id=127986

Reviewed by Enrica Casucci.

Source/WebCore:

Removed numerous inline member functions of FrameSelection that depend on m_selection.

This is needed to ensure all accesses to m_selection happen through FrameSelection::selection(),
which in turn, allows us to update its call sites to use either validated selection that editing
and rendering code uses or invalidated selection that's exposed to JavaScript.

* WebCore.exp.in:
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper _convertToNSRange:]):
(-[WebAccessibilityObjectWrapper _convertToDOMRange:]):
* bindings/objc/DOMUIKitExtensions.mm:
(-[DOMRange move:inDirection:]):
(-[DOMRange extend:inDirection:]):
* dom/Element.cpp:
(WebCore::Element::updateFocusAppearance):
* editing/Editor.cpp:
(WebCore::Editor::canEdit):
(WebCore::Editor::canEditRichly):
(WebCore::Editor::canDHTMLCut):
(WebCore::Editor::canDHTMLCopy):
(WebCore::Editor::canCopy):
(WebCore::Editor::canDelete):
(WebCore::Editor::replaceSelectionWithFragment):
(WebCore::Editor::tryDHTMLCopy):
(WebCore::Editor::tryDHTMLCut):
(WebCore::Editor::applyStyle):
(WebCore::Editor::applyParagraphStyle):
(WebCore::Editor::cut):
(WebCore::Editor::copy):
(WebCore::Editor::paste):
(WebCore::Editor::setComposition):
(WebCore::Editor::guessesForMisspelledOrUngrammatical):
(WebCore::Editor::markMisspellingsAfterTypingToWord):
(WebCore::Editor::isSpellCheckingEnabledInFocusedNode):
(WebCore::Editor::markAndReplaceFor):
(WebCore::Editor::getCompositionSelection):
(WebCore::Editor::selectionStartHasMarkerFor):
* editing/EditorCommand.cpp:
(WebCore::expandSelectionToGranularity):
(WebCore::enabledInRichlyEditableText):
(WebCore::enabledRangeInEditableText):
(WebCore::enabledRangeInRichlyEditableText):
* editing/FrameSelection.cpp:
(WebCore::CaretBase::updateCaretRect):
(WebCore::FrameSelection::recomputeCaretRect):
(WebCore::FrameSelection::selectAll):
(WebCore::FrameSelection::updateAppearance):
(WebCore::FrameSelection::updateSelectionCachesIfSelectionIsInsideTextFormControl):
(WebCore::FrameSelection::setFocusedElementIfNeeded):
(WebCore::FrameSelection::currentForm):
(WebCore::FrameSelection::revealSelection):
(WebCore::FrameSelection::setSelectionFromNone):
* editing/FrameSelection.h:
(WebCore::FrameSelection::isCaretOrRange):
* editing/RemoveFormatCommand.cpp:
(WebCore::RemoveFormatCommand::doApply):
* editing/VisibleSelection.cpp:
(WebCore::VisibleSelection::isInPasswordField):
* editing/VisibleSelection.h:
* editing/mac/EditorMac.mm:
(WebCore::Editor::canCopyExcludingStandaloneImages):
(WebCore::Editor::readSelectionFromPasteboard):
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::defaultEventHandler):
(WebCore::HTMLAnchorElement::setActive):
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::computeSelectionStart):
(WebCore::HTMLTextFormControlElement::computeSelectionEnd):
* page/ContextMenuController.cpp:
(WebCore::ContextMenuController::contextMenuItemSelected):
(WebCore::ContextMenuController::populate):
* page/DragController.cpp:
(WebCore::DragController::dragIsMove):
(WebCore::setSelectionToDragCaret):
(WebCore::DragController::concludeEditDrag):
(WebCore::DragController::startDrag):
* page/EventHandler.cpp:
(WebCore::nodeIsNotBeingEdited):
(WebCore::EventHandler::sendContextMenuEvent):
(WebCore::EventHandler::sendContextMenuEventForKey):
(WebCore::EventHandler::handleDrag):
* page/FocusController.cpp:
(WebCore::FocusController::advanceFocusInDocumentOrder):
(WebCore::clearSelectionIfNeeded):
* page/ios/FrameIOS.mm:
(WebCore::Frame::caretRect):
(WebCore::Frame::rectForScrollToVisible):
(WebCore::Frame::styleAtSelectionStart):
(WebCore::Frame::setRangedSelectionBaseToCurrentSelectionStart):
(WebCore::Frame::setRangedSelectionBaseToCurrentSelectionEnd):
(WebCore::Frame::setRangedSelectionInitialExtentToCurrentSelectionStart):
(WebCore::Frame::setRangedSelectionInitialExtentToCurrentSelectionEnd):
(WebCore::Frame::interpretationsForCurrentRoot):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::paintCaret):

Source/WebKit/efl:

* WebCoreSupport/DumpRenderTreeSupportEfl.cpp:
(DumpRenderTreeSupportEfl::selectedRange):
* ewk/ewk_frame.cpp:
(ewk_frame_text_selection_type_get):

Source/WebKit/gtk:

* WebCoreSupport/DumpRenderTreeSupportGtk.cpp:
(DumpRenderTreeSupportGtk::selectedRange):
* WebCoreSupport/EditorClientGtk.cpp:
(WebKit::collapseSelection):

Source/WebKit/ios:

* WebCoreSupport/WebFrameIOS.mm:
(-[WebFrame extendSelection:]):
(-[WebFrame ensureRangedSelectionContainsInitialStartPoint:initialEndPoint:]):
(-[WebFrame aggressivelyExpandSelectionToWordContainingCaretSelection]):
(-[WebFrame expandSelectionToSentence]):
(-[WebFrame setBaseWritingDirection:]):
(-[WebFrame smartExtendRangedSelection:]):

Source/WebKit/mac:

* WebView/WebFrame.mm:
(-[WebFrame hasEditableSelection]):
(-[WebFrame selectionAffinity]):
(-[WebFrame getDictationResultRanges:andMetadatas:]):
(-[WebFrame hasRichlyEditableSelection]):
(-[WebFrame focusedNodeHasContent]):
* WebView/WebHTMLView.mm:
(-[WebHTMLView readSelectionFromPasteboard:]):
(-[WebHTMLView _hasSelection]):
(-[WebHTMLView _hasSelectionOrInsertionPoint]):
(-[WebHTMLView _hasInsertionPoint]):
(-[WebHTMLView _isEditable]):
(-[WebHTMLView validateUserInterfaceItemWithoutDelegate:]):
(-[WebHTMLView maintainsInactiveSelection]):
(isTextInput):
(isInPasswordField):
* WebView/WebView.mm:
(-[WebView selectionAffinity]):

Source/WebKit2:

* WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
(WebKit::collapseSelection):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::editorState):
(WebKit::WebPage::confirmComposition):
(WebKit::WebPage::setComposition):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::setComposition):
(WebKit::WebPage::updateSelectionWithTouches):
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::setComposition):
(WebKit::WebPage::getAttributedSubstringFromRange):

Tools:

* TestWebKitAPI/Configurations/Base.xcconfig:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@163232 268f45cc-cd09-0410-ab3c-d52691b4dbfc
39 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm
Source/WebCore/bindings/objc/DOMUIKitExtensions.mm
Source/WebCore/dom/Element.cpp
Source/WebCore/editing/Editor.cpp
Source/WebCore/editing/EditorCommand.cpp
Source/WebCore/editing/FrameSelection.cpp
Source/WebCore/editing/FrameSelection.h
Source/WebCore/editing/RemoveFormatCommand.cpp
Source/WebCore/editing/VisibleSelection.cpp
Source/WebCore/editing/VisibleSelection.h
Source/WebCore/editing/mac/EditorMac.mm
Source/WebCore/html/HTMLAnchorElement.cpp
Source/WebCore/html/HTMLTextFormControlElement.cpp
Source/WebCore/page/ContextMenuController.cpp
Source/WebCore/page/DragController.cpp
Source/WebCore/page/EventHandler.cpp
Source/WebCore/page/FocusController.cpp
Source/WebCore/page/ios/FrameIOS.mm
Source/WebCore/rendering/RenderBlock.cpp
Source/WebKit/efl/ChangeLog
Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp
Source/WebKit/efl/ewk/ewk_frame.cpp
Source/WebKit/gtk/ChangeLog
Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp
Source/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp
Source/WebKit/ios/ChangeLog
Source/WebKit/ios/WebCoreSupport/WebFrameIOS.mm
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebView/WebFrame.mm
Source/WebKit/mac/WebView/WebHTMLView.mm
Source/WebKit/mac/WebView/WebView.mm
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm
Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm
Tools/ChangeLog