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: http://svn.webkit.org/repository/webkit/trunk@163232 268f45cc-cd09-0410-ab3c-d52691b4dbfc
39 files changed