1. 07 Oct, 2013 1 commit
  2. 30 Aug, 2013 1 commit
  3. 19 Aug, 2013 1 commit
    • psolanki@apple.com's avatar
      <https://webkit.org/b/119918> Frame::selection() should return a reference · 87ae63d7
      psolanki@apple.com authored
      Reviewed by Darin Adler.
      
      m_selection is never NULL so return a reference from Frame::selection(). Also removed some
      unnecessary null checks and assert diff ts exposed as a result.
      
      Source/WebCore:
      
      * accessibility/AccessibilityRenderObject.cpp:
      (WebCore::AccessibilityRenderObject::selection):
      (WebCore::AccessibilityRenderObject::setSelectedTextRange):
      (WebCore::AccessibilityRenderObject::isFocused):
      (WebCore::AccessibilityRenderObject::setSelectedVisiblePositionRange):
      (WebCore::AccessibilityRenderObject::handleActiveDescendantChanged):
      * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
      (-[WebAccessibilityObjectWrapper accessibilityModifySelection:increase:]):
      (-[WebAccessibilityObjectWrapper accessibilityMoveSelectionToMarker:]):
      (-[WebAccessibilityObjectWrapper _convertToNSRange:]):
      (-[WebAccessibilityObjectWrapper _convertToDOMRange:]):
      * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
      (-[WebAccessibilityObjectWrapper accessibilitySetValue:forAttribute:]):
      * css/SelectorChecker.cpp:
      (WebCore::SelectorChecker::isFrameFocused):
      * dom/CharacterData.cpp:
      (WebCore::CharacterData::setDataAndUpdate):
      * dom/Document.cpp:
      (WebCore::Document::nodeChildrenWillBeRemoved):
      (WebCore::Document::nodeWillBeRemoved):
      * dom/Element.cpp:
      (WebCore::Element::updateFocusAppearance):
      * editing/AlternativeTextController.cpp:
      (WebCore::AlternativeTextController::stopPendingCorrection):
      (WebCore::AlternativeTextController::applyAlternativeTextToRange):
      (WebCore::AlternativeTextController::applyAutocorrectionBeforeTypingIfAppropriate):
      (WebCore::AlternativeTextController::respondToUnappliedSpellCorrection):
      (WebCore::AlternativeTextController::timerFired):
      (WebCore::AlternativeTextController::respondToChangedSelection):
      * editing/DeleteButtonController.cpp:
      (WebCore::DeleteButtonController::respondToChangedSelection):
      (WebCore::DeleteButtonController::enable):
      (WebCore::DeleteButtonController::deleteTarget):
      * editing/DeleteSelectionCommand.cpp:
      (WebCore::DeleteSelectionCommand::calculateTypingStyleAfterDelete):
      * editing/DictationCommand.cpp:
      (WebCore::DictationCommand::insertText):
      * editing/EditCommand.cpp:
      (WebCore::EditCommand::EditCommand):
      * editing/EditingStyle.cpp:
      (WebCore::EditingStyle::mergeTypingStyle):
      * editing/Editor.cpp:
      (WebCore::Editor::selectionForCommand):
      (WebCore::Editor::canEdit):
      (WebCore::Editor::canEditRichly):
      (WebCore::Editor::canDHTMLCut):
      (WebCore::Editor::canDHTMLCopy):
      (WebCore::Editor::canCopy):
      (WebCore::Editor::canDelete):
      (WebCore::Editor::canSmartCopyOrDelete):
      (WebCore::Editor::deleteWithDirection):
      (WebCore::Editor::deleteSelectionWithSmartDelete):
      (WebCore::Editor::replaceSelectionWithFragment):
      (WebCore::Editor::selectedRange):
      (WebCore::Editor::tryDHTMLCopy):
      (WebCore::Editor::tryDHTMLCut):
      (WebCore::Editor::hasBidiSelection):
      (WebCore::Editor::selectionUnorderedListState):
      (WebCore::Editor::selectionOrderedListState):
      (WebCore::Editor::increaseSelectionListLevel):
      (WebCore::Editor::increaseSelectionListLevelOrdered):
      (WebCore::Editor::increaseSelectionListLevelUnordered):
      (WebCore::Editor::decreaseSelectionListLevel):
      (WebCore::Editor::findEventTargetFromSelection):
      (WebCore::Editor::applyStyle):
      (WebCore::Editor::applyParagraphStyle):
      (WebCore::Editor::applyStyleToSelection):
      (WebCore::Editor::applyParagraphStyleToSelection):
      (WebCore::Editor::selectionStartHasStyle):
      (WebCore::Editor::selectionHasStyle):
      (WebCore::Editor::selectionStartCSSPropertyValue):
      (WebCore::Editor::appliedEditing):
      (WebCore::Editor::insertTextWithoutSendingTextEvent):
      (WebCore::Editor::insertLineBreak):
      (WebCore::Editor::insertParagraphSeparator):
      (WebCore::Editor::cut):
      (WebCore::Editor::copy):
      (WebCore::Editor::paste):
      (WebCore::Editor::baseWritingDirectionForSelectionStart):
      (WebCore::Editor::selectComposition):
      (WebCore::Editor::setComposition):
      (WebCore::Editor::ignoreSpelling):
      (WebCore::Editor::learnSpelling):
      (WebCore::Editor::advanceToNextMisspelling):
      (WebCore::Editor::misspelledWordAtCaretOrRange):
      (WebCore::Editor::isSelectionUngrammatical):
      (WebCore::Editor::guessesForMisspelledOrUngrammatical):
      (WebCore::Editor::markMisspellingsAfterTypingToWord):
      (WebCore::Editor::isSpellCheckingEnabledInFocusedNode):
      (WebCore::Editor::markAndReplaceFor):
      (WebCore::Editor::updateMarkersForWordsAffectedByEditing):
      (WebCore::Editor::revealSelectionAfterEditingOperation):
      (WebCore::Editor::getCompositionSelection):
      (WebCore::Editor::transpose):
      (WebCore::Editor::changeSelectionAfterCommand):
      (WebCore::Editor::selectedText):
      (WebCore::Editor::computeAndSetTypingStyle):
      (WebCore::Editor::findString):
      (WebCore::Editor::respondToChangedSelection):
      (WebCore::Editor::selectionStartHasMarkerFor):
      (WebCore::Editor::toggleOverwriteModeEnabled):
      * editing/EditorCommand.cpp:
      (WebCore::executeToggleStyleInList):
      (WebCore::expandSelectionToGranularity):
      (WebCore::stateTextWritingDirection):
      (WebCore::executeDelete):
      (WebCore::executeDeleteToMark):
      (WebCore::executeMoveBackward):
      (WebCore::executeMoveBackwardAndModifySelection):
      (WebCore::executeMoveDown):
      (WebCore::executeMoveDownAndModifySelection):
      (WebCore::executeMoveForward):
      (WebCore::executeMoveForwardAndModifySelection):
      (WebCore::executeMoveLeft):
      (WebCore::executeMoveLeftAndModifySelection):
      (WebCore::executeMovePageDown):
      (WebCore::executeMovePageDownAndModifySelection):
      (WebCore::executeMovePageUp):
      (WebCore::executeMovePageUpAndModifySelection):
      (WebCore::executeMoveRight):
      (WebCore::executeMoveRightAndModifySelection):
      (WebCore::executeMoveToBeginningOfDocument):
      (WebCore::executeMoveToBeginningOfDocumentAndModifySelection):
      (WebCore::executeMoveToBeginningOfLine):
      (WebCore::executeMoveToBeginningOfLineAndModifySelection):
      (WebCore::executeMoveToBeginningOfParagraph):
      (WebCore::executeMoveToBeginningOfParagraphAndModifySelection):
      (WebCore::executeMoveToBeginningOfSentence):
      (WebCore::executeMoveToBeginningOfSentenceAndModifySelection):
      (WebCore::executeMoveToEndOfDocument):
      (WebCore::executeMoveToEndOfDocumentAndModifySelection):
      (WebCore::executeMoveToEndOfSentence):
      (WebCore::executeMoveToEndOfSentenceAndModifySelection):
      (WebCore::executeMoveToEndOfLine):
      (WebCore::executeMoveToEndOfLineAndModifySelection):
      (WebCore::executeMoveToEndOfParagraph):
      (WebCore::executeMoveToEndOfParagraphAndModifySelection):
      (WebCore::executeMoveParagraphBackwardAndModifySelection):
      (WebCore::executeMoveParagraphForwardAndModifySelection):
      (WebCore::executeMoveUp):
      (WebCore::executeMoveUpAndModifySelection):
      (WebCore::executeMoveWordBackward):
      (WebCore::executeMoveWordBackwardAndModifySelection):
      (WebCore::executeMoveWordForward):
      (WebCore::executeMoveWordForwardAndModifySelection):
      (WebCore::executeMoveWordLeft):
      (WebCore::executeMoveWordLeftAndModifySelection):
      (WebCore::executeMoveWordRight):
      (WebCore::executeMoveWordRightAndModifySelection):
      (WebCore::executeMoveToLeftEndOfLine):
      (WebCore::executeMoveToLeftEndOfLineAndModifySelection):
      (WebCore::executeMoveToRightEndOfLine):
      (WebCore::executeMoveToRightEndOfLineAndModifySelection):
      (WebCore::executeSelectAll):
      (WebCore::executeSelectToMark):
      (WebCore::executeSetMark):
      (WebCore::executeSwapWithMark):
      (WebCore::executeUnselect):
      (WebCore::enabledInRichlyEditableText):
      (WebCore::enabledRangeInEditableText):
      (WebCore::enabledRangeInRichlyEditableText):
      (WebCore::valueFormatBlock):
      * editing/FrameSelection.cpp:
      (WebCore::FrameSelection::setSelection):
      (WebCore::FrameSelection::selectFrameElementInParentIfFullySelected):
      * editing/InsertLineBreakCommand.cpp:
      (WebCore::InsertLineBreakCommand::doApply):
      * editing/InsertTextCommand.cpp:
      (WebCore::InsertTextCommand::doApply):
      * editing/ModifySelectionListLevel.cpp:
      (WebCore::IncreaseSelectionListLevelCommand::canIncreaseSelectionListLevel):
      (WebCore::DecreaseSelectionListLevelCommand::canDecreaseSelectionListLevel):
      * editing/RemoveFormatCommand.cpp:
      (WebCore::RemoveFormatCommand::doApply):
      * editing/ReplaceSelectionCommand.cpp:
      (WebCore::ReplaceSelectionCommand::doApply):
      * editing/SetSelectionCommand.cpp:
      (WebCore::SetSelectionCommand::doApply):
      (WebCore::SetSelectionCommand::doUnapply):
      * editing/SpellingCorrectionCommand.cpp:
      (WebCore::SpellingCorrectionCommand::doApply):
      * editing/TextInsertionBaseCommand.cpp:
      (WebCore::TextInsertionBaseCommand::applyTextInsertionCommand):
      * editing/TypingCommand.cpp:
      (WebCore::TypingCommand::deleteSelection):
      (WebCore::TypingCommand::updateSelectionIfDifferentFromCurrentSelection):
      (WebCore::TypingCommand::insertText):
      (WebCore::TypingCommand::deleteKeyPressed):
      (WebCore::TypingCommand::forwardDeleteKeyPressed):
      * editing/ios/EditorIOS.mm:
      (WebCore::Editor::setTextAlignmentForChangedBaseWritingDirection):
      (WebCore::styleForSelectionStart):
      (WebCore::Editor::fontForSelection):
      * editing/mac/EditorMac.mm:
      (WebCore::styleForSelectionStart):
      (WebCore::Editor::fontForSelection):
      (WebCore::Editor::canCopyExcludingStandaloneImages):
      (WebCore::Editor::readSelectionFromPasteboard):
      * html/HTMLAnchorElement.cpp:
      (WebCore::HTMLAnchorElement::defaultEventHandler):
      (WebCore::HTMLAnchorElement::setActive):
      * html/HTMLInputElement.cpp:
      (WebCore::HTMLInputElement::updateFocusAppearance):
      * html/HTMLTextAreaElement.cpp:
      (WebCore::HTMLTextAreaElement::updateFocusAppearance):
      (WebCore::HTMLTextAreaElement::handleBeforeTextInsertedEvent):
      * html/HTMLTextFormControlElement.cpp:
      (WebCore::HTMLTextFormControlElement::setSelectionRange):
      (WebCore::HTMLTextFormControlElement::computeSelectionStart):
      (WebCore::HTMLTextFormControlElement::computeSelectionEnd):
      (WebCore::HTMLTextFormControlElement::computeSelectionDirection):
      (WebCore::HTMLTextFormControlElement::selectionChanged):
      * html/TextFieldInputType.cpp:
      (WebCore::TextFieldInputType::handleBeforeTextInsertedEvent):
      * loader/FrameLoader.cpp:
      (WebCore::FrameLoader::clear):
      * loader/archive/cf/LegacyWebArchive.cpp:
      (WebCore::LegacyWebArchive::createFromSelection):
      * page/ContextMenuController.cpp:
      (WebCore::insertUnicodeCharacter):
      (WebCore::ContextMenuController::contextMenuItemSelected):
      (WebCore::selectionContainsPossibleWord):
      (WebCore::ContextMenuController::populate):
      (WebCore::ContextMenuController::checkOrEnableIfNeeded):
      * page/DOMSelection.cpp:
      (WebCore::selectionShadowAncestor):
      (WebCore::DOMSelection::visibleSelection):
      (WebCore::DOMSelection::isCollapsed):
      (WebCore::DOMSelection::type):
      (WebCore::DOMSelection::rangeCount):
      (WebCore::DOMSelection::collapse):
      (WebCore::DOMSelection::collapseToEnd):
      (WebCore::DOMSelection::collapseToStart):
      (WebCore::DOMSelection::empty):
      (WebCore::DOMSelection::setBaseAndExtent):
      (WebCore::DOMSelection::setPosition):
      (WebCore::DOMSelection::modify):
      (WebCore::DOMSelection::extend):
      (WebCore::DOMSelection::getRangeAt):
      (WebCore::DOMSelection::removeAllRanges):
      (WebCore::DOMSelection::addRange):
      (WebCore::DOMSelection::deleteFromDocument):
      (WebCore::DOMSelection::containsNode):
      (WebCore::DOMSelection::toString):
      * page/DragController.cpp:
      (WebCore::DragController::dragIsMove):
      (WebCore::setSelectionToDragCaret):
      (WebCore::DragController::concludeEditDrag):
      (WebCore::DragController::draggableElement):
      (WebCore::selectElement):
      (WebCore::dragLocForSelectionDrag):
      (WebCore::DragController::startDrag):
      * page/DragController.h:
      * page/EventHandler.cpp:
      (WebCore::setSelectionIfNeeded):
      (WebCore::EventHandler::updateSelectionForMouseDownDispatchingSelectStart):
      (WebCore::EventHandler::handleMousePressEventDoubleClick):
      (WebCore::EventHandler::handleMousePressEventSingleClick):
      (WebCore::EventHandler::updateSelectionForMouseDrag):
      (WebCore::EventHandler::lostMouseCapture):
      (WebCore::EventHandler::handleMouseReleaseEvent):
      (WebCore::nodeIsNotBeingEdited):
      (WebCore::EventHandler::selectCursor):
      (WebCore::EventHandler::handleMousePressEvent):
      (WebCore::EventHandler::handleMouseDoubleClickEvent):
      (WebCore::EventHandler::dispatchMouseEvent):
      (WebCore::EventHandler::sendContextMenuEvent):
      (WebCore::EventHandler::sendContextMenuEventForKey):
      (WebCore::handleKeyboardSelectionMovement):
      (WebCore::EventHandler::handleDrag):
      * page/FocusController.cpp:
      (WebCore::FocusController::setFocusedFrame):
      (WebCore::FocusController::setFocused):
      (WebCore::FocusController::advanceFocusInDocumentOrder):
      (WebCore::clearSelectionIfNeeded):
      (WebCore::FocusController::setActive):
      * page/Frame.cpp:
      (WebCore::Frame::dragImageForSelection):
      * page/Frame.h:
      (WebCore::Frame::selection):
      * page/FrameView.cpp:
      (WebCore::FrameView::performPostLayoutTasks):
      (WebCore::FrameView::paintContentsForSnapshot):
      * page/Page.cpp:
      (WebCore::Page::findString):
      (WebCore::Page::findStringMatchingRanges):
      (WebCore::Page::selection):
      * page/mac/FrameMac.mm:
      (WebCore::Frame::dragImageForSelection):
      * page/mac/FrameSnapshottingMac.mm:
      (WebCore::selectionImage):
      * page/win/FrameWin.cpp:
      (WebCore::imageFromSelection):
      (WebCore::Frame::dragImageForSelection):
      * platform/ios/PasteboardIOS.mm:
      (WebCore::Pasteboard::documentFragmentForPasteboardItemAtIndex):
      * rendering/HitTestResult.cpp:
      (WebCore::HitTestResult::isSelected):
      * rendering/RenderBlock.cpp:
      (WebCore::RenderBlock::paintCaret):
      * rendering/RenderImage.cpp:
      (WebCore::RenderImage::paintAreaElementFocusRing):
      * rendering/RenderLayer.cpp:
      (WebCore::RenderLayer::scrollTo):
      * rendering/RenderListBox.cpp:
      (WebCore::RenderListBox::paintItemForeground):
      (WebCore::RenderListBox::paintItemBackground):
      * rendering/RenderObject.cpp:
      (WebCore::RenderObject::selectionBackgroundColor):
      (WebCore::RenderObject::selectionColor):
      * rendering/RenderTextControlSingleLine.cpp:
      (WebCore::RenderTextControlSingleLine::capsLockStateMayHaveChanged):
      * rendering/RenderTheme.cpp:
      (WebCore::RenderTheme::isFocused):
      * rendering/RenderThemeWin.cpp:
      (WebCore::RenderThemeWin::adjustSearchFieldStyle):
      * rendering/RenderTreeAsText.cpp:
      (WebCore::writeSelection):
      * rendering/RenderView.cpp:
      (WebCore::RenderView::setSelection):
      * svg/SVGSVGElement.cpp:
      (WebCore::SVGSVGElement::deselectAll):
      * svg/SVGTextContentElement.cpp:
      (WebCore::SVGTextContentElement::selectSubString):
      * testing/Internals.cpp:
      (WebCore::Internals::absoluteCaretBounds):
      (WebCore::Internals::selectionBounds):
      
      Source/WebKit/blackberry:
      
      * Api/InRegionScroller.cpp:
      (BlackBerry::WebKit::InRegionScrollerPrivate::setLayerScrollPosition):
      * WebKitSupport/DatePickerClient.cpp:
      (BlackBerry::WebKit::DatePickerClient::setValueAndClosePopup):
      * WebKitSupport/InPageSearchManager.cpp:
      (BlackBerry::WebKit::InPageSearchManager::findNextString):
      (BlackBerry::WebKit::InPageSearchManager::clearTextMatches):
      * WebKitSupport/InputHandler.cpp:
      (BlackBerry::WebKit::InputHandler::focusedNodeChanged):
      (BlackBerry::WebKit::InputHandler::requestSpellingCheckingOptions):
      (BlackBerry::WebKit::InputHandler::setElementUnfocused):
      (BlackBerry::WebKit::InputHandler::setInputModeEnabled):
      (BlackBerry::WebKit::InputHandler::setElementFocused):
      (BlackBerry::WebKit::InputHandler::openDatePopup):
      (BlackBerry::WebKit::InputHandler::ensureFocusTextElementVisible):
      (BlackBerry::WebKit::InputHandler::selectionPosition):
      (BlackBerry::WebKit::InputHandler::setSelection):
      (BlackBerry::WebKit::InputHandler::deleteSelection):
      (BlackBerry::WebKit::InputHandler::setRelativeCursorPosition):
      * WebKitSupport/SelectionHandler.cpp:
      (BlackBerry::WebKit::SelectionHandler::cancelSelection):
      (BlackBerry::WebKit::SelectionHandler::shouldUpdateSelectionOrCaretForPoint):
      (BlackBerry::WebKit::SelectionHandler::setCaretPosition):
      (BlackBerry::WebKit::SelectionHandler::extendSelectionToFieldBoundary):
      (BlackBerry::WebKit::SelectionHandler::updateOrHandleInputSelection):
      (BlackBerry::WebKit::SelectionHandler::setSelection):
      (BlackBerry::WebKit::SelectionHandler::startCaretViewportRect):
      (BlackBerry::WebKit::SelectionHandler::selectNextParagraph):
      (BlackBerry::WebKit::SelectionHandler::expandSelectionToGranularity):
      (BlackBerry::WebKit::SelectionHandler::selectObject):
      (BlackBerry::WebKit::directionOfEnclosingBlock):
      (BlackBerry::WebKit::SelectionHandler::selectionPositionChanged):
      (BlackBerry::WebKit::SelectionHandler::notifyCaretPositionChangedIfNeeded):
      (BlackBerry::WebKit::SelectionHandler::caretPositionChanged):
      (BlackBerry::WebKit::SelectionHandler::selectionContains):
      * WebKitSupport/SpellingHandler.cpp:
      (BlackBerry::WebKit::SpellingHandler::spellCheckTextBlock):
      
      Source/WebKit/efl:
      
      * WebCoreSupport/DumpRenderTreeSupportEfl.cpp:
      (DumpRenderTreeSupportEfl::selectionRectangle):
      (DumpRenderTreeSupportEfl::firstRectForCharacterRange):
      (DumpRenderTreeSupportEfl::selectedRange):
      * WebCoreSupport/EditorClientEfl.cpp:
      (WebCore::EditorClientEfl::handleEditingKeyboardEvent):
      * ewk/ewk_frame.cpp:
      (ewk_frame_text_selection_type_get):
      
      Source/WebKit/gtk:
      
      * WebCoreSupport/ChromeClientGtk.cpp:
      (WebKit::ChromeClient::paint):
      * WebCoreSupport/DumpRenderTreeSupportGtk.cpp:
      (DumpRenderTreeSupportGtk::firstRectForCharacterRange):
      (DumpRenderTreeSupportGtk::selectedRange):
      (DumpRenderTreeSupportGtk::rectangleForSelection):
      * WebCoreSupport/EditorClientGtk.cpp:
      (WebKit::collapseSelection):
      (WebKit::setSelectionPrimaryClipboardIfNeeded):
      * webkit/webkitwebframe.cpp:
      (webkit_web_frame_get_range_for_word_around_caret):
      * webkit/webkitwebview.cpp:
      (getLocationForKeyboardGeneratedContextMenu):
      
      Source/WebKit/mac:
      
      * Plugins/WebPluginController.mm:
      * WebView/WebFrame.mm:
      (-[WebFrame _hasSelection]):
      (-[WebFrame _rangeByAlteringCurrentSelection:FrameSelection::direction:granularity:]):
      (-[WebFrame _selectionGranularity]):
      (-[WebFrame _convertToNSRange:]):
      (-[WebFrame _convertToDOMRange:]):
      (-[WebFrame _insertParagraphSeparatorInQuotedContent]):
      (-[WebFrame _typingStyle]):
      (-[WebFrame _selectedNSRange]):
      (-[WebFrame _selectNSRange:]):
      (-[WebFrame _replaceSelectionWithFragment:selectReplacement:smartReplace:matchStyle:]):
      (-[WebFrame _replaceSelectionWithText:selectReplacement:smartReplace:]):
      * WebView/WebHTMLRepresentation.mm:
      (-[WebHTMLRepresentation currentForm]):
      * WebView/WebHTMLView.mm:
      (-[WebHTMLView readSelectionFromPasteboard:]):
      (-[WebHTMLView _selectedRange]):
      (-[WebHTMLView _hasSelection]):
      (-[WebHTMLView _hasSelectionOrInsertionPoint]):
      (-[WebHTMLView _hasInsertionPoint]):
      (-[WebHTMLView _isEditable]):
      (-[WebHTMLView jumpToSelection:]):
      (-[WebHTMLView validateUserInterfaceItemWithoutDelegate:]):
      (-[WebHTMLView maintainsInactiveSelection]):
      (isTextInput):
      (isInPasswordField):
      (-[WebHTMLView centerSelectionInVisibleArea:]):
      (-[WebHTMLView _canSmartCopyOrDelete]):
      (-[WebHTMLView _lookUpInDictionaryFromMenu:]):
      (-[WebHTMLView _updateSelectionForInputManager]):
      (-[WebHTMLView selectionRect]):
      (-[WebHTMLView selectionTextRects]):
      (-[WebHTMLView selectionImageRect]):
      (-[WebHTMLView selectAll]):
      (-[WebHTMLView deselectAll]):
      (-[WebHTMLView selectedAttributedString]):
      * WebView/WebTextCompletionController.mm:
      (-[WebTextCompletionController doCompletion]):
      * WebView/WebView.mm:
      (-[WebView setSelectedDOMRange:affinity:]):
      (-[WebView selectedDOMRange]):
      (-[WebView selectionAffinity]):
      (-[WebView setEditable:]):
      (-[WebView _selectionIsCaret]):
      (-[WebView _selectionIsAll]):
      
      Source/WebKit/qt:
      
      * WebCoreSupport/DumpRenderTreeSupportQt.cpp:
      (DumpRenderTreeSupportQt::selectedRange):
      (DumpRenderTreeSupportQt::firstRectForCharacterRange):
      * WebCoreSupport/EditorClientQt.cpp:
      (WebCore::EditorClientQt::respondToChangedSelection):
      (WebCore::EditorClientQt::handleKeyboardEvent):
      * WebCoreSupport/QWebPageAdapter.cpp:
      (QWebPageAdapter::hasSelection):
      (QWebPageAdapter::selectedText):
      (QWebPageAdapter::findText):
      (QWebPageAdapter::inputMethodEvent):
      (QWebPageAdapter::inputMethodQuery):
      
      Source/WebKit/win:
      
      * WebFrame.cpp:
      (WebFrame::currentForm):
      * WebView.cpp:
      (WebView::updateFocusedAndActiveState):
      (WebView::selectionRect):
      (WebView::centerSelectionInVisibleArea):
      (WebView::hasSelectedRange):
      (WebView::replaceSelectionWithText):
      (WebView::clearSelection):
      (WebView::prepareCandidateWindow):
      (WebView::onIMERequestCharPosition):
      (WebView::onIMERequestReconvertString):
      (WebView::firstRectForCharacterRangeForTesting):
      (WebView::selectedRangeForTesting):
      
      Source/WebKit/wince:
      
      * WebCoreSupport/EditorClientWinCE.cpp:
      (WebKit::EditorClientWinCE::handleEditingKeyboardEvent):
      
      Source/WebKit2:
      
      * WebProcess/WebCoreSupport/WebEditorClient.cpp:
      (WebKit::WebEditorClient::updateGlobalSelection):
      * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
      (WebKit::collapseSelection):
      (WebKit::WebEditorClient::updateGlobalSelection):
      * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
      (WebKit::WebContextMenuClient::lookUpInDictionary):
      (WebKit::WebContextMenuClient::searchWithSpotlight):
      * WebProcess/WebPage/FindController.cpp:
      (WebKit::frameWithSelection):
      (WebKit::FindController::updateFindUIAfterPageScroll):
      (WebKit::FindController::getFindIndicatorBitmapAndRect):
      (WebKit::FindController::getImageForFindMatch):
      (WebKit::FindController::selectFindMatch):
      (WebKit::FindController::updateFindIndicator):
      (WebKit::FindController::drawRect):
      * WebProcess/WebPage/WebPage.cpp:
      (WebKit::WebPage::editorState):
      (WebKit::WebPage::scaledSnapshotWithOptions):
      (WebKit::WebPage::centerSelectionInVisibleArea):
      (WebKit::frameWithSelection):
      (WebKit::WebPage::clearSelection):
      (WebKit::WebPage::confirmComposition):
      (WebKit::WebPage::setComposition):
      (WebKit::WebPage::currentSelectionAsRange):
      * WebProcess/WebPage/mac/WebPageMac.mm:
      (WebKit::WebPage::setComposition):
      (WebKit::WebPage::insertText):
      (WebKit::WebPage::insertDictatedText):
      (WebKit::WebPage::getMarkedRange):
      (WebKit::WebPage::getSelectedRange):
      (WebKit::WebPage::getAttributedSubstringFromRange):
      (WebKit::WebPage::characterIndexForPoint):
      (WebKit::convertToRange):
      (WebKit::WebPage::performDictionaryLookupAtLocation):
      (WebKit::WebPage::readSelectionFromPasteboard):
      (WebKit::WebPage::getStringSelectionForPasteboard):
      (WebKit::WebPage::getDataSelectionForPasteboard):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154286 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      87ae63d7
  4. 22 May, 2013 1 commit
  5. 09 Feb, 2013 1 commit
    • mkwst@chromium.org's avatar
      Use IGNORE_EXCEPTION for initialized, but unused, ExceptionCodes. · d15dbe65
      mkwst@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=109295
      
      Reviewed by Darin Adler.
      
      The monster patch in http://wkbug.com/108771 missed an entire class of
      ignored exceptions. It only dealt with call sites that never initialized
      the ExceptionCode variable, on the assumption that only such call sites
      would ignore the variable's value.
      
      That was a flawed assumption: a large number of sites that initialize the
      ExceptionCode to 0 ignore it regardless. This patch deals with the
      almost-as-large set of callsites that initialize the variable, pass it to
      a function, and then never touch it again.
      
      * Modules/indexeddb/IDBDatabase.cpp:
      (WebCore::IDBDatabase::forceClose):
      * accessibility/AccessibilityRenderObject.cpp:
      (WebCore::AccessibilityRenderObject::ariaSelectedTextRange):
      (WebCore::AccessibilityRenderObject::visiblePositionForIndex):
      (WebCore::AccessibilityRenderObject::indexForVisiblePosition):
      * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
      (getSelectionOffsetsForObject):
      * accessibility/atk/WebKitAccessibleUtil.cpp:
      (selectionBelongsToObject):
      * dom/Node.cpp:
      (WebCore::Node::textRects):
      * editing/DeleteButtonController.cpp:
      (WebCore::DeleteButtonController::hide):
      * editing/EditingStyle.cpp:
      (WebCore::EditingStyle::styleAtSelectionStart):
      * editing/Editor.cpp:
      (WebCore::Editor::canDeleteRange):
      (WebCore::Editor::pasteAsPlainText):
      (WebCore::Editor::pasteAsFragment):
      (WebCore::Editor::shouldDeleteRange):
      (WebCore::Editor::dispatchCPPEvent):
      (WebCore::Editor::setComposition):
      (WebCore::Editor::advanceToNextMisspelling):
      (WebCore::isFrameInRange):
      * editing/EditorCommand.cpp:
      (WebCore::expandSelectionToGranularity):
      * editing/MergeIdenticalElementsCommand.cpp:
      (WebCore::MergeIdenticalElementsCommand::doApply):
      * editing/SplitElementCommand.cpp:
      (WebCore::SplitElementCommand::doUnapply):
      * editing/SplitTextNodeCommand.cpp:
      (WebCore::SplitTextNodeCommand::doApply):
      * editing/TextCheckingHelper.cpp:
      (WebCore::expandToParagraphBoundary):
      (WebCore::TextCheckingHelper::findFirstMisspellingOrBadGrammar):
      (WebCore::TextCheckingHelper::isUngrammatical):
      (WebCore::TextCheckingHelper::guessesForMisspelledOrUngrammaticalRange):
      * editing/TextInsertionBaseCommand.cpp:
      (WebCore::dispatchBeforeTextInsertedEvent):
      (WebCore::canAppendNewLineFeedToSelection):
      * editing/TextIterator.cpp:
      (WebCore::findPlainText):
      * editing/htmlediting.cpp:
      (WebCore::extendRangeToWrappingNodes):
      (WebCore::isNodeVisiblyContainedWithin):
      * editing/visible_units.cpp:
      (WebCore::nextBoundary):
      * html/FileInputType.cpp:
      (WebCore::FileInputType::createShadowSubtree):
      * html/HTMLKeygenElement.cpp:
      (WebCore::HTMLKeygenElement::HTMLKeygenElement):
      * html/HTMLScriptElement.cpp:
      (WebCore::HTMLScriptElement::setText):
      * html/HTMLTitleElement.cpp:
      (WebCore::HTMLTitleElement::setText):
      * html/HTMLTrackElement.cpp:
      (WebCore::HTMLTrackElement::didCompleteLoad):
      * html/RangeInputType.cpp:
      (WebCore::RangeInputType::createShadowSubtree):
      * html/SearchInputType.cpp:
      (WebCore::SearchInputType::createShadowSubtree):
      * html/TextFieldInputType.cpp:
      (WebCore::TextFieldInputType::createShadowSubtree):
      * html/track/TextTrackList.cpp:
      (TextTrackList::asyncEventTimerFired):
      * inspector/DOMPatchSupport.cpp:
      (WebCore::DOMPatchSupport::patchDocument):
      * inspector/InspectorDatabaseAgent.cpp:
      (WebCore):
      * inspector/InspectorFileSystemAgent.cpp:
      (WebCore):
      * page/DOMSelection.cpp:
      (WebCore::DOMSelection::addRange):
      * page/DragController.cpp:
      (WebCore::DragController::dispatchTextInputEventFor):
      * page/EventHandler.cpp:
      (WebCore::EventHandler::dispatchMouseEvent):
      (WebCore::EventHandler::handleTouchEvent):
      * page/FrameActionScheduler.cpp:
      (WebCore::EventFrameAction::fire):
      * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
      (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource):
      * svg/SVGDocument.cpp:
      (WebCore::SVGDocument::dispatchZoomEvent):
      (WebCore::SVGDocument::dispatchScrollEvent):
      * svg/SVGLength.cpp:
      (WebCore::SVGLength::SVGLength):
      (WebCore::SVGLength::value):
      * xml/parser/XMLDocumentParser.cpp:
      (WebCore::XMLDocumentParser::exitText):
      * xml/parser/XMLDocumentParserQt.cpp:
      (WebCore::XMLDocumentParser::parse):
      (WebCore::XMLDocumentParser::startDocument):
      (WebCore::XMLDocumentParser::parseCharacters):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142375 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      d15dbe65
  6. 08 Feb, 2013 1 commit
    • mkwst@chromium.org's avatar
      Replace ExceptionCode assertions with ASSERT_NO_EXCEPTION macro. · 4d257487
      mkwst@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=109044
      
      Reviewed by Darin Adler.
      
      The pattern:
      
          ExceptionCode ec = 0;
          methodThatGeneratesException(ec);
          ASSERT(!ec);
      
      is more clearly and succinctly written as:
      
          methodThatGeneratesException(ASSERT_NO_EXCEPTION);
      
      This patch replaces the occurances of the former that never touch 'ec'
      again with the latter. It does the same for 'ASSERT(ec == 0);' (and, as
      a drive-by, replaces 'ASSERT(ec == 0)' with 'ASSERT(!ec)' in places
      where it does indeed matter that 'ec' get set properly.
      
      No change in behavior should result from this refactoring.
      
      * dom/ContainerNode.cpp:
      (WebCore::ContainerNode::takeAllChildrenFrom):
      * dom/Document.cpp:
      (WebCore::Document::setTitle):
      * dom/MessagePort.cpp:
      (WebCore::MessagePort::dispatchMessages):
      (WebCore::MessagePort::disentanglePorts):
      * editing/DeleteButtonController.cpp:
      (WebCore::enclosingDeletableElement):
      (WebCore::DeleteButtonController::createDeletionUI):
          Replaced inline ASSERT with ASSERT_NO_EXCEPTION.
      (WebCore::DeleteButtonController::show):
          Replaced 'ASSERT(ec == 0)' with 'ASSERT(!ec)' to match the style guide.
      * editing/EditorCommand.cpp:
      (WebCore::unionDOMRanges):
      * editing/ReplaceNodeWithSpanCommand.cpp:
      (WebCore::swapInNodePreservingAttributesAndChildren):
      * editing/ReplaceSelectionCommand.cpp:
      (WebCore::ReplacementFragment::ReplacementFragment):
      (WebCore::ReplacementFragment::removeNode):
      (WebCore::ReplacementFragment::insertNodeBefore):
      (WebCore::ReplacementFragment::insertFragmentForTestRendering):
      (WebCore::ReplacementFragment::restoreAndRemoveTestRenderingNodesToFragment):
      (WebCore::ReplaceSelectionCommand::insertAsListItems):
      * editing/SplitTextNodeCommand.cpp:
      (WebCore::SplitTextNodeCommand::doUnapply):
      * editing/TextIterator.cpp:
      (WebCore::CharacterIterator::range):
      (WebCore::BackwardsCharacterIterator::range):
      (WebCore::TextIterator::rangeFromLocationAndLength):
      (WebCore::collapsedToBoundary):
      * editing/htmlediting.cpp:
      (WebCore::createTabSpanElement):
      * editing/mac/EditorMac.mm:
      (WebCore::Editor::fontForSelection):
      (WebCore::Editor::fontAttributesForSelectionStart):
      * editing/markup.cpp:
      (WebCore::createMarkup):
      (WebCore::trimFragment):
      (WebCore::createFragmentFromMarkupWithContext):
      (WebCore::fillContainerFromString):
      (WebCore::createFragmentFromText):
      (WebCore::createFragmentFromNodes):
      * html/ColorInputType.cpp:
      (WebCore::ColorInputType::createShadowSubtree):
          Replaced inline ASSERT with ASSERT_NO_EXCEPTION.
      * html/HTMLOptionsCollection.cpp:
      (WebCore::HTMLOptionsCollection::add):
          Replaced 'ASSERT(ec == 0)' with 'ASSERT(!ec)' to match the style guide.
      * html/HTMLTextAreaElement.cpp:
      (WebCore::HTMLTextAreaElement::updatePlaceholderText):
      * html/HTMLTextFormControlElement.cpp:
      (WebCore::HTMLTextFormControlElement::indexForVisiblePosition):
      (WebCore::HTMLTextFormControlElement::setInnerTextValue):
      * html/TextFieldInputType.cpp:
      (WebCore::TextFieldInputType::updatePlaceholderText):
      * html/ValidationMessage.cpp:
      (WebCore::ValidationMessage::buildBubbleTree):
      * html/shadow/MediaControlElementTypes.cpp:
      (WebCore::MediaControlVolumeSliderElement::defaultEventHandler):
      * inspector/InspectorPageAgent.cpp:
      (WebCore::InspectorPageAgent::getCookies):
      * inspector/InspectorStyleSheet.cpp:
      (WebCore::InspectorStyleSheet::addRule):
      * loader/appcache/ApplicationCacheHost.cpp:
      (WebCore::ApplicationCacheHost::dispatchDOMEvent):
      * page/DOMSelection.cpp:
      (WebCore::DOMSelection::deleteFromDocument):
      * page/DragController.cpp:
      (WebCore::prepareClipboardForImageDrag):
      * rendering/RenderTextControl.cpp:
      (WebCore::RenderTextControl::visiblePositionForIndex):
          Replaced inline ASSERT with ASSERT_NO_EXCEPTION.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142247 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      4d257487
  7. 07 Feb, 2013 2 commits
    • gavinp@chromium.org's avatar
      Unreviewed, rolling out r142118. · 0a23dbe0
      gavinp@chromium.org authored
      http://trac.webkit.org/changeset/142118
      https://bugs.webkit.org/show_bug.cgi?id=109044
      
      Broke SVG! Oh noes!
      
      * Modules/indexeddb/IDBCursor.cpp:
      (WebCore::IDBCursor::direction):
      * Modules/indexeddb/IDBObjectStore.cpp:
      (WebCore):
      * Modules/indexeddb/IDBTransaction.cpp:
      (WebCore::IDBTransaction::mode):
      * dom/ContainerNode.cpp:
      (WebCore::ContainerNode::takeAllChildrenFrom):
      * dom/Document.cpp:
      (WebCore::Document::setTitle):
      * dom/MessagePort.cpp:
      (WebCore::MessagePort::dispatchMessages):
      (WebCore::MessagePort::disentanglePorts):
      * editing/DeleteButtonController.cpp:
      (WebCore::enclosingDeletableElement):
      (WebCore::DeleteButtonController::createDeletionUI):
      (WebCore::DeleteButtonController::show):
      * editing/EditorCommand.cpp:
      (WebCore::unionDOMRanges):
      * editing/ReplaceNodeWithSpanCommand.cpp:
      (WebCore::swapInNodePreservingAttributesAndChildren):
      * editing/ReplaceSelectionCommand.cpp:
      (WebCore::ReplacementFragment::ReplacementFragment):
      (WebCore::ReplacementFragment::removeNode):
      (WebCore::ReplacementFragment::insertNodeBefore):
      (WebCore::ReplacementFragment::insertFragmentForTestRendering):
      (WebCore::ReplacementFragment::restoreAndRemoveTestRenderingNodesToFragment):
      (WebCore::ReplaceSelectionCommand::insertAsListItems):
      * editing/SplitTextNodeCommand.cpp:
      (WebCore::SplitTextNodeCommand::doUnapply):
      * editing/TextIterator.cpp:
      (WebCore::CharacterIterator::range):
      (WebCore::BackwardsCharacterIterator::range):
      (WebCore::TextIterator::rangeFromLocationAndLength):
      (WebCore::collapsedToBoundary):
      * editing/htmlediting.cpp:
      (WebCore::createTabSpanElement):
      * editing/mac/EditorMac.mm:
      (WebCore::Editor::fontForSelection):
      (WebCore::Editor::fontAttributesForSelectionStart):
      * editing/markup.cpp:
      (WebCore::createMarkup):
      (WebCore::trimFragment):
      (WebCore::createFragmentFromMarkupWithContext):
      (WebCore::fillContainerFromString):
      (WebCore::createFragmentFromText):
      (WebCore::createFragmentFromNodes):
      * html/ColorInputType.cpp:
      (WebCore::ColorInputType::createShadowSubtree):
      * html/HTMLOptionsCollection.cpp:
      (WebCore::HTMLOptionsCollection::add):
      * html/HTMLTextAreaElement.cpp:
      (WebCore::HTMLTextAreaElement::updatePlaceholderText):
      * html/HTMLTextFormControlElement.cpp:
      (WebCore::HTMLTextFormControlElement::indexForVisiblePosition):
      (WebCore::HTMLTextFormControlElement::setInnerTextValue):
      * html/TextFieldInputType.cpp:
      (WebCore::TextFieldInputType::updatePlaceholderText):
      * html/ValidationMessage.cpp:
      (WebCore::ValidationMessage::buildBubbleTree):
      * html/shadow/MediaControlElementTypes.cpp:
      (WebCore::MediaControlVolumeSliderElement::defaultEventHandler):
      * inspector/InspectorPageAgent.cpp:
      (WebCore::InspectorPageAgent::getCookies):
      * inspector/InspectorStyleSheet.cpp:
      (WebCore::InspectorStyleSheet::addRule):
      * loader/appcache/ApplicationCacheHost.cpp:
      (WebCore::ApplicationCacheHost::dispatchDOMEvent):
      * page/DOMSelection.cpp:
      (WebCore::DOMSelection::deleteFromDocument):
      * page/DragController.cpp:
      (WebCore::prepareClipboardForImageDrag):
      * rendering/RenderTextControl.cpp:
      (WebCore::RenderTextControl::visiblePositionForIndex):
      * rendering/style/SVGRenderStyle.h:
      (WebCore::SVGRenderStyle::initialBaselineShiftValue):
      (WebCore::SVGRenderStyle::initialKerning):
      (WebCore::SVGRenderStyle::initialStrokeDashOffset):
      (WebCore::SVGRenderStyle::initialStrokeWidth):
      * svg/SVGAnimatedLength.cpp:
      (WebCore::sharedSVGLength):
      (WebCore::SVGAnimatedLengthAnimator::addAnimatedTypes):
      (WebCore::SVGAnimatedLengthAnimator::calculateAnimatedValue):
      * svg/SVGAnimatedLengthList.cpp:
      (WebCore::SVGAnimatedLengthListAnimator::addAnimatedTypes):
      (WebCore::SVGAnimatedLengthListAnimator::calculateAnimatedValue):
      * svg/SVGLength.cpp:
      (WebCore::SVGLength::SVGLength):
      * svg/SVGTextContentElement.cpp:
      (WebCore::SVGTextContentElement::textLengthAnimated):
      * svg/animation/SVGSMILElement.cpp:
      (WebCore::constructQualifiedName):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142126 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      0a23dbe0
    • mkwst@chromium.org's avatar
      Replace ExceptionCode assertions with ASSERT_NO_EXCEPTION macro. · 50f39a6e
      mkwst@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=109044
      
      Reviewed by Darin Adler.
      
      The pattern:
      
          ExceptionCode ec = 0;
          methodThatGeneratesException(ec);
          ASSERT(!ec);
      
      is more clearly and succinctly written as:
      
          methodThatGeneratesException(ASSERT_NO_EXCEPTION);
      
      This patch replaces the occurances of the former that never touch 'ec'
      again with the latter. It does the same for 'ASSERT(ec == 0);' (and, as
      a drive-by, replaces 'ASSERT(ec == 0)' with 'ASSERT(!ec)' in places
      where it does indeed matter that 'ec' get set properly.
      
      No change in behavior should result from this refactoring.
      
      * Modules/indexeddb/IDBCursor.cpp:
      (WebCore::IDBCursor::direction):
      * Modules/indexeddb/IDBObjectStore.cpp:
      (WebCore):
      * Modules/indexeddb/IDBTransaction.cpp:
      (WebCore::IDBTransaction::mode):
      * dom/ContainerNode.cpp:
      (WebCore::ContainerNode::takeAllChildrenFrom):
      * dom/Document.cpp:
      (WebCore::Document::setTitle):
      * dom/MessagePort.cpp:
      (WebCore::MessagePort::dispatchMessages):
      (WebCore::MessagePort::disentanglePorts):
      * editing/DeleteButtonController.cpp:
      (WebCore::enclosingDeletableElement):
      (WebCore::DeleteButtonController::createDeletionUI):
          Replaced inline ASSERT with ASSERT_NO_EXCEPTION.
      (WebCore::DeleteButtonController::show):
          Replaced 'ASSERT(ec == 0)' with 'ASSERT(!ec)' to match the style guide.
      * editing/EditorCommand.cpp:
      (WebCore::unionDOMRanges):
      * editing/ReplaceNodeWithSpanCommand.cpp:
      (WebCore::swapInNodePreservingAttributesAndChildren):
      * editing/ReplaceSelectionCommand.cpp:
      (WebCore::ReplacementFragment::ReplacementFragment):
      (WebCore::ReplacementFragment::removeNode):
      (WebCore::ReplacementFragment::insertNodeBefore):
      (WebCore::ReplacementFragment::insertFragmentForTestRendering):
      (WebCore::ReplacementFragment::restoreAndRemoveTestRenderingNodesToFragment):
      (WebCore::ReplaceSelectionCommand::insertAsListItems):
      * editing/SplitTextNodeCommand.cpp:
      (WebCore::SplitTextNodeCommand::doUnapply):
      * editing/TextIterator.cpp:
      (WebCore::CharacterIterator::range):
      (WebCore::BackwardsCharacterIterator::range):
      (WebCore::TextIterator::rangeFromLocationAndLength):
      (WebCore::collapsedToBoundary):
      * editing/htmlediting.cpp:
      (WebCore::createTabSpanElement):
      * editing/mac/EditorMac.mm:
      (WebCore::Editor::fontForSelection):
      (WebCore::Editor::fontAttributesForSelectionStart):
      * editing/markup.cpp:
      (WebCore::createMarkup):
      (WebCore::trimFragment):
      (WebCore::createFragmentFromMarkupWithContext):
      (WebCore::fillContainerFromString):
      (WebCore::createFragmentFromText):
      (WebCore::createFragmentFromNodes):
      * html/ColorInputType.cpp:
      (WebCore::ColorInputType::createShadowSubtree):
          Replaced inline ASSERT with ASSERT_NO_EXCEPTION.
      * html/HTMLOptionsCollection.cpp:
      (WebCore::HTMLOptionsCollection::add):
          Replaced 'ASSERT(ec == 0)' with 'ASSERT(!ec)' to match the style guide.
      * html/HTMLTextAreaElement.cpp:
      (WebCore::HTMLTextAreaElement::updatePlaceholderText):
      * html/HTMLTextFormControlElement.cpp:
      (WebCore::HTMLTextFormControlElement::indexForVisiblePosition):
      (WebCore::HTMLTextFormControlElement::setInnerTextValue):
      * html/TextFieldInputType.cpp:
      (WebCore::TextFieldInputType::updatePlaceholderText):
      * html/ValidationMessage.cpp:
      (WebCore::ValidationMessage::buildBubbleTree):
      * html/shadow/MediaControlElementTypes.cpp:
      (WebCore::MediaControlVolumeSliderElement::defaultEventHandler):
      * inspector/InspectorPageAgent.cpp:
      (WebCore::InspectorPageAgent::getCookies):
      * inspector/InspectorStyleSheet.cpp:
      (WebCore::InspectorStyleSheet::addRule):
      * loader/appcache/ApplicationCacheHost.cpp:
      (WebCore::ApplicationCacheHost::dispatchDOMEvent):
      * page/DOMSelection.cpp:
      (WebCore::DOMSelection::deleteFromDocument):
      * page/DragController.cpp:
      (WebCore::prepareClipboardForImageDrag):
      * rendering/RenderTextControl.cpp:
      (WebCore::RenderTextControl::visiblePositionForIndex):
      * rendering/style/SVGRenderStyle.h:
      (WebCore::SVGRenderStyle::initialBaselineShiftValue):
      (WebCore::SVGRenderStyle::initialKerning):
      (WebCore::SVGRenderStyle::initialStrokeDashOffset):
      (WebCore::SVGRenderStyle::initialStrokeWidth):
      * svg/SVGAnimatedLength.cpp:
      (WebCore::sharedSVGLength):
      (WebCore::SVGAnimatedLengthAnimator::addAnimatedTypes):
      (WebCore::SVGAnimatedLengthAnimator::calculateAnimatedValue):
      * svg/SVGAnimatedLengthList.cpp:
      (WebCore::SVGAnimatedLengthListAnimator::addAnimatedTypes):
      (WebCore::SVGAnimatedLengthListAnimator::calculateAnimatedValue):
      * svg/SVGLength.cpp:
      (WebCore::SVGLength::SVGLength):
      * svg/SVGTextContentElement.cpp:
      (WebCore::SVGTextContentElement::textLengthAnimated):
      * svg/animation/SVGSMILElement.cpp:
      (WebCore::constructQualifiedName):
          Replaced inline ASSERT with ASSERT_NO_EXCEPTION.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142118 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      50f39a6e
  8. 05 Feb, 2013 1 commit
    • mkwst@chromium.org's avatar
      Cleanup: Use exceptionless Range::* methods rather than ignoring exceptions. · e12976ac
      mkwst@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=108773
      
      Reviewed by Darin Adler.
      
      We often call Range::{start,end}{Container,Offset} with an ExceptionCode
      that's completely ignored. In these cases, we should simply use the
      exceptionless version of the method instead.
      
      * dom/DocumentMarkerController.cpp:
      (WebCore::DocumentMarkerController::addMarker):
          Here, I also moved parameters onto one line to make the
          stylebot happy.
      (WebCore::DocumentMarkerController::addTextMatchMarker):
      (WebCore::DocumentMarkerController::setMarkersActive):
          Dropped ignored ExceptionCode variable entirely.
      * accessibility/AccessibilityRenderObject.cpp:
      (WebCore::AccessibilityRenderObject::visiblePositionForIndex):
          Can't drop the variable because of the selectNodeContents call.
      * editing/Editor.cpp:
      (WebCore::Editor::canDeleteRange):
          Dropped ignored ExceptionCode variable entirely.
      (WebCore::Editor::advanceToNextMisspelling):
          Can't drop the variable because of setStart/setEnd.
      * editing/EditorCommand.cpp:
      (WebCore::unionDOMRanges):
          Can't drop the variable because of compareBoundaryPoints.
      * editing/MarkupAccumulator.cpp:
      (WebCore::MarkupAccumulator::appendNodeValue):
          Dropped ignored ExceptionCode variable entirely.
      * editing/TextCheckingHelper.cpp:
      (WebCore::TextCheckingParagraph::offsetAsRange):
      (WebCore::TextCheckingHelper::findFirstMisspelling):
      (WebCore::TextCheckingHelper::findFirstGrammarDetail):
      (WebCore::TextCheckingHelper::findFirstMisspellingOrBadGrammar):
      * editing/markup.cpp:
      (WebCore::StyledMarkupAccumulator::renderedText):
      (WebCore::StyledMarkupAccumulator::stringValueForRange):
          Dropped ignored ExceptionCode variable entirely.
      * editing/visible_units.cpp:
      (WebCore::previousBoundary):
          Can't drop the variable due to many other calls.
      * page/DOMSelection.cpp:
      (WebCore::DOMSelection::deleteFromDocument):
      (WebCore::DOMSelection::containsNode):
          For both these cases, the 'ASSERT(!ec)' after the statement I've
          edited only checked the last occurance of the exception: that is,
          if 'startXxx(ec)' threw an exception, it would be overwritten by
          the 'setBaseAndExtend()' or 'compareBoundaryPoints()' exception.
          Removing the exception parameters from the parameters' calls
          shouldn't effect behavior.
      * platform/chromium/PasteboardChromium.cpp:
      (WebCore::Pasteboard::writeSelection):
      * platform/mac/HTMLConverter.mm:
      (+[WebHTMLConverter editingAttributedStringFromRange:]):
      * platform/win/ClipboardWin.cpp:
      (WebCore::ClipboardWin::writeRange):
      * platform/win/PasteboardWin.cpp:
      (WebCore::Pasteboard::writeSelection):
      * platform/wince/PasteboardWinCE.cpp:
      (WebCore::Pasteboard::writeSelection):
          Dropped ignored ExceptionCode variable entirely.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141877 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      e12976ac
  9. 13 Nov, 2012 2 commits
    • commit-queue@webkit.org's avatar
      Unreviewed, rolling out r134345. · a5d24144
      commit-queue@webkit.org authored
      http://trac.webkit.org/changeset/134345
      https://bugs.webkit.org/show_bug.cgi?id=102106
      
      Incomplete support for NATIVE_TYPE_ERR in objc and other
      bindings (Requested by jsbell on #webkit).
      
      Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2012-11-13
      
      Source/WebCore:
      
      * Modules/mediastream/MediaConstraintsImpl.cpp:
      (WebCore::MediaConstraintsImpl::create):
      * Modules/mediastream/MediaStreamTrackList.cpp:
      (WebCore::MediaStreamTrackList::add):
      (WebCore::MediaStreamTrackList::remove):
      * Modules/mediastream/RTCDataChannel.cpp:
      (WebCore::RTCDataChannel::setBinaryType):
      * Modules/mediastream/RTCIceCandidate.cpp:
      (WebCore::RTCIceCandidate::create):
      * Modules/mediastream/RTCPeerConnection.cpp:
      (WebCore::RTCPeerConnection::parseConfiguration):
      (WebCore::RTCPeerConnection::createOffer):
      (WebCore::RTCPeerConnection::createAnswer):
      (WebCore::RTCPeerConnection::setLocalDescription):
      (WebCore::RTCPeerConnection::setRemoteDescription):
      (WebCore::RTCPeerConnection::addIceCandidate):
      (WebCore::RTCPeerConnection::addStream):
      (WebCore::RTCPeerConnection::removeStream):
      * Modules/mediastream/RTCSessionDescription.cpp:
      (WebCore::RTCSessionDescription::create):
      (WebCore::RTCSessionDescription::setType):
      * bindings/js/CallbackFunction.cpp:
      (WebCore::checkFunctionOnlyCallback):
      * bindings/js/JSCustomXPathNSResolver.cpp:
      (WebCore::JSCustomXPathNSResolver::create):
      * bindings/js/JSHTMLOptionsCollectionCustom.cpp:
      (WebCore::JSHTMLOptionsCollection::add):
      * bindings/js/JSHTMLSelectElementCustom.cpp:
      (WebCore::selectIndexSetter):
      * bindings/js/JSMutationObserverCustom.cpp:
      (WebCore::JSMutationObserverConstructor::constructJSMutationObserver):
      * bindings/js/JSSQLResultSetRowListCustom.cpp:
      (WebCore::JSSQLResultSetRowList::item):
      * bindings/js/JSSQLTransactionCustom.cpp:
      (WebCore::JSSQLTransaction::executeSql):
      * bindings/js/JSSQLTransactionSyncCustom.cpp:
      (WebCore::JSSQLTransactionSync::executeSql):
      * bindings/scripts/CodeGeneratorJS.pm:
      (GenerateParametersCheck):
      * bindings/scripts/CodeGeneratorObjC.pm:
      (GenerateImplementation):
      * bindings/scripts/CodeGeneratorV8.pm:
      (GenerateFunctionCallString):
      * bindings/v8/V8Callback.h:
      (WebCore::createFunctionOnlyCallback):
      * bindings/v8/V8Collection.cpp:
      (WebCore::toOptionsCollectionSetter):
      * bindings/v8/custom/V8DocumentCustom.cpp:
      (WebCore::V8Document::evaluateCallback):
      * bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp:
      (WebCore::V8HTMLOptionsCollection::addCallback):
      * bindings/v8/custom/V8MutationObserverCustom.cpp:
      (WebCore::V8MutationObserver::constructorCallback):
      * bindings/v8/custom/V8SQLTransactionCustom.cpp:
      (WebCore::V8SQLTransaction::executeSqlCallback):
      * bindings/v8/custom/V8SQLTransactionSyncCustom.cpp:
      (WebCore::V8SQLTransactionSync::executeSqlCallback):
      * dom/DOMCoreException.idl:
      * html/HTMLElement.cpp:
      (WebCore::HTMLElement::insertAdjacentElement):
      * html/HTMLMediaElement.cpp:
      (WebCore::HTMLMediaElement::webkitAddKey):
      * html/HTMLOptionsCollection.cpp:
      (WebCore::HTMLOptionsCollection::add):
      * html/canvas/CanvasRenderingContext2D.cpp:
      (WebCore::CanvasRenderingContext2D::drawImage):
      (WebCore::CanvasRenderingContext2D::createPattern):
      (WebCore::CanvasRenderingContext2D::putImageData):
      (WebCore::CanvasRenderingContext2D::webkitPutImageDataHD):
      * page/Crypto.cpp:
      (WebCore::Crypto::getRandomValues):
      * page/DOMSelection.cpp:
      (WebCore::DOMSelection::extend):
      * svg/properties/SVGTransformListPropertyTearOff.h:
      (WebCore::SVGTransformListPropertyTearOff::createSVGTransformFromMatrix):
      
      LayoutTests:
      
      * canvas/philip/tests/2d.drawImage.null.html:
      * canvas/philip/tests/2d.imageData.put.null.html:
      * canvas/philip/tests/2d.pattern.image.null.html:
      * editing/selection/extend-expected.txt:
      * fast/dom/Geolocation/argument-types-expected.txt:
      * fast/dom/Geolocation/not-enough-arguments-expected.txt:
      * fast/dom/Geolocation/script-tests/argument-types.js:
      (test):
      * fast/dom/HTMLSelectElement/select-selectedIndex-expected.txt:
      * fast/dom/HTMLSelectElement/select-selectedIndex-multiple-expected.txt:
      * fast/js/select-options-add-expected.txt:
      * fast/mediastream/RTCIceCandidate-expected.txt:
      * fast/mediastream/RTCPeerConnection-expected.txt:
      * fast/mediastream/RTCSessionDescription-expected.txt:
      * media/encrypted-media/encrypted-media-syntax-expected.txt:
      * media/encrypted-media/encrypted-media-syntax.html:
      * media/video-test.js:
      * platform/chromium/fast/dynamic/insertAdjacentElement-expected.txt:
      * security/crypto-random-values-types-expected.txt:
      * svg/dom/SVGTransformList-expected.txt:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134440 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      a5d24144
    • arv@chromium.org's avatar
      Replace DOMException TYPE_MISMATCH_ERR with TypeError · 04fc7b0e
      arv@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=101604
      
      Reviewed by Adam Barth.
      
      Source/WebCore:
      
      DOMException.TYPE_MISMATCH_ERR is deprecated in favor of using TypeError.
      
      We have historically used TYPE_MISMATCH_ERR as a blanket DOMException code when
      the spec mandates TypeError being thrown.
      
      Updated existing tests.
      
      * Modules/mediastream/MediaConstraintsImpl.cpp:
      * Modules/mediastream/MediaStreamTrackList.cpp:
      * Modules/mediastream/PeerConnection00.cpp:
      * Modules/mediastream/RTCDataChannel.cpp:
      * Modules/mediastream/RTCIceCandidate.cpp:
      * Modules/mediastream/RTCPeerConnection.cpp:
      * Modules/mediastream/RTCSessionDescription.cpp:
      * Modules/mediastream/SessionDescription.cpp:
      * bindings/js/CallbackFunction.cpp:
      * bindings/js/JSCustomXPathNSResolver.cpp:
      * bindings/js/JSHTMLOptionsCollectionCustom.cpp:
      * bindings/js/JSHTMLSelectElementCustom.cpp:
      * bindings/js/JSMutationObserverCustom.cpp:
      * bindings/js/JSSQLResultSetRowListCustom.cpp:
      * bindings/js/JSSQLTransactionCustom.cpp:
      * bindings/js/JSSQLTransactionSyncCustom.cpp:
      * bindings/scripts/CodeGeneratorJS.pm:
      * bindings/scripts/CodeGeneratorObjC.pm:
      * bindings/scripts/CodeGeneratorV8.pm:
      * bindings/v8/V8Callback.h:
      * bindings/v8/V8Collection.cpp:
      * bindings/v8/custom/V8DocumentCustom.cpp:
      * bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp:
      * bindings/v8/custom/V8MutationObserverCustom.cpp:
      * bindings/v8/custom/V8SQLTransactionCustom.cpp:
      * bindings/v8/custom/V8SQLTransactionSyncCustom.cpp:
      * dom/DOMCoreException.idl:
      * html/HTMLElement.cpp:
      * html/HTMLMediaElement.cpp:
      * html/HTMLOptionsCollection.cpp:
      * html/canvas/CanvasRenderingContext2D.cpp:
      * page/Crypto.cpp:
      * page/DOMSelection.cpp:
      * svg/properties/SVGTransformListPropertyTearOff.h:
      
      LayoutTests:
      
      Update the tests to test for TypeError instead of DOMException with the TYPE_MISMATCH_ERR code.
      
      * canvas/philip/tests/2d.drawImage.null.html:
      * canvas/philip/tests/2d.imageData.put.null.html:
      * canvas/philip/tests/2d.pattern.image.null.html:
      * editing/selection/extend-expected.txt:
      * fast/dom/Geolocation/argument-types-expected.txt:
      * fast/dom/Geolocation/not-enough-arguments-expected.txt:
      * fast/dom/Geolocation/script-tests/argument-types.js:
      * fast/dom/HTMLSelectElement/select-selectedIndex-expected.txt:
      * fast/dom/HTMLSelectElement/select-selectedIndex-multiple-expected.txt:
      * fast/js/select-options-add-expected.txt:
      * fast/mediastream/RTCIceCandidate-expected.txt:
      * fast/mediastream/RTCPeerConnection-expected.txt:
      * fast/mediastream/RTCSessionDescription-expected.txt:
      * fast/mediastream/SessionDescription-expected.txt:
      * fast/mediastream/peerconnection-addstream-expected.txt:
      * fast/mediastream/peerconnection-iceoptions-expected.txt:
      * fast/mediastream/peerconnection-iceoptions.html:
      * fast/mediastream/peerconnection-removestream-expected.txt:
      * media/encrypted-media/encrypted-media-syntax.html:
      * media/video-test.js:
      * platform/chromium/fast/dynamic/insertAdjacentElement-expected.txt:
      * security/crypto-random-values-types-expected.txt:
      * svg/dom/SVGTransformList-expected.txt:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134345 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      04fc7b0e
  10. 02 Oct, 2012 1 commit
  11. 06 Sep, 2012 1 commit
    • weinig@apple.com's avatar
      Part 2 of removing PlatformString.h, remove PlatformString.h · 3f5ab024
      weinig@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=95931
      
      Reviewed by Adam Barth.
      
      Remove PlatformString.h
      
      Source/WebCore:
      
      * GNUmakefile.list.am:
      * Modules/filesystem/AsyncFileWriter.h:
      * Modules/filesystem/DOMFilePath.h:
      * Modules/filesystem/DOMFileSystemBase.h:
      * Modules/filesystem/DirectoryEntry.h:
      * Modules/filesystem/DirectoryEntrySync.h:
      * Modules/filesystem/DirectoryReader.h:
      * Modules/filesystem/DirectoryReaderBase.h:
      * Modules/filesystem/DirectoryReaderSync.h:
      * Modules/filesystem/EntryBase.cpp:
      * Modules/filesystem/EntrySync.h:
      * Modules/filesystem/FileEntrySync.h:
      * Modules/filesystem/FileSystemCallbacks.h:
      * Modules/filesystem/LocalFileSystem.h:
      * Modules/geolocation/GeolocationError.h:
      * Modules/geolocation/Geoposition.h:
      * Modules/geolocation/PositionError.h:
      * Modules/indexeddb/IDBAny.h:
      * Modules/indexeddb/IDBDatabaseBackendInterface.h:
      * Modules/indexeddb/IDBDatabaseCallbacks.h:
      * Modules/indexeddb/IDBDatabaseCallbacksImpl.h:
      * Modules/indexeddb/IDBDatabaseError.h:
      * Modules/indexeddb/IDBFactory.h:
      * Modules/indexeddb/IDBFactoryBackendInterface.h:
      * Modules/indexeddb/IDBIndex.h:
      * Modules/indexeddb/IDBIndexBackendInterface.h:
      * Modules/indexeddb/IDBKey.h:
      * Modules/indexeddb/IDBKeyPath.h:
      * Modules/indexeddb/IDBMetadata.h:
      * Modules/indexeddb/IDBObjectStore.h:
      * Modules/indexeddb/IDBObjectStoreBackendInterface.h:
      * Modules/indexeddb/IDBTransactionBackendInterface.h:
      * Modules/indexeddb/IDBUpgradeNeededEvent.h:
      * Modules/indexeddb/IDBVersionChangeEvent.h:
      * Modules/mediastream/MediaStreamTrack.h:
      * Modules/networkinfo/NetworkInfoConnection.h:
      * Modules/notifications/DOMWindowNotifications.h:
      * Modules/speech/SpeechGrammar.h:
      * Modules/speech/SpeechRecognition.h:
      * Modules/speech/SpeechRecognitionAlternative.h:
      * Modules/speech/SpeechRecognitionClient.h:
      * Modules/speech/SpeechRecognitionError.h:
      * Modules/webaudio/AudioContext.cpp:
      * Modules/webaudio/AudioParam.h:
      * Modules/webdatabase/AbstractDatabase.h:
      * Modules/webdatabase/ChangeVersionWrapper.h:
      * Modules/webdatabase/DOMWindowWebDatabase.h:
      * Modules/webdatabase/Database.h:
      * Modules/webdatabase/DatabaseAuthorizer.cpp:
      * Modules/webdatabase/DatabaseAuthorizer.h:
      * Modules/webdatabase/DatabaseDetails.h:
      * Modules/webdatabase/DatabaseSync.h:
      * Modules/webdatabase/DatabaseTask.h:
      * Modules/webdatabase/DatabaseTracker.h:
      * Modules/webdatabase/OriginUsageRecord.h:
      * Modules/webdatabase/SQLError.h:
      * Modules/webdatabase/SQLStatement.h:
      * Modules/webdatabase/SQLStatementSync.h:
      * Modules/webdatabase/SQLTransaction.cpp:
      * Modules/webdatabase/SQLTransactionSync.cpp:
      * Modules/webdatabase/SQLTransactionSync.h:
      * Modules/webdatabase/WorkerContextWebDatabase.h:
      * Modules/webdatabase/chromium/DatabaseTrackerChromium.cpp:
      * Modules/webdatabase/chromium/QuotaTracker.h:
      * Modules/websockets/ThreadableWebSocketChannel.cpp:
      * Modules/websockets/ThreadableWebSocketChannelClientWrapper.h:
      * Modules/websockets/WebSocketHandshake.h:
      * Modules/websockets/WebSocketHandshakeResponse.h:
      * Modules/websockets/WorkerThreadableWebSocketChannel.cpp:
      * Modules/websockets/WorkerThreadableWebSocketChannel.h:
      * WebCore.gypi:
      * WebCore.vcproj/WebCore.vcproj:
      * WebCore.xcodeproj/project.pbxproj:
      * bindings/gobject/ConvertToUTF8String.cpp:
      * bindings/js/JSCSSStyleDeclarationCustom.cpp:
      * bindings/js/JSClipboardCustom.cpp:
      * bindings/js/JSImageDataCustom.cpp:
      * bindings/js/JSInspectorFrontendHostCustom.cpp:
      * bindings/js/JSLazyEventListener.h:
      * bindings/js/JSStorageCustom.cpp:
      * bindings/js/JSXSLTProcessorCustom.cpp:
      * bindings/js/JavaScriptCallFrame.cpp:
      * bindings/js/ScheduledAction.h:
      * bindings/js/ScriptDebugServer.h:
      * bindings/js/ScriptHeapSnapshot.h:
      * bindings/js/ScriptValue.h:
      * bindings/js/SerializedScriptValue.h:
      * bindings/objc/DOMCustomXPathNSResolver.mm:
      * bindings/objc/DOMXPath.mm:
      * bindings/objc/WebScriptObject.mm:
      * bindings/scripts/CodeGeneratorJS.pm:
      (AddIncludesForTypeInImpl):
      (AddIncludesForSVGAnimatedType):
      * bindings/scripts/CodeGeneratorV8.pm:
      (AddIncludesForType):
      * bindings/v8/Dictionary.h:
      * bindings/v8/JavaScriptCallFrame.h:
      * bindings/v8/NPV8Object.cpp:
      * bindings/v8/ScriptDebugServer.h:
      * bindings/v8/ScriptFunctionCall.h:
      * bindings/v8/ScriptHeapSnapshot.h:
      * bindings/v8/ScriptProfile.h:
      * bindings/v8/ScriptProfileNode.h:
      * bindings/v8/ScriptProfiler.h:
      * bindings/v8/ScriptSourceCode.h:
      * bindings/v8/V8Binding.cpp:
      * bindings/v8/V8DOMWrapper.h:
      * bindings/v8/V8LazyEventListener.h:
      * bindings/v8/V8NPUtils.cpp:
      * bindings/v8/custom/V8HTMLCanvasElementCustom.cpp:
      * bindings/v8/custom/V8InspectorFrontendHostCustom.cpp:
      * bindings/v8/custom/V8LocationCustom.cpp:
      * bridge/IdentifierRep.cpp:
      * bridge/NP_jsobject.cpp:
      * bridge/c/c_utility.cpp:
      * css/CSSBasicShapes.h:
      * css/CSSBorderImageSliceValue.cpp:
      * css/CSSCharsetRule.h:
      * css/CSSCursorImageValue.cpp:
      * css/CSSFontFaceSrcValue.h:
      * css/CSSGradientValue.cpp:
      * css/CSSInheritedValue.cpp:
      * css/CSSInitialValue.cpp:
      * css/CSSLineBoxContainValue.cpp:
      * css/CSSMediaRule.h:
      * css/CSSProperty.cpp:
      * css/CSSPropertySourceData.cpp:
      * css/CSSPropertySourceData.h:
      * css/CSSReflectValue.cpp:
      * css/CSSTimingFunctionValue.cpp:
      * css/CSSUnicodeRangeValue.cpp:
      * css/CSSValueList.cpp:
      * css/Counter.h:
      * css/FontFeatureValue.h:
      * css/FontValue.cpp:
      * css/MediaQuery.h:
      * css/MediaQueryEvaluator.h:
      * css/MediaQueryListListener.h:
      * css/ShadowValue.cpp:
      * css/StyleMedia.h:
      * css/StyleSheet.h:
      * css/StyleSheetList.cpp:
      * css/WebKitCSSMatrix.h:
      * css/WebKitCSSTransformValue.cpp:
      * dom/DOMStringList.h:
      * dom/DOMStringMap.h:
      * dom/DocumentMarker.h:
      * dom/ErrorEvent.h:
      * dom/ExceptionBase.h:
      * dom/MessagePortChannel.h:
      * dom/MutationRecord.h:
      * dom/TransformSource.h:
      * dom/ViewportArguments.cpp:
      * editing/DOMTransactionStep.h:
      * editing/EditingStyle.h:
      * editing/MarkupAccumulator.h:
      * editing/SmartReplaceICU.cpp:
      * editing/SpellChecker.h:
      * editing/SurroundingText.h:
      * fileapi/AsyncFileStream.cpp:
      * fileapi/Blob.h:
      * fileapi/BlobURL.cpp:
      * fileapi/File.h:
      * history/HistoryItem.h:
      * history/blackberry/HistoryItemViewState.h:
      * history/cf/HistoryPropertyList.h:
      * html/DOMFormData.cpp:
      * html/DOMURL.h:
      * html/MicroDataItemValue.h:
      * html/PublicURLManager.h:
      * html/canvas/CanvasPattern.cpp:
      * html/canvas/CanvasRenderingContext2D.h:
      * html/canvas/CanvasStyle.h:
      * html/canvas/WebGLActiveInfo.h:
      * html/canvas/WebGLGetInfo.h:
      * html/canvas/WebGLRenderingContext.h:
      * html/parser/CSSPreloadScanner.h:
      * html/parser/HTMLEntitySearch.h:
      * html/parser/HTMLEntityTable.h:
      * html/parser/HTMLMetaCharsetParser.cpp:
      * inspector/CodeGeneratorInspector.py:
      (InspectorFrontend_h):
      * inspector/ContentSearchUtils.h:
      * inspector/InjectedScript.cpp:
      * inspector/InjectedScriptBase.cpp:
      * inspector/InjectedScriptManager.h:
      * inspector/InjectedScriptModule.h:
      * inspector/InjectedScriptWebGLModule.h:
      * inspector/InspectorAgent.h:
      * inspector/InspectorCSSAgent.h:
      * inspector/InspectorController.h:
      * inspector/InspectorDOMDebuggerAgent.h:
      * inspector/InspectorDOMStorageAgent.h:
      * inspector/InspectorDatabaseAgent.h:
      * inspector/InspectorDatabaseResource.h:
      * inspector/InspectorFrontendClientLocal.cpp:
      * inspector/InspectorFrontendClientLocal.h:
      * inspector/InspectorFrontendHost.h:
      * inspector/InspectorIndexedDBAgent.h:
      * inspector/InspectorPageAgent.h:
      * inspector/InspectorProfilerAgent.h:
      * inspector/InspectorResourceAgent.h:
      * inspector/InspectorState.h:
      * inspector/InspectorStyleSheet.h:
      * inspector/InspectorStyleTextEditor.h:
      * inspector/InspectorValues.h:
      * inspector/InspectorWebGLAgent.h:
      * inspector/InspectorWorkerResource.h:
      * inspector/ScriptArguments.h:
      * inspector/ScriptBreakpoint.h:
      * inspector/ScriptCallFrame.h:
      * inspector/ScriptDebugListener.h:
      * inspector/TimelineRecordFactory.h:
      * inspector/generate-inspector-protocol-version:
      (main):
      * loader/DocumentLoader.cpp:
      * loader/DocumentWriter.h:
      * loader/FTPDirectoryParser.h:
      * loader/FormState.h:
      * loader/HistoryController.h:
      * loader/PolicyChecker.h:
      * loader/ResourceLoadScheduler.h:
      * loader/SubframeLoader.h:
      * loader/SubstituteData.h:
      * loader/WorkerThreadableLoader.h:
      * loader/appcache/ApplicationCache.h:
      * loader/appcache/ApplicationCacheGroup.h:
      * loader/archive/ArchiveFactory.cpp:
      * loader/archive/ArchiveResourceCollection.h:
      * loader/cache/CachedResource.h:
      * loader/cache/MemoryCache.h:
      * loader/icon/IconRecord.h:
      * loader/icon/PageURLRecord.h:
      * loader/mac/LoaderNSURLExtras.mm:
      * loader/win/DocumentLoaderWin.cpp:
      * page/Console.cpp:
      * page/Coordinates.h:
      * page/DOMSelection.cpp:
      * page/EventSource.cpp:
      * page/GroupSettings.h:
      * page/NavigatorBase.cpp:
      * page/OriginAccessEntry.h:
      * page/Page.h:
      * page/SecurityOrigin.h:
      * page/SpeechInputResult.h:
      * page/UserContentURLPattern.h:
      * page/WindowFeatures.cpp:
      * page/WindowFeatures.h:
      * page/WorkerNavigator.h:
      * page/animation/AnimationControllerPrivate.h:
      * platform/AsyncFileSystem.h:
      * platform/AsyncFileSystemCallbacks.h:
      * platform/ContentType.h:
      * platform/ContextMenu.h:
      * platform/ContextMenuItem.h:
      * platform/Cookie.h:
      * platform/CrossThreadCopier.cpp:
      * platform/DateComponents.cpp:
      * platform/FileChooser.h:
      * platform/FileStream.cpp:
      * platform/FileSystem.h:
      * platform/KURL.cpp:
      (WebCore):
      * platform/KURL.h:
      * platform/KURLHash.h:
      * platform/KillRing.h:
      * platform/Language.cpp:
      * platform/Length.cpp:
      * platform/LinkHash.cpp:
      * platform/Logging.cpp:
      * platform/MIMETypeRegistry.h:
      * platform/SSLKeyGenerator.h:
      * platform/SchemeRegistry.h:
      * platform/SharedBuffer.h:
      * platform/Theme.h:
      * platform/UUID.h:
      * platform/animation/Animation.h:
      * platform/blackberry/CookieDatabaseBackingStore/CookieDatabaseBackingStore.h:
      * platform/blackberry/CookieManager.h:
      * platform/blackberry/CookieMap.h:
      * platform/blackberry/DragDataBlackBerry.cpp:
      * platform/blackberry/KURLBlackBerry.cpp:
      * platform/blackberry/LocalizedStringsBlackBerry.cpp:
      * platform/blackberry/SSLKeyGeneratorBlackBerry.cpp:
      * platform/blackberry/TemporaryLinkStubs.cpp:
      * platform/cf/FileSystemCF.cpp:
      * platform/cf/SchedulePair.h:
      * platform/chromium/ChromiumDataObject.h:
      * platform/chromium/ClipboardUtilitiesChromium.cpp:
      * platform/chromium/DragDataChromium.cpp:
      * platform/chromium/FileSystemChromium.cpp:
      * platform/chromium/FileSystemChromiumMac.mm:
      * platform/chromium/LanguageChromium.cpp:
      * platform/chromium/SSLKeyGeneratorChromium.cpp:
      * platform/cocoa/KeyEventCocoa.mm:
      * platform/efl/ErrorsEfl.h:
      * platform/efl/LanguageEfl.cpp:
      * platform/efl/LocalizedStringsEfl.cpp:
      * platform/efl/LoggingEfl.cpp:
      * platform/efl/PasteboardEfl.cpp:
      * platform/efl/PlatformScreenEfl.cpp:
      * platform/graphics/ANGLEWebKitBridge.h:
      * platform/graphics/BitmapImage.cpp:
      * platform/graphics/FontPlatformData.cpp:
      * platform/graphics/GlyphPageTreeNode.cpp:
      * platform/graphics/GraphicsContext3D.h:
      * platform/graphics/GraphicsTypes.cpp:
      * platform/graphics/SegmentedFontData.cpp:
      * platform/graphics/blackberry/IconBlackBerry.cpp:
      * platform/graphics/blackberry/LayerData.h:
      * platform/graphics/blackberry/LayerFilterRenderer.cpp:
      * platform/graphics/blackberry/LayerRenderer.cpp:
      * platform/graphics/blackberry/skia/PlatformSupport.h:
      * platform/graphics/ca/PlatformCALayer.h:
      * platform/graphics/ca/PlatformCALayerClient.h:
      * platform/graphics/ca/mac/PlatformCAAnimationMac.mm:
      * platform/graphics/ca/win/PlatformCAAnimationWin.cpp:
      * platform/graphics/cairo/ImageBufferCairo.cpp:
      * platform/graphics/cairo/PathCairo.cpp:
      * platform/graphics/cg/ImageSourceCGMac.mm:
      * platform/graphics/cg/PathCG.cpp:
      * platform/graphics/chromium/FontUtilsChromiumWin.cpp:
      * platform/graphics/chromium/GraphicsLayerChromium.cpp:
      * platform/graphics/chromium/IconChromium.cpp:
      * platform/graphics/chromium/IconChromiumAndroid.cpp:
      * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
      * platform/graphics/efl/IconEfl.cpp:
      * platform/graphics/filters/FEComposite.h:
      * platform/graphics/filters/FEDisplacementMap.h:
      * platform/graphics/filters/SourceAlpha.cpp:
      * platform/graphics/filters/SourceAlpha.h:
      * platform/graphics/filters/SourceGraphic.cpp:
      * platform/graphics/filters/SourceGraphic.h:
      * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
      * platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.cpp:
      * platform/graphics/mac/IconMac.mm:
      * platform/graphics/mac/ImageMac.mm:
      * platform/graphics/opentype/OpenTypeUtilities.h:
      * platform/graphics/openvg/PathOpenVG.cpp:
      * platform/graphics/pango/FontPlatformDataPango.cpp:
      * platform/graphics/qt/FontCacheQt.cpp:
      * platform/graphics/qt/FontPlatformDataQt.cpp:
      * platform/graphics/qt/IconQt.cpp:
      * platform/graphics/qt/ImageQt.cpp:
      * platform/graphics/qt/PathQt.cpp:
      * platform/graphics/skia/FontCustomPlatformData.h:
      * platform/graphics/skia/ImageSkia.cpp:
      * platform/graphics/win/FontCustomPlatformData.h:
      * platform/graphics/win/FontPlatformDataCGWin.cpp:
      * platform/graphics/win/FontPlatformDataCairoWin.cpp:
      * platform/graphics/win/FontPlatformDataWin.cpp:
      * platform/graphics/win/IconWin.cpp:
      * platform/graphics/win/ImageCGWin.cpp:
      * platform/graphics/win/ImageCairoWin.cpp:
      * platform/graphics/win/SimpleFontDataCGWin.cpp:
      * platform/graphics/wince/FontCustomPlatformData.h:
      * platform/graphics/wince/FontPlatformData.cpp:
      * platform/graphics/wince/ImageWinCE.cpp:
      * platform/graphics/wince/MediaPlayerProxy.cpp:
      * platform/graphics/wince/PathWinCE.cpp:
      * platform/graphics/wince/PlatformPathWinCE.cpp:
      * platform/graphics/wx/FontCacheWx.cpp:
      * platform/graphics/wx/FontPlatformDataWx.cpp:
      * platform/graphics/wx/IconWx.cpp:
      * platform/graphics/wx/PathWx.cpp:
      * platform/gtk/ErrorsGtk.h:
      * platform/gtk/FileSystemGtk.cpp:
      * platform/gtk/GtkPopupMenu.h:
      * platform/gtk/KeyBindingTranslator.h:
      * platform/gtk/LanguageGtk.cpp:
      * platform/gtk/LocalizedStringsGtk.cpp:
      * platform/gtk/LoggingGtk.cpp:
      * platform/gtk/PasteboardGtk.cpp:
      * platform/image-decoders/ImageDecoder.h:
      * platform/leveldb/LevelDBSlice.h:
      * platform/mac/FileSystemMac.mm:
      * platform/mediastream/MediaStreamSource.h:
      * platform/mock/GeolocationClientMock.h:
      * platform/network/BlobData.h:
      * platform/network/BlobRegistryImpl.h:
      * platform/network/BlobResourceHandle.h:
      * platform/network/Credential.h:
      * platform/network/FormData.h:
      * platform/network/FormDataBuilder.h:
      * platform/network/HTTPParsers.cpp:
      * platform/network/HTTPRequest.h:
      * platform/network/HTTPValidation.cpp:
      * platform/network/ProtectionSpace.h:
      * platform/network/ResourceErrorBase.h:
      * platform/network/SocketStreamErrorBase.h:
      * platform/network/blackberry/DNSBlackBerry.cpp:
      * platform/network/blackberry/DeferredData.h:
      * platform/network/blackberry/NetworkJob.h:
      * platform/network/cf/CookieJarCFNet.cpp:
      * platform/network/curl/CookieJarCurl.cpp:
      * platform/network/curl/ResourceHandleManager.h:
      * platform/network/qt/DnsPrefetchHelper.cpp:
      * platform/network/soup/ResourceRequestSoup.cpp:
      * platform/network/soup/ResourceResponseSoup.cpp:
      * platform/network/win/CookieJarWin.cpp:
      * platform/posix/FileSystemPOSIX.cpp:
      * platform/qt/ClipboardQt.cpp:
      * platform/qt/CookieJarQt.cpp:
      * platform/qt/FileSystemQt.cpp:
      * platform/qt/LanguageQt.cpp:
      * platform/qt/LocalizedStringsQt.cpp:
      * platform/qt/LoggingQt.cpp:
      * platform/qt/PlatformSupport.h:
      * platform/sql/SQLValue.h:
      * platform/sql/SQLiteDatabase.h:
      * platform/sql/SQLiteFileSystem.h:
      * platform/text/DecodeEscapeSequences.h:
      * platform/text/LineEnding.cpp:
      * platform/text/ParserUtilities.h:
      * platform/text/PlatformString.h: Removed.
      * platform/text/RegularExpression.h:
      * platform/text/SegmentedString.h:
      * platform/text/StringWithDirection.h:
      * platform/text/SuffixTree.h:
      * platform/text/TextBreakIteratorICU.cpp:
      * platform/text/TextCodec.cpp:
      * platform/text/TextCodec.h:
      * platform/text/TextCodecLatin1.cpp:
      * platform/text/TextCodecUTF16.cpp:
      * platform/text/TextCodecUserDefined.cpp:
      * platform/text/TextEncoding.cpp:
      * platform/text/blackberry/StringBlackBerry.cpp:
      * platform/text/cf/StringCF.cpp:
      * platform/text/chromium/TextBreakIteratorInternalICUChromium.cpp:
      * platform/text/gtk/TextCodecGtk.cpp:
      * platform/text/mac/StringMac.mm:
      * platform/text/mac/TextCodecMac.cpp:
      * platform/text/qt/TextCodecQt.cpp:
      * platform/text/win/TextCodecWin.h:
      * platform/text/wince/TextBreakIteratorWinCE.cpp:
      * platform/win/BString.cpp:
      * platform/win/DragDataWin.cpp:
      * platform/win/GDIObjectCounter.h:
      * platform/win/LoggingWin.cpp:
      * platform/win/WCDataObject.cpp:
      * platform/wince/DragDataWinCE.cpp:
      * platform/wx/ClipboardWx.cpp:
      * platform/wx/FileSystemWx.cpp:
      * platform/wx/LanguageWx.cpp:
      * platform/wx/LocalizedStringsWx.cpp:
      * platform/wx/LoggingWx.cpp:
      * platform/wx/PasteboardWx.cpp:
      * platform/wx/PopupMenuWx.cpp:
      * plugins/PluginData.h:
      * plugins/PluginDatabase.h:
      * plugins/PluginDebug.cpp:
      * plugins/PluginPackage.h:
      * plugins/PluginStream.h:
      * rendering/style/StyleDashboardRegion.h:
      * storage/Storage.cpp:
      * storage/StorageArea.h:
      * storage/StorageEvent.h:
      * storage/StorageEventDispatcher.h:
      * storage/StorageMap.h:
      * storage/StorageNamespace.h:
      * storage/StorageNamespaceImpl.h:
      * storage/StorageSyncManager.h:
      * storage/StorageTask.h:
      * storage/StorageTracker.h:
      * svg/SVGPathByteStreamBuilder.h:
      * svg/SVGPathParser.h:
      * svg/SVGPathStringSource.h:
      * svg/SVGStyledElement.cpp:
      * svg/animation/SMILTimeContainer.h:
      * svg/graphics/filters/SVGFilterBuilder.cpp:
      * svg/graphics/filters/SVGFilterBuilder.h:
      * testing/Internals.h:
      * workers/DefaultSharedWorkerRepository.cpp:
      * workers/WorkerLocation.cpp:
      * workers/WorkerThread.cpp:
      * xml/DOMParser.cpp:
      * xml/NativeXPathNSResolver.cpp:
      * xml/XMLSerializer.cpp:
      * xml/XMLSerializer.h:
      * xml/XPathExpression.cpp:
      * xml/XPathValue.h:
      * xml/XSLTUnicodeSort.cpp:
      
      Source/WebKit/blackberry:
      
      * Api/DumpRenderTreeClient.h:
      * WebCoreSupport/ChromeClientBlackBerry.cpp:
      * WebCoreSupport/InspectorClientBlackBerry.h:
      * WebCoreSupport/JavaScriptDebuggerBlackBerry.cpp:
      * WebKitSupport/AboutData.h:
      
      Source/WebKit/cf:
      
      * WebCoreSupport/WebInspectorClientCF.cpp:
      (WebInspectorClient::createFrontendSettings):
      
      Source/WebKit/chromium:
      
      * src/ContextMenuClientImpl.cpp:
      * src/EditorClientImpl.cpp:
      * src/InspectorFrontendClientImpl.cpp:
      * src/LocalFileSystemChromium.cpp:
      * src/SpeechInputClientImpl.cpp:
      * src/SpeechRecognitionClientProxy.h:
      * src/WebDevToolsAgentImpl.cpp:
      * src/WebDevToolsFrontendImpl.cpp:
      * src/WebDevToolsFrontendImpl.h:
      * src/WebEntities.h:
      * src/WebFrameImpl.h:
      * src/WorkerFileSystemCallbacksBridge.h:
      * tests/UniscribeHelperTest.cpp:
      
      Source/WebKit/efl:
      
      * WebCoreSupport/ChromeClientEfl.cpp:
      * WebCoreSupport/InspectorClientEfl.cpp:
      
      Source/WebKit/gtk:
      
      * WebCoreSupport/ChromeClientGtk.cpp:
      * WebCoreSupport/DumpRenderTreeSupportGtk.cpp:
      * WebCoreSupport/InspectorClientGtk.cpp:
      * gdom/ConvertToGCharPrivate.h:
      * webkit/webkitsecurityorigin.cpp:
      * webkit/webkitwebdatasource.cpp:
      * webkit/webkitwebhistoryitem.cpp:
      * webkit/webkitwebresource.cpp:
      
      Source/WebKit/mac:
      
      * History/WebHistoryItem.mm:
      * Misc/WebStringTruncator.mm:
      * Plugins/Hosted/NetscapePluginHostManager.h:
      (NetscapePluginHostManager):
      * Plugins/WebPluginController.mm:
      * Storage/WebStorageTrackerClient.mm:
      * WebCoreSupport/WebChromeClient.mm:
      * WebCoreSupport/WebEditorClient.mm:
      * WebCoreSupport/WebFrameLoaderClient.mm:
      * WebCoreSupport/WebIconDatabaseClient.mm:
      * WebCoreSupport/WebInspectorClient.h:
      (WebInspectorClient):
      (WebInspectorFrontendClient):
      * WebView/WebRenderLayer.mm:
      * WebView/WebViewData.h:
      
      Source/WebKit/qt:
      
      * Api/qwebdatabase_p.h:
      * Api/qwebframe_p.h:
      * Api/qwebhistory.cpp:
      * Api/qwebhistoryinterface.cpp:
      * Api/qwebpage_p.h:
      * Api/qwebsettings.cpp:
      * WebCoreSupport/ChromeClientQt.h:
      * WebCoreSupport/InspectorClientQt.cpp:
      
      Source/WebKit/win:
      
      * DOMCSSClasses.cpp:
      * DefaultPolicyDelegate.cpp:
      * MarshallingHelpers.cpp:
      * WebCoreSupport/WebInspectorClient.h:
      * WebDownload.h:
      * WebFrame.h:
      * WebHistoryItem.h:
      * WebIconDatabase.cpp:
      * WebKitDLL.h:
      * WebKitGraphics.cpp:
      * WebKitSystemBits.cpp:
      * WebLocalizableStrings.cpp:
      * WebNotificationCenter.cpp:
      * WebResource.h:
      
      Source/WebKit/wx:
      
      * WebFrame.cpp:
      * WebKitSupport/ChromeClientWx.cpp:
      * WebKitSupport/EditorClientWx.cpp:
      * WebKitSupport/FrameLoaderClientWx.cpp:
      * WebKitSupport/InspectorClientWx.cpp:
      * WebSettings.cpp:
      * WebView.cpp:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@127757 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      3f5ab024
  12. 17 May, 2012 1 commit
    • shinyak@chromium.org's avatar
      [Refactoring] Remove TreeScopeAdjuster · 45dc115c
      shinyak@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=86599
      
      Reviewed by Hajime Morita.
      
      It seems the right place of the method of TreeScopeAdjuster are in VisibleSelection
      and TreeScope. So we can remove TreeScopeAdjuster.
      
      No new tests, no change in behavior.
      
      * CMakeLists.txt:
      * GNUmakefile.list.am:
      * Target.pri:
      * WebCore.gypi:
      * WebCore.vcproj/WebCore.vcproj:
      * WebCore.xcodeproj/project.pbxproj:
      * dom/DOMAllInOne.cpp:
      * dom/TreeScope.cpp:
      (WebCore::TreeScope::ancestorInThisScope):
      (WebCore):
      * dom/TreeScope.h:
      (TreeScope):
      * dom/TreeScopeAdjuster.cpp: Removed.
      * dom/TreeScopeAdjuster.h: Removed.
      * editing/VisibleSelection.cpp:
      (WebCore::VisibleSelection::adjustPositionBefore):
      (WebCore):
      (WebCore::VisibleSelection::adjustPositionAfter):
      (WebCore::VisibleSelection::adjustSelectionToAvoidCrossingShadowBoundaries):
      * editing/VisibleSelection.h:
      (VisibleSelection):
      * page/DOMSelection.cpp:
      (WebCore::DOMSelection::shadowAdjustedNode):
      (WebCore::DOMSelection::shadowAdjustedOffset):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@117420 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      45dc115c
  13. 16 May, 2012 1 commit
    • shinyak@chromium.org's avatar
      ShadowRoot.selection should return the seleciton whose range is in a shadow tree. · 589b39fc
      shinyak@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=82698
      
      Reviewed by Ryosuke Niwa.
      
      Source/WebCore:
      
      The selection object returned from shadowRoot.selection should be able to see
      the inner object of the shadowRoot.
      
      In the previous code, the node out of the shadow subtree was returned for
      anchorNode, focusNode, baseNode, and extentNode. This patch enables us to get
      the corresponding shadow ancestor in the specified TreeScope (m_treeScope).
      
      Tests: editing/shadow/selection-of-orphan-shadowroot.html
             editing/shadow/selection-of-shadowroot.html
      
      * dom/ShadowRoot.cpp:
      (WebCore::ShadowRoot::selection):
      * dom/ShadowRoot.h:
      (ShadowRoot):
      * dom/TreeScope.cpp:
      (WebCore::TreeScope::getSelection): When shadow DOM feature is not enabled, we want to use the same
      instance of DOMSelection among Document and ShadowRoot.
      * dom/TreeScopeAdjuster.cpp:
      (WebCore::TreeScopeAdjuster::TreeScopeAdjuster):
      (WebCore::TreeScopeAdjuster::ancestorInThisScope): Since node could be null, I've added a node check code.
      * dom/TreeScopeAdjuster.h:
      (TreeScopeAdjuster):
      (WebCore::TreeScopeAdjuster::treeScope):
      * page/DOMSelection.cpp:
      (WebCore::DOMSelection::anchorNode):
      (WebCore::DOMSelection::anchorOffset):
      (WebCore::DOMSelection::focusNode):
      (WebCore::DOMSelection::focusOffset):
      (WebCore::DOMSelection::baseNode):
      (WebCore::DOMSelection::baseOffset):
      (WebCore::DOMSelection::extentNode):
      (WebCore::DOMSelection::extentOffset):
      (WebCore::DOMSelection::shadowAdjustedNode): Gets the corresponding node in the m_treeScope from the Position.
      (WebCore):
      (WebCore::DOMSelection::shadowAdjustedOffset): Gets the corresponding node offset in the m_treeScope from the Position.
      * page/DOMSelection.h:
      (WebCore):
      (DOMSelection):
      
      LayoutTests:
      
      This patch contains 2 tests:
      - Generates a complex HTML tree having a ShadowRoot, an older ShadowRoot, a nested ShadowRoot,
      nested ShadowRoot in an older ShadowRoot, etc., and try to drag from a nested shadow root of
      older shadow root to a nested shadow root of younger shadow root. Then checks nodes of Shadowroot.selection
      are in the same tree scope or null.
      - Generates a ShadowDOM which is not inserted into a document, and confirms nodes taken from
      the selection are all null.
      
      Also, this patch deprecates old shadowRoot.selection tests, because they test to check
      window.getSelection() and shadowRoot.selection is the same. This behavior is changed by this patch.
      
      * editing/shadow/selection-of-orphan-shadowroot-expected.txt: Added.
      * editing/shadow/selection-of-orphan-shadowroot.html: Added.
      * editing/shadow/selection-of-shadowroot-expected.txt: Added.
      * editing/shadow/selection-of-shadowroot.html: Added.
      * fast/dom/resources/event-sender-util.js:
      (mouseMoveToElem):
      (dragFromTo):
      * fast/dom/shadow/resources/shadow-dom-util.js: Added.
      (getElementByIdConsideringShadowDOM.iter):
      (getElementByIdConsideringShadowDOM):
      * fast/dom/shadow/selection-in-shadow.html: Removed.
      * platform/chromium-mac-snowleopard/fast/dom/shadow/selection-in-shadow-expected.txt: Removed.
      * platform/chromium/fast/dom/shadow/selection-in-shadow-expected.txt: Removed.
      * platform/qt/Skipped:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@117249 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      589b39fc
  14. 11 May, 2012 3 commits
    • shinyak@chromium.org's avatar
      [Refactoring] Move Selection from DOMWindow to TreeScope. · 4fd60ed7
      shinyak@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=82699
      
      Reviewed by Ryosuke Niwa.
      
      Since ShadowRoot will also manage its own version of DOMSelection, we would like to
      share the code among Document and DOMSelection. This patch moves DOMSelection from DOMWindow to TreeScope
      so that ShadowRoot can also use it.
      
      No new tests, should covered by existing tests.
      
      * dom/Document.cpp:
      (WebCore::Document::updateFocusAppearanceTimerFired):
      * dom/Document.h:
      (Document):
      * dom/ShadowRoot.cpp:
      (WebCore::ShadowRoot::selection):
      * dom/TreeScope.cpp:
      (WebCore::TreeScope::~TreeScope):
      (WebCore::TreeScope::getSelection):
      (WebCore):
      * dom/TreeScope.h:
      (WebCore):
      (TreeScope):
      * page/DOMSelection.cpp:
      (WebCore::DOMSelection::DOMSelection):
      (WebCore::DOMSelection::clearTreeScope):
      (WebCore):
      * page/DOMSelection.h:
      (WebCore):
      (WebCore::DOMSelection::create):
      (DOMSelection):
      * page/DOMWindow.cpp:
      (WebCore::DOMWindow::~DOMWindow):
      (WebCore::DOMWindow::clearDOMWindowProperties):
      (WebCore::DOMWindow::getSelection):
      * page/DOMWindow.h:
      (DOMWindow):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116746 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      4fd60ed7
    • tkent@chromium.org's avatar
      Unreviewed, rolling out r116715. · a0917c6c
      tkent@chromium.org authored
      http://trac.webkit.org/changeset/116715
      https://bugs.webkit.org/show_bug.cgi?id=86172
      
      Broke http/tests/security/cross-frame-access-selection.html
      (Requested by tkent on #webkit).
      
      Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2012-05-10
      
      * dom/Document.cpp:
      (WebCore):
      (WebCore::Document::getSelection):
      * dom/Document.h:
      (Document):
      * dom/ShadowRoot.cpp:
      (WebCore::ShadowRoot::selection):
      * dom/TreeScope.cpp:
      (WebCore::TreeScope::~TreeScope):
      * dom/TreeScope.h:
      (WebCore):
      (TreeScope):
      * page/DOMSelection.cpp:
      (WebCore::DOMSelection::DOMSelection):
      * page/DOMSelection.h:
      (WebCore):
      (WebCore::DOMSelection::create):
      (DOMSelection):
      * page/DOMWindow.cpp:
      (WebCore::DOMWindow::~DOMWindow):
      (WebCore::DOMWindow::clearDOMWindowProperties):
      (WebCore::DOMWindow::getSelection):
      * page/DOMWindow.h:
      (DOMWindow):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116724 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      a0917c6c
    • shinyak@chromium.org's avatar
      [Refactoring] Move Selection from DOMWindow to TreeScope. · b6563baf
      shinyak@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=82699
      
      Reviewed by Ryosuke Niwa.
      
      Since ShadowRoot will also manage its own version of DOMSelection, we would like to
      share the code among Document and DOMSelection. This patch moves DOMSelection from DOMWindow to TreeScope
      so that ShadowRoot can also use it.
      
      No new tests, should covered by existing tests.
      
      * dom/Document.cpp:
      (WebCore::Document::updateFocusAppearanceTimerFired):
      * dom/Document.h:
      (Document):
      * dom/ShadowRoot.cpp:
      (WebCore::ShadowRoot::selection):
      * do/mTreeScope.cpp:
      (WebCore::TreeScope::~TreeScope):
      (WebCore::TreeScope::getSelection):
      (WebCore):
      * dom/TreeScope.h:
      (WebCore):
      (TreeScope):
      * page/DOMSelection.cpp:
      (WebCore::DOMSelection::DOMSelection):
      (WebCore::DOMSelection::clearTreeScope):
      (WebCore):
      * page/DOMSelection.h:
      (WebCore):
      (WebCore::DOMSelection::create):
      (DOMSelection):
      (WebCore::DOMSelection::frame):
      * page/DOMWindow.cpp:
      (WebCore::DOMWindow::~DOMWindow):
      (WebCore::DOMWindow::clearDOMWindowProperties):
      (WebCore::DOMWindow::getSelection):
      * page/DOMWindow.h:
      (DOMWindow):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116715 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      b6563baf
  15. 05 Apr, 2012 1 commit
    • shinyak@chromium.org's avatar
      Shadow DOM is exposed in JS. · e53235c9
      shinyak@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=82607
      
      Reviewed by Hajime Morita.
      
      .:
      
      * Source/autotools/symbols.filter:
      
      Source/WebCore:
      
      DOMSelection didn't consider nested shadow trees. This patch makes DOMSelection
      take nested shadow trees into account.
      
      To test that the element is not in a shadow tree, Internals has a treeScopeRootNode method
      which returns the root node of the belonging tree scope.
      
      Test: fast/dom/shadow/selection-shouldnt-expose-shadow-dom.html
      
      * WebCore.exp.in:
      * page/DOMSelection.cpp:
      (WebCore::selectionShadowAncestor):
      (WebCore):
      * testing/Internals.cpp:
      (WebCore::Internals::treeScopeRootNode):
      (WebCore):
      * testing/Internals.h:
      (Internals):
      * testing/Internals.idl:
      
      Source/WebKit2:
      
      * win/WebKit2.def:
      * win/WebKit2CFLite.def:
      
      LayoutTests:
      
      * fast/dom/shadow/selection-shouldnt-expose-shadow-dom-expected.txt: Added.
      * fast/dom/shadow/selection-shouldnt-expose-shadow-dom.html: Added.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113276 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      e53235c9
  16. 07 Jan, 2012 1 commit
    • abarth@webkit.org's avatar
      Disconnecting DOMWindow properties is fragile and overly complicated · 84fe60e1
      abarth@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=75699
      
      Reviewed by Alexey Proskuryakov.
      
      Previously, we had to carefully check every object tree hanging off of
      DOMWindow to make sure that every property correctly disconnected
      itself and all its subobjects from the Frame when the DOMWindow
      disconnected from the Frame.
      
      This patch introduces DOMWindowProperty, which is a base class that
      handles this work automagically, ensuring that we won't have any
      dangling Frame pointers and removing a bunch of boilerplate code.
      
      * CMakeLists.txt:
      * GNUmakefile.list.am:
      * Target.pri:
      * WebCore.gypi:
      * WebCore.vcproj/WebCore.vcproj:
      * css/StyleMedia.cpp:
      (WebCore::StyleMedia::StyleMedia):
      * css/StyleMedia.h:
      (WebCore::StyleMedia::create):
      * loader/appcache/DOMApplicationCache.cpp:
      (WebCore::DOMApplicationCache::DOMApplicationCache):
      (WebCore::DOMApplicationCache::disconnectFrame):
      * loader/appcache/DOMApplicationCache.h:
      * page/BarInfo.cpp:
      (WebCore::BarInfo::BarInfo):
      * page/BarInfo.h:
      * page/Console.cpp:
      (WebCore::Console::Console):
      (WebCore::Console::memory):
      * page/Console.h:
      * page/DOMSelection.cpp:
      (WebCore::DOMSelection::DOMSelection):
      * page/DOMSelection.h:
      * page/DOMWindow.cpp:
      (WebCore::DOMWindow::registerProperty):
      (WebCore::DOMWindow::unregisterProperty):
      (WebCore::DOMWindow::clear):
      * page/DOMWindow.h:
      * page/Geolocation.cpp:
      (WebCore::Geolocation::Geolocation):
      (WebCore::Geolocation::disconnectFrame):
      * page/Geolocation.h:
      * page/History.cpp:
      (WebCore::History::History):
      * page/History.h:
      * page/Location.cpp:
      (WebCore::Location::Location):
      * page/Location.h:
      * page/Navigator.cpp:
      (WebCore::Navigator::Navigator):
      (WebCore::Navigator::~Navigator):
      * page/Navigator.h:
      * page/Performance.cpp:
      (WebCore::Performance::Performance):
      (WebCore::Performance::memory):
      * page/Performance.h:
      * page/PerformanceNavigation.cpp:
      (WebCore::PerformanceNavigation::PerformanceNavigation):
      * page/PerformanceNavigation.h:
      * page/PerformanceTiming.cpp:
      (WebCore::PerformanceTiming::PerformanceTiming):
      * page/PerformanceTiming.h:
      * page/Screen.cpp:
      (WebCore::Screen::Screen):
      * page/Screen.h:
      * plugins/DOMMimeTypeArray.cpp:
      (WebCore::DOMMimeTypeArray::DOMMimeTypeArray):
      * plugins/DOMMimeTypeArray.h:
      * plugins/DOMPluginArray.cpp:
      (WebCore::DOMPluginArray::DOMPluginArray):
      * plugins/DOMPluginArray.h:
      * storage/Storage.cpp:
      (WebCore::Storage::Storage):
      * storage/Storage.h:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@104380 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      84fe60e1
  17. 06 Jan, 2012 1 commit
  18. 07 Dec, 2011 1 commit
    • xji@chromium.org's avatar
      Source/WebCore: Turn on move caret by word visually for Windows platform. · 8fc6abdc
      xji@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=59652
      
      Reviewed by Ryosuke Niwa.
      
      We already support (arrow key) moving cursor by character in visual order.
      This patch implements (ctrl/alt-arrow) moving cursor by word in visual order (in Windows).
      It matches Firefox's default behavior.
      
      Without this patch, ctrl(alt for mac)-arrow key or
      selection.modify("move", "left"/"right", "word") moves cursor by word in logical order. 
      
      IE implements moving cursor by logical order for both arrow key and ctrl-arrow key.
      Firefox implements moving cursor by visual order for both operations.
      From Chromium bug report, native speakers would like moving cursor by visual order since it
      is more intuitive.
      
      The patch is only enabled for Windows (by EditingBehavior) because current implementation
      matches Windows' native behavior.
      For exmaple, if the logical text is "abc def hij", the cursor positions are
      "|abc |def |hij|" no matter pressing ctrl-left-arrow or ctrl-right-arrow.
      
      Mac and Linux's native behavior is slightly different. In which, when pressing
      ctrl-left-arrow, the cursor positions are "|abc |def |hij|". When pressing ctrl-right-arrow,
      the cursor positions are "|abc| def| hij|". We will implement it next.
      
      Test: editing/selection/move-left-right-by-word-mac.html
      
      * editing/EditingBehavior.h:
      (WebCore::EditingBehavior::shouldMoveLeftRightByWordInVisualOrder):
      * editing/FrameSelection.cpp: Remove experimental enum WebKitVisualWordGranularity.
      (WebCore::FrameSelection::modifyExtendingRight):
      (WebCore::FrameSelection::modifyExtendingForward):
      (WebCore::FrameSelection::modifyMovingRight):
      (WebCore::FrameSelection::modifyMovingForward):
      (WebCore::FrameSelection::modifyExtendingLeft):
      (WebCore::FrameSelection::modifyExtendingBackward):
      (WebCore::FrameSelection::modifyMovingLeft):
      (WebCore::FrameSelection::modifyMovingBackward):
      * editing/TextGranularity.h: Remove experimental enum WebKitVisualWordGranularity.
      * editing/VisibleSelection.cpp: Remove experimental enum WebKitVisualWordGranularity.
      (WebCore::VisibleSelection::setStartAndEndFromBaseAndExtentRespectingGranularity):
      * page/DOMSelection.cpp: Remove experimental experimental flag -webkit-visual-word.
      (WebCore::DOMSelection::modify):
      
      LayoutTests: Turn on move caret by word visually for windows platform.
      https://bugs.webkit.org/show_bug.cgi?id=59652
      
      Reviewed by Ryosuke Niwa.
      
      * editing/selection/caret-mode-paragraph-keys-navigation.html:
      * editing/selection/move-by-word-visually-crash-test-1.html:
      * editing/selection/move-by-word-visually-crash-test-2.html:
      * editing/selection/move-by-word-visually-crash-test-3.html:
      * editing/selection/move-by-word-visually-crash-test-4.html:
      * editing/selection/move-by-word-visually-crash-test-textarea.html:
      * editing/selection/move-by-word-visually-inline-block-positioned-element.html:
      * editing/selection/move-by-word-visually-multi-line.html:
      * editing/selection/move-by-word-visually-multi-space.html:
      * editing/selection/move-by-word-visually-null-box.html:
      * editing/selection/move-by-word-visually-single-space-inline-element.html:
      * editing/selection/move-by-word-visually-single-space-one-element.html:
      * editing/selection/move-by-word-visually-textarea.html:
      * editing/selection/move-left-right-by-word-mac-expected.txt: Added.
      * editing/selection/move-left-right-by-word-mac.html: Added.
      * editing/selection/resources/move-by-word-visually.js:
      (moveByWord):
      (moveByWordOnEveryChar):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@102252 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      8fc6abdc
  19. 22 Jun, 2011 1 commit
    • rniwa@webkit.org's avatar
      2011-06-22 Ryosuke Niwa <rniwa@webkit.org> · 7045c7e5
      rniwa@webkit.org authored
              Reviewed by Darin Adler.
      
              Make instantiation of legacy editing position more explicit
              https://bugs.webkit.org/show_bug.cgi?id=63037
      
              Create new positions since we can't create a legacy editing position outside of WebCore anymore.
      
              * WebView/WebFrame.mm:
              (-[WebFrame _smartDeleteRangeForProposedRange:]): Calls createLegacyEditingPosition.
              (-[WebFrame _smartInsertForString:replacingRange:beforeString:afterString:]): Ditto.
      2011-06-22  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Darin Adler.
      
              Make instantiation of legacy editing position more explicit
              https://bugs.webkit.org/show_bug.cgi?id=63037
      
              Replaced the constructor of Position class that used to instantiate a legacy editing position
              by a function called createLegacyEditingPosition.
      
              * WebCore.exp.in: Removed the constructor from the list.
              * accessibility/AXObjectCache.cpp:
              (WebCore::AXObjectCache::visiblePositionForTextMarkerData): Calls createLegacyEditingPosition.
              * accessibility/gtk/AXObjectCacheAtk.cpp:
              (WebCore::AXObjectCache::nodeTextChangePlatformNotification): No longer uses Positions to instantiate a range.
              * dom/Position.cpp:
              (WebCore::Position::Position): New constructor takes LegacyEditingOffset, which can only be instantiated
              by createLegacyEditingPosition.
              (WebCore::Position::previous): Calls createLegacyEditingPosition.
              (WebCore::Position::next): Ditto.
              (WebCore::Position::upstream): Ditto.
              (WebCore::Position::downstream): Ditto.
              * dom/Position.h: Added new Position::LegacyEditingOffset class to hide the legacy constructor from the world.
              (WebCore::Position::LegacyEditingOffset::value): Added.
              (WebCore::Position::LegacyEditingOffset::LegacyEditingOffset): Added.
              (WebCore::createLegacyEditingPosition): Added.
              * dom/PositionIterator.cpp:
              (WebCore::PositionIterator::operator Position): Calls createLegacyEditingPosition.
              * dom/RangeBoundaryPoint.h:
              (WebCore::RangeBoundaryPoint::toPosition): Ditto.
              * editing/InsertTextCommand.cpp:
              (WebCore::InsertTextCommand::performTrivialReplace): Instantiates new Position instead of old one; this is always
              safe since the anchor node is always a text node.
              * editing/VisiblePosition.cpp:
              (WebCore::VisiblePosition::leftVisuallyDistinctCandidate): Calls createLegacyEditingPosition.
              (WebCore::VisiblePosition::rightVisuallyDistinctCandidate): Ditto.
              * editing/markup.cpp:
              (WebCore::StyledMarkupAccumulator::renderedText): Ditto.
              * editing/visible_units.cpp:
              (WebCore::previousBoundary): Ditto.
              (WebCore::previousLinePosition): Ditto.
              (WebCore::nextLinePosition): Ditto.
              * page/DOMSelection.cpp:
              (WebCore::DOMSelection::collapse): Ditto.
              (WebCore::DOMSelection::setBaseAndExtent): Ditto.
              (WebCore::DOMSelection::setPosition): Ditto.
              (WebCore::DOMSelection::extend): Ditto.
              * rendering/RenderBlock.cpp:
              (WebCore::RenderBlock::positionForBox): Ditto.
              * rendering/RenderBox.cpp:
              (WebCore::RenderBox::positionForPoint): Calls Position() instead of Position(0, 0).
              * rendering/RenderObject.cpp:
              (WebCore::RenderObject::createVisiblePosition): Calls createLegacyEditingPosition.s
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@89440 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      7045c7e5
  20. 20 Jun, 2011 1 commit
    • rniwa@webkit.org's avatar
      2011-06-20 Ryosuke Niwa <rniwa@webkit.org> · 03c49e8d
      rniwa@webkit.org authored
              Reviewed by Darin Adler.
      
              Various editing functions take boolean userTriggered but should be replaced by an enum
              https://bugs.webkit.org/show_bug.cgi?id=62933
      
              Replaced boolean userTriggered in many functions by new EUserTriggered enum.
      
              * WebCore.exp.in: FrameSelection::modify's signature changed.
              * accessibility/AccessibilityRenderObject.cpp:
              (WebCore::AccessibilityRenderObject::setSelectedVisiblePositionRange): Calls FrameSelection::moveTo.
              * editing/EditorCommand.cpp:
              (WebCore::executeMoveBackward): Calls FrameSelection::modify.
              (WebCore::executeMoveBackwardAndModifySelection): Ditto.
              (WebCore::executeMoveDown): Ditto.
              (WebCore::executeMoveDownAndModifySelection): Ditto.
              (WebCore::executeMoveForward): Ditto.
              (WebCore::executeMoveForwardAndModifySelection): Ditto.
              (WebCore::executeMoveLeft): Ditto.
              (WebCore::executeMoveLeftAndModifySelection): Ditto.
              (WebCore::executeMovePageDown): Ditto.
              (WebCore::executeMovePageDownAndModifySelection): Ditto.
              (WebCore::executeMovePageUp): Ditto.
              (WebCore::executeMovePageUpAndModifySelection): Ditto.
              (WebCore::executeMoveRight): Ditto.
              (WebCore::executeMoveRightAndModifySelection): Ditto.
              (WebCore::executeMoveToBeginningOfDocument): Ditto.
              (WebCore::executeMoveToBeginningOfDocumentAndModifySelection): Ditto.
              (WebCore::executeMoveToBeginningOfLine): Ditto.
              (WebCore::executeMoveToBeginningOfLineAndModifySelection): Ditto.
              (WebCore::executeMoveToBeginningOfParagraph): Ditto.
              (WebCore::executeMoveToBeginningOfParagraphAndModifySelection): Ditto.
              (WebCore::executeMoveToBeginningOfSentence): Ditto.
              (WebCore::executeMoveToBeginningOfSentenceAndModifySelection): Ditto.
              (WebCore::executeMoveToEndOfDocument): Ditto.
              (WebCore::executeMoveToEndOfDocumentAndModifySelection): Ditto.
              (WebCore::executeMoveToEndOfSentence): Ditto.
              (WebCore::executeMoveToEndOfSentenceAndModifySelection): Ditto.
              (WebCore::executeMoveToEndOfLine): Ditto.
              (WebCore::executeMoveToEndOfLineAndModifySelection): Ditto.
              (WebCore::executeMoveToEndOfParagraph): Ditto.
              (WebCore::executeMoveToEndOfParagraphAndModifySelection): Ditto.
              (WebCore::executeMoveParagraphBackwardAndModifySelection): Ditto.
              (WebCore::executeMoveParagraphForwardAndModifySelection): Ditto.
              (WebCore::executeMoveUp): Ditto.
              (WebCore::executeMoveUpAndModifySelection): Ditto.
              (WebCore::executeMoveWordBackward): Ditto.
              (WebCore::executeMoveWordBackwardAndModifySelection): Ditto.
              (WebCore::executeMoveWordForward): Ditto.
              (WebCore::executeMoveWordForwardAndModifySelection): Ditto.
              (WebCore::executeMoveWordLeft): Ditto.
              (WebCore::executeMoveWordLeftAndModifySelection): Ditto.
              (WebCore::executeMoveWordRight): Ditto.
              (WebCore::executeMoveWordRightAndModifySelection): Ditto.
              (WebCore::executeMoveToLeftEndOfLine): Ditto.
              (WebCore::executeMoveToLeftEndOfLineAndModifySelection): Ditto.
              (WebCore::executeMoveToRightEndOfLine): Ditto.
              (WebCore::executeMoveToRightEndOfLineAndModifySelection): Ditto.
              * editing/FrameSelection.cpp:
              (WebCore::FrameSelection::moveTo): Takes EUserTriggered instead of a boolean.
              (WebCore::FrameSelection::setSelection): Ditto.
              (WebCore::FrameSelection::modify): Ditto.
              (WebCore::FrameSelection::setStart): Ditto.
              (WebCore::FrameSelection::setEnd): Ditto.
              (WebCore::FrameSelection::setBase): Ditto.
              (WebCore::FrameSelection::setExtent): Ditto.
              (WebCore::FrameSelection::selectAll): Ditto.
              (WebCore::FrameSelection::notifyRendererOfSelectionChange): Ditto.
              * editing/FrameSelection.h: Extracted EUserTriggered out of SetSelectionOption; SetSelectionOptions
              now takes the union of values of SetSelectionOption and EUserTriggered.
              (WebCore::FrameSelection::selectionOptionsToUserTriggered): Converts SetSelectionOptions to
              EUserTriggered. 
              * page/DOMSelection.cpp:
              (WebCore::DOMSelection::modify): Calls FrameSelection::modify.
              * page/EventHandler.cpp:
              (WebCore::EventHandler::handleMouseReleaseEvent): Ditto.
              (WebCore::handleKeyboardSelectionMovement): Ditto.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@89293 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      03c49e8d
  21. 12 May, 2011 1 commit
    • tonyg@chromium.org's avatar
      2011-05-10 Tony Gentilcore <tonyg@chromium.org> · 4b0a55f4
      tonyg@chromium.org authored
              Reviewed by Darin Adler.
      
              Perform some forward declarations suggested by include-what-you-use
              https://bugs.webkit.org/show_bug.cgi?id=60545
      
              * accessibility/AccessibilityObject.cpp:
              * accessibility/AccessibilityRenderObject.cpp:
              * accessibility/mac/AccessibilityObjectWrapper.mm:
              * dom/DocumentMarkerController.cpp:
              * dom/Position.cpp:
              * dom/PositionIterator.cpp:
              * dom/Range.cpp:
              * editing/ApplyBlockElementCommand.cpp:
              * editing/ApplyStyleCommand.cpp:
              * editing/Editor.cpp:
              * editing/EditorCommand.cpp:
              * editing/FrameSelection.cpp:
              * editing/HTMLInterchange.cpp:
              * editing/IndentOutdentCommand.cpp:
              * editing/ReplaceSelectionCommand.cpp:
              * editing/SpellChecker.h:
              * editing/SpellingCorrectionCommand.cpp:
              * editing/SpellingCorrectionController.h:
              * editing/TextCheckingHelper.cpp:
              * editing/TextIterator.h:
              * editing/htmlediting.h:
              * editing/markup.cpp:
              * editing/visible_units.cpp:
              * editing/visible_units.h:
              * fileapi/DOMFileSystem.cpp:
              * fileapi/DirectoryReaderSync.cpp:
              * fileapi/DirectoryReaderSync.h:
              * fileapi/FileEntry.h:
              * fileapi/FileWriter.h:
              * fileapi/FileWriterBase.h:
              * fileapi/FileWriterSync.h:
              * history/CachedFrame.cpp:
              * history/CachedPage.cpp:
              * history/HistoryItem.cpp:
              * history/HistoryItem.h:
              * history/PageCache.h:
              * loader/HistoryController.h:
              * loader/PingLoader.h:
              * loader/ResourceLoader.h:
              * loader/appcache/DOMApplicationCache.h:
              * loader/cache/CachedCSSStyleSheet.h:
              * loader/cache/CachedFont.cpp:
              * loader/cache/CachedFont.h:
              * loader/cache/CachedResourceRequest.cpp:
              * loader/cache/CachedResourceRequest.h:
              * loader/cache/MemoryCache.h:
              * notifications/Notification.cpp:
              * notifications/Notification.h:
              * notifications/NotificationCenter.cpp:
              * notifications/NotificationCenter.h:
              * page/Chrome.cpp:
              * page/Chrome.h:
              * page/DOMSelection.cpp:
              * page/DOMTimer.h:
              * page/DOMWindow.cpp:
              * page/EventHandler.cpp:
              * page/FocusController.h:
              * page/Geolocation.cpp:
              * page/Geolocation.h:
              * page/History.cpp:
              * rendering/RenderListBox.cpp:
              * workers/WorkerContext.cpp:
      2011-05-10  Tony Gentilcore  <tonyg@chromium.org>
      
              Reviewed by Darin Adler.
      
              Perform some forward declarations suggested by include-what-you-use
              https://bugs.webkit.org/show_bug.cgi?id=60545
      
              * src/WebHistoryItem.cpp:
              * src/WebNotification.cpp:
              * src/WebTextCheckingCompletionImpl.cpp:
              * src/mac/WebSubstringUtil.mm:
      2011-05-10  Tony Gentilcore  <tonyg@chromium.org>
      
              Reviewed by Darin Adler.
      
              Perform some forward declarations suggested by include-what-you-use
              https://bugs.webkit.org/show_bug.cgi?id=60545
      
              * Plugins/Hosted/WebHostedNetscapePluginView.mm:
              * WebView/WebFrame.mm:
      2011-05-10  Tony Gentilcore  <tonyg@chromium.org>
      
              Reviewed by Darin Adler.
      
              Perform some forward declarations suggested by include-what-you-use
              https://bugs.webkit.org/show_bug.cgi?id=60545
      
              * WebProcess/WebPage/mac/WebPageMac.mm:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@86325 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      4b0a55f4
  22. 05 May, 2011 1 commit
    • rniwa@webkit.org's avatar
      2011-05-05 Ryosuke Niwa <rniwa@webkit.org> · 78bbc94c
      rniwa@webkit.org authored
              Reviewed by Eric Seidel.
      
              Rename SelectionController to FrameSelection
              https://bugs.webkit.org/show_bug.cgi?id=60234
      
              * src/WebFrameImpl.cpp:
              (WebKit::WebFrameImpl::selectWordAroundCaret):
              * src/WebViewImpl.cpp:
              (WebKit::WebViewImpl::textInputType):
              (WebKit::WebViewImpl::caretOrSelectionBounds):
              (WebKit::WebViewImpl::caretOrSelectionRange):
              (WebKit::WebViewImpl::clearFocusedNode):
      2011-05-05  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Eric Seidel.
      
              Rename SelectionController to FrameSelection
              https://bugs.webkit.org/show_bug.cgi?id=60234
      
              * Api/qwebframe.cpp:
      2011-05-05  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Eric Seidel.
      
              Rename SelectionController to FrameSelection
              https://bugs.webkit.org/show_bug.cgi?id=60234
      
              * webkit/webkitwebview.cpp:
              (getLocationForKeyboardGeneratedContextMenu):
      2011-05-05  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Eric Seidel.
      
              Rename SelectionController to FrameSelection
              https://bugs.webkit.org/show_bug.cgi?id=60234
      
              * WebView.cpp:
      2011-05-05  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Eric Seidel.
      
              Rename SelectionController to FrameSelection
              https://bugs.webkit.org/show_bug.cgi?id=60234
      
              * WebDOMSelection.cpp:
              * WebDOMSelection.h:
              * WebKitSupport/EditorClientWx.cpp:
              * WebView.cpp:
      2011-05-05  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Eric Seidel.
      
              Rename SelectionController to FrameSelection
              https://bugs.webkit.org/show_bug.cgi?id=60234
      
              * WebView/WebFrame.mm:
              (-[WebFrame _rangeByAlteringCurrentSelection:FrameSelection::direction:granularity:]):
              * WebView/WebFrameInternal.h:
              * WebView/WebHTMLView.mm:
              * WebView/WebTextCompletionController.mm:
              (-[WebTextCompletionController doCompletion]):
              * WebView/WebView.mm:
      2011-05-05  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Eric Seidel.
      
              Rename SelectionController to FrameSelection
              https://bugs.webkit.org/show_bug.cgi?id=60234
      
              * WebCoreSupport/EditorClientHaiku.cpp:
              (WebCore::EditorClientHaiku::handleKeyboardEvent):
      2011-05-05  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Eric Seidel.
      
              Rename SelectionController to FrameSelection
              https://bugs.webkit.org/show_bug.cgi?id=60234
      
              * WebCoreSupport/EditorClientWinCE.cpp:
              (WebKit::EditorClientWinCE::handleEditingKeyboardEvent):
      2011-05-05  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Eric Seidel.
      
              Rename SelectionController to FrameSelection
              https://bugs.webkit.org/show_bug.cgi?id=60234
      
              * WebCoreSupport/EditorClientEfl.cpp:
              (WebCore::EditorClientEfl::handleEditingKeyboardEvent):
      2011-05-05  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Eric Seidel.
      
              Rename SelectionController to FrameSelection
              https://bugs.webkit.org/show_bug.cgi?id=60234
      
              * CMakeLists.txt:
              * GNUmakefile.list.am:
              * WebCore.exp.in:
              * WebCore.gypi:
              * WebCore.pro:
              * WebCore.vcproj/WebCore.vcproj:
              * WebCore.xcodeproj/project.pbxproj:
              * accessibility/AccessibilityObject.cpp:
              * accessibility/AccessibilityRenderObject.cpp:
              (WebCore::AccessibilityRenderObject::visiblePositionRangeForLine):
              * accessibility/mac/AccessibilityObjectWrapper.mm:
              * bindings/objc/ExceptionHandlers.h:
              * css/CSSStyleSelector.cpp:
              * dom/ContainerNode.cpp:
              (WebCore::ContainerNode::cloneChildNodes):
              * dom/Document.cpp:
              * dom/InputElement.cpp:
              * editing/DeleteButtonController.cpp:
              * editing/EditCommand.cpp:
              * editing/EditingAllInOne.cpp:
              * editing/EditingStyle.cpp:
              * editing/Editor.cpp:
              (WebCore::Editor::canCopy):
              (WebCore::Editor::canDelete):
              (WebCore::Editor::markMisspellingsAfterTypingToWord):
              (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges):
              (WebCore::Editor::changeSelectionAfterCommand):
              (WebCore::Editor::respondToChangedSelection):
              * editing/Editor.h:
              * editing/EditorCommand.cpp:
              (WebCore::executeDeleteToMark):
              (WebCore::executeMoveBackward):
              (WebCore::executeMoveBackwardAndModifySelection):
              (WebCore::executeMoveDown):
              (WebCore::executeMoveDownAndModifySelection):
              (WebCore::executeMoveForward):
              (WebCore::executeMoveForwardAndModifySelection):
              (WebCore::executeMoveLeft):
              (WebCore::executeMoveLeftAndModifySelection):
              (WebCore::executeMovePageDown):
              (WebCore::executeMovePageDownAndModifySelection):
              (WebCore::executeMovePageUp):
              (WebCore::executeMovePageUpAndModifySelection):
              (WebCore::executeMoveRight):
              (WebCore::executeMoveRightAndModifySelection):
              (WebCore::executeMoveToBeginningOfDocument):
              (WebCore::executeMoveToBeginningOfDocumentAndModifySelection):
              (WebCore::executeMoveToBeginningOfLine):
              (WebCore::executeMoveToBeginningOfLineAndModifySelection):
              (WebCore::executeMoveToBeginningOfParagraph):
              (WebCore::executeMoveToBeginningOfParagraphAndModifySelection):
              (WebCore::executeMoveToBeginningOfSentence):
              (WebCore::executeMoveToBeginningOfSentenceAndModifySelection):
              (WebCore::executeMoveToEndOfDocument):
              (WebCore::executeMoveToEndOfDocumentAndModifySelection):
              (WebCore::executeMoveToEndOfSentence):
              (WebCore::executeMoveToEndOfSentenceAndModifySelection):
              (WebCore::executeMoveToEndOfLine):
              (WebCore::executeMoveToEndOfLineAndModifySelection):
              (WebCore::executeMoveToEndOfParagraph):
              (WebCore::executeMoveToEndOfParagraphAndModifySelection):
              (WebCore::executeMoveParagraphBackwardAndModifySelection):
              (WebCore::executeMoveParagraphForwardAndModifySelection):
              (WebCore::executeMoveUp):
              (WebCore::executeMoveUpAndModifySelection):
              (WebCore::executeMoveWordBackward):
              (WebCore::executeMoveWordBackwardAndModifySelection):
              (WebCore::executeMoveWordForward):
              (WebCore::executeMoveWordForwardAndModifySelection):
              (WebCore::executeMoveWordLeft):
              (WebCore::executeMoveWordLeftAndModifySelection):
              (WebCore::executeMoveWordRight):
              (WebCore::executeMoveWordRightAndModifySelection):
              (WebCore::executeMoveToLeftEndOfLine):
              (WebCore::executeMoveToLeftEndOfLineAndModifySelection):
              (WebCore::executeMoveToRightEndOfLine):
              (WebCore::executeMoveToRightEndOfLineAndModifySelection):
              * editing/FrameSelection.cpp: Copied from Source/WebCore/editing/SelectionController.cpp.
              (WebCore::FrameSelection::FrameSelection):
              (WebCore::FrameSelection::moveTo):
              (WebCore::FrameSelection::setSelection):
              (WebCore::FrameSelection::nodeWillBeRemoved):
              (WebCore::FrameSelection::respondToNodeModification):
              (WebCore::FrameSelection::textWillBeReplaced):
              (WebCore::FrameSelection::setIsDirectional):
              (WebCore::FrameSelection::directionOfEnclosingBlock):
              (WebCore::FrameSelection::willBeModified):
              (WebCore::FrameSelection::positionForPlatform):
              (WebCore::FrameSelection::startForPlatform):
              (WebCore::FrameSelection::endForPlatform):
              (WebCore::FrameSelection::modifyExtendingRight):
              (WebCore::FrameSelection::modifyExtendingForward):
              (WebCore::FrameSelection::modifyMovingRight):
              (WebCore::FrameSelection::modifyMovingForward):
              (WebCore::FrameSelection::modifyExtendingLeft):
              (WebCore::FrameSelection::modifyExtendingBackward):
              (WebCore::FrameSelection::modifyMovingLeft):
              (WebCore::FrameSelection::modifyMovingBackward):
              (WebCore::FrameSelection::modify):
              (WebCore::FrameSelection::xPosForVerticalArrowNavigation):
              (WebCore::FrameSelection::clear):
              (WebCore::FrameSelection::setStart):
              (WebCore::FrameSelection::setEnd):
              (WebCore::FrameSelection::setBase):
              (WebCore::FrameSelection::setExtent):
              (WebCore::FrameSelection::setCaretRectNeedsUpdate):
              (WebCore::FrameSelection::updateCaretRect):
              (WebCore::FrameSelection::caretRenderer):
              (WebCore::FrameSelection::localCaretRect):
              (WebCore::FrameSelection::absoluteBoundsForLocalRect):
              (WebCore::FrameSelection::absoluteCaretBounds):
              (WebCore::FrameSelection::caretRepaintRect):
              (WebCore::FrameSelection::recomputeCaretRect):
              (WebCore::FrameSelection::shouldRepaintCaret):
              (WebCore::FrameSelection::invalidateCaretRect):
              (WebCore::FrameSelection::paintCaret):
              (WebCore::FrameSelection::debugRenderer):
              (WebCore::FrameSelection::contains):
              (WebCore::FrameSelection::selectFrameElementInParentIfFullySelected):
              (WebCore::FrameSelection::selectAll):
              (WebCore::FrameSelection::setSelectedRange):
              (WebCore::FrameSelection::isInPasswordField):
              (WebCore::FrameSelection::caretRendersInsideNode):
              (WebCore::FrameSelection::focusedOrActiveStateChanged):
              (WebCore::FrameSelection::pageActivationChanged):
              (WebCore::FrameSelection::updateSecureKeyboardEntryIfActive):
              (WebCore::FrameSelection::setUseSecureKeyboardEntry):
              (WebCore::FrameSelection::setFocused):
              (WebCore::FrameSelection::isFocusedAndActive):
              (WebCore::FrameSelection::updateAppearance):
              (WebCore::FrameSelection::setCaretVisible):
              (WebCore::FrameSelection::clearCaretRectIfNeeded):
              (WebCore::FrameSelection::caretBlinkTimerFired):
              (WebCore::FrameSelection::notifyRendererOfSelectionChange):
              (WebCore::FrameSelection::setFocusedNodeIfNeeded):
              (WebCore::FrameSelection::paintDragCaret):
              (WebCore::FrameSelection::copyTypingStyle):
              (WebCore::FrameSelection::shouldDeleteSelection):
              (WebCore::FrameSelection::bounds):
              (WebCore::FrameSelection::getClippedVisibleTextRectangles):
              (WebCore::FrameSelection::currentForm):
              (WebCore::FrameSelection::revealSelection):
              (WebCore::FrameSelection::setSelectionFromNone):
              (WebCore::FrameSelection::shouldChangeSelection):
              (WebCore::FrameSelection::formatForDebugger):
              (WebCore::FrameSelection::showTreeForThis):
              (showTree):
              * editing/FrameSelection.h: Copied from Source/WebCore/editing/SelectionController.h.
              (WebCore::FrameSelection::typingStyle):
              (WebCore::FrameSelection::clearTypingStyle):
              (WebCore::FrameSelection::setTypingStyle):
              (WebCore::FrameSelection::notifyAccessibilityForSelectionChange):
              * editing/ModifySelectionListLevel.cpp:
              * editing/RemoveFormatCommand.cpp:
              * editing/ReplaceSelectionCommand.cpp:
              * editing/SelectionController.cpp: Removed.
              * editing/SelectionController.h: Removed.
              * editing/SetSelectionCommand.cpp:
              (WebCore::SetSelectionCommand::SetSelectionCommand):
              (WebCore::SetSelectionCommand::doApply):
              (WebCore::SetSelectionCommand::doUnapply):
              * editing/SetSelectionCommand.h:
              (WebCore::SetSelectionCommand::create):
              * editing/SpellingCorrectionCommand.cpp:
              (WebCore::SpellingCorrectionCommand::doApply):
              * editing/SpellingCorrectionController.cpp:
              (WebCore::SpellingCorrectionController::respondToUnappliedSpellCorrection):
              * editing/TypingCommand.cpp:
              (WebCore::TypingCommand::deleteKeyPressed):
              (WebCore::TypingCommand::forwardDeleteKeyPressed):
              * editing/chromium/FrameSelectionChromium.cpp: Copied from Source/WebCore/editing/chromium/SelectionControllerChromium.cpp.
              (WebCore::FrameSelection::notifyAccessibilityForSelectionChange):
              * editing/chromium/SelectionControllerChromium.cpp: Removed.
              * editing/gtk/FrameSelectionGtk.cpp: Copied from Source/WebCore/editing/gtk/SelectionControllerGtk.cpp.
              (WebCore::FrameSelection::notifyAccessibilityForSelectionChange):
              * editing/gtk/SelectionControllerGtk.cpp: Removed.
              * editing/mac/EditorMac.mm:
              (WebCore::Editor::canCopyExcludingStandaloneImages):
              * editing/mac/FrameSelectionMac.mm: Copied from Source/WebCore/editing/mac/SelectionControllerMac.mm.
              (WebCore::FrameSelection::notifyAccessibilityForSelectionChange):
              * editing/mac/SelectionControllerMac.mm: Removed.
              * editing/qt/EditorQt.cpp:
              * loader/archive/cf/LegacyWebArchive.cpp:
              * page/ContextMenuController.cpp:
              (WebCore::ContextMenuController::populate):
              * page/DOMSelection.cpp:
              (WebCore::DOMSelection::type):
              (WebCore::DOMSelection::modify):
              (WebCore::DOMSelection::addRange):
              (WebCore::DOMSelection::deleteFromDocument):
              (WebCore::DOMSelection::containsNode):
              * page/DragController.cpp:
              (WebCore::DragController::dragIsMove):
              * page/DragController.h:
              * page/EventHandler.cpp:
              (WebCore::setSelectionIfNeeded):
              (WebCore::setNonDirectionalSelectionIfNeeded):
              (WebCore::EventHandler::sendContextMenuEventForKey):
              (WebCore::EventHandler::handleKeyboardSelectionMovement):
              * page/EventHandler.h:
              * page/FocusController.cpp:
              (WebCore::clearSelectionIfNeeded):
              * page/Frame.cpp:
              (WebCore::Frame::Frame):
              * page/Frame.h:
              (WebCore::Frame::selection):
              * page/Page.cpp:
              (WebCore::Page::Page):
              * page/Page.h:
              (WebCore::Page::dragCaretController):
              * page/chromium/DragControllerChromium.cpp:
              * page/chromium/EventHandlerChromium.cpp:
              * page/win/DragControllerWin.cpp:
              * page/win/EventHandlerWin.cpp:
              * rendering/HitTestResult.cpp:
              * rendering/RenderBlock.cpp:
              (WebCore::RenderBlock::destroy):
              (WebCore::RenderBlock::paintCaret):
              * rendering/RenderImage.cpp:
              * rendering/RenderInline.cpp:
              (WebCore::RenderInline::destroy):
              * rendering/RenderLayer.cpp:
              * rendering/RenderListBox.cpp:
              * rendering/RenderObjectChildList.cpp:
              (WebCore::RenderObjectChildList::removeChildNode):
              * rendering/RenderTextControl.cpp:
              * rendering/RenderTextControlSingleLine.cpp:
              * rendering/RenderTheme.cpp:
              * rendering/RenderTreeAsText.cpp:
              * svg/SVGSVGElement.cpp:
              * svg/SVGTextContentElement.cpp:
              (WebCore::SVGTextContentElement::selectSubString):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@85864 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      78bbc94c
  23. 19 Apr, 2011 1 commit
    • rniwa@webkit.org's avatar
      2011-04-19 Ryosuke Niwa <rniwa@webkit.org> · 77a1ed7c
      rniwa@webkit.org authored
              Reviewed by Dimitri Glazkov.
      
              REGRESSION(r74228-75294): removing nodes is 200+ times slower when selection is inside a shadow DOM
              https://bugs.webkit.org/show_bug.cgi?id=57061
      
              The bug was caused by Range::compareNode's incorrectly returning NODE_INSIDE when the selection is inside
              a shadow DOM and the node is outside of the shadow DOM. This caused respondToNodeModification to call
              RenderView::clearSelection every time a node is removed when selection is in a shadow DOM and resulted in
              a significant performance regression.
      
              Fixed Ranged::compareNode by making Range::compareBoundaryPoints throw a WRONG_DOCUMENT_ERR when there are
              no common ancestors between containerA and containerB. This will force compareNode to also throw an exception
              and prevents respondToNodeModification from clearing selection.
      
              No new tests because this is a performance improvement and the fix in Range cannot be tested since shadow DOM
              isn't exposed to JavaScript.
      
              * dom/Range.cpp:
              (WebCore::Range::setStart): Calls compareBoundaryPoints; since we ensures that the root container noes of
              start and end nodes are same, we should never get an exception from compareBoundaryPoints.
              (WebCore::Range::setEnd): Ditto.
              (WebCore::Range::isPointInRange): Calls compareBoundaryPoints; returns false when compareBoundaryPoints
              throws an exception.
              (WebCore::Range::comparePoint): Calls compareBoundaryPoints; exit early when an exception is thrown by
              compareBoundaryPoints.
              (WebCore::Range::compareBoundaryPoints): Throws an exception when two containers do not have a common ancestor.
              (WebCore::Range::boundaryPointsValid): Calls compareBoundaryPoints and checks that it didn't throw an exception.
              * dom/Range.h:
              * editing/SelectionController.cpp:
              (WebCore::SelectionController::respondToNodeModification):
              * editing/htmlediting.cpp:
              (WebCore::comparePositions): Calls compareBoundaryPoints.
              * editing/markup.cpp:
              (WebCore::createMarkup): Calls compareBoundaryPoints; since startNode and pastEnd are both in the same document
              and neither are in a shadow DOM, it should never throw an exception.
              * page/DOMSelection.cpp:
              (WebCore::DOMSelection::containsNode): Calls compareBoundaryPoints; node is fully selected only if no exception
              was thrown.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@84265 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      77a1ed7c
  24. 31 Mar, 2011 1 commit
    • xji@chromium.org's avatar
      2011-03-30 Xiaomei Ji <xji@chromium.org> · 429dd21b
      xji@chromium.org authored
              Reviewed by Ryosuke Niwa.
      
              Experiment with moving caret by word in visual order.
              https://bugs.webkit.org/show_bug.cgi?id=57336
      
              * editing/selection/move-by-word-visually-expected.txt: Added.
              * editing/selection/move-by-word-visually.html: Added.
      2011-03-30  Xiaomei Ji  <xji@chromium.org>
      
              Reviewed by Ryosuke Niwa.
      
              Experiment with moving caret by word in visual order.
              https://bugs.webkit.org/show_bug.cgi?id=57336
      
              Follow Firefox's convention in Windows, 
              In LTR block, word break visually moves cursor to the left boundary of words,
              In RTL block, word break visually moves cursor to the right boundary of words.
      
              This is the 1st version of implementing "move caret by word in visual order".
              It only works in the following situation:
              1. For a LTR box in a LTR block or a RTL box in RTL block, 
              when caret is at the left boundary of the box and we are looking for 
              the word boundary in right.
              2. For a LTR or RTL box in a LTR block, when caret is at the left boundary
              of the box and we are looking for the word boundary in left and 
              previous box is a LTR box.
              3. For a LTR or RTL box in a RTL block, when the caret is at the right 
              boundary of the box and we are looking for the word boundary in right and next box is RTL box.
      
              An experimental granularity is introduced, as a side effect, functions having switch statements
              to handle those granularities have to add more one case to handle this new granularity.
              The experimental granularity is exposed though JS by '-webkit-visual-word".
      
              The overall algorithm is looping through inline boxes visually and looking
              for the visually nearest word break position. 
      
              Test: editing/selection/move-by-word-visually.html
      
              * editing/SelectionController.cpp:
              (WebCore::SelectionController::modifyExtendingRight):
              (WebCore::SelectionController::modifyExtendingForward):
              (WebCore::SelectionController::modifyMovingRight):
              (WebCore::SelectionController::modifyMovingForward):
              (WebCore::SelectionController::modifyExtendingLeft):
              (WebCore::SelectionController::modifyExtendingBackward):
              (WebCore::SelectionController::modifyMovingLeft):
              (WebCore::SelectionController::modifyMovingBackward):
              * editing/TextGranularity.h:
              * editing/VisibleSelection.cpp:
              (WebCore::VisibleSelection::setStartAndEndFromBaseAndExtentRespectingGranularity):
              * editing/visible_units.cpp:
              (WebCore::previousWordBreakInBoxInsideBlockWithSameDirectionality):
              (WebCore::wordBoundaryInBox):
              (WebCore::wordBoundaryInAdjacentBoxes):
              (WebCore::leftWordBoundary):
              (WebCore::rightWordBoundary):
              (WebCore::leftWordPosition):
              (WebCore::rightWordPosition):
              * editing/visible_units.h:
              * page/DOMSelection.cpp:
              (WebCore::DOMSelection::modify):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@82588 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      429dd21b
  25. 09 Mar, 2011 1 commit
    • rniwa@webkit.org's avatar
      2011-03-08 Ryosuke Niwa <rniwa@webkit.org> · f6f91779
      rniwa@webkit.org authored
              Reviewed by Kent Tamura.
      
              Remove calls to deprecatedEditingOffset in SelectionController and VisibleSelection
              https://bugs.webkit.org/show_bug.cgi?id=54937
      
              * editing/SelectionController.cpp:
              (WebCore::SelectionController::setSelection): Calls anchorNode() instead of deprecatedNode() to obtain
              the document. Also restrained the lifetime of document variable.
              (WebCore::removingNodeRemovesPosition): Compare the node with anchorNode() instead of deprecatedNode()
              to determine whether or not position becomes null after removing a node.
              (WebCore::SelectionController::directionOfEnclosingBlock): The enclosing block is always a container
              so call containerNode() instead of deprecatedNode().
              (WebCore::SelectionController::debugRenderer): Call containerNode() and computeOffsetInContainer()
              instead of deprecatedNode() and deprecatedEditingOffset() respectively.
              (WebCore::SelectionController::isInPasswordField): Look for the shadow root from containerNode()
              instead of deprecatedNode to determine whether or not selection inside a password field. Also assert
              that the specified position is not before or after the shadow root as it violates our assumption.
              * editing/VisibleSelection.cpp:
              (WebCore::makeSearchRange): Call containerNode() and offsetInContainerNode() instead of deprecatedNode()
              and deprecatedEditingOffset() respectively because start is always parent anchored and therefore
              guaranteed to be an offset inside an anchor node.
              (WebCore::VisibleSelection::adjustSelectionToAvoidCrossingEditingBoundaries): Call containerNode()
              instead of deprecatedNode() to look for the lowest editable ancestor because position before or after
              an editable element isn't editable.
              * page/DOMSelection.cpp: Call containerNode() and offsetInContainerNode() instead of deprecatedNode()
              and deprecatedEditingOffset() respectively in the following functions because they are exposed to
              DOM, which doesn't have before/after concept.
              (WebCore::DOMSelection::anchorNode):
              (WebCore::DOMSelection::anchorOffset):
              (WebCore::DOMSelection::focusNode):
              (WebCore::DOMSelection::focusOffset):
              (WebCore::DOMSelection::baseNode):
              (WebCore::DOMSelection::baseOffset):
              (WebCore::DOMSelection::extentNode):
              (WebCore::DOMSelection::extentOffset):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@80604 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      f6f91779
  26. 02 Mar, 2011 1 commit
    • leviw@chromium.org's avatar
      2011-03-01 Levi Weintraub <leviw@chromium.org> · ca40abff
      leviw@chromium.org authored
              Reviewed by Ryosuke Niwa.
      
              Stop instantiating legacy editing Positions in VisiblePosition
              https://bugs.webkit.org/show_bug.cgi?id=52919
      
              Changing usage of legacy VisiblePosition constructor. Since we were dealing
              with positions from DOM Ranges, we're guaranteed a parent-anchored position.
      
              * WebView/WebFrame.mm:
              (-[WebFrame _caretRectAtPosition:affinity:]):
              * WebView/WebFrameInternal.h:
              * WebView/WebTextCompletionController.mm:
              (-[WebTextCompletionController doCompletion]):
      2011-03-01  Levi Weintraub  <leviw@chromium.org>
      
              Reviewed by Ryosuke Niwa.
      
              Stop instantiating legacy editing Positions in VisiblePosition
              https://bugs.webkit.org/show_bug.cgi?id=52919
      
              Changing VisiblePosition completely away from legacy positions.
      
              No new tests since this is functionaly equivalent.
      
              * WebCore.exp.in: Removing the legacy VisiblePosition constructor and
              adding the PositionIsOffsetInAnchor symbol. If we must create VisiblePositions
              outside of WebCore, they should be parent anchored.
              * accessibility/AXObjectCache.cpp:
              (WebCore::AXObjectCache::visiblePositionForTextMarkerData):
              * accessibility/AccessibilityObject.cpp:
              (WebCore::startOfStyleRange):
              (WebCore::endOfStyleRange):
              * accessibility/AccessibilityRenderObject.cpp:
              (WebCore::AccessibilityRenderObject::visiblePositionForIndex):
              * accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:
              (objectAndOffsetUnignored):
              * dom/Position.cpp:
              (WebCore::Position::document): Added this inline function to avoid the necessity
              of calling anchorNode to assure a document from a Position.
              (WebCore::Position::upstream): Fixed to correctly respect PositionIsAfterAnchor
              (WebCore::Position::downstream): ditto
              * dom/Range.cpp:
              (WebCore::Range::editingStartPosition):
              * editing/Editor.cpp:
              (WebCore::Editor::canDeleteRange):
              * editing/ReplaceSelectionCommand.cpp:
              (WebCore::ReplaceSelectionCommand::doApply):
              * editing/SelectionController.cpp:
              (WebCore::SelectionController::selectFrameElementInParentIfFullySelected):
              (WebCore::SelectionController::setSelectedRange):
              * editing/TextIterator.cpp:
              (WebCore::TextIterator::shouldRepresentNodeOffsetZero):
              * editing/TypingCommand.cpp:
              (WebCore::TypingCommand::deleteKeyPressed):
              * editing/VisiblePosition.cpp:
              (WebCore::VisiblePosition::leftVisuallyDistinctCandidate):
              (WebCore::VisiblePosition::rightVisuallyDistinctCandidate):
              (WebCore::VisiblePosition::canonicalPosition):
              (WebCore::VisiblePosition::characterAfter):
              (WebCore::VisiblePosition::localCaretRect):
              (WebCore::makeRange):
              (WebCore::startVisiblePosition):
              (WebCore::endVisiblePosition):
              (WebCore::setStart):
              (WebCore::setEnd):
              (WebCore::isFirstVisiblePositionInNode):
              (WebCore::isLastVisiblePositionInNode):
              * editing/VisiblePosition.h:
              (WebCore::VisiblePosition::VisiblePosition):
              * editing/htmlediting.cpp:
              (WebCore::firstInSpecialElement):
              (WebCore::lastInSpecialElement):
              (WebCore::visiblePositionBeforeNode):
              (WebCore::visiblePositionAfterNode):
              * editing/visible_units.cpp:
              (WebCore::startPositionForLine):
              (WebCore::endPositionForLine):
              (WebCore::previousLinePosition):
              (WebCore::nextLinePosition):
              (WebCore::startOfParagraph):
              (WebCore::endOfParagraph):
              (WebCore::endOfBlock):
              (WebCore::startOfDocument):
              (WebCore::endOfDocument):
              (WebCore::logicalStartPositionForLine):
              (WebCore::logicalEndPositionForLine):
              * page/DOMSelection.cpp:
              (WebCore::DOMSelection::collapse):
              (WebCore::DOMSelection::setBaseAndExtent):
              (WebCore::DOMSelection::setPosition):
              (WebCore::DOMSelection::extend):
              * page/EventHandler.cpp:
              (WebCore::EventHandler::handleMousePressEventSingleClick):
              * rendering/RenderObject.cpp:
              (WebCore::RenderObject::createVisiblePosition):
              * rendering/RenderTextControl.cpp:
              (WebCore::RenderTextControl::visiblePositionForIndex):
              * svg/SVGTextContentElement.cpp:
              (WebCore::SVGTextContentElement::selectSubString):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@80059 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      ca40abff
  27. 21 Feb, 2011 1 commit
    • rniwa@webkit.org's avatar
      2011-02-17 Ryosuke Niwa <rniwa@webkit.org> · 62b16970
      rniwa@webkit.org authored
              Reviewed by Kent Tamura.
      
              Rename Position::node() to Position::deprecatedNode()
              https://bugs.webkit.org/show_bug.cgi?id=54622
      
              Done the rename. All calls to node() are replaced by calls to deprecatedNode().
      
              * src/WebViewImpl.cpp:
              (WebKit::WebViewImpl::setComposition): Check the nullity of startContainer() instead of startPosition()->node().
              (WebKit::WebViewImpl::confirmComposition): Ditto.
              (WebKit::WebViewImpl::textInputType):
              (WebKit::WebViewImpl::caretOrSelectionBounds):
      2011-02-17  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Kent Tamura.
      
              Rename Position::node() to Position::deprecatedNode()
              https://bugs.webkit.org/show_bug.cgi?id=54622
      
              Replaced the call to node() by a call to containerNode() because the returned node is
              used to determine whether or not the selected contents are editable and such a check
              must be done against the container node.
      
              * WebCoreSupport/EditorClientQt.cpp:
              (WebCore::EditorClientQt::handleKeyboardEvent):
      2011-02-17  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Kent Tamura.
      
              Rename Position::node() to Position::deprecatedNode()
              https://bugs.webkit.org/show_bug.cgi?id=54622
      
              Done the rename. All calls to node() are replaced by calls to deprecatedNode().
      
              * webkit/webkitwebview.cpp:
              (webkit_web_view_popup_menu_handler):
      2011-02-17  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Kent Tamura.
      
              Rename Position::node() to Position::deprecatedNode()
              https://bugs.webkit.org/show_bug.cgi?id=54622
      
              * WebView/WebFrame.mm:
              (-[WebFrame _smartDeleteRangeForProposedRange:]):
      2011-02-17  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Kent Tamura.
      
              Rename Position::node() to Position::deprecatedNode()
              https://bugs.webkit.org/show_bug.cgi?id=54622
      
              Replaced the call to node() by a call to containerNode() because the returned node is
              used to determine whether or not the selected contents are editable and such a check
              must be done against the container node.
      
              * WebCoreSupport/EditorClientHaiku.cpp:
              (WebCore::EditorClientHaiku::handleKeyboardEvent):
      2011-02-17  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Kent Tamura.
      
              Rename Position::node() to Position::deprecatedNode()
              https://bugs.webkit.org/show_bug.cgi?id=54622
      
              Done the rename. All calls to node() are replaced by calls to deprecatedNode() except when
              calls were of the form node()->document() and node()->inDocument() in which case they were
              replaced by anchorNode()->document() and anchorNode()->inDocument() respectively.
      
              * WebCore.exp.in: Added Position::containerNode.
      
              The rest abbreviated for simplicity. Please see svn log.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@79196 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      62b16970
  28. 09 Feb, 2011 1 commit
    • leviw@chromium.org's avatar
      2011-02-08 Sheriff Bot <webkit.review.bot@gmail.com> · 0f9d6132
      leviw@chromium.org authored
              Unreviewed, rolling out r77980.
              http://trac.webkit.org/changeset/77980
              https://bugs.webkit.org/show_bug.cgi?id=54043
      
              "Crashes on Windows and Linux..." (Requested by leviw on
              #webkit).
      
              * WebView/WebFrame.mm:
              (-[WebFrame _caretRectAtNode:offset:affinity:]):
              * WebView/WebFrameInternal.h:
              * WebView/WebTextCompletionController.mm:
              (-[WebTextCompletionController doCompletion]):
      2011-02-08  Sheriff Bot  <webkit.review.bot@gmail.com>
      
              Unreviewed, rolling out r77980.
              http://trac.webkit.org/changeset/77980
              https://bugs.webkit.org/show_bug.cgi?id=54043
      
              "Crashes on Windows and Linux..." (Requested by leviw on
              #webkit).
      
              * WebCore.exp.in:
              * accessibility/AXObjectCache.cpp:
              (WebCore::AXObjectCache::visiblePositionForTextMarkerData):
              * accessibility/AccessibilityObject.cpp:
              (WebCore::startOfStyleRange):
              (WebCore::endOfStyleRange):
              * accessibility/AccessibilityRenderObject.cpp:
              (WebCore::AccessibilityRenderObject::visiblePositionForIndex):
              * accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:
              (objectAndOffsetUnignored):
              * dom/Position.cpp:
              (WebCore::Position::upstream):
              (WebCore::Position::downstream):
              * dom/Range.cpp:
              (WebCore::Range::editingStartPosition):
              * editing/Editor.cpp:
              (WebCore::Editor::canDeleteRange):
              * editing/ReplaceSelectionCommand.cpp:
              (WebCore::ReplaceSelectionCommand::doApply):
              * editing/SelectionController.cpp:
              (WebCore::SelectionController::selectFrameElementInParentIfFullySelected):
              (WebCore::SelectionController::setSelectedRange):
              * editing/TextIterator.cpp:
              (WebCore::TextIterator::shouldRepresentNodeOffsetZero):
              * editing/TypingCommand.cpp:
              (WebCore::TypingCommand::deleteKeyPressed):
              * editing/VisiblePosition.cpp:
              (WebCore::VisiblePosition::VisiblePosition):
              (WebCore::VisiblePosition::leftVisuallyDistinctCandidate):
              (WebCore::VisiblePosition::rightVisuallyDistinctCandidate):
              (WebCore::VisiblePosition::canonicalPosition):
              (WebCore::VisiblePosition::characterAfter):
              (WebCore::VisiblePosition::localCaretRect):
              (WebCore::makeRange):
              (WebCore::startVisiblePosition):
              (WebCore::endVisiblePosition):
              (WebCore::setStart):
              (WebCore::setEnd):
              (WebCore::isFirstVisiblePositionInNode):
              (WebCore::isLastVisiblePositionInNode):
              * editing/VisiblePosition.h:
              * editing/htmlediting.cpp:
              (WebCore::firstInSpecialElement):
              (WebCore::lastInSpecialElement):
              (WebCore::visiblePositionBeforeNode):
              (WebCore::visiblePositionAfterNode):
              * editing/visible_units.cpp:
              (WebCore::startPositionForLine):
              (WebCore::endPositionForLine):
              (WebCore::previousLinePosition):
              (WebCore::nextLinePosition):
              (WebCore::startOfParagraph):
              (WebCore::endOfParagraph):
              (WebCore::endOfBlock):
              (WebCore::startOfDocument):
              (WebCore::endOfDocument):
              (WebCore::logicalStartPositionForLine):
              (WebCore::logicalEndPositionForLine):
              * page/DOMSelection.cpp:
              (WebCore::DOMSelection::collapse):
              (WebCore::DOMSelection::setBaseAndExtent):
              (WebCore::DOMSelection::setPosition):
              (WebCore::DOMSelection::extend):
              * page/EventHandler.cpp:
              (WebCore::EventHandler::handleMousePressEventSingleClick):
              * rendering/RenderObject.cpp:
              (WebCore::RenderObject::createVisiblePosition):
              * rendering/RenderTextControl.cpp:
              (WebCore::RenderTextControl::visiblePositionForIndex):
              * svg/SVGTextContentElement.cpp:
              (WebCore::SVGTextContentElement::selectSubString):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@77997 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      0f9d6132
  29. 08 Feb, 2011 1 commit
    • leviw@chromium.org's avatar
      2011-02-08 Levi Weintraub <leviw@chromium.org> · ddcb501f
      leviw@chromium.org authored
              Reviewed by Ryosuke Niwa.
      
              Stop instantiating legacy editing Positions in VisiblePosition
              https://bugs.webkit.org/show_bug.cgi?id=52919
      
              Changing usage of legacy VisiblePosition constructor. Since we were dealing
              with positions from DOM Ranges, we're guaranteed a parent-anchored position.
      
              * WebView/WebFrame.mm:
              (-[WebFrame _caretRectAtPosition:affinity:]):
              * WebView/WebFrameInternal.h:
              * WebView/WebTextCompletionController.mm:
              (-[WebTextCompletionController doCompletion]):
      2011-02-08  Levi Weintraub  <leviw@chromium.org>
      
              Reviewed by Ryosuke Niwa.
      
              Stop instantiating legacy editing Positions in VisiblePosition
              https://bugs.webkit.org/show_bug.cgi?id=52919
      
              Changing VisiblePosition completely away from legacy positions.
      
              No new tests since this is functionaly equivalent.
      
              * WebCore.exp.in: Removing the legacy VisiblePosition constructor and
              adding the PositionIsOffsetInAnchor symbol. If we must create VisiblePositions
              outside of WebCore, they should be parent anchored.
              * accessibility/AXObjectCache.cpp:
              (WebCore::AXObjectCache::visiblePositionForTextMarkerData):
              * accessibility/AccessibilityObject.cpp:
              (WebCore::startOfStyleRange):
              (WebCore::endOfStyleRange):
              * accessibility/AccessibilityRenderObject.cpp:
              (WebCore::AccessibilityRenderObject::visiblePositionForIndex):
              * accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:
              (objectAndOffsetUnignored):
              * dom/Position.cpp:
              (WebCore::Position::upstream): Fixed to correctly respect PositionIsAfterAnchor
              (WebCore::Position::downstream): ditto
              * dom/Range.cpp:
              (WebCore::Range::editingStartPosition):
              * editing/Editor.cpp:
              (WebCore::Editor::canDeleteRange):
              * editing/ReplaceSelectionCommand.cpp:
              (WebCore::ReplaceSelectionCommand::doApply):
              * editing/SelectionController.cpp:
              (WebCore::SelectionController::selectFrameElementInParentIfFullySelected):
              (WebCore::SelectionController::setSelectedRange):
              * editing/TextIterator.cpp:
              (WebCore::TextIterator::shouldRepresentNodeOffsetZero):
              * editing/TypingCommand.cpp:
              (WebCore::TypingCommand::deleteKeyPressed):
              * editing/VisiblePosition.cpp:
              (WebCore::VisiblePosition::leftVisuallyDistinctCandidate):
              (WebCore::VisiblePosition::rightVisuallyDistinctCandidate):
              (WebCore::VisiblePosition::canonicalPosition):
              (WebCore::VisiblePosition::characterAfter):
              (WebCore::VisiblePosition::localCaretRect):
              (WebCore::makeRange):
              (WebCore::startVisiblePosition):
              (WebCore::endVisiblePosition):
              (WebCore::setStart):
              (WebCore::setEnd):
              (WebCore::isFirstVisiblePositionInNode):
              (WebCore::isLastVisiblePositionInNode):
              * editing/VisiblePosition.h:
              (WebCore::VisiblePosition::VisiblePosition):
              * editing/htmlediting.cpp:
              (WebCore::firstInSpecialElement):
              (WebCore::lastInSpecialElement):
              (WebCore::visiblePositionBeforeNode):
              (WebCore::visiblePositionAfterNode):
              * editing/visible_units.cpp:
              (WebCore::startPositionForLine):
              (WebCore::endPositionForLine):
              (WebCore::previousLinePosition):
              (WebCore::nextLinePosition):
              (WebCore::startOfParagraph):
              (WebCore::endOfParagraph):
              (WebCore::endOfBlock):
              (WebCore::startOfDocument):
              (WebCore::endOfDocument):
              (WebCore::logicalStartPositionForLine):
              (WebCore::logicalEndPositionForLine):
              * page/DOMSelection.cpp:
              (WebCore::DOMSelection::collapse):
              (WebCore::DOMSelection::setBaseAndExtent):
              (WebCore::DOMSelection::setPosition):
              (WebCore::DOMSelection::extend):
              * page/EventHandler.cpp:
              (WebCore::EventHandler::handleMousePressEventSingleClick):
              * rendering/RenderObject.cpp:
              (WebCore::RenderObject::createVisiblePosition):
              * rendering/RenderTextControl.cpp:
              (WebCore::RenderTextControl::visiblePositionForIndex):
              * svg/SVGTextContentElement.cpp:
              (WebCore::SVGTextContentElement::selectSubString):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@77980 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      ddcb501f
  30. 19 Jan, 2011 1 commit
    • commit-queue@webkit.org's avatar
      2011-01-19 Levi Weintraub <leviw@google.com> · c56f5de7
      commit-queue@webkit.org authored
              Reviewed by Ryosuke Niwa.
      
              Replaced rangeCompliantEquivalent with Position::parentAnchoredEquivalent
              and simplified the logic a bit. Unfortunately, Tables and some legacy
              editing positions still need to be handled specifically.
      
              remove rangeCompliantEquivalent and replace it with Position methods
              https://bugs.webkit.org/show_bug.cgi?id=25057
      
              No new tests as this is a refactor that doesn't change behavior.
      
              * WebCore.exp.in:
              * dom/Document.cpp:
              (WebCore::Document::caretRangeFromPoint):
              * dom/Position.cpp:
              (WebCore::Position::parentAnchoredEquivalent):
              * dom/Position.h:
              * editing/ApplyStyleCommand.cpp:
              (WebCore::ApplyStyleCommand::applyBlockStyle):
              * editing/CompositeEditCommand.cpp:
              (WebCore::CompositeEditCommand::insertNodeAt):
              (WebCore::CompositeEditCommand::moveParagraphs):
              * editing/DeleteSelectionCommand.cpp:
              (WebCore::DeleteSelectionCommand::initializePositionData):
              (WebCore::DeleteSelectionCommand::mergeParagraphs):
              * editing/Editor.cpp:
              (WebCore::Editor::textDirectionForSelection):
              (WebCore::Editor::advanceToNextMisspelling):
              * editing/InsertLineBreakCommand.cpp:
              (WebCore::InsertLineBreakCommand::shouldUseBreakElement):
              * editing/InsertParagraphSeparatorCommand.cpp:
              (WebCore::InsertParagraphSeparatorCommand::doApply):
              * editing/ReplaceSelectionCommand.cpp:
              (WebCore::handleStyleSpansBeforeInsertion):
              * editing/VisiblePosition.cpp:
              (WebCore::makeRange):
              (WebCore::setStart):
              (WebCore::setEnd):
              * editing/VisibleSelection.cpp:
              (WebCore::VisibleSelection::firstRange):
              (WebCore::VisibleSelection::toNormalizedRange):
              (WebCore::makeSearchRange):
              * editing/htmlediting.cpp:
              (WebCore::indexForVisiblePosition):
              * editing/htmlediting.h:
              * editing/visible_units.cpp:
              (WebCore::previousBoundary):
              (WebCore::nextBoundary):
              * page/DOMSelection.cpp:
              (WebCore::anchorPosition):
              (WebCore::focusPosition):
              (WebCore::basePosition):
              (WebCore::extentPosition):
      2011-01-19  Levi Weintraub  <leviw@google.com>
      
              Reviewed by Ryosuke Niwa.
      
              Updating to use Position::parentAnchoredEquivalent instead of
              the old htmlediting rangeCompliantEquivalent.
      
              remove rangeCompliantEquivalent and replace it with Position methods
              https://bugs.webkit.org/show_bug.cgi?id=25057
      
              * WebView/WebFrame.mm:
              (-[WebFrame _smartDeleteRangeForProposedRange:]):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76107 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      c56f5de7
  31. 08 Jan, 2011 1 commit
  32. 23 Dec, 2010 1 commit
    • rniwa@webkit.org's avatar
      2010-12-22 Ryosuke Niwa <rniwa@webkit.org> · bfb682fd
      rniwa@webkit.org authored
              Reviewed by Eric Seidel.
      
              Editor.h doesn't need to include SelectionController.h
              https://bugs.webkit.org/show_bug.cgi?id=51441
      
              Renamed SelectionController::EDirection to SelectionDirection.
      
              * src/WebFrameImpl.cpp:
              (WebKit::WebFrameImpl::executeCommand):
      2010-12-22  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Eric Seidel.
      
              Editor.h doesn't need to include SelectionController.h
              https://bugs.webkit.org/show_bug.cgi?id=51441
      
              Renamed SelectionController::EDirection to SelectionDirection.
      
              * WebCoreSupport/EditorClientQt.cpp:
              (WebCore::EditorClientQt::handleKeyboardEvent):
      2010-12-22  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Eric Seidel.
      
              Editor.h doesn't need to include SelectionController.h
              https://bugs.webkit.org/show_bug.cgi?id=51441
      
              Renamed SelectionController::EDirection to SelectionDirection.
      
              * WebView/WebFrame.mm:
              (-[WebFrame _rangeByAlteringCurrentSelection:SelectionController::direction:granularity:]):
              Takes SelectionDirection instead of SelectionController::EDirection.
              * WebView/WebFrameInternal.h:
              * WebView/WebTextCompletionController.mm:
              (-[WebTextCompletionController doCompletion]): Calls _rangeByAlteringCurrentSelection:SelectionController.
      2010-12-22  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Eric Seidel.
      
              Editor.h doesn't need to include SelectionController.h
              https://bugs.webkit.org/show_bug.cgi?id=51441
      
              Renamed SelectionController::EDirection to SelectionDirection.
      
              * WebCoreSupport/EditorClientHaiku.cpp:
              (WebCore::EditorClientHaiku::handleKeyboardEvent):
      2010-12-22  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Eric Seidel.
      
              Editor.h doesn't need to include SelectionController.h
              https://bugs.webkit.org/show_bug.cgi?id=51441
      
              Renamed SelectionController::EDirection to SelectionDirection.
      
              * WebCoreSupport/EditorClientWinCE.cpp:
              (WebKit::EditorClientWinCE::handleEditingKeyboardEvent):
      2010-12-22  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Eric Seidel.
      
              Editor.h doesn't need to include SelectionController.h
              https://bugs.webkit.org/show_bug.cgi?id=51441
      
              Renamed SelectionController::EDirection to SelectionDirection.
      
              * WebCoreSupport/EditorClientEfl.cpp:
              (WebCore::EditorClientEfl::handleEditingKeyboardEvent):
      2010-12-22  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Eric Seidel.
      
              Editor.h doesn't need to include SelectionController.h
              https://bugs.webkit.org/show_bug.cgi?id=51441
      
              Removed #include <Selection.h> from Editor.h.
              Also extracted WritingDirection.h from EditingStyle.h and renamed SelectionController::EDirection
              to SelectionDirection and moved its declaration from SelectionController.h to VisibleSelection.h
      
              * WebCore.exp.in: Signature changes.
              * WebCore.xcodeproj/project.pbxproj: Added WritingDirection.h
              * accessibility/AccessibilityRenderObject.cpp:
              (WebCore::AccessibilityRenderObject::visiblePositionRangeForLine): Change due to SelectionDirection.
              * editing/EditingStyle.h: Removed WritingDirection and included WritingDirection.h
              * editing/Editor.cpp:
              (WebCore::Editor::deleteWithDirection): Change due to SelectionDirection.
              (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges): Ditto.
              (WebCore::Editor::markMisspellingsAfterTypingToWord): Ditto.
              * editing/Editor.h: Removed SelectionController.h; added DocumentMarker.h, Timer.h, VisibleSelection.h
              and WritingDirection.h; forward declared CSSMutableStyleDeclaration.
              * editing/EditorCommand.cpp:
              (WebCore::executeDeleteBackward): Change due to SelectionDirection.
              (WebCore::executeDeleteBackwardByDecomposingPreviousCharacter): Ditto.
              (WebCore::executeDeleteForward): Ditto.
              (WebCore::executeDeleteToBeginningOfLine): Ditto.
              (WebCore::executeDeleteToBeginningOfParagraph): Ditto.
              (WebCore::executeDeleteToEndOfLine): Ditto.
              (WebCore::executeDeleteToEndOfParagraph): Ditto.
              (WebCore::executeDeleteWordBackward): Ditto.
              (WebCore::executeDeleteWordForward): Ditto.
              (WebCore::executeForwardDelete): Ditto.
              (WebCore::executeMoveBackward): Ditto.
              (WebCore::executeMoveBackwardAndModifySelection): Ditto.
              (WebCore::executeMoveDown): Ditto.
              (WebCore::executeMoveDownAndModifySelection): Ditto.
              (WebCore::executeMoveForward): Ditto.
              (WebCore::executeMoveForwardAndModifySelection): Ditto.
              (WebCore::executeMoveLeft): Ditto.
              (WebCore::executeMoveLeftAndModifySelection): Ditto.
              (WebCore::executeMoveRight): Ditto.
              (WebCore::executeMoveRightAndModifySelection): Ditto.
              (WebCore::executeMoveToBeginningOfDocument): Ditto.
              (WebCore::executeMoveToBeginningOfDocumentAndModifySelection): Ditto.
              (WebCore::executeMoveToBeginningOfLine): Ditto.
              (WebCore::executeMoveToBeginningOfLineAndModifySelection): Ditto.
              (WebCore::executeMoveToBeginningOfParagraph): Ditto.
              (WebCore::executeMoveToBeginningOfParagraphAndModifySelection): Ditto.
              (WebCore::executeMoveToBeginningOfSentence): Ditto.
              (WebCore::executeMoveToBeginningOfSentenceAndModifySelection): Ditto.
              (WebCore::executeMoveToEndOfDocument): Ditto.
              (WebCore::executeMoveToEndOfDocumentAndModifySelection): Ditto.
              (WebCore::executeMoveToEndOfSentence): Ditto.
              (WebCore::executeMoveToEndOfSentenceAndModifySelection): Ditto.
              (WebCore::executeMoveToEndOfLine): Ditto.
              (WebCore::executeMoveToEndOfLineAndModifySelection): Ditto.
              (WebCore::executeMoveToEndOfParagraph): Ditto.
              (WebCore::executeMoveToEndOfParagraphAndModifySelection): Ditto.
              (WebCore::executeMoveParagraphBackwardAndModifySelection): Ditto.
              (WebCore::executeMoveParagraphForwardAndModifySelection): Ditto.
              (WebCore::executeMoveUp): Ditto.
              (WebCore::executeMoveUpAndModifySelection): Ditto.
              (WebCore::executeMoveWordBackward): Ditto.
              (WebCore::executeMoveWordBackwardAndModifySelection): Ditto.
              (WebCore::executeMoveWordForward): Ditto.
              (WebCore::executeMoveWordForwardAndModifySelection): Ditto.
              (WebCore::executeMoveWordLeft): Ditto.
              (WebCore::executeMoveWordLeftAndModifySelection): Ditto.
              (WebCore::executeMoveWordRight): Ditto.
              (WebCore::executeMoveWordRightAndModifySelection): Ditto.
              (WebCore::executeMoveToLeftEndOfLine): Ditto.
              (WebCore::executeMoveToLeftEndOfLineAndModifySelection): Ditto.
              (WebCore::executeMoveToRightEndOfLine): Ditto.
              (WebCore::executeMoveToRightEndOfLineAndModifySelection): Ditto.
              * editing/SelectionController.cpp:
              (WebCore::SelectionController::willBeModified): Takes SelectionDirection instead of EDirection.
              (WebCore::SelectionController::modify): Ditto.
              * editing/SelectionController.h: Change due to SelectionDirection.
              * editing/TypingCommand.cpp:
              (WebCore::TypingCommand::deleteKeyPressed): Ditto.
              (WebCore::TypingCommand::forwardDeleteKeyPressed): Ditto.
              * editing/VisibleSelection.h: Added SelectionDirection, renamed and moved from EDirection
              in SelectionController.h
              * editing/WritingDirection.h: Added.
              * page/DOMSelection.cpp:
              (WebCore::DOMSelection::modify): Change due to SelectionDirection.
              (WebCore::DOMSelection::deleteFromDocument): Ditto.
              * page/EventHandler.cpp:
              (WebCore::EventHandler::handleKeyboardSelectionMovement): Ditto.
              * page/Frame.h: Includes SelectionController.h.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74566 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      bfb682fd
  33. 09 Dec, 2010 1 commit
    • dglazkov@chromium.org's avatar
      2010-12-08 Dimitri Glazkov <dglazkov@chromium.org> · e5cbec63
      dglazkov@chromium.org authored
              Reviewed by Darin Adler.
      
              Provide a generic way to store shadowParent on a Node.
              https://bugs.webkit.org/show_bug.cgi?id=50184
      
              This patch makes TreeShared::m_parent act as either parentNode() or
              shadowHost() for Node. The distinction is controlled by IsShadowRootFlag.
      
              Refactoring, so no new tests. See performance result testing in bug.
      
              * dom/Element.cpp:
              (WebCore::Element::recalcStyle): Changed to use parentOrHostNode().
              * dom/Node.cpp:
              (WebCore::Node::shadowHost): Added.
              (WebCore::Node::setShadowHost): Added.
              (WebCore::Node::isContentEditable): Changed to use parentOrHostNode().
              (WebCore::Node::isContentRichlyEditable): Ditto.
              (WebCore::Node::nextRenderer): Ditto.
              (WebCore::Node::virtualComputedStyle): Ditto.
              (WebCore::Node::canStartSelection): Ditto.
              (WebCore::Node::shadowTreeRootNode): Changed to use parentNodeGuaranteedHostFree().
              (WebCore::Node::getEventAncestors): Ditto.
              (WebCore::Node::defaultEventHandler): Changed to use parentOrHostNode().
              * dom/Node.h: Added an extra flag and adjusted bit counts.
              (WebCore::Node::isShadowNode): Made non-virtual, switched to use flag.
              (WebCore::Node::parentNode): Made to recognize flag.
              (WebCore::Node::parentOrHostNode): Changed to use straight parent() and made const.
              (WebCore::Node::parentNodeGuaranteedHostFree): Added.
              (WebCore::Node::shadowParentNode): Made non-virtual and const.
              * editing/TextIterator.cpp:
              (WebCore::depthCrossingShadowBoundaries): Changed to use parentOrHostNode();
              (WebCore::nextInPreOrderCrossingShadowBoundaries): Ditto.
              (WebCore::previousInPostOrderCrossingShadowBoundaries):  Ditto.
              (WebCore::setUpFullyClippedStack): Ditto.
              (WebCore::TextIterator::advance): Ditto.
              (WebCore::SimplifiedBackwardsTextIterator::advance): Ditto.
              * page/DOMSelection.cpp:
              (WebCore::DOMSelection::anchorNode): Changed to use parentNodeGuaranteedHostFree().
              (WebCore::DOMSelection::focusNode): Ditto.
              (WebCore::DOMSelection::baseNode): Ditto.
              (WebCore::DOMSelection::extentNode): Ditto.
              (WebCore::DOMSelection::getRangeAt): Ditto.
              * rendering/MediaControlElements.cpp:
              (WebCore::MediaControlShadowRootElement::MediaControlShadowRootElement):
                  Changed to setShadowHost().
              (WebCore::MediaControlShadowRootElement::updateStyle): Changed to use shadowHost().
              (WebCore::MediaControlShadowRootElement::detach): Added an override to
                  explicitly set shadowHost to 0. Otherwise, the element will leak.
              * rendering/MediaControlElements.h: Added detach def, removed members that are
                  no longer needed.
              * rendering/RenderSVGShadowTreeRootContainer.cpp:
              (WebCore::RenderSVGShadowTreeRootContainer::~RenderSVGShadowTreeRootContainer):
                  Added explicit clearing of shadowHost to avoid leaking and crashes,
                  because SVG shadow DOM can be dynamically attached/detached, producing
                  stale nodes in over/out event handling.
              * rendering/RenderSlider.cpp:
              (WebCore::SliderThumbElement::defaultEventHandler): Changed to use shadowHost().
              * rendering/RenderTextControlSingleLine.cpp:
              (WebCore::RenderTextControlSingleLine::~RenderTextControlSingleLine):
                  Added explicit clearing of shadowHost and explicit destruction to
                  avoid out-of-order removal of children.
              * rendering/RenderTreeAsText.cpp:
              (WebCore::nodePosition): Simplified code.
              * rendering/SVGShadowTreeElements.cpp:
              (WebCore::SVGShadowTreeRootElement::SVGShadowTreeRootElement): Added
                  setting of shadowHost.
              (WebCore::SVGShadowTreeRootElement::attachElement): Changed to use shadowHost().
              (WebCore::SVGShadowTreeRootElement::clearShadowHost): Added.
              * rendering/SVGShadowTreeElements.h: Added def, removed members that are
                   no longer needed.
              * rendering/ShadowElement.cpp:
              (WebCore::ShadowBlockElement::initAsPart): Changed to use shadowHost().
              * rendering/ShadowElement.h: Removed members that are no longer needed.
              (WebCore::ShadowElement::ShadowElement): Added setting of shadowHost.
              (WebCore::ShadowElement::detach): Added.
              * rendering/TextControlInnerElements.cpp:
              (WebCore::TextControlInnerElement::TextControlInnerElement): Added setting
                  of shadowHost.
              (WebCore::TextControlInnerElement::attachInnerElement): Changed to use
                  isShadowNode().
              (WebCore::TextControlInnerElement::detach): Added.
              * rendering/TextControlInnerElements.h: Removed members that are no
                  longer needed.
              * svg/SVGElement.cpp:
              (WebCore::SVGElement::ownerSVGElement): Simplified code.
              (WebCore::SVGElement::viewportElement): Ditto.
              * svg/SVGLocatable.cpp:
              (WebCore::SVGLocatable::computeCTM): Ditto.
              * svg/SVGStyledElement.cpp:
              (WebCore::SVGStyledElement::title): Ditto.
              * svg/SVGUseElement.cpp:
              (WebCore::ShadowTreeUpdateBlocker::while): Ditto.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73618 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      e5cbec63
  34. 15 Oct, 2010 1 commit
    • darin@apple.com's avatar
      2010-10-14 Darin Adler <darin@apple.com> · 601d44bd
      darin@apple.com authored
              Reviewed by Alexey Proskuryakov.
      
              Use more specific types for node pointers, especially when calling node insertion and removal functions
              https://bugs.webkit.org/show_bug.cgi?id=47702
      
              Refactoring. No new tests.
      
              While developing this patch I temporarily removed the node insertion and
              removal member functions from the Node class and fixed almost all call sites
              so they call it directly on the ContainerNode class, which will be important
              once we make the functions non-virtual.
      
              * css/CSSStyleSelector.cpp:
              (WebCore::CSSStyleSelector::SelectorChecker::checkSelector):
              * dom/ContainerNode.cpp:
              (WebCore::ContainerNode::insertBefore):
              (WebCore::ContainerNode::replaceChild):
              (WebCore::ContainerNode::appendChild):
              * dom/Document.cpp:
              (WebCore::Document::caretRangeFromPoint):
              * dom/DynamicNodeList.cpp:
              (WebCore::DynamicNodeList::itemWithName):
              * dom/Position.cpp:
              (WebCore::Position::previous):
              (WebCore::Position::next):
              * dom/Text.cpp:
              (WebCore::Text::replaceWholeText):
              * dom/TreeWalker.cpp:
              (WebCore::TreeWalker::firstChild):
              (WebCore::TreeWalker::lastChild):
              (WebCore::TreeWalker::previousNode):
              * dom/XMLDocumentParserLibxml2.cpp:
              (WebCore::XMLDocumentParser::XMLDocumentParser):
              * editing/BreakBlockquoteCommand.cpp:
              (WebCore::BreakBlockquoteCommand::doApply):
              * editing/CompositeEditCommand.h:
              * editing/DeleteButtonController.cpp:
              (WebCore::isDeletableElement):
              * editing/IndentOutdentCommand.cpp:
              (WebCore::IndentOutdentCommand::outdentParagraph):
              * editing/InsertNodeBeforeCommand.cpp:
              (WebCore::InsertNodeBeforeCommand::doApply):
              * editing/JoinTextNodesCommand.cpp:
              (WebCore::JoinTextNodesCommand::doApply):
              (WebCore::JoinTextNodesCommand::doUnapply):
              * editing/MergeIdenticalElementsCommand.cpp:
              (WebCore::MergeIdenticalElementsCommand::doUnapply):
              * editing/RemoveNodeCommand.cpp:
              (WebCore::RemoveNodeCommand::doApply):
              (WebCore::RemoveNodeCommand::doUnapply):
              * editing/RemoveNodeCommand.h:
              * editing/SplitElementCommand.cpp:
              (WebCore::SplitElementCommand::executeApply):
              * editing/SplitTextNodeCommand.cpp:
              (WebCore::SplitTextNodeCommand::doApply):
              (WebCore::SplitTextNodeCommand::doReapply):
              * editing/TextIterator.cpp:
              (WebCore::parentCrossingShadowBoundaries):
              * editing/htmlediting.cpp:
              (WebCore::enclosingList):
              * editing/markup.cpp:
              (WebCore::serializeNodes):
              (WebCore::ancestorToRetainStructureAndAppearance):
              (WebCore::createMarkup):
              * html/HTMLAreaElement.cpp:
              (WebCore::HTMLAreaElement::updateFocusAppearance):
              * html/HTMLEmbedElement.cpp:
              (WebCore::HTMLEmbedElement::rendererIsNeeded):
              * html/HTMLFormElement.cpp:
              (WebCore::HTMLFormElement::rendererIsNeeded):
              * html/HTMLFrameSetElement.cpp:
              (WebCore::HTMLFrameSetElement::attach):
              * html/HTMLImageElement.cpp:
              (WebCore::HTMLImageElement::insertedIntoTree):
              * html/HTMLLegendElement.cpp:
              (WebCore::HTMLLegendElement::associatedControl):
              * html/HTMLOptGroupElement.cpp:
              (WebCore::HTMLOptGroupElement::recalcSelectOptions):
              (WebCore::HTMLOptGroupElement::ownerSelectElement):
              * html/HTMLOptionElement.cpp:
              (WebCore::HTMLOptionElement::ownerSelectElement):
              * html/HTMLTableCellElement.cpp:
              (WebCore::HTMLTableCellElement::additionalAttributeStyleDecls):
              * html/HTMLTableColElement.cpp:
              (WebCore::HTMLTableColElement::additionalAttributeStyleDecls):
              * html/HTMLTableElement.cpp:
              (WebCore::HTMLTableElement::insertRow):
              * html/HTMLTableRowElement.cpp:
              (WebCore::HTMLTableRowElement::rowIndex):
              * html/HTMLTableSectionElement.cpp:
              (WebCore::HTMLTableSectionElement::additionalAttributeStyleDecls):
              * page/DOMSelection.cpp:
              (WebCore::DOMSelection::getRangeAt):
              (WebCore::DOMSelection::containsNode):
              * rendering/RenderSVGGradientStop.cpp:
              (WebCore::RenderSVGGradientStop::gradientElement):
              * svg/SVGElement.cpp:
              (WebCore::SVGElement::ownerSVGElement):
              (WebCore::SVGElement::viewportElement):
              * svg/SVGFELightElement.cpp:
              (WebCore::SVGFELightElement::svgAttributeChanged):
              (WebCore::SVGFELightElement::childrenChanged):
              * svg/SVGFEMergeNodeElement.cpp:
              (WebCore::SVGFEMergeNodeElement::svgAttributeChanged):
              * svg/SVGFontFaceFormatElement.cpp:
              (WebCore::SVGFontFaceFormatElement::childrenChanged):
              * svg/SVGFontFaceUriElement.cpp:
              (WebCore::SVGFontFaceUriElement::childrenChanged):
              * svg/SVGGlyphElement.cpp:
              (WebCore::SVGGlyphElement::invalidateGlyphCache):
              * svg/SVGHKernElement.cpp:
              (WebCore::SVGHKernElement::insertedIntoDocument):
              (WebCore::SVGHKernElement::removedFromDocument):
              * svg/SVGLocatable.cpp:
              (WebCore::SVGLocatable::nearestViewportElement):
              (WebCore::SVGLocatable::farthestViewportElement):
              * svg/SVGUseElement.cpp:
              (WebCore::SVGUseElement::updateContainerOffsets):
              * svg/SVGVKernElement.cpp:
              (WebCore::SVGVKernElement::insertedIntoDocument):
              (WebCore::SVGVKernElement::removedFromDocument):
              * svg/animation/SVGSMILElement.cpp:
              (WebCore::SVGSMILElement::targetElement):
              * wml/WMLDoElement.cpp:
              (WebCore::WMLDoElement::insertedIntoDocument):
              (WebCore::WMLDoElement::removedFromDocument):
              * wml/WMLNoopElement.cpp:
              (WebCore::WMLNoopElement::insertedIntoDocument):
              * wml/WMLOptionElement.cpp:
              (WebCore::ownerSelectElement):
              * wml/WMLPostfieldElement.cpp:
              (WebCore::WMLPostfieldElement::insertedIntoDocument):
              (WebCore::WMLPostfieldElement::removedFromDocument):
              * wml/WMLSetvarElement.cpp:
              (WebCore::WMLSetvarElement::insertedIntoDocument):
              (WebCore::WMLSetvarElement::removedFromDocument):
              * wml/WMLTaskElement.cpp:
              (WebCore::WMLTaskElement::insertedIntoDocument):
              (WebCore::WMLTaskElement::removedFromDocument):
              * wml/WMLTimerElement.cpp:
              (WebCore::WMLTimerElement::insertedIntoDocument):
              (WebCore::WMLTimerElement::removedFromDocument):
              * xml/XPathStep.cpp:
              (WebCore::XPath::Step::nodesInAxis):
              Use ContainerNode* for the result of the parentNode function now that
              it returns a ContainerNode*. In the past it used to return just Node*.
      
              * dom/ContainerNode.h: Added toContainerNode.
      
              * dom/Element.h: Use ContainerNode*. Added toElement.
      
              * dom/Element.cpp:
              (WebCore::Element::deprecatedCreateContextualFragment): Explcitly
              cast to HTMLElement* in the case that handles <html> and <body>
              elements.
              (WebCore::Element::baseURI): Use ContainerNode*.
      
              * dom/Node.cpp:
              (WebCore::Node::markAncestorsWithChildNeedsStyleRecalc): Use ContainerNode*.
              (WebCore::Node::isDescendantOf): Ditto.
              (WebCore::Node::createRendererIfNeeded): Ditto.
              (WebCore::Node::setTextContent): Use already-typecast pointer in a call to
              appendChild.
              (WebCore::Node::ancestorElement): Use ContainerNode*.
      
              * dom/Range.cpp:
              (WebCore::Range::compareNode): Use ContainerNode*.
              (WebCore::Range::intersectsNode): Ditto.
              (WebCore::Range::processContents): Cast to ContainerNode* in a couple cases
              where we previously checked that the node in question has a child. Any node
              that returns a non-zero value for firstChild is a ContainerNode.
              (WebCore::Range::checkNodeBA): Ditto.
              (WebCore::Range::selectNode): Ditto.
              (WebCore::Range::surroundContents): Ditto.
      
              * dom/XMLDocumentParser.cpp:
              (WebCore::XMLDocumentParser::insertErrorMessageBlock): Rewrote code to use
              more specific types, document instead of doc, and paragraph instead of par.
      
              * editing/ApplyStyleCommand.cpp:
              (WebCore::ApplyStyleCommand::removeStyleFromRunBeforeApplyingStyle):
              Use ContainerNode*.
              (WebCore::ApplyStyleCommand::replaceWithSpanOrRemoveIfWithoutAttributes):
              Use replaceElementWithSpanPreservingChildrenAndAttributes; the old function
              took a Node argument and had Node in its name.
      
              * editing/CompositeEditCommand.cpp:
              (WebCore::CompositeEditCommand::removeNodeAndPruneAncestors): Use ContainerNode.
              (WebCore::CompositeEditCommand::replaceElementWithSpanPreservingChildrenAndAttributes):
              Renamed and changed to take HTMLElement. Also use ContainerNode.
              (WebCore::CompositeEditCommand::prune): Ditto.
              (WebCore::CompositeEditCommand::breakOutOfEmptyListItem): Ditto.
              (WebCore::CompositeEditCommand::breakOutOfEmptyMailBlockquotedParagraph): Ditto.
      
              * editing/ReplaceNodeWithSpanCommand.cpp:
              (WebCore::ReplaceNodeWithSpanCommand::ReplaceNodeWithSpanCommand): Take an
              HTMLElement instead of a Node. Call it m_elementToReplace instead of m_node.
              (WebCore::swapInNodePreservingAttributesAndChildren): Take HTMLElement.
              (WebCore::ReplaceNodeWithSpanCommand::doApply): Updated for name changes.
              (WebCore::ReplaceNodeWithSpanCommand::doUnapply): Ditto.
              * editing/ReplaceNodeWithSpanCommand.h: Ditto.
      
              * editing/ReplaceSelectionCommand.cpp:
              (WebCore::ReplacementFragment::ReplacementFragment): Use StyledElement for result
              of insertFragmentForTestRendering since that's what it returns.
              (WebCore::ReplacementFragment::removeNode): Use ContainerNode.
              (WebCore::ReplacementFragment::insertNodeBefore): Ditto.
              (WebCore::ReplacementFragment::insertFragmentForTestRendering): Return StyledElement.
              Use HTMLElement for body.
              (WebCore::ReplacementFragment::restoreTestRenderingNodesToFragment): Take
              StyledElement.
              (WebCore::ReplaceSelectionCommand::handleStyleSpans): Use ContainerNode.
              (WebCore::ReplaceSelectionCommand::copyStyleToChildren): Use HTMLElement for
              the cloned span, since the clone will be a sspan too.
              (WebCore::ReplaceSelectionCommand::insertAsListItems): Use ContainerNode since
              the list item has a child, and that proves it is a ContainerNode.
      
              * editing/SelectionController.cpp:
              (WebCore::SelectionController::selectFrameElementInParentIfFullySelected):
              Use ContainerNode and also removed an unnneded local variable.
      
              * html/HTMLElement.cpp:
              (WebCore::HTMLElement::setOuterText): Use ContainerNode.
              (WebCore::HTMLElement::insertAdjacent): Use ContainerNode and also use && to make
              the logic a little simpler.
              (WebCore::contextElementForInsertion): Use ContainerNode.
              (WebCore::HTMLElement::findFormAncestor): Ditto.
      
              * inspector/InspectorDOMAgent.cpp:
              (WebCore::InspectorDOMAgent::removeNode): Use ContainerNode.
              (WebCore::InspectorDOMAgent::changeTagName): Ditto.
              (WebCore::InspectorDOMAgent::setOuterHTML): Ditto.
              (WebCore::InspectorDOMAgent::innerParentNode): Use isDocumentNode instead of
              nodeType. We should almost never use nodeType inside the engine.
              (WebCore::InspectorDOMAgent::didInsertDOMNode): Use ContainerNode.
              (WebCore::InspectorDOMAgent::didRemoveDOMNode): Ditto.
      
              * wml/WMLOptGroupElement.cpp: Removed unneeded overrides of insertBefore,
              replaceChild, removeChild, appendChild, and removeChildren functions.
              Ths already overrides childrenChanged, that is called by all of the above,
              and it does the same thing these functions did.
              (WebCore::ownerSelectElement): Use ContainerNode.
              * wml/WMLOptGroupElement.h: Ditto.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@69868 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      601d44bd
  35. 02 Sep, 2010 2 commits