WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Cleanup
bug-127986-20140130234825.patch (text/plain), 72.45 KB, created by
Ryosuke Niwa
on 2014-01-30 23:48:26 PST
(
hide
)
Description:
Cleanup
Filename:
MIME Type:
Creator:
Ryosuke Niwa
Created:
2014-01-30 23:48:26 PST
Size:
72.45 KB
patch
obsolete
>Index: Source/WebCore/ChangeLog >=================================================================== >--- Source/WebCore/ChangeLog (revision 163163) >+++ Source/WebCore/ChangeLog (working copy) >@@ -1,3 +1,105 @@ >+2014-01-30 Ryosuke Niwa <rniwa@webkit.org> >+ >+ Remove inline member functions of FrameSelection that access m_selection >+ https://bugs.webkit.org/show_bug.cgi?id=127986 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ 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:]): >+ * 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::FrameSelection::setSelection): >+ (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): >+ (WebCore::FrameSelection::wordSelectionContainingCaretSelection): >+ * 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): >+ > 2014-01-30 Simon Fraser <simon.fraser@apple.com> > > Fix iOS build after r163156. >Index: Source/WebCore/WebCore.exp.in >=================================================================== >--- Source/WebCore/WebCore.exp.in (revision 163128) >+++ Source/WebCore/WebCore.exp.in (working copy) >@@ -1534,7 +1534,6 @@ __ZNK7WebCore14DocumentLoader9isLoadingE > __ZNK7WebCore14DocumentMarker11descriptionEv > __ZNK7WebCore14FrameSelection11currentFormEv > __ZNK7WebCore14FrameSelection15copyTypingStyleEv >-__ZNK7WebCore14FrameSelection17isInPasswordFieldEv > __ZNK7WebCore14FrameSelection18isFocusedAndActiveEv > __ZNK7WebCore14FrameSelection31getClippedVisibleTextRectanglesERN3WTF6VectorINS_9FloatRectELm0ENS1_15CrashOnOverflowEEE > __ZNK7WebCore14FrameSelection36rootEditableElementOrDocumentElementEv >@@ -1613,6 +1612,7 @@ __ZNK7WebCore16IconDatabaseBase12databas > __ZNK7WebCore16ResourceResponse13nsURLResponseEv > __ZNK7WebCore16ResourceResponse16certificateChainEv > __ZNK7WebCore16VisibleSelection17isContentEditableEv >+__ZNK7WebCore16VisibleSelection17isInPasswordFieldEv > __ZNK7WebCore16VisibleSelection17toNormalizedRangeEv > __ZNK7WebCore16VisibleSelection19rootEditableElementEv > __ZNK7WebCore16VisibleSelection23isContentRichlyEditableEv >Index: Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm >=================================================================== >--- Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm (revision 163128) >+++ Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm (working copy) >@@ -1641,9 +1641,7 @@ - (NSRange)_convertToNSRange:(Range *)ra > return NSMakeRange(NSNotFound, 0); > > Document* document = m_object->document(); >- FrameSelection& frameSelection = document->frame()->selection(); >- >- Element* selectionRoot = frameSelection.rootEditableElement(); >+ Element* selectionRoot = document->frame()->selection().selection().rootEditableElement(); > Element* scope = selectionRoot ? selectionRoot : document->documentElement(); > > // Mouse events may cause TSM to attempt to create an NSRange for a portion of the view >@@ -1679,8 +1677,7 @@ - (PassRefPtr<Range>)_convertToDOMRange: > // to use the root editable element of the selection start as the positional base. > // That fits with AppKit's idea of an input context. > Document* document = m_object->document(); >- FrameSelection& frameSelection = document->frame()->selection(); >- Element* selectionRoot = frameSelection.rootEditableElement(); >+ Element* selectionRoot = document->frame()->selection().selection().rootEditableElement(); > Element* scope = selectionRoot ? selectionRoot : document->documentElement(); > return TextIterator::rangeFromLocationAndLength(scope, nsrange.location, nsrange.length); > } >Index: Source/WebCore/dom/Element.cpp >=================================================================== >--- Source/WebCore/dom/Element.cpp (revision 163128) >+++ Source/WebCore/dom/Element.cpp (working copy) >@@ -2007,7 +2007,7 @@ void Element::updateFocusAppearance(bool > return; > > // When focusing an editable element in an iframe, don't reset the selection if it already contains a selection. >- if (this == frame->selection().rootEditableElement()) >+ if (this == frame->selection().selection().rootEditableElement()) > return; > > // FIXME: We should restore the previous selection if there is one. >Index: Source/WebCore/editing/Editor.cpp >=================================================================== >--- Source/WebCore/editing/Editor.cpp (revision 163128) >+++ Source/WebCore/editing/Editor.cpp (working copy) >@@ -286,12 +286,12 @@ bool Editor::handleTextEvent(TextEvent* > > bool Editor::canEdit() const > { >- return m_frame.selection().rootEditableElement(); >+ return m_frame.selection().selection().rootEditableElement(); > } > > bool Editor::canEditRichly() const > { >- return m_frame.selection().isContentRichlyEditable(); >+ return m_frame.selection().selection().isContentRichlyEditable(); > } > > // WinIE uses onbeforecut and onbeforepaste to enables the cut and paste menu items. They >@@ -301,12 +301,12 @@ bool Editor::canEditRichly() const > > bool Editor::canDHTMLCut() > { >- return !m_frame.selection().isInPasswordField() && !dispatchCPPEvent(eventNames().beforecutEvent, ClipboardNumb); >+ return !m_frame.selection().selection().isInPasswordField() && !dispatchCPPEvent(eventNames().beforecutEvent, ClipboardNumb); > } > > bool Editor::canDHTMLCopy() > { >- return !m_frame.selection().isInPasswordField() && !dispatchCPPEvent(eventNames().beforecopyEvent, ClipboardNumb); >+ return !m_frame.selection().selection().isInPasswordField() && !dispatchCPPEvent(eventNames().beforecopyEvent, ClipboardNumb); > } > > bool Editor::canDHTMLPaste() >@@ -340,7 +340,7 @@ bool Editor::canCopy() const > { > if (imageElementFromImageDocument(document())) > return true; >- FrameSelection& selection = m_frame.selection(); >+ const VisibleSelection& selection = m_frame.selection().selection(); > return selection.isRange() && !selection.isInPasswordField(); > } > >@@ -351,7 +351,7 @@ bool Editor::canPaste() const > > bool Editor::canDelete() const > { >- FrameSelection& selection = m_frame.selection(); >+ const VisibleSelection& selection = m_frame.selection().selection(); > return selection.isRange() && selection.rootEditableElement(); > } > >@@ -598,7 +598,8 @@ bool Editor::shouldInsertFragment(PassRe > > void Editor::replaceSelectionWithFragment(PassRefPtr<DocumentFragment> fragment, bool selectReplacement, bool smartReplace, bool matchStyle) > { >- if (m_frame.selection().isNone() || !m_frame.selection().isContentEditable() || !fragment) >+ VisibleSelection selection = m_frame.selection().selection(); >+ if (selection.isNone() || !selection.isContentEditable() || !fragment) > return; > > ReplaceSelectionCommand::CommandOptions options = ReplaceSelectionCommand::PreventNesting | ReplaceSelectionCommand::SanitizeFragment; >@@ -611,9 +612,10 @@ void Editor::replaceSelectionWithFragmen > applyCommand(ReplaceSelectionCommand::create(document(), fragment, options, EditActionPaste)); > revealSelectionAfterEditingOperation(); > >- if (m_frame.selection().isInPasswordField() || !isContinuousSpellCheckingEnabled()) >+ selection = m_frame.selection().selection(); >+ if (selection.isInPasswordField() || !isContinuousSpellCheckingEnabled()) > return; >- Node* nodeToCheck = m_frame.selection().rootEditableElement(); >+ Node* nodeToCheck = selection.rootEditableElement(); > if (!nodeToCheck) > return; > >@@ -728,7 +730,7 @@ bool Editor::shouldDeleteRange(Range* ra > > bool Editor::tryDHTMLCopy() > { >- if (m_frame.selection().isInPasswordField()) >+ if (m_frame.selection().selection().isInPasswordField()) > return false; > > return !dispatchCPPEvent(eventNames().copyEvent, ClipboardWritable); >@@ -736,7 +738,7 @@ bool Editor::tryDHTMLCopy() > > bool Editor::tryDHTMLCut() > { >- if (m_frame.selection().isInPasswordField()) >+ if (m_frame.selection().selection().isInPasswordField()) > return false; > > return !dispatchCPPEvent(eventNames().cutEvent, ClipboardWritable); >@@ -970,7 +972,7 @@ Node* Editor::findEventTargetFromSelecti > > void Editor::applyStyle(StyleProperties* style, EditAction editingAction) > { >- switch (m_frame.selection().selectionType()) { >+ switch (m_frame.selection().selection().selectionType()) { > case VisibleSelection::NoSelection: > // do nothing > break; >@@ -991,7 +993,7 @@ bool Editor::shouldApplyStyle(StylePrope > > void Editor::applyParagraphStyle(StyleProperties* style, EditAction editingAction) > { >- switch (m_frame.selection().selectionType()) { >+ switch (m_frame.selection().selection().selectionType()) { > case VisibleSelection::NoSelection: > // do nothing > break; >@@ -1280,7 +1282,7 @@ void Editor::cut() > willWriteSelectionToPasteboard(selection); > if (shouldDeleteRange(selection.get())) { > updateMarkersForWordsAffectedByEditing(true); >- if (enclosingTextFormControl(m_frame.selection().start())) >+ if (enclosingTextFormControl(m_frame.selection().selection().start())) > Pasteboard::createForCopyAndPaste()->writePlainText(selectedTextForClipboard(), canSmartCopyOrDelete() ? Pasteboard::CanSmartReplace : Pasteboard::CannotSmartReplace); > else { > #if PLATFORM(MAC) || PLATFORM(EFL) >@@ -1305,7 +1307,7 @@ void Editor::copy() > } > > willWriteSelectionToPasteboard(selectedRange()); >- if (enclosingTextFormControl(m_frame.selection().start())) { >+ if (enclosingTextFormControl(m_frame.selection().selection().start())) { > Pasteboard::createForCopyAndPaste()->writePlainText(selectedTextForClipboard(), > canSmartCopyOrDelete() ? Pasteboard::CanSmartReplace : Pasteboard::CannotSmartReplace); > } else { >@@ -1342,7 +1344,7 @@ void Editor::paste(Pasteboard& pasteboar > updateMarkersForWordsAffectedByEditing(false); > CachedResourceLoader* loader = document().cachedResourceLoader(); > ResourceCacheValidationSuppressor validationSuppressor(loader); >- if (m_frame.selection().isContentRichlyEditable()) >+ if (m_frame.selection().selection().isContentRichlyEditable()) > pasteWithPasteboard(&pasteboard, true); > else > pasteAsPlainTextWithPasteboard(pasteboard); >@@ -1842,8 +1844,8 @@ void Editor::setComposition(const String > TypingCommand::insertText(document(), text, TypingCommand::SelectInsertedText | TypingCommand::PreventSpellChecking, TypingCommand::TextCompositionUpdate); > > // Find out what node has the composition now. >- Position base = m_frame.selection().base().downstream(); >- Position extent = m_frame.selection().extent(); >+ Position base = m_frame.selection().selection().base().downstream(); >+ Position extent = m_frame.selection().selection().extent(); > Node* baseNode = base.deprecatedNode(); > unsigned baseOffset = base.deprecatedEditingOffset(); > Node* extentNode = extent.deprecatedNode(); >@@ -2161,13 +2163,13 @@ Vector<String> Editor::guessesForMisspel > { > if (unifiedTextCheckerEnabled()) { > RefPtr<Range> range; >- FrameSelection& frameSelection = m_frame.selection(); >- if (frameSelection.isCaret() && behavior().shouldAllowSpellingSuggestionsWithoutSelection()) { >- VisibleSelection wordSelection = VisibleSelection(frameSelection.base()); >+ VisibleSelection selection = m_frame.selection().selection(); >+ if (selection.isCaret() && behavior().shouldAllowSpellingSuggestionsWithoutSelection()) { >+ VisibleSelection wordSelection = VisibleSelection(selection.base()); > wordSelection.expandUsingGranularity(WordGranularity); > range = wordSelection.toNormalizedRange(); > } else >- range = frameSelection.toNormalizedRange(); >+ range = selection.toNormalizedRange(); > if (!range) > return Vector<String>(); > return TextCheckingHelper(client(), range).guessesForMisspelledOrUngrammaticalRange(isGrammarCheckingEnabled(), misspelled, ungrammatical); >@@ -2301,7 +2303,7 @@ void Editor::markMisspellingsAfterTyping > m_frame.editor().replaceSelectionWithText(autocorrectedString, false, false); > > // Reset the charet one character further. >- m_frame.selection().moveTo(m_frame.selection().end()); >+ m_frame.selection().moveTo(m_frame.selection().selection().end()); > m_frame.selection().modify(FrameSelection::AlterationMove, DirectionForward, CharacterGranularity); > } > >@@ -2370,7 +2372,7 @@ bool Editor::isSpellCheckingEnabledFor(N > > bool Editor::isSpellCheckingEnabledInFocusedNode() const > { >- return isSpellCheckingEnabledFor(m_frame.selection().start().deprecatedNode()); >+ return isSpellCheckingEnabledFor(m_frame.selection().selection().start().deprecatedNode()); > } > > void Editor::markMisspellings(const VisibleSelection& selection, RefPtr<Range>& firstMisspellingRange) >@@ -2494,9 +2496,9 @@ void Editor::markAndReplaceFor(PassRefPt > bool adjustSelectionForParagraphBoundaries = false; > > if (shouldPerformReplacement || shouldMarkSpelling || shouldCheckForCorrection) { >- if (m_frame.selection().selectionType() == VisibleSelection::CaretSelection) { >+ if (m_frame.selection().selection().selectionType() == VisibleSelection::CaretSelection) { > // Attempt to save the caret position so we can restore it later if needed >- Position caretPosition = m_frame.selection().end(); >+ Position caretPosition = m_frame.selection().selection().end(); > selectionOffset = paragraph.offsetTo(caretPosition, ASSERT_NO_EXCEPTION); > restoreSelectionAfterChange = true; > if (selectionOffset > 0 && (selectionOffset > paragraph.textLength() || paragraph.textCharAt(selectionOffset - 1) == newlineCharacter)) >@@ -2625,7 +2627,7 @@ void Editor::markAndReplaceFor(PassRefPt > m_frame.selection().modify(FrameSelection::AlterationMove, DirectionForward, CharacterGranularity); > } else { > // If this fails for any reason, the fallback is to go one position beyond the last replacement >- m_frame.selection().moveTo(m_frame.selection().end()); >+ m_frame.selection().moveTo(m_frame.selection().selection().end()); > m_frame.selection().modify(FrameSelection::AlterationMove, DirectionForward, CharacterGranularity); > } > } >@@ -2822,10 +2824,11 @@ bool Editor::getCompositionSelection(uns > { > if (!m_compositionNode) > return false; >- Position start = m_frame.selection().start(); >+ const VisibleSelection& selection = m_frame.selection().selection(); >+ Position start = selection.start(); > if (start.deprecatedNode() != m_compositionNode) > return false; >- Position end = m_frame.selection().end(); >+ Position end = selection.end(); > if (end.deprecatedNode() != m_compositionNode) > return false; > >@@ -3382,7 +3385,7 @@ static Node* findFirstMarkable(Node* nod > > bool Editor::selectionStartHasMarkerFor(DocumentMarker::MarkerType markerType, int from, int length) const > { >- Node* node = findFirstMarkable(m_frame.selection().start().deprecatedNode()); >+ Node* node = findFirstMarkable(m_frame.selection().selection().start().deprecatedNode()); > if (!node) > return false; > >Index: Source/WebCore/editing/EditorCommand.cpp >=================================================================== >--- Source/WebCore/editing/EditorCommand.cpp (revision 163128) >+++ Source/WebCore/editing/EditorCommand.cpp (working copy) >@@ -215,8 +215,8 @@ static bool expandSelectionToGranularity > return false; > if (newRange->collapsed(IGNORE_EXCEPTION)) > return false; >- RefPtr<Range> oldRange = frame.selection().selection().toNormalizedRange(); >- EAffinity affinity = frame.selection().affinity(); >+ RefPtr<Range> oldRange = selection.toNormalizedRange(); >+ EAffinity affinity = selection.affinity(); > if (!frame.editor().client()->shouldChangeSelectedRange(oldRange.get(), newRange.get(), affinity, false)) > return false; > frame.selection().setSelectedRange(newRange.get(), affinity, true); >@@ -1297,7 +1297,8 @@ static bool enabledInEditableTextOrCaret > > static bool enabledInRichlyEditableText(Frame& frame, Event*, EditorCommandSource) > { >- return frame.selection().isCaretOrRange() && frame.selection().isContentRichlyEditable() && frame.selection().rootEditableElement(); >+ const VisibleSelection& selection = frame.selection().selection(); >+ return selection.isCaretOrRange() && selection.isContentRichlyEditable() && selection.rootEditableElement(); > } > > static bool enabledPaste(Frame& frame, Event*, EditorCommandSource) >@@ -1307,12 +1308,12 @@ static bool enabledPaste(Frame& frame, E > > static bool enabledRangeInEditableText(Frame& frame, Event*, EditorCommandSource) > { >- return frame.selection().isRange() && frame.selection().isContentEditable(); >+ return frame.selection().isRange() && frame.selection().selection().isContentEditable(); > } > > static bool enabledRangeInRichlyEditableText(Frame& frame, Event*, EditorCommandSource) > { >- return frame.selection().isRange() && frame.selection().isContentRichlyEditable(); >+ return frame.selection().isRange() && frame.selection().selection().isContentRichlyEditable(); > } > > static bool enabledRedo(Frame& frame, Event*, EditorCommandSource) >Index: Source/WebCore/editing/FrameSelection.cpp >=================================================================== >--- Source/WebCore/editing/FrameSelection.cpp (revision 163128) >+++ Source/WebCore/editing/FrameSelection.cpp (working copy) >@@ -302,6 +302,7 @@ void FrameSelection::setSelection(const > VisibleSelection oldSelection = m_selection; > > m_selection = s; >+ > setCaretRectNeedsUpdate(); > > if (!s.isNone() && !(options & DoNotSetFocus)) >@@ -1307,7 +1308,7 @@ static RenderObject* caretRenderer(Node* > > bool CaretBase::updateCaretRect(Document* document, const VisiblePosition& caretPosition) > { >- document->updateStyleIfNeeded(); >+ document->updateLayoutIgnorePendingStylesheets(); > m_caretLocalRect = LayoutRect(); > > m_caretRectNeedsUpdate = false; >@@ -1426,7 +1427,7 @@ bool FrameSelection::recomputeCaretRect( > > #if ENABLE(TEXT_CARET) > if (RenderView* view = m_frame->document()->renderView()) { >- bool previousOrNewCaretNodeIsContentEditable = isContentEditable() || (m_previousCaretNode && m_previousCaretNode->isContentEditable()); >+ bool previousOrNewCaretNodeIsContentEditable = selection().isContentEditable() || (m_previousCaretNode && m_previousCaretNode->isContentEditable()); > if (shouldRepaintCaret(view, previousOrNewCaretNodeIsContentEditable)) { > if (m_previousCaretNode) > repaintCaretForLocalRect(m_previousCaretNode.get(), oldRect); >@@ -1675,7 +1676,7 @@ void FrameSelection::selectAll() > > RefPtr<Node> root = 0; > Node* selectStartTarget = 0; >- if (isContentEditable()) { >+ if (m_selection.isContentEditable()) { > root = highestEditableRoot(m_selection.start()); > if (Node* shadowRoot = m_selection.nonBoundaryShadowTreeRootNode()) > selectStartTarget = shadowRoot->shadowHost(); >@@ -1733,12 +1734,6 @@ bool FrameSelection::setSelectedRange(Ra > return true; > } > >-bool FrameSelection::isInPasswordField() const >-{ >- HTMLTextFormControlElement* textControl = enclosingTextFormControl(start()); >- return textControl && isHTMLInputElement(textControl) && toHTMLInputElement(textControl)->isPasswordField(); >-} >- > void FrameSelection::focusedOrActiveStateChanged() > { > bool activeAndFocused = isFocusedAndActive(); >@@ -1813,8 +1808,9 @@ void FrameSelection::updateAppearance() > > // Paint a block cursor instead of a caret in overtype mode unless the caret is at the end of a line (in this case > // the FrameSelection will paint a blinking caret as usual). >+ VisibleSelection oldSelection = selection(); > VisiblePosition forwardPosition; >- if (m_shouldShowBlockCursor && m_selection.isCaret()) { >+ if (m_shouldShowBlockCursor && oldSelection.isCaret()) { > forwardPosition = modifyExtendingForward(CharacterGranularity); > m_caretPaint = forwardPosition.isNull(); > } >@@ -1823,7 +1819,7 @@ void FrameSelection::updateAppearance() > bool caretRectChangedOrCleared = recomputeCaretRect(); > > bool caretBrowsing = m_frame->settings().caretBrowsingEnabled(); >- bool shouldBlink = caretIsVisible() && isCaret() && (isContentEditable() || caretBrowsing) && forwardPosition.isNull(); >+ bool shouldBlink = caretIsVisible() && isCaret() && (oldSelection.isContentEditable() || caretBrowsing) && forwardPosition.isNull(); > > // If the caret moved, stop the blink timer so we can restart with a > // black caret in the new location. >@@ -1849,7 +1845,7 @@ void FrameSelection::updateAppearance() > > // Construct a new VisibleSolution, since m_selection is not necessarily valid, and the following steps > // assume a valid selection. See <https://bugs.webkit.org/show_bug.cgi?id=69563> and <rdar://problem/10232866>. >- VisibleSelection selection(m_selection.visibleStart(), forwardPosition.isNotNull() ? forwardPosition : m_selection.visibleEnd()); >+ VisibleSelection selection(oldSelection.visibleStart(), forwardPosition.isNotNull() ? forwardPosition : oldSelection.visibleEnd()); > > if (!selection.isRange()) { > view->clearSelection(); >@@ -1912,7 +1908,7 @@ void FrameSelection::caretBlinkTimerFire > > void FrameSelection::updateSelectionCachesIfSelectionIsInsideTextFormControl(EUserTriggered userTriggered) > { >- if (HTMLTextFormControlElement* textControl = enclosingTextFormControl(start())) >+ if (HTMLTextFormControlElement* textControl = enclosingTextFormControl(m_selection.start())) > textControl->selectionChanged(userTriggered == UserTriggered); > } > >@@ -1936,13 +1932,13 @@ void FrameSelection::setFocusedElementIf > > bool caretBrowsing = m_frame->settings().caretBrowsingEnabled(); > if (caretBrowsing) { >- if (Element* anchor = enclosingAnchorElement(base())) { >+ if (Element* anchor = enclosingAnchorElement(m_selection.base())) { > m_frame->page()->focusController().setFocusedElement(anchor, m_frame); > return; > } > } > >- if (Element* target = rootEditableElement()) { >+ if (Element* target = m_selection.rootEditableElement()) { > // Walk up the DOM tree to search for an element to focus. > while (target) { > // We don't want to set focus on a subframe when selecting in a parent frame, >@@ -2054,7 +2050,7 @@ HTMLFormElement* FrameSelection::current > // Start looking either at the active (first responder) node, or where the selection is. > Element* start = m_frame->document()->focusedElement(); > if (!start) >- start = this->start().element(); >+ start = m_selection.start().element(); > if (!start) > return nullptr; > >@@ -2071,18 +2067,18 @@ void FrameSelection::revealSelection(con > { > LayoutRect rect; > >- switch (selectionType()) { >+ switch (m_selection.selectionType()) { > case VisibleSelection::NoSelection: > return; > case VisibleSelection::CaretSelection: > rect = absoluteCaretBounds(); > break; > case VisibleSelection::RangeSelection: >- rect = revealExtentOption == RevealExtent ? VisiblePosition(extent()).absoluteCaretBounds() : enclosingIntRect(bounds(false)); >+ rect = revealExtentOption == RevealExtent ? VisiblePosition(m_selection.extent()).absoluteCaretBounds() : enclosingIntRect(bounds(false)); > break; > } > >- Position start = this->start(); >+ Position start = m_selection.start(); > ASSERT(start.deprecatedNode()); > if (start.deprecatedNode() && start.deprecatedNode()->renderer()) { > #if PLATFORM(IOS) >@@ -2117,7 +2113,7 @@ void FrameSelection::setSelectionFromNon > if (!isNone() || !(document->hasEditableStyle() || caretBrowsing)) > return; > #else >- if (!document || !(isNone() || isStartOfDocument(VisiblePosition(selection().start(), selection().affinity()))) || !document->hasEditableStyle()) >+ if (!document || !(isNone() || isStartOfDocument(VisiblePosition(m_selection.start(), m_selection.affinity()))) || !document->hasEditableStyle()) > return; > #endif > >@@ -2431,8 +2427,8 @@ VisibleSelection FrameSelection::wordSel > newSelection.expandUsingGranularity(WordGranularity); > frameSelection.setSelection(newSelection, CloseTyping | ClearTypingStyle, AlignCursorOnScrollIfNeeded, frameSelection.granularity()); > >- Position startPos(frameSelection.selection().start()); >- Position endPos(frameSelection.selection().end()); >+ Position startPos(frameSelection.selection().selection().start()); >+ Position endPos(frameSelection.selection().selection().end()); > > // Expansion cannot be allowed to change selection so that it is no longer > // touches (or contains) the original, unexpanded selection. >@@ -2479,8 +2475,8 @@ VisibleSelection FrameSelection::wordSel > } > frameSelection.moveTo(startVisiblePos); > frameSelection.modify(FrameSelection::AlterationExtend, DirectionBackward, WordGranularity); >- startPos = frameSelection.selection().start(); >- endPos = frameSelection.selection().end(); >+ startPos = frameSelection.selection().selection().start(); >+ endPos = frameSelection.selection().selection().end(); > startVisiblePos = VisiblePosition(startPos, VP_DEFAULT_AFFINITY); > endVisiblePos = VisiblePosition(endPos, VP_DEFAULT_AFFINITY); > if (startVisiblePos.isNull() || endVisiblePos.isNull()) { >Index: Source/WebCore/editing/FrameSelection.h >=================================================================== >--- Source/WebCore/editing/FrameSelection.h (revision 163128) >+++ Source/WebCore/editing/FrameSelection.h (working copy) >@@ -135,12 +135,7 @@ public: > > explicit FrameSelection(Frame* = 0); > >- Element* rootEditableElement() const { return m_selection.rootEditableElement(); } > Element* rootEditableElementOrDocumentElement() const; >- >- bool hasEditableStyle() const { return m_selection.hasEditableStyle(); } >- bool isContentEditable() const { return m_selection.isContentEditable(); } >- bool isContentRichlyEditable() const { return m_selection.isContentRichlyEditable(); } > > void moveTo(const Range*, EAffinity, EUserTriggered = NotUserTriggered); > void moveTo(const VisiblePosition&, EUserTriggered = NotUserTriggered, CursorAlignOnScroll = AlignCursorOnScrollIfNeeded); >@@ -157,10 +152,6 @@ public: > > bool contains(const LayoutPoint&); > >- VisibleSelection::SelectionType selectionType() const { return m_selection.selectionType(); } >- >- EAffinity affinity() const { return m_selection.affinity(); } >- > bool modify(EAlteration, SelectionDirection, TextGranularity, EUserTriggered = NotUserTriggered); > enum VerticalDirection { DirectionUp, DirectionDown }; > bool modify(EAlteration, unsigned verticalDistance, VerticalDirection, EUserTriggered = NotUserTriggered, CursorAlignOnScroll = AlignCursorOnScrollIfNeeded); >@@ -175,9 +166,6 @@ public: > void setExtent(const VisiblePosition&, EUserTriggered = NotUserTriggered); > void setExtent(const Position&, EAffinity, EUserTriggered = NotUserTriggered); > >- Position base() const { return m_selection.base(); } >- Position extent() const { return m_selection.extent(); } >- Position start() const { return m_selection.start(); } > Position end() const { return m_selection.end(); } > > // Return the renderer that is responsible for painting the caret (in the selection start node) >@@ -196,7 +184,6 @@ public: > bool isCaret() const { return m_selection.isCaret(); } > bool isRange() const { return m_selection.isRange(); } > bool isCaretOrRange() const { return m_selection.isCaretOrRange(); } >- bool isInPasswordField() const; > bool isAll(EditingBoundaryCrossingRule rule = CannotCrossEditingBoundary) const { return m_selection.isAll(rule); } > > PassRefPtr<Range> toNormalizedRange() const { return m_selection.toNormalizedRange(); } >@@ -335,6 +322,7 @@ private: > LayoutUnit m_xPosForVerticalArrowNavigation; > > VisibleSelection m_selection; >+ mutable VisibleSelection m_validatedSelectionCache; > VisiblePosition m_originalBase; // Used to store base before the adjustment at bidi boundary > TextGranularity m_granularity; > >@@ -391,4 +379,4 @@ void showTree(const WebCore::FrameSelect > void showTree(const WebCore::FrameSelection*); > #endif > >-#endif // FrameSelection_h >+#endif // FrameSelection >Index: Source/WebCore/editing/RemoveFormatCommand.cpp >=================================================================== >--- Source/WebCore/editing/RemoveFormatCommand.cpp (revision 163128) >+++ Source/WebCore/editing/RemoveFormatCommand.cpp (working copy) >@@ -77,12 +77,12 @@ static bool isElementForRemoveFormatComm > > void RemoveFormatCommand::doApply() > { >- if (!frame().selection().selection().isNonOrphanedCaretOrRange()) >+ if (!endingSelection().isNonOrphanedCaretOrRange()) > return; > > // Get the default style for this editable root, it's the style that we'll give the > // content that we're operating on. >- Node* root = frame().selection().rootEditableElement(); >+ Node* root = endingSelection().rootEditableElement(); > RefPtr<EditingStyle> defaultStyle = EditingStyle::create(root); > > // We want to remove everything but transparent background. >Index: Source/WebCore/editing/VisibleSelection.cpp >=================================================================== >--- Source/WebCore/editing/VisibleSelection.cpp (revision 163128) >+++ Source/WebCore/editing/VisibleSelection.cpp (working copy) >@@ -28,6 +28,7 @@ > > #include "Document.h" > #include "Element.h" >+#include "HTMLInputElement.h" > #include "TextIterator.h" > #include "VisibleUnits.h" > #include "htmlediting.h" >@@ -666,6 +667,12 @@ Node* VisibleSelection::nonBoundaryShado > return start().deprecatedNode() ? start().deprecatedNode()->nonBoundaryShadowTreeRootNode() : 0; > } > >+bool VisibleSelection::isInPasswordField() const >+{ >+ HTMLTextFormControlElement* textControl = enclosingTextFormControl(start()); >+ return textControl && isHTMLInputElement(textControl) && toHTMLInputElement(textControl)->isPasswordField(); >+} >+ > #ifndef NDEBUG > > void VisibleSelection::debugPosition() const >Index: Source/WebCore/editing/VisibleSelection.h >=================================================================== >--- Source/WebCore/editing/VisibleSelection.h (revision 163128) >+++ Source/WebCore/editing/VisibleSelection.h (working copy) >@@ -105,6 +105,8 @@ public: > // ShadowRoot node for new shadow trees, or 0 for non-shadow trees. > Node* nonBoundaryShadowTreeRootNode() const; > >+ bool isInPasswordField() const; >+ > #ifndef NDEBUG > void debugPosition() const; > void formatForDebugger(char* buffer, unsigned length) const; >Index: Source/WebCore/editing/mac/EditorMac.mm >=================================================================== >--- Source/WebCore/editing/mac/EditorMac.mm (revision 163128) >+++ Source/WebCore/editing/mac/EditorMac.mm (working copy) >@@ -239,7 +239,7 @@ NSDictionary* Editor::fontAttributesForS > > bool Editor::canCopyExcludingStandaloneImages() > { >- FrameSelection& selection = m_frame.selection(); >+ const VisibleSelection& selection = m_frame.selection().selection(); > return selection.isRange() && !selection.isInPasswordField(); > } > >@@ -259,7 +259,7 @@ void Editor::takeFindStringFromSelection > void Editor::readSelectionFromPasteboard(const String& pasteboardName) > { > Pasteboard pasteboard(pasteboardName); >- if (m_frame.selection().isContentRichlyEditable()) >+ if (m_frame.selection().selection().isContentRichlyEditable()) > pasteWithPasteboard(&pasteboard, true); > else > pasteAsPlainTextWithPasteboard(pasteboard); >Index: Source/WebCore/html/HTMLAnchorElement.cpp >=================================================================== >--- Source/WebCore/html/HTMLAnchorElement.cpp (revision 163128) >+++ Source/WebCore/html/HTMLAnchorElement.cpp (working copy) >@@ -195,7 +195,7 @@ void HTMLAnchorElement::defaultEventHand > // This keeps track of the editable block that the selection was in (if it was in one) just before the link was clicked > // for the LiveWhenNotFocused editable link behavior > if (event->type() == eventNames().mousedownEvent && event->isMouseEvent() && static_cast<MouseEvent*>(event)->button() != RightButton && document().frame()) { >- setRootEditableElementForSelectionOnMouseDown(document().frame()->selection().rootEditableElement()); >+ setRootEditableElementForSelectionOnMouseDown(document().frame()->selection().selection().rootEditableElement()); > m_wasShiftKeyDownOnMouseDown = static_cast<MouseEvent*>(event)->shiftKey(); > } else if (event->type() == eventNames().mouseoverEvent) { > // These are cleared on mouseover and not mouseout because their values are needed for drag events, >@@ -228,7 +228,7 @@ void HTMLAnchorElement::setActive(bool d > // Don't set the link to be active if the current selection is in the same editable block as > // this link > case EditableLinkLiveWhenNotFocused: >- if (down && document().frame() && document().frame()->selection().rootEditableElement() == rootEditableElement()) >+ if (down && document().frame() && document().frame()->selection().selection().rootEditableElement() == rootEditableElement()) > return; > break; > >Index: Source/WebCore/html/HTMLTextFormControlElement.cpp >=================================================================== >--- Source/WebCore/html/HTMLTextFormControlElement.cpp (revision 163128) >+++ Source/WebCore/html/HTMLTextFormControlElement.cpp (working copy) >@@ -356,7 +356,7 @@ int HTMLTextFormControlElement::computeS > if (!frame) > return 0; > >- return indexForVisiblePosition(frame->selection().start()); >+ return indexForVisiblePosition(frame->selection().selection().start()); > } > > int HTMLTextFormControlElement::selectionEnd() const >@@ -375,7 +375,7 @@ int HTMLTextFormControlElement::computeS > if (!frame) > return 0; > >- return indexForVisiblePosition(frame->selection().end()); >+ return indexForVisiblePosition(frame->selection().selection().end()); > } > > static const AtomicString& directionString(TextFieldSelectionDirection direction) >Index: Source/WebCore/page/ContextMenuController.cpp >=================================================================== >--- Source/WebCore/page/ContextMenuController.cpp (revision 163128) >+++ Source/WebCore/page/ContextMenuController.cpp (working copy) >@@ -341,15 +341,15 @@ void ContextMenuController::contextMenuI > break; > #endif > case ContextMenuItemTagSpellingGuess: { >- FrameSelection& frameSelection = frame->selection(); >- if (frame->editor().shouldInsertText(item->title(), frameSelection.toNormalizedRange().get(), EditorInsertActionPasted)) { >+ VisibleSelection selection = frame->selection().selection(); >+ if (frame->editor().shouldInsertText(item->title(), selection.toNormalizedRange().get(), EditorInsertActionPasted)) { > ReplaceSelectionCommand::CommandOptions replaceOptions = ReplaceSelectionCommand::MatchStyle | ReplaceSelectionCommand::PreventNesting; > > if (frame->editor().behavior().shouldAllowSpellingSuggestionsWithoutSelection()) { >- ASSERT(frameSelection.isCaretOrRange()); >- VisibleSelection wordSelection(frameSelection.base()); >+ ASSERT(selection.isCaretOrRange()); >+ VisibleSelection wordSelection(selection.base()); > wordSelection.expandUsingGranularity(WordGranularity); >- frameSelection.setSelection(wordSelection); >+ frame->selection().setSelection(wordSelection); > } else { > ASSERT(frame->editor().selectedText().length()); > replaceOptions |= ReplaceSelectionCommand::SelectReplacement; >@@ -359,7 +359,7 @@ void ContextMenuController::contextMenuI > ASSERT(document); > RefPtr<ReplaceSelectionCommand> command = ReplaceSelectionCommand::create(*document, createFragmentFromMarkup(*document, item->title(), ""), replaceOptions); > applyCommand(command); >- frameSelection.revealSelection(ScrollAlignment::alignToEdgeIfNeeded); >+ frame->selection().revealSelection(ScrollAlignment::alignToEdgeIfNeeded); > } > break; > } >@@ -921,7 +921,7 @@ void ContextMenuController::populate() > } > } > } else { // Make an editing context menu >- bool inPasswordField = frame->selection().isInPasswordField(); >+ bool inPasswordField = frame->selection().selection().isInPasswordField(); > if (!inPasswordField) { > bool haveContextMenuItemsForMisspellingOrGrammer = false; > bool spellCheckingEnabled = frame->editor().isSpellCheckingEnabledFor(node); >Index: Source/WebCore/page/DragController.cpp >=================================================================== >--- Source/WebCore/page/DragController.cpp (revision 163128) >+++ Source/WebCore/page/DragController.cpp (working copy) >@@ -158,7 +158,8 @@ static PassRefPtr<DocumentFragment> docu > > bool DragController::dragIsMove(FrameSelection& selection, DragData& dragData) > { >- return m_documentUnderMouse == m_dragInitiator && selection.isContentEditable() && selection.isRange() && !isCopyKeyDown(dragData); >+ const VisibleSelection& validatedSelection = selection.selection(); >+ return m_documentUnderMouse == m_dragInitiator && validatedSelection.isContentEditable() && validatedSelection.isRange() && !isCopyKeyDown(dragData); > } > > // FIXME: This method is poorly named. We're just clearing the selection from the document this drag is exiting. >@@ -413,12 +414,12 @@ DragOperation DragController::operationF > static bool setSelectionToDragCaret(Frame* frame, VisibleSelection& dragCaret, RefPtr<Range>& range, const IntPoint& point) > { > frame->selection().setSelection(dragCaret); >- if (frame->selection().isNone()) { >+ if (frame->selection().selection().isNone()) { > dragCaret = frame->visiblePositionForPoint(point); > frame->selection().setSelection(dragCaret); > range = dragCaret.toNormalizedRange(); > } >- return !frame->selection().isNone() && frame->selection().isContentEditable(); >+ return !frame->selection().isNone() && frame->selection().selection().isContentEditable(); > } > > bool DragController::dispatchTextInputEventFor(Frame* innerFrame, DragData& dragData) >@@ -482,7 +483,7 @@ bool DragController::concludeEditDrag(Dr > VisibleSelection dragCaret = m_page.dragCaretController().caretPosition(); > m_page.dragCaretController().clear(); > RefPtr<Range> range = dragCaret.toNormalizedRange(); >- RefPtr<Element> rootEditableElement = innerFrame->selection().rootEditableElement(); >+ RefPtr<Element> rootEditableElement = innerFrame->selection().selection().rootEditableElement(); > > // For range to be null a WebKit client must have done something bad while > // manually controlling drag behaviour >@@ -765,7 +766,7 @@ bool DragController::startDrag(Frame& sr > > src.editor().willWriteSelectionToPasteboard(selectionRange.get()); > >- if (enclosingTextFormControl(src.selection().start())) >+ if (enclosingTextFormControl(src.selection().selection().start())) > clipboard.pasteboard().writePlainText(src.editor().selectedTextForClipboard(), Pasteboard::CannotSmartReplace); > else { > #if PLATFORM(MAC) || PLATFORM(EFL) >@@ -812,11 +813,12 @@ bool DragController::startDrag(Frame& sr > // on the web page. This includes replacing newlines with spaces. > src.editor().copyURL(linkURL, hitTestResult.textContent().simplifyWhiteSpace(), clipboard.pasteboard()); > >- if (src.selection().isCaret() && src.selection().isContentEditable()) { >+ const VisibleSelection& srcSelection = src.selection().selection(); >+ if (srcSelection.isCaret() && srcSelection.isContentEditable()) { > // a user can initiate a drag on a link without having any text > // selected. In this case, we should expand the selection to > // the enclosing anchor element >- Position pos = src.selection().base(); >+ Position pos = srcSelection.base(); > Node* node = enclosingAnchorElement(pos); > if (node) > src.selection().setSelection(VisibleSelection::selectionFromContentsOfNode(node)); >Index: Source/WebCore/page/EventHandler.cpp >=================================================================== >--- Source/WebCore/page/EventHandler.cpp (revision 163128) >+++ Source/WebCore/page/EventHandler.cpp (working copy) >@@ -1223,7 +1223,7 @@ static bool isSubmitImage(Node* node) > // Returns true if the node's editable block is not current focused for editing > static bool nodeIsNotBeingEdited(const Node& node, const Frame& frame) > { >- return frame.selection().rootEditableElement() != node.rootEditableElement(); >+ return frame.selection().selection().rootEditableElement() != node.rootEditableElement(); > } > > bool EventHandler::useHandCursor(Node* node, bool isOverLink, bool shiftKey) >@@ -2640,7 +2640,7 @@ bool EventHandler::sendContextMenuEvent( > // FIXME: In the editable case, word selection sometimes selects content that isn't underneath the mouse. > // If the selection is non-editable, we do word selection to make it easier to use the contextual menu items > // available for text selections. But only if we're above text. >- && (m_frame.selection().isContentEditable() || (mev.targetNode() && mev.targetNode()->isTextNode()))) { >+ && (m_frame.selection().selection().isContentEditable() || (mev.targetNode() && mev.targetNode()->isTextNode()))) { > m_mouseDownMayStartSelect = true; // context menu events are always allowed to perform a selection > selectClosestWordOrLinkFromMouseEvent(mev); > } >@@ -2673,8 +2673,8 @@ bool EventHandler::sendContextMenuEventF > IntPoint location; > > Element* focusedElement = doc->focusedElement(); >- FrameSelection& selection = m_frame.selection(); >- Position start = selection.selection().start(); >+ const VisibleSelection& selection = m_frame.selection().selection(); >+ Position start = selection.start(); > > if (start.deprecatedNode() && (selection.rootEditableElement() || selection.isRange())) { > RefPtr<Range> selectionRange = selection.toNormalizedRange(); >@@ -3273,7 +3273,7 @@ bool EventHandler::handleDrag(const Mous > } > > m_mouseDownMayStartDrag = dispatchDragSrcEvent(eventNames().dragstartEvent, m_mouseDown) >- && !m_frame.selection().isInPasswordField(); >+ && !m_frame.selection().selection().isInPasswordField(); > > // Invalidate clipboard here against anymore pasteboard writing for security. The drag > // image can still be changed as we drag, but not the pasteboard data. >Index: Source/WebCore/page/FocusController.cpp >=================================================================== >--- Source/WebCore/page/FocusController.cpp (revision 163128) >+++ Source/WebCore/page/FocusController.cpp (working copy) >@@ -281,7 +281,7 @@ bool FocusController::advanceFocusInDocu > bool caretBrowsing = frame.settings().caretBrowsingEnabled(); > > if (caretBrowsing && !currentNode) >- currentNode = frame.selection().start().deprecatedNode(); >+ currentNode = frame.selection().selection().start().deprecatedNode(); > > document->updateLayoutIgnorePendingStylesheets(); > >@@ -553,8 +553,8 @@ static void clearSelectionIfNeeded(Frame > > if (oldFocusedFrame->document() != newFocusedFrame->document()) > return; >- >- FrameSelection& selection = oldFocusedFrame->selection(); >+ >+ const VisibleSelection& selection = oldFocusedFrame->selection().selection(); > if (selection.isNone()) > return; > >@@ -562,7 +562,7 @@ static void clearSelectionIfNeeded(Frame > if (caretBrowsing) > return; > >- Node* selectionStartNode = selection.selection().start().deprecatedNode(); >+ Node* selectionStartNode = selection.start().deprecatedNode(); > if (selectionStartNode == newFocusedNode || selectionStartNode->isDescendantOf(newFocusedNode) || selectionStartNode->deprecatedShadowAncestorNode() == newFocusedNode) > return; > >@@ -579,8 +579,8 @@ static void clearSelectionIfNeeded(Frame > } > } > } >- >- selection.clear(); >+ >+ oldFocusedFrame->selection().clear(); > } > > bool FocusController::setFocusedElement(Element* element, PassRefPtr<Frame> newFocusedFrame, FocusDirection direction) >Index: Source/WebCore/page/ios/FrameIOS.mm >=================================================================== >--- Source/WebCore/page/ios/FrameIOS.mm (revision 163128) >+++ Source/WebCore/page/ios/FrameIOS.mm (working copy) >@@ -601,15 +601,15 @@ void Frame::updateLayout() const > > NSRect Frame::caretRect() const > { >- if (selection().isNone()) >+ VisibleSelection visibleSelection = selection().selection(); >+ if (visibleSelection.isNone()) > return CGRectZero; >- return selection().isCaret() ? selection().absoluteCaretBounds() : VisiblePosition(selection().end()).absoluteCaretBounds(); >+ return visibleSelection.isCaret() ? selection().absoluteCaretBounds() : VisiblePosition(visibleSelection.end()).absoluteCaretBounds(); > } > > NSRect Frame::rectForScrollToVisible() const > { >- VisibleSelection selection(this->selection().selection()); >- return rectForSelection(selection); >+ return rectForSelection(selection().selection()); > } > > NSRect Frame::rectForSelection(VisibleSelection& selection) const >@@ -658,7 +658,6 @@ NSRect Frame::rectForSelection(VisibleSe > > DOMCSSStyleDeclaration* Frame::styleAtSelectionStart() const > { >- Position start = selection().start(); > RefPtr<EditingStyle> editingStyle = EditingStyle::styleAtSelectionStart(selection().selection()); > if (!editingStyle) > return nullptr; >@@ -737,14 +736,14 @@ void Frame::setRangedSelectionBaseToCurr > > void Frame::setRangedSelectionBaseToCurrentSelectionStart() > { >- FrameSelection& frameSelection = selection(); >- m_rangedSelectionBase = VisibleSelection(frameSelection.selection().start(), frameSelection.affinity()); >+ const VisibleSelection& selection = selection().selection(); >+ m_rangedSelectionBase = VisibleSelection(selection.start(), selection.affinity()); > } > > void Frame::setRangedSelectionBaseToCurrentSelectionEnd() > { >- FrameSelection& frameSelection = selection(); >- m_rangedSelectionBase = VisibleSelection(frameSelection.selection().end(), frameSelection.affinity()); >+ const VisibleSelection& selection = selection().selection(); >+ m_rangedSelectionBase = VisibleSelection(selection.end(), selection.affinity()); > } > > VisibleSelection Frame::rangedSelectionBase() const >@@ -759,14 +758,14 @@ void Frame::clearRangedSelectionInitialE > > void Frame::setRangedSelectionInitialExtentToCurrentSelectionStart() > { >- FrameSelection& frameSelection = selection(); >- m_rangedSelectionInitialExtent = VisibleSelection(frameSelection.selection().start(), frameSelection.affinity()); >+ const VisibleSelection& selection = selection().selection(); >+ m_rangedSelectionInitialExtent = VisibleSelection(selection.start(), selection.affinity()); > } > > void Frame::setRangedSelectionInitialExtentToCurrentSelectionEnd() > { >- FrameSelection& frameSelection = selection(); >- m_rangedSelectionInitialExtent = VisibleSelection(frameSelection.selection().end(), frameSelection.affinity()); >+ const VisibleSelection& selection = selection().selection(); >+ m_rangedSelectionInitialExtent = VisibleSelection(selection.end(), selection.affinity()); > } > > VisibleSelection Frame::rangedSelectionInitialExtent() const >@@ -787,7 +786,7 @@ NSArray *Frame::interpretationsForCurren > if (!document()) > return nil; > >- Element* root = selection().selectionType() == VisibleSelection::NoSelection ? document()->body() : selection().rootEditableElement(); >+ Element* root = selection().selection().selectionType() == VisibleSelection::NoSelection ? document()->body() : selection().selection().rootEditableElement(); > unsigned rootChildCount = root->childNodeCount(); > RefPtr<Range> rangeOfRootContents = Range::create(*document(), createLegacyEditingPosition(root, 0), createLegacyEditingPosition(root, rootChildCount)); > >Index: Source/WebCore/rendering/RenderBlock.cpp >=================================================================== >--- Source/WebCore/rendering/RenderBlock.cpp (revision 163128) >+++ Source/WebCore/rendering/RenderBlock.cpp (working copy) >@@ -2444,7 +2444,7 @@ void RenderBlock::paintCaret(PaintInfo& > bool isContentEditable; > if (type == CursorCaret) { > caretPainter = frame().selection().caretRenderer(); >- isContentEditable = frame().selection().hasEditableStyle(); >+ isContentEditable = frame().selection().selection().isContentEditable(); > } else { > caretPainter = frame().page()->dragCaretController().caretRenderer(); > isContentEditable = frame().page()->dragCaretController().isContentEditable(); >Index: Source/WebKit2/ChangeLog >=================================================================== >--- Source/WebKit2/ChangeLog (revision 163163) >+++ Source/WebKit2/ChangeLog (working copy) >@@ -1,3 +1,24 @@ >+ >+2014-01-30 Ryosuke Niwa <rniwa@webkit.org> >+ >+ Remove inline member functions of FrameSelection that access m_selection >+ https://bugs.webkit.org/show_bug.cgi?id=127986 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * 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): >+ > 2014-01-30 Simon Fraser <simon.fraser@apple.com> > > Fix iOS WK2 build after r163156. >Index: Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp >=================================================================== >--- Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp (revision 163128) >+++ Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp (working copy) >@@ -166,7 +166,8 @@ static void collapseSelection(GtkClipboa > > // Collapse the selection without clearing it. > ASSERT(frame); >- frame->selection().setBase(frame->selection().extent(), frame->selection().affinity()); >+ const VisibleSelection& selection = frame.selection(); >+ frame->selection().setBase(selection.extent(), selection.affinity()); > } > #endif > >Index: Source/WebKit2/WebProcess/WebPage/WebPage.cpp >=================================================================== >--- Source/WebKit2/WebProcess/WebPage/WebPage.cpp (revision 163128) >+++ Source/WebKit2/WebProcess/WebPage/WebPage.cpp (working copy) >@@ -643,16 +643,17 @@ EditorState WebPage::editorState() const > } > } > >- result.selectionIsNone = frame.selection().isNone(); >- result.selectionIsRange = frame.selection().isRange(); >- result.isContentEditable = frame.selection().isContentEditable(); >- result.isContentRichlyEditable = frame.selection().isContentRichlyEditable(); >- result.isInPasswordField = frame.selection().isInPasswordField(); >+ const VisibleSelection& selection = frame.selection().selection(); >+ >+ result.selectionIsNone = selection.isNone(); >+ result.selectionIsRange = selection.isRange(); >+ result.isContentEditable = selection.isContentEditable(); >+ result.isContentRichlyEditable = selection.isContentRichlyEditable(); >+ result.isInPasswordField = selection.isInPasswordField(); > result.hasComposition = frame.editor().hasComposition(); > result.shouldIgnoreCompositionSelectionChange = frame.editor().ignoreCompositionSelectionChange(); > > #if PLATFORM(IOS) >- FrameSelection& selection = frame.selection(); > if (frame.editor().hasComposition()) { > RefPtr<Range> compositionRange = frame.editor().compositionRange(); > Vector<WebCore::SelectionRect> compositionRects; >@@ -666,7 +667,7 @@ EditorState WebPage::editorState() const > result.markedText = plainText(compositionRange.get()); > } > if (selection.isCaret()) { >- result.caretRectAtStart = selection.absoluteCaretBounds(); >+ result.caretRectAtStart = frame.selection().absoluteCaretBounds(); > result.caretRectAtEnd = result.caretRectAtStart; > if (m_shouldReturnWordAtSelection) > result.wordAtSelection = plainText(wordRangeFromPosition(selection.start()).get()); >@@ -3812,7 +3813,7 @@ void WebPage::confirmComposition(const S > return; > } > >- Element* scope = targetFrame->selection().rootEditableElement(); >+ Element* scope = targetFrame->selection().selection().rootEditableElement(); > RefPtr<Range> selectionRange = TextIterator::rangeFromLocationAndLength(scope, selectionStart, selectionLength); > ASSERT_WITH_MESSAGE(selectionRange, "Invalid selection: [%lld:%lld] in text of length %d", static_cast<long long>(selectionStart), static_cast<long long>(selectionLength), scope->innerText().length()); > >@@ -3826,7 +3827,7 @@ void WebPage::confirmComposition(const S > void WebPage::setComposition(const String& text, Vector<CompositionUnderline> underlines, uint64_t selectionStart, uint64_t selectionEnd, uint64_t replacementStart, uint64_t replacementLength) > { > Frame* targetFrame = targetFrameForEditing(this); >- if (!targetFrame || !targetFrame->selection().isContentEditable()) { >+ if (!targetFrame || !targetFrame->selection().selection().isContentEditable()) { > send(Messages::WebPageProxy::EditorStateChanged(editorState())); > return; > } >@@ -3835,7 +3836,7 @@ void WebPage::setComposition(const Strin > // The layout needs to be uptodate before setting a selection > targetFrame->document()->updateLayout(); > >- Element* scope = targetFrame->selection().rootEditableElement(); >+ Element* scope = targetFrame->selection().selection().rootEditableElement(); > RefPtr<Range> replacementRange = TextIterator::rangeFromLocationAndLength(scope, replacementStart, replacementLength); > targetFrame->editor().setIgnoreCompositionSelectionChange(true); > targetFrame->selection().setSelection(VisibleSelection(replacementRange.get(), SEL_DEFAULT_AFFINITY)); >Index: Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm >=================================================================== >--- Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm (revision 163128) >+++ Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm (working copy) >@@ -96,7 +96,7 @@ void WebPage::setComposition(const Strin > { > Frame& frame = m_page->focusController().focusedOrMainFrame(); > >- if (frame.selection().isContentEditable()) >+ if (frame.selection().selection().isContentEditable()) > frame.editor().setComposition(text, underlines, selectionStart, selectionEnd); > } > >@@ -590,7 +590,7 @@ void WebPage::updateSelectionWithTouches > break; > > case WKSelectionTouchEnded: >- if (frame.selection().isContentEditable()) { >+ if (frame.selection().selection().isContentEditable()) { > result = closestWordBoundaryForPosition(position); > if (result.isNotNull()) > range = Range::create(*frame.document(), result, result); >Index: Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm >=================================================================== >--- Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm (revision 163128) >+++ Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm (working copy) >@@ -260,7 +260,7 @@ void WebPage::setComposition(const Strin > { > Frame& frame = m_page->focusController().focusedOrMainFrame(); > >- if (frame.selection().isContentEditable()) { >+ if (frame.selection().selection().isContentEditable()) { > RefPtr<Range> replacementRange; > if (replacementRangeStart != NSNotFound) { > replacementRange = convertToRange(&frame, NSMakeRange(replacementRangeStart, replacementRangeEnd - replacementRangeStart)); >@@ -360,7 +360,10 @@ void WebPage::getAttributedSubstringFrom > { > Frame& frame = m_page->focusController().focusedOrMainFrame(); > >- if (frame.selection().isNone() || !frame.selection().isContentEditable() || frame.selection().isInPasswordField()) >+ if (frame.selection().isNone()) >+ return; >+ const VisibleSelection& selection = frame.selection().selection(); >+ if (!selection.isContentEditable() || selection.isInPasswordField()) > return; > > NSRange nsRange = NSMakeRange(location, length - location); >Index: Source/WebKit/efl/ChangeLog >=================================================================== >--- Source/WebKit/efl/ChangeLog (revision 163163) >+++ Source/WebKit/efl/ChangeLog (working copy) >@@ -1,3 +1,13 @@ >+2014-01-30 Ryosuke Niwa <rniwa@webkit.org> >+ >+ Remove inline member functions of FrameSelection that access m_selection >+ https://bugs.webkit.org/show_bug.cgi?id=127986 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * ewk/ewk_frame.cpp: >+ (ewk_frame_text_selection_type_get): >+ > 2014-01-30 Andrei Bucur <abucur@adobe.com> > > Remove the ACCELERATED_COMPOSITING flag >Index: Source/WebKit/efl/ewk/ewk_frame.cpp >=================================================================== >--- Source/WebKit/efl/ewk/ewk_frame.cpp (revision 163128) >+++ Source/WebKit/efl/ewk/ewk_frame.cpp (working copy) >@@ -1073,9 +1073,9 @@ Ewk_Text_Selection_Type ewk_frame_text_s > EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, smartData, EWK_TEXT_SELECTION_NONE); > EINA_SAFETY_ON_NULL_RETURN_VAL(smartData->frame, EWK_TEXT_SELECTION_NONE); > >- WebCore::FrameSelection& controller = smartData->frame->selection(); >+ WebCore::FrameSelection& selection = smartData->frame->selection().selection(); > >- switch (controller.selectionType()) { >+ switch (selection.selectionType()) { > case WebCore::VisibleSelection::NoSelection: > return EWK_TEXT_SELECTION_NONE; > case WebCore::VisibleSelection::CaretSelection: >Index: Source/WebKit/gtk/ChangeLog >=================================================================== >--- Source/WebKit/gtk/ChangeLog (revision 163163) >+++ Source/WebKit/gtk/ChangeLog (working copy) >@@ -1,3 +1,13 @@ >+2014-01-30 Ryosuke Niwa <rniwa@webkit.org> >+ >+ Remove inline member functions of FrameSelection that access m_selection >+ https://bugs.webkit.org/show_bug.cgi?id=127986 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * WebCoreSupport/EditorClientGtk.cpp: >+ (WebKit::collapseSelection): >+ > 2014-01-30 Andrei Bucur <abucur@adobe.com> > > Remove the ACCELERATED_COMPOSITING flag >Index: Source/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp >=================================================================== >--- Source/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp (revision 163128) >+++ Source/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp (working copy) >@@ -216,7 +216,8 @@ static void collapseSelection(GtkClipboa > Frame& frame = corePage->focusController().focusedOrMainFrame(); > > // Collapse the selection without clearing it >- frame.selection().setBase(frame.selection().extent(), frame.selection().affinity()); >+ const VisibleSelection& selection = frame.selection(); >+ frame.selection().setBase(selection.extent(), selection.affinity()); > } > > #if PLATFORM(X11) >Index: Source/WebKit/ios/ChangeLog >=================================================================== >--- Source/WebKit/ios/ChangeLog (revision 163163) >+++ Source/WebKit/ios/ChangeLog (working copy) >@@ -1,3 +1,13 @@ >+2014-01-30 Ryosuke Niwa <rniwa@webkit.org> >+ >+ Remove inline member functions of FrameSelection that access m_selection >+ https://bugs.webkit.org/show_bug.cgi?id=127986 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * WebCoreSupport/WebFrameIOS.mm: >+ (-[WebFrame setBaseWritingDirection:]): >+ > 2014-01-30 Andrei Bucur <abucur@adobe.com> > > Remove the ACCELERATED_COMPOSITING flag >Index: Source/WebKit/ios/WebCoreSupport/WebFrameIOS.mm >=================================================================== >--- Source/WebKit/ios/WebCoreSupport/WebFrameIOS.mm (revision 163128) >+++ Source/WebKit/ios/WebCoreSupport/WebFrameIOS.mm (working copy) >@@ -575,7 +575,7 @@ - (void)setBaseWritingDirection:(WKWriti > WKWritingDirection originalDirection = [self selectionBaseWritingDirection]; > > Frame *frame = [self coreFrame]; >- if (!frame->selection().isContentEditable()) >+ if (!frame->selection().selection().isContentEditable()) > return; > > WritingDirection wcDirection = LeftToRightWritingDirection; >Index: Source/WebKit/mac/ChangeLog >=================================================================== >--- Source/WebKit/mac/ChangeLog (revision 163163) >+++ Source/WebKit/mac/ChangeLog (working copy) >@@ -1,3 +1,28 @@ >+2014-01-30 Ryosuke Niwa <rniwa@webkit.org> >+ >+ Remove inline member functions of FrameSelection that access m_selection >+ https://bugs.webkit.org/show_bug.cgi?id=127986 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * WebView/WebFrame.mm: >+ (-[WebFrame hasEditableSelection]): >+ (-[WebFrame selectionAffinity]): >+ (-[WebFrame getDictationResultRanges:andMetadatas:]): >+ (-[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]): >+ > 2014-01-30 David Kilzer <ddkilzer@apple.com> > > Add security-checked cast for WebCore::CachedImage >Index: Source/WebKit/mac/WebView/WebFrame.mm >=================================================================== >--- Source/WebKit/mac/WebView/WebFrame.mm (revision 163128) >+++ Source/WebKit/mac/WebView/WebFrame.mm (working copy) >@@ -1348,7 +1348,7 @@ - (void)resetSelection > - (BOOL)hasEditableSelection > { > WebCore::Frame *frame = core(self); >- return frame->selection().isContentEditable(); >+ return frame->selection().selection().isContentEditable(); > } > > - (int)preferredHeight >@@ -1473,7 +1473,7 @@ - (void)setSelectedDOMRange:(DOMRange *) > - (NSSelectionAffinity)selectionAffinity > { > WebCore::Frame *frame = core(self); >- return (NSSelectionAffinity)(frame->selection().affinity()); >+ return (NSSelectionAffinity)(frame->selection().selection().affinity()); > } > > - (void)expandSelectionToElementContainingCaretSelection >@@ -1714,8 +1714,9 @@ - (void)getDictationResultRanges:(NSArra > > Frame *frame = core(self); > Document *document = frame->document(); >- >- Element *root = frame->selection().selectionType() == VisibleSelection::NoSelection ? frame->document()->body() : frame->selection().rootEditableElement(); >+ >+ const VisibleSelection& selection = frame->selection().selection(); >+ Element *root = selection.selectionType() == VisibleSelection::NoSelection ? frame->document()->body() : selection.rootEditableElement(); > > DOMRange *previousDOMRange = nil; > id previousMetadata = nil; >@@ -2271,11 +2272,12 @@ - (BOOL)focusedNodeHasContent > Frame* coreFrame = _private->coreFrame; > > Element* root; >- if (coreFrame->selection().isNone() || !coreFrame->selection().isContentEditable()) >+ const VisibleSelection& selection = coreFrame->selection().selection(); >+ if (selection.isNone() || !selection.isContentEditable()) > root = coreFrame->document()->body(); > else { > // Can't use the focusedNode here because we want the root of the shadow tree for form elements. >- root = coreFrame->selection().rootEditableElement(); >+ root = selection.rootEditableElement(); > } > // Early return to avoid the expense of creating VisiblePositions. > // FIXME: We fail to compute a root for SVG, we have a null check here so that we don't crash. >Index: Source/WebKit/mac/WebView/WebHTMLView.mm >=================================================================== >--- Source/WebKit/mac/WebView/WebHTMLView.mm (revision 163128) >+++ Source/WebKit/mac/WebView/WebHTMLView.mm (working copy) >@@ -1001,7 +1001,7 @@ - (BOOL)readSelectionFromPasteboard:(NSP > Frame* coreFrame = core([self _frame]); > if (!coreFrame) > return NO; >- if (coreFrame->selection().isContentRichlyEditable()) >+ if (coreFrame->selection().selection().isContentRichlyEditable()) > [self _pasteWithPasteboard:pasteboard allowPlainText:YES]; > else > [self _pasteAsPlainTextWithPasteboard:pasteboard]; >@@ -1986,25 +1986,25 @@ - (BOOL)_canAlterCurrentSelection > - (BOOL)_hasSelection > { > Frame* coreFrame = core([self _frame]); >- return coreFrame && coreFrame->selection().isRange(); >+ return coreFrame && coreFrame->selection().selection().isRange(); > } > > - (BOOL)_hasSelectionOrInsertionPoint > { > Frame* coreFrame = core([self _frame]); >- return coreFrame && coreFrame->selection().isCaretOrRange(); >+ return coreFrame && coreFrame->selection().selection().isCaretOrRange(); > } > > - (BOOL)_hasInsertionPoint > { > Frame* coreFrame = core([self _frame]); >- return coreFrame && coreFrame->selection().isCaret(); >+ return coreFrame && coreFrame->selection().selection().isCaret(); > } > > - (BOOL)_isEditable > { > Frame* coreFrame = core([self _frame]); >- return coreFrame && coreFrame->selection().isContentEditable(); >+ return coreFrame && coreFrame->selection().selection().isContentEditable(); > } > > - (BOOL)_transparentBackground >@@ -2899,7 +2899,7 @@ - (BOOL)validateUserInterfaceItemWithout > > if (action == @selector(pasteAsRichText:)) > return frame && (frame->editor().canDHTMLPaste() >- || (frame->editor().canPaste() && frame->selection().isContentRichlyEditable())); >+ || (frame->editor().canPaste() && frame->selection().selection().isContentRichlyEditable())); > > if (action == @selector(performFindPanelAction:)) > return NO; >@@ -3026,7 +3026,7 @@ - (BOOL)maintainsInactiveSelection > return YES; > > Frame* coreFrame = core([self _frame]); >- return coreFrame && coreFrame->selection().isContentEditable(); >+ return coreFrame && coreFrame->selection().selection().isContentEditable(); > #else > // This method helps to determine whether the WebHTMLView should maintain > // an inactive selection when it's not first responder. >@@ -3057,7 +3057,7 @@ - (BOOL)maintainsInactiveSelection > return YES; > > Frame* coreFrame = core([self _frame]); >- bool selectionIsEditable = coreFrame && coreFrame->selection().isContentEditable(); >+ bool selectionIsEditable = coreFrame && coreFrame->selection().selection().isContentEditable(); > bool nextResponderIsInWebView = [nextResponder isKindOfClass:[NSView class]] > && [nextResponder isDescendantOf:[[[self _webView] mainFrame] frameView]]; > >@@ -4137,13 +4137,16 @@ - (BOOL)needsPanelToBecomeKey > // API when an editable region is not currently focused. > static BOOL isTextInput(Frame* coreFrame) > { >- return coreFrame && !coreFrame->selection().isNone() && coreFrame->selection().isContentEditable(); >+ if (!coreFrame) >+ return NO; >+ const VisibleSelection& selection = coreFrame->selection().selection(); >+ return !selection.isNone() && selection.isContentEditable(); > } > > #if !PLATFORM(IOS) > static BOOL isInPasswordField(Frame* coreFrame) > { >- return coreFrame && coreFrame->selection().isInPasswordField(); >+ return coreFrame && coreFrame->selection().selection().isInPasswordField(); > } > #endif > >Index: Source/WebKit/mac/WebView/WebView.mm >=================================================================== >--- Source/WebKit/mac/WebView/WebView.mm (revision 163128) >+++ Source/WebKit/mac/WebView/WebView.mm (working copy) >@@ -7244,7 +7244,7 @@ - (NSSelectionAffinity)selectionAffinity > Frame* coreFrame = core([self _selectedOrMainFrame]); > if (!coreFrame) > return NSSelectionAffinityDownstream; >- return kit(coreFrame->selection().affinity()); >+ return kit(coreFrame->selection().selection().affinity()); > } > > - (void)setEditable:(BOOL)flag
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 127986
:
222798
|
222802
|
222805
|
222855
|
222861