1. 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
  2. 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
  3. 21 Apr, 2011 1 commit
    • rniwa@webkit.org's avatar
      2011-04-21 Ryosuke Niwa <rniwa@webkit.org> · f5a84a01
      rniwa@webkit.org authored
              Reviewed by Sam Weinig.
      
              Add Frame* to the argument lists of canCopyCut and canPaste
              https://bugs.webkit.org/show_bug.cgi?id=59153
      
              * src/EditorClientImpl.cpp:
              (WebKit::EditorClientImpl::canCopyCut):
              (WebKit::EditorClientImpl::canPaste):
              * src/EditorClientImpl.h:
      2011-04-21  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Sam Weinig.
      
              Add Frame* to the argument lists of canCopyCut and canPaste
              https://bugs.webkit.org/show_bug.cgi?id=59153
      
              * WebCoreSupport/EditorClientQt.cpp:
              (WebCore::EditorClientQt::canCopyCut):
              (WebCore::EditorClientQt::canPaste):
              * WebCoreSupport/EditorClientQt.h:
      2011-04-21  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Sam Weinig.
      
              Add Frame* to the argument lists of canCopyCut and canPaste
              https://bugs.webkit.org/show_bug.cgi?id=59153
      
              * WebCoreSupport/EditorClientGtk.cpp:
              (WebKit::EditorClient::canCopyCut):
              (WebKit::EditorClient::canPaste):
              * WebCoreSupport/EditorClientGtk.h:
      2011-04-21  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Sam Weinig.
      
              Add Frame* to the argument lists of canCopyCut and canPaste
              https://bugs.webkit.org/show_bug.cgi?id=59153
      
              * WebCoreSupport/WebEditorClient.cpp:
              (WebEditorClient::canCopyCut):
              (WebEditorClient::canPaste):
              * WebCoreSupport/WebEditorClient.h:
      2011-04-21  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Sam Weinig.
      
              Add Frame* to the argument lists of canCopyCut and canPaste
              https://bugs.webkit.org/show_bug.cgi?id=59153
      
              * WebKitSupport/EditorClientWx.cpp:
              (WebCore::EditorClientWx::canCopyCut):
              (WebCore::EditorClientWx::canPaste):
              * WebKitSupport/EditorClientWx.h:
      2011-04-21  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Sam Weinig.
      
              Add Frame* to the argument lists of canCopyCut and canPaste
              https://bugs.webkit.org/show_bug.cgi?id=59153
      
              * WebCoreSupport/WebEditorClient.h:
              * WebCoreSupport/WebEditorClient.mm:
              (WebEditorClient::canCopyCut):
              (WebEditorClient::canPaste):
      2011-04-21  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Sam Weinig.
      
              Add Frame* to the argument lists of canCopyCut and canPaste
              https://bugs.webkit.org/show_bug.cgi?id=59153
      
              * WebCoreSupport/EditorClientHaiku.cpp:
              (WebCore::EditorClientHaiku::canCopyCut):
              (WebCore::EditorClientHaiku::canPaste):
              * WebCoreSupport/EditorClientHaiku.h:
      2011-04-21  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Sam Weinig.
      
              Add Frame* to the argument lists of canCopyCut and canPaste
              https://bugs.webkit.org/show_bug.cgi?id=59153
      
              * WebCoreSupport/EditorClientEfl.cpp:
              (WebCore::EditorClientEfl::canCopyCut):
              (WebCore::EditorClientEfl::canPaste):
              * WebCoreSupport/EditorClientEfl.h:
      2011-04-21  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Sam Weinig.
      
              Add Frame* to the argument lists of canCopyCut and canPaste
              https://bugs.webkit.org/show_bug.cgi?id=59153
      
              canCopyCut and canPaste now takes Frame* for which supportedCopyCut and supportedPaste are called.
              This allows editor client to grant copy/cut and paste permissions per origin.
      
              * editing/EditorCommand.cpp:
              (WebCore::supportedCopyCut):
              (WebCore::supportedPaste):
              * loader/EmptyClients.h:
              (WebCore::EmptyEditorClient::canCopyCut):
              (WebCore::EmptyEditorClient::canPaste):
              * page/EditorClient.h:
      2011-04-21  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Sam Weinig.
      
              Add Frame* to the argument lists of canCopyCut and canPaste
              https://bugs.webkit.org/show_bug.cgi?id=59153
      
              * WebProcess/WebCoreSupport/WebEditorClient.cpp:
              (WebKit::WebEditorClient::canCopyCut):
              (WebKit::WebEditorClient::canPaste):
              * WebProcess/WebCoreSupport/WebEditorClient.h:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@84574 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      f5a84a01
  4. 07 Apr, 2011 1 commit
    • commit-queue@webkit.org's avatar
      2011-04-07 Jia Pu <jpu@apple.com> · 6aedb680
      commit-queue@webkit.org authored
              Reviewed by Darin Adler.
      
              [Mac] Editor::setComposition() should not trigger correction panel timer.
              https://bugs.webkit.org/show_bug.cgi?id=58049
               <rdar://problem/9226305>
      
              On Mac OS X that supports autocorrection panel, typing unconfirmed composition (i.e. unconfirmed Japanese or Chinese input)
              should not start autocorrection timer. We added a member variable, m_shouldPreventSpellChecking, to TypingCommand.
              When this value is true, markMisspellingsAfterTyping() will not be called in TypingCommand::typingAddedToOpenCommand().
              m_shouldPreventSpellChecking is set to true in the TypingCommand objects created by Editor::setComposition().
      
              No new tests. No deterministically reproducible test case. Patch is based on static code analysis. Testing this also requires firing
              autocorrection panel timer, which can not be easily done in automated fashion.
      
              * editing/Editor.cpp:
              (WebCore::Editor::deleteWithDirection):
              (WebCore::Editor::insertTextWithoutSendingTextEvent):
              (WebCore::Editor::confirmComposition):
              (WebCore::Editor::setComposition):
              * editing/EditorCommand.cpp:
              (WebCore::executeDelete):
              * editing/TypingCommand.cpp:
              (WebCore::TypingCommand::TypingCommand):
              (WebCore::TypingCommand::deleteSelection):
              (WebCore::TypingCommand::deleteKeyPressed):
              (WebCore::TypingCommand::forwardDeleteKeyPressed):
              (WebCore::TypingCommand::insertText):
              (WebCore::TypingCommand::insertLineBreak):
              (WebCore::TypingCommand::insertParagraphSeparator):
              (WebCore::TypingCommand::typingAddedToOpenCommand):
              * editing/TypingCommand.h:
              (WebCore::TypingCommand::create):
              (WebCore::TypingCommand::setShouldPreventSpellChecking):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@83245 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      6aedb680
  5. 03 Apr, 2011 1 commit
    • rniwa@webkit.org's avatar
      2011-03-21 Ryosuke Niwa <rniwa@webkit.org> · 48291001
      rniwa@webkit.org authored
              Reviewed by Eric Seidel.
      
              editing commands shouldn't run when there's no body
              https://bugs.webkit.org/show_bug.cgi?id=56771
      
              The bug was caused by WebKit's not checking the existence of root editable element
              in enabled* functions. Although isContentEditable returns true whenever we're in design mode,
              we should not run editing commands in a document without a body element editable because
              doing so results in appending a non-body element to the document node.
      
              Fixed the bug by modifying various enabled* functions to ensure we have a root editable element.
              New behavior tries to match that of Firefox except StyleWithCSS, which Firefox seems to ignore
              when there are no body element. Since StyleWithCSS is a document's state or property, we allow
              execCommand('StyleWithCSS') even in a document without a body element.
      
              WebKit's and Firefox's behaviors also deviate in insert-image-with-selecting-document.html.
              Whereas WebKit respects selection set by script and ignores execCommand, Firefox modifies
              the selection when document.write("x") is ran and successfully inserts image.
      
              Thus, empty-document-delete.html and empty-document-justify-right.html both pass on Firefox
              while empty-document-stylewithcss.html and insert-image-with-selecting-document.html both fail.
      
              Since Internet Explorer does not allow execCommand to run under design mode properly, we could
              not test its behavior.
      
              Tests: editing/editability/empty-document-delete.html
                     editing/editability/empty-document-justify-right.html
                     editing/editability/empty-document-stylewithcss.html
                     editing/execCommand/insert-image-with-selecting-document.html
      
              * editing/Editor.cpp:
              (WebCore::Editor::canEdit): Verify that the root editable element exists
              instead of just checking that selection endpoints are editable because
              selection endpoints could be document node without a body element in design mode
              and we don't want to consider such a document editable.
              (WebCore::Editor::canDelete): Ditto.
              * editing/EditorCommand.cpp:
              (WebCore::enabledInEditableText): Ditto.
              (WebCore::enabledInRichlyEditableText): Ditto.
              (WebCore::enabledDelete): Call enabledCut and enabledInEditableText instead
              of duplicating the code in order to fix the same bug.
      2011-03-21  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Eric Seidel.
      
              editing commands shouldn't run when there's no body
              https://bugs.webkit.org/show_bug.cgi?id=56771
      
              Added tests to ensure WebKit does not crash when attempted to execute editing commands
              in an empty document. Also added a test to ensure WebKit does not crash when InsertImage
              is executed with selection endpoints being document. WebKit should ignore such attempts
              and should not crash.
      
              * editing/editability/empty-document-delete-expected.txt: Added.
              * editing/editability/empty-document-delete.html: Added.
              * editing/editability/empty-document-justify-right-expected.txt: Added.
              * editing/editability/empty-document-justify-right.html: Added.
              * editing/editability/empty-document-stylewithcss-expected.txt: Added.
              * editing/editability/empty-document-stylewithcss.html: Added.
              * editing/execCommand/insert-image-with-selecting-document-expected.txt: Added.
              * editing/execCommand/insert-image-with-selecting-document.html: Added.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@82791 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      48291001
  6. 28 Mar, 2011 1 commit
    • enrica@apple.com's avatar
      REGRESSION: Can't enter pasted with context or Edit menu text in search or... · 68c7c11c
      enrica@apple.com authored
      REGRESSION: Can't enter pasted with context or Edit menu text in search or address field in the browser.
      https://bugs.webkit.org/show_bug.cgi?id=57275
      <rdar://problem/8246691>
      
      Reviewed by Sam Weinig.
      
      We need to classify cut and paste actions as user typing actions even when
      the action is triggered by a context menu selection to
      allow the propagation of the textDidChangeInTextField event.
      
      * editing/EditorCommand.cpp:
      The following methods have been modified to properly set up
      the UserTypingGestureAction when the command source is the
      menu or a key binding sequence.
      (WebCore::executeCut):
      (WebCore::executePaste):
      (WebCore::executePasteAndMatchStyle):
      (WebCore::executePasteAsPlainText):
      (WebCore::executeDelete):
      * page/ContextMenuController.cpp:
      (WebCore::ContextMenuController::contextMenuItemSelected): Changed to
      call execute command instead of referring to the specific method in
      the editor class.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@82176 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      68c7c11c
  7. 25 Mar, 2011 1 commit
    • commit-queue@webkit.org's avatar
      2011-03-25 Chang Shu <cshu@webkit.org> · 595681f4
      commit-queue@webkit.org authored
              Reviewed by Ryosuke Niwa.
      
              rename Node::isContentEditable and all call sites to rendererIsEditable
              https://bugs.webkit.org/show_bug.cgi?id=54290
      
              This is part of the effort to separate JS API HTMLElement isContentEditable from
              internal Node::rendererIsEditable.
      
              Code refactoring. No new tests.
      
              * accessibility/AccessibilityRenderObject.cpp:
              (WebCore::AccessibilityRenderObject::isReadOnly):
              (WebCore::AccessibilityRenderObject::accessibilityIsIgnored):
              * dom/Document.cpp:
              (WebCore::acceptsEditingFocus):
              * dom/Node.cpp:
              (WebCore::Node::rendererIsEditable):
              (WebCore::Node::shouldUseInputMethod):
              (WebCore::Node::canStartSelection):
              (WebCore::Node::rootEditableElement):
              * dom/Node.h:
              (WebCore::Node::isContentEditable):
              (WebCore::Node::rendererIsEditable):
              (WebCore::Node::rendererIsRichlyEditable):
              * dom/Position.cpp:
              (WebCore::nextRenderedEditable):
              (WebCore::previousRenderedEditable):
              (WebCore::Position::atEditingBoundary):
              (WebCore::Position::parentEditingBoundary):
              (WebCore::Position::upstream):
              (WebCore::Position::downstream):
              (WebCore::Position::isCandidate):
              * dom/PositionIterator.cpp:
              (WebCore::PositionIterator::isCandidate):
              * editing/AppendNodeCommand.cpp:
              (WebCore::AppendNodeCommand::AppendNodeCommand):
              (WebCore::AppendNodeCommand::doApply):
              (WebCore::AppendNodeCommand::doUnapply):
              * editing/ApplyStyleCommand.cpp:
              (WebCore::containsNonEditableRegion):
              (WebCore::ApplyStyleCommand::applyInlineStyleToNodeRange):
              (WebCore::ApplyStyleCommand::removeInlineStyleFromElement):
              (WebCore::ApplyStyleCommand::surroundNodeRangeWithElement):
              * editing/CompositeEditCommand.cpp:
              (WebCore::CompositeEditCommand::breakOutOfEmptyListItem):
              * editing/DeleteButtonController.cpp:
              (WebCore::isDeletableElement):
              (WebCore::enclosingDeletableElement):
              * editing/DeleteFromTextNodeCommand.cpp:
              (WebCore::DeleteFromTextNodeCommand::doApply):
              (WebCore::DeleteFromTextNodeCommand::doUnapply):
              * editing/DeleteSelectionCommand.cpp:
              (WebCore::DeleteSelectionCommand::removeNode):
              * editing/Editor.cpp:
              (WebCore::Editor::canDeleteRange):
              (WebCore::Editor::markMisspellingsOrBadGrammar):
              (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges):
              * editing/EditorCommand.cpp:
              (WebCore::verticalScrollDistance):
              * editing/FormatBlockCommand.cpp:
              (WebCore::enclosingBlockToSplitTreeTo):
              * editing/IndentOutdentCommand.cpp:
              (WebCore::IndentOutdentCommand::outdentParagraph):
              * editing/InsertIntoTextNodeCommand.cpp:
              (WebCore::InsertIntoTextNodeCommand::doApply):
              (WebCore::InsertIntoTextNodeCommand::doUnapply):
              * editing/InsertNodeBeforeCommand.cpp:
              (WebCore::InsertNodeBeforeCommand::InsertNodeBeforeCommand):
              (WebCore::InsertNodeBeforeCommand::doApply):
              (WebCore::InsertNodeBeforeCommand::doUnapply):
              * editing/JoinTextNodesCommand.cpp:
              (WebCore::JoinTextNodesCommand::doApply):
              (WebCore::JoinTextNodesCommand::doUnapply):
              * editing/MergeIdenticalElementsCommand.cpp:
              (WebCore::MergeIdenticalElementsCommand::doApply):
              (WebCore::MergeIdenticalElementsCommand::doUnapply):
              * editing/RemoveNodeCommand.cpp:
              (WebCore::RemoveNodeCommand::doApply):
              (WebCore::RemoveNodeCommand::doUnapply):
              * editing/ReplaceSelectionCommand.cpp:
              (WebCore::ReplacementFragment::ReplacementFragment):
              * editing/SelectionController.cpp:
              (WebCore::SelectionController::selectFrameElementInParentIfFullySelected):
              (WebCore::SelectionController::setSelectionFromNone):
              * editing/SplitElementCommand.cpp:
              (WebCore::SplitElementCommand::executeApply):
              (WebCore::SplitElementCommand::doUnapply):
              * editing/SplitTextNodeCommand.cpp:
              (WebCore::SplitTextNodeCommand::doApply):
              (WebCore::SplitTextNodeCommand::doUnapply):
              (WebCore::SplitTextNodeCommand::doReapply):
              * editing/SplitTextNodeContainingElementCommand.cpp:
              (WebCore::SplitTextNodeContainingElementCommand::doApply):
              * editing/VisiblePosition.cpp:
              (WebCore::VisiblePosition::canonicalPosition):
              * editing/WrapContentsInDummySpanCommand.cpp:
              (WebCore::WrapContentsInDummySpanCommand::doUnapply):
              (WebCore::WrapContentsInDummySpanCommand::doReapply):
              * editing/htmlediting.cpp:
              (WebCore::highestEditableRoot):
              (WebCore::lowestEditableAncestor):
              (WebCore::isEditablePosition):
              (WebCore::isRichlyEditablePosition):
              (WebCore::firstEditablePositionAfterPositionInRoot):
              (WebCore::extendRangeToWrappingNodes):
              (WebCore::enclosingNodeWithTag):
              (WebCore::enclosingNodeOfType):
              (WebCore::highestEnclosingNodeOfType):
              (WebCore::canMergeLists):
              * editing/visible_units.cpp:
              (WebCore::previousLeafWithSameEditability):
              (WebCore::previousLinePosition):
              (WebCore::nextLeafWithSameEditability):
              (WebCore::nextLinePosition):
              (WebCore::startOfParagraph):
              (WebCore::endOfParagraph):
              * html/HTMLAnchorElement.cpp:
              (WebCore::HTMLAnchorElement::supportsFocus):
              (WebCore::HTMLAnchorElement::defaultEventHandler):
              (WebCore::HTMLAnchorElement::setActive):
              (WebCore::HTMLAnchorElement::canStartSelection):
              (WebCore::HTMLAnchorElement::treatLinkAsLiveForEventType):
              * html/HTMLBodyElement.cpp:
              (WebCore::HTMLBodyElement::supportsFocus):
              * html/HTMLElement.cpp:
              (WebCore::HTMLElement::supportsFocus):
              (WebCore::HTMLElement::isContentEditable):
              (WebCore::HTMLElement::contentEditable):
              * html/HTMLElement.h:
              * page/DragController.cpp:
              (WebCore::DragController::operationForLoad):
              (WebCore::DragController::canProcessDrag):
              * page/EventHandler.cpp:
              (WebCore::EventHandler::handleMouseReleaseEvent):
              (WebCore::EventHandler::selectCursor):
              * page/FocusController.cpp:
              (WebCore::relinquishesEditingFocus):
              * rendering/HitTestResult.cpp:
              (WebCore::HitTestResult::isContentEditable):
              * rendering/RenderBlock.cpp:
              (WebCore::positionForPointRespectingEditingBoundaries):
              (WebCore::RenderBlock::hasLineIfEmpty):
              * rendering/RenderBlockLineLayout.cpp:
              (WebCore::RenderBlock::addOverflowFromInlineChildren):
              * rendering/RenderBox.cpp:
              (WebCore::RenderBox::canBeProgramaticallyScrolled):
              * rendering/RenderObject.cpp:
              (WebCore::RenderObject::createVisiblePosition):
              * rendering/RootInlineBox.cpp:
              (WebCore::isEditableLeaf):
              * svg/SVGAElement.cpp:
              (WebCore::SVGAElement::supportsFocus):
      2011-03-25  Chang Shu  <cshu@webkit.org>
      
              Reviewed by Ryosuke Niwa.
      
              rename Node::isContentEditable and all call sites to rendererIsEditable
              https://bugs.webkit.org/show_bug.cgi?id=54290
      
              This is part of the effort to separate JS API HTMLElement isContentEditable from
              internal Node::rendererIsEditable.
      
              * src/WebNode.cpp:
              (WebKit::WebNode::isContentEditable):
              * src/WebViewImpl.cpp:
              (WebKit::WebViewImpl::setFocus):
              (WebKit::WebViewImpl::setComposition):
              (WebKit::WebViewImpl::confirmComposition):
      2011-03-25  Chang Shu  <cshu@webkit.org>
      
              Reviewed by Ryosuke Niwa.
      
              rename Node::isContentEditable and all call sites to rendererIsEditable
              https://bugs.webkit.org/show_bug.cgi?id=54290
      
              This is part of the effort to separate JS API HTMLElement isContentEditable from
              internal Node::rendererIsEditable.
      
              * WebCoreSupport/EditorClientHaiku.cpp:
              (WebCore::EditorClientHaiku::handleKeyboardEvent):
      2011-03-25  Chang Shu  <cshu@webkit.org>
      
              Reviewed by Ryosuke Niwa.
      
              rename Node::isContentEditable and all call sites to rendererIsEditable
              https://bugs.webkit.org/show_bug.cgi?id=54290
      
              This is part of the effort to separate JS API HTMLElement isContentEditable from
              internal Node::rendererIsEditable.
      
              * WebCoreSupport/EditorClientQt.cpp:
              (WebCore::EditorClientQt::handleKeyboardEvent):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@81965 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      595681f4
  8. 23 Mar, 2011 1 commit
    • commit-queue@webkit.org's avatar
      2011-03-23 Jia Pu <jpu@apple.com> · b5484ecd
      commit-queue@webkit.org authored
              Reviewed by Darin Adler.
      
              Hook up new AppKit autocorrection UI with WK2.
              https://bugs.webkit.org/show_bug.cgi?id=56055
              <rdar://problem/8947463>
      
              Please see WebCore/ChangeLog for detail.
      
              * platform/mac-wk2/Skipped: Enable autocorrection tests for WK2.
      2011-03-23  Jia Pu  <jpu@apple.com>
      
              Reviewed by Darin Adler.
      
              Hook up new AppKit autocorrection UI with WK2.
              https://bugs.webkit.org/show_bug.cgi?id=56055
              <rdar://problem/8947463>
      
              This patch is to enable WK2 to utilize autocorrection UI on Mac OS X. It contains following
              major changes:
      
              1. All but one autocorrection related message is synchronous. Since dismissing autocorrection
              panel can potentially cause editing to occur, a synchronous dismissCorrectionPanelSoon() function
              is introduced to ensure all editing commands occur in correct order.
      
              2. Additional condition variable is needed to implement dismissCorrectionPanelSoon().
              To improve maintainability, CorrectionPanel class is introduced to manage the
              internal state related to correction panel. This change is applied to both WK1 and WK2.
      
              3. EditorClient::isShowingCorrectionPanel() has been removed. The original purpose is to allow
              editor to know when to handle ESC key event. Now this is handled internally in AppKit, so
              EditorClient::isShowingCorrectionPanel() isn't necessary anymore.
      
              4. The Editor* argument in EditorClient::showCorrectionPanel() has been removed, since we can
              access object via WebView or WKView.
      
              * editing/Editor.cpp:
              (WebCore::Editor::markMisspellingsAfterTypingToWord):
              (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges):
              (WebCore::Editor::correctionPanelTimerFired):
              (WebCore::Editor::dismissCorrectionPanel):
              (WebCore::Editor::dismissCorrectionPanelSoon):
              (WebCore::Editor::applyAutocorrectionBeforeTypingIfAppropriate):
              * editing/Editor.h:
              * editing/EditorCommand.cpp:
              (WebCore::createCommandMap):
              * loader/EmptyClients.h:
              (WebCore::EmptyEditorClient::showCorrectionPanel):
              (WebCore::EmptyEditorClient::dismissCorrectionPanelSoon):
              * manual-tests/autocorrection/close-window-when-correction-is-shown.html: Added.
              * page/EditorClient.h:
      2011-03-23  Jia Pu  <jpu@apple.com>
      
              Reviewed by Darin Adler.
      
              Hook up new AppKit autocorrection UI with WK2.
              https://bugs.webkit.org/show_bug.cgi?id=56055
              <rdar://problem/8947463>
      
              Please see WebCore/ChangeLog for detail.
      
              * WebKit.xcodeproj/project.pbxproj:
      2011-03-23  Jia Pu  <jpu@apple.com>
      
              Reviewed by Darin Adler.
      
              Hook up new AppKit autocorrection UI with WK2.
              https://bugs.webkit.org/show_bug.cgi?id=56055
              <rdar://problem/8947463>
      
              Please see WebCore/ChangeLog for detail.
      
              * WebCoreSupport/CorrectionPanel.h: Added.
              (CorrectionPanel::isShowing):
              * WebCoreSupport/CorrectionPanel.mm: Added.
              (correctionBubbleType):
              (CorrectionPanel::CorrectionPanel):
              (CorrectionPanel::~CorrectionPanel):
              (CorrectionPanel::show):
              (CorrectionPanel::dismiss):
              (CorrectionPanel::dismissSoon):
              (CorrectionPanel::dismissInternal):
              (CorrectionPanel::recordAutocorrectionResponse):
              * WebCoreSupport/WebEditorClient.h:
              * WebCoreSupport/WebEditorClient.mm:
              (WebEditorClient::WebEditorClient):
              (WebEditorClient::showCorrectionPanel):
              (WebEditorClient::dismissCorrectionPanel):
              (WebEditorClient::dismissCorrectionPanelSoon):
              (WebEditorClient::recordAutocorrectionResponse):
              * WebView/WebView.mm:
              (-[WebView handleCorrectionPanelResult:]):
              * WebView/WebViewPrivate.h:
      2011-03-23  Jia Pu  <jpu@apple.com>
      
              Reviewed by Darin Adler.
      
              Hook up new AppKit autocorrection UI with WK2.
              https://bugs.webkit.org/show_bug.cgi?id=56055
              <rdar://problem/8947463>
      
              Please see WebCore/ChangeLog for detail.
      
              The calls to AppKit are implemented in PageClientImpl. Other changes are necessary for the
              plumbing work.
      
              * UIProcess/API/mac/PageClientImpl.h:
              * UIProcess/API/mac/PageClientImpl.mm:
              (WebKit::PageClientImpl::showCorrectionPanel):
              (WebKit::PageClientImpl::dismissCorrectionPanel):
              (WebKit::PageClientImpl::dismissCorrectionPanelSoon):
              (WebKit::PageClientImpl::recordAutocorrectionResponse):
              * UIProcess/API/mac/WKView.mm:
              (-[WKView spellCheckerDocumentTag]):
              (-[WKView handleCorrectionPanelResult:]):
              * UIProcess/API/mac/WKViewPrivate.h:
              * UIProcess/PageClient.h:
              * UIProcess/WebPageProxy.cpp:
              (WebKit::WebPageProxy::didCommitLoadForFrame):
              (WebKit::WebPageProxy::showCorrectionPanel):
              (WebKit::WebPageProxy::dismissCorrectionPanel):
              (WebKit::WebPageProxy::dismissCorrectionPanelSoon):
              (WebKit::WebPageProxy::recordAutocorrectionResponse):
              (WebKit::WebPageProxy::handleCorrectionPanelResult):
              * UIProcess/WebPageProxy.h:
              * UIProcess/WebPageProxy.messages.in:
              * UIProcess/mac/CorrectionPanel.h: Added.
              (WebKit::CorrectionPanel::isShowing):
              * UIProcess/mac/CorrectionPanel.mm: Added.
              (correctionBubbleType):
              (WebKit::CorrectionPanel::CorrectionPanel):
              (WebKit::CorrectionPanel::~CorrectionPanel):
              (WebKit::CorrectionPanel::show):
              (WebKit::CorrectionPanel::dismiss):
              (WebKit::CorrectionPanel::dismissSoon):
              (WebKit::CorrectionPanel::dismissInternal):
              (WebKit::CorrectionPanel::recordAutocorrectionResponse):
              * WebKit2.xcodeproj/project.pbxproj:
              * WebProcess/WebCoreSupport/WebEditorClient.h:
              * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
              (WebKit::WebEditorClient::showCorrectionPanel):
              (WebKit::WebEditorClient::dismissCorrectionPanel):
              (WebKit::WebEditorClient::dismissCorrectionPanelSoon):
              (WebKit::WebEditorClient::recordAutocorrectionResponse):
              * WebProcess/WebPage/WebPage.cpp:
              (WebKit::WebPage::handleCorrectionPanelResult):
              * WebProcess/WebPage/WebPage.h:
              * WebProcess/WebPage/WebPage.messages.in:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@81847 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      b5484ecd
  9. 07 Mar, 2011 1 commit
    • rniwa@webkit.org's avatar
      2011-03-07 Ryosuke Niwa <rniwa@webkit.org> · f9c8d307
      rniwa@webkit.org authored
              Reviewed by Darin Adler.
      
              selectionHasStyle and selectionStartHasStyle should use EditingStyle
              https://bugs.webkit.org/show_bug.cgi?id=55902
      
              selectionHasStyle now takes a property id and a value instead of a CSSMutableStyleDeclaration.
      
              * src/ContextMenuClientImpl.cpp:
              (WebKit::ContextMenuClientImpl::getCustomMenuFromDefaultItems): Calls selectionHasStyle.
      2011-03-07  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Darin Adler.
      
              selectionHasStyle and selectionStartHasStyle should use EditingStyle
              https://bugs.webkit.org/show_bug.cgi?id=55902
      
              selectionHasStyle now takes a property id and a value instead of a CSSMutableStyleDeclaration.
      
              * WebView/WebHTMLView.mm: Removed unused selectionHasStyle.
              (-[WebHTMLView validateUserInterfaceItemWithoutDelegate:]): Calls Editor::selectionHasStyle.
      2011-03-07  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Darin Adler.
      
              selectionHasStyle and selectionStartHasStyle should use EditingStyle
              https://bugs.webkit.org/show_bug.cgi?id=55902
      
              Deployed EditingStyle in selectionHasStyle and selectionStartHasStyle.
              This allowed us to move triStateOfStyle from Editor.cpp to EditingStyle.cpp.
      
              Also changed the argument lists of selectionHasStyle and selectionStartHasStyle
              to take a property id and a value instead of a CSSMutableStyleDeclaration to cleanup
              call sites of these two functions.
      
              * WebCore.exp.in: Updated the signature of selectionHasStyle. No longer exports
              selectionStartHasStyle because it's not called anywhere outside of WebCore.
              * WebCore.order: Ditto.
              * editing/EditingStyle.cpp:
              (WebCore::EditingStyle::EditingStyle): Added a new constructor that takes a property id
              and a property value.
              (WebCore::EditingStyle::triStateOfStyle): Moved from Editor.cpp.
              * editing/EditingStyle.h:
              (WebCore::EditingStyle::create): Added.
              * editing/Editor.cpp:
              (WebCore::Editor::selectionStartHasStyle): Takes a property id and a value instead of
              a CSSStyleDeclaration.
              (WebCore::Editor::selectionHasStyle): Ditto.
              * editing/Editor.h: Updated the signatures of selectionStartHasStyle and selectionHasStyle.
              * editing/EditorCommand.cpp:
              (WebCore::executeToggleStyle): Calls selectionStartHasStyle and selectionHasStyle.
              (WebCore::stateStyle): Ditto.
              * page/ContextMenuController.cpp:
              (WebCore::ContextMenuController::checkOrEnableIfNeeded): Ditto.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@80528 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      f9c8d307
  10. 01 Mar, 2011 1 commit
    • commit-queue@webkit.org's avatar
      2011-03-01 Jia Pu <jpu@apple.com> · 5396fd99
      commit-queue@webkit.org authored
              Reviewed by Darin Adler.
      
              Remove CorrectionIndicator markers sooner.
              https://bugs.webkit.org/show_bug.cgi?id=54893
              <rdar://problem/8997524>
      
              See WebCore/ChangeLog for detail.
      
              * platform/mac-leopard/Skipped:
              * platform/mac-snowleopard/Skipped:
              * platform/mac-tiger/Skipped:
              * platform/mac-wk2/Skipped:
              * platform/mac/editing/spelling/autocorrection-simple-expected.checksum:
              * platform/mac/editing/spelling/autocorrection-simple-expected.png:
              * platform/mac/editing/spelling/autocorrection-simple-expected.txt:
              * platform/mac/editing/spelling/autocorrection-simple.html:
              * platform/mac/editing/spelling/delete-into-autocorrected-word-expected.checksum:
              * platform/mac/editing/spelling/delete-into-autocorrected-word-expected.png:
              * platform/mac/editing/spelling/removing-underline-after-accepting-autocorrection-using-punctuation-expected.checksum: Added.
              * platform/mac/editing/spelling/removing-underline-after-accepting-autocorrection-using-punctuation-expected.png: Added.
              * platform/mac/editing/spelling/removing-underline-after-accepting-autocorrection-using-punctuation-expected.txt: Copied from LayoutTests/platform/mac/editing/spelling/autocorrection-simple-expected.txt.
              * platform/mac/editing/spelling/removing-underline-after-accepting-autocorrection-using-punctuation.html: Copied from LayoutTests/platform/mac/editing/spelling/autocorrection-simple.html.
      2011-03-01  Jia Pu  <jpu@apple.com>
      
              Reviewed by Darin Adler.
      
              Remove CorrectionIndicator markers sooner.
              https://bugs.webkit.org/show_bug.cgi?id=54893
              <rdar://problem/8997524>
      
              Test: platform/mac/editing/spelling/removing-underline-after-accepting-autocorrection-using-punctuation.html
      
              This patch changes the autocorrection behavior on Mac OS X. We want to remove CorrectionIndicator
              marker after any editing command if the command:
              1. is not a SpellingCorrectionCommand itself.
              2. is not the command that triggers the autocorrection.
              This is achieved by adding shouldRetainAutocorrectionIndicator() function to EditCommand. This function returns
              false for all commands derived from EditCommand, except SpellingCorrectionCommand and TypingCommand. This function
              always returns true for SpellingCorrectionCommand. For TypingCommand, the return value is determined by member
              variable m_shouldRetainAutocorrectionIndicator, which can be modified by passing option into the TypingCommand's
              public functions.
      
              To avoid constantly searching marker list, we use variable DocumentMarkerController::m_absentMarkerTypeCache
              to cache whether there is any marker of a particular type.
      
              This patch also fixes two minor existing bugs.
      
              1. We used to show reversion panel for word with CorrectionIndicator marker. This is incorrect because
              CorrectionIndicator marker can be removed from corrected words. Since all autocorrected words have Replacement
              marker unless the whole word is deleted, the correct behavior is to show reversion panel for word with Replacement
              marker, since all autocorrected words have such marker. However, since we don't want to show the reversion panel
              if an autocorrected word has been edited, we also check to see if the Replacement marker's description is null.
      
              This works as following:
              When we apply an autocorrection, we add Replacement marker to corrected word, and store original word
              as the marker's description. If the user edited the corrected word afterward, we set description to null.
              So when we decide whether to show a reversion panel, we not only check for the existence of Replacement
              marker, but also check if description is null.
      
              2. Fixed an assertion violation in Editor::removeSpellAndCorrectionMarkersFromWordsToBeEdited(), which would
              occur when deleting the first character in an editable area.
      
              * dom/DocumentMarker.h: Added m_possiblyExistingMarkerTypes to allow quickly checking whether a marker type is
                 completely in from the document.
      
              * dom/DocumentMarkerController.cpp: Most of the functions listed here are optimized for early return by checking
                 the return value of possiblyHasMarkers() at beginning.
              (WebCore::DocumentMarkerController::possiblyHasMarkers):
              (WebCore::DocumentMarkerController::DocumentMarkerController):
              (WebCore::DocumentMarkerController::detach):
              (WebCore::DocumentMarkerController::removeMarkers):
              (WebCore::DocumentMarkerController::addMarker):
              (WebCore::DocumentMarkerController::copyMarkers):
              (WebCore::DocumentMarkerController::markerContainingPoint):
              (WebCore::DocumentMarkerController::renderedRectsForMarkers):
              (WebCore::DocumentMarkerController::removeMarkersFromMarkerMapVectorPair):
              (WebCore::DocumentMarkerController::repaintMarkers):
              (WebCore::DocumentMarkerController::shiftMarkers):
              (WebCore::DocumentMarkerController::setMarkersActive):
              (WebCore::DocumentMarkerController::hasMarkers):
              (WebCore::DocumentMarkerController::clearDescriptionOnMarkersIntersectingRange):
              * dom/DocumentMarkerController.h:
              * editing/EditCommand.cpp:
              (WebCore::EditCommand::apply):
              (WebCore::EditCommand::shouldRetainAutocorrectionIndicator):
              (WebCore::EditCommand::setShouldRetainAutocorrectionIndicator):
              * editing/EditCommand.h:
              * editing/Editor.cpp:
              (WebCore::Editor::respondToChangedSelection):
              (WebCore::Editor::appliedEditing):
              (WebCore::Editor::insertTextWithoutSendingTextEvent):
              (WebCore::Editor::insertLineBreak):
              (WebCore::Editor::insertParagraphSeparator):
              (WebCore::Editor::markMisspellingsAfterTypingToWord):
              (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges):
              (WebCore::Editor::removeSpellAndCorrectionMarkersFromWordsToBeEdited):
              (WebCore::Editor::applyAutocorrectionBeforeTypingIfAppropriate):
              * editing/Editor.h:
              * editing/EditorCommand.cpp:
              (WebCore::executeInsertLineBreak):
              (WebCore::executeInsertParagraph):
              (WebCore::executeInsertText):
              * editing/SpellingCorrectionCommand.cpp:
              (WebCore::SpellingCorrectionCommand::shouldRetainAutocorrectionIndicator):
              * editing/SpellingCorrectionCommand.h:
              * editing/TypingCommand.cpp:
              (WebCore::TypingCommand::TypingCommand):
              (WebCore::TypingCommand::deleteSelection):
              (WebCore::TypingCommand::deleteKeyPressed):
              (WebCore::TypingCommand::forwardDeleteKeyPressed):
              (WebCore::TypingCommand::updateSelectionIfDifferentFromCurrentSelection):
              (WebCore::TypingCommand::insertText):
              (WebCore::TypingCommand::insertLineBreak):
              (WebCore::TypingCommand::insertParagraphSeparatorInQuotedContent):
              (WebCore::TypingCommand::insertParagraphSeparator):
              * editing/TypingCommand.h:
              (WebCore::TypingCommand::create):
              (WebCore::TypingCommand::shouldRetainAutocorrectionIndicator):
              (WebCore::TypingCommand::setShouldRetainAutocorrectionIndicator):
              * manual-tests/autocorrection/type-whitespace-to-dismiss-reversion.html:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@80023 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      5396fd99
  11. 22 Feb, 2011 1 commit
    • rniwa@webkit.org's avatar
      2011-02-22 Ryosuke Niwa <rniwa@webkit.org> · 19980977
      rniwa@webkit.org authored
              Reviewed by Darin Adler.
      
              Make Editor::selectionComputedStyle return EditingStyle
              https://bugs.webkit.org/show_bug.cgi?id=54933
      
              Renamed selectionComputedStyle to selectionStartStyle and changed the return type to EditingStyle.
              It also no longer takes a boolean shouldUseFixedFontDefaultSize.
      
              Also added EditingStyle::mergeTypingStyle which replaced old editingStyleIncludingTypingStyle. This function
              doesn't extract inheritable properties prior to merge because this turned out be a bug, which was revealed
              by an existing layout test only after the code was shared with selectionStartStyle.
      
              No tests are added since this is a refactoring.
      
              * editing/CompositeEditCommand.cpp:
              (WebCore::CompositeEditCommand::moveParagraphs): Calls EditingStyle::create and EditingStyle::mergeTypingStyle.
              (WebCore::CompositeEditCommand::breakOutOfEmptyListItem): Ditto.
              * editing/EditingStyle.cpp: Removed editingStyleIncludingTypingStyle.
              (WebCore::EditingStyle::mergeTypingStyle): Added.
              * editing/EditingStyle.h:
              (WebCore::EditingStyle::shouldUseFixedDefaultFontSize): Added.
              * editing/Editor.cpp:
              (WebCore::Editor::selectionStartHasStyle): Calls selectionStartStyle.
              (WebCore::Editor::selectionHasStyle): Ditto.
              (WebCore::Editor::selectionStartCSSPropertyValue): Ditto.
              (WebCore::Editor::selectionStartStyle): Renamed from selectionComputedStyle; returns EditingStyle.
              * editing/Editor.h:
              * editing/EditorCommand.cpp:
              (WebCore::executeToggleStyleInList): Calls selectionStartStyle.
              * editing/InsertLineBreakCommand.cpp:
              * editing/InsertParagraphSeparatorCommand.cpp:
              (WebCore::InsertParagraphSeparatorCommand::calculateStyleBeforeInsertion): Calls EditingStyle::create and
              EditingStyle::mergeTypingStyle.
              * editing/ReplaceSelectionCommand.cpp:
              (WebCore::ReplaceSelectionCommand::doApply): Ditto.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@79398 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      19980977
  12. 15 Feb, 2011 2 commits
    • darin@apple.com's avatar
      2011-02-15 Jia Pu <jpu@apple.com> · 060d7a1a
      darin@apple.com authored
              Reviewed by Darin Adler.
      
              Autocorrection should respect undo.
              https://bugs.webkit.org/show_bug.cgi?id=52221
              <rdar://problem/8663399>
      
              Please see WebCore/ChangeLog for detailed description.
      
              * WebCoreSupport/WebEditorClient.cpp:
              (WebFrameImpl::replaceSelection): Adopted new signature of ReplaceSelectionCommand::create().
      2011-02-15  Jia Pu  <jpu@apple.com>
      
              Reviewed by Darin Adler.
      
              Autocorrection should respect undo.
              https://bugs.webkit.org/show_bug.cgi?id=52221
              <rdar://problem/8663399>
      
              Please see WebCore/ChangeLog for detailed description.
      
              * WebCoreSupport/WebEditorClient.h: Updated for the new function declared in EditorClient.
      
              * WebCoreSupport/WebEditorClient.mm:
              (WebEditorClient::recordAutocorrectionResponse): Ditto.
      
              * WebView/WebFrame.mm:
              (-[WebFrame _replaceSelectionWithFragment:selectReplacement:smartReplace:matchStyle:]):
                   Adopted new signature of ReplaceSelectionCommand::create().
      2011-02-15  Jia Pu  <jpu@apple.com>
      
              Reviewed by Darin Adler.
      
              Autocorrection should respect undo.
              https://bugs.webkit.org/show_bug.cgi?id=52221
              <rdar://problem/8663399>
      
              Manual test: manual-tests/autocorrection/undo-autocorrection.html
      
              When user undoes an autocorrection, we need to do four things:
              1. Revert the change in text that has been made by correction.
              2. Revert the selection to pre-correction state so that user can immediately continue typing.
              3. Add appropriate markers to reverted text so that it won't be corrected again and/or shown
                 as misspelled.
              4. If applicable, notify spell checking service to record this reversion.
      
              To achieve these, this patch introduces following changes:
              1. Created SpellingCorrectionCommand so that correction can be undone in similar way as any
                 other editing command. SpellingCorrectionCommand is a composition of SetSelectionCommand,
                 SpellingCorrectionRecordUndoCommand and ReplaceSelectionCommand.
              2. Created SetSelectionCommand so that undo command can restore selection state.
              3. Added member function recordAutocorrectionResponse() to editor client.
      
              To improve readability, this patch also consolidates various boolean arguments in SelectionController::setSelection()
              and ReplaceSelectionCommand::ReplaceSelectionCommand(). These boolean arguments have been
              replaced by enum variable.
      
              * WebCore.exp.in: Updated for changes in Editor and ReplaceSelectionCommand.
      
              * WebCore.xcodeproj/project.pbxproj: Updated for new source files.
      
              * editing/CompositeEditCommand.cpp:
              (WebCore::CompositeEditCommand::moveParagraphs): Adopted new signature of ReplaceSelectionCommand::create().
      
              * editing/Editor.cpp:
              (WebCore::Editor::replaceSelectionWithFragment): Ditto.
              (WebCore::Editor::unappliedEditing): Cleaned up trailing whitespace.
              (WebCore::Editor::reappliedEditing): Ditto.
              (WebCore::Editor::selectComposition): Adopted new signature of SelectionController::setSelection().
              (WebCore::Editor::confirmComposition): Ditto.
              (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges): Rearranged code to reduce the
                  level of deeply nested if statement. Adopted SpellingCorrectionCommand.
              (WebCore::Editor::applyCorrectionPanelInfo): Adopted SpellingCorrectionCommand.
              (WebCore::Editor::unappliedSpellCorrection): Function for adding markers to reverted text and
                  for notifiying editor client about undone correction.
              (WebCore::Editor::changeSelectionAfterCommand): Adopted new signature of SelectionController::setSelection().
              (WebCore::Editor::respondToChangedSelection): Use SelectionController::SetSelectionOptions
                  instead of boolean variables.
      
              * editing/Editor.h: Added Editor::unappliedSpellCorrection().
      
              * editing/EditorCommand.cpp:
              (WebCore::executeInsertFragment): Adopted new signature of ReplaceSelectionCommand::create().
      
              * editing/MoveSelectionCommand.cpp:
              (WebCore::MoveSelectionCommand::doApply): Ditto.
      
              * editing/ReplaceSelectionCommand.cpp:
              (WebCore::ReplaceSelectionCommand::ReplaceSelectionCommand): Replaced all boolean arguments
                  with an enum value.
      
              * editing/ReplaceSelectionCommand.h:
              (WebCore::ReplaceSelectionCommand::create): Ditto.
      
              * editing/SelectionController.cpp: Adopted new signature of SelectionController::setSelection().
              (WebCore::SelectionController::moveTo):
              (WebCore::SelectionController::setSelection):
              (WebCore::SelectionController::respondToNodeModification):
              (WebCore::SelectionController::setBase):
              (WebCore::SelectionController::setExtent):
              (WebCore::SelectionController::setSelectedRange):
      
              * editing/SelectionController.h:
              (WebCore::SelectionController::setSelection): Replaced all boolean arguments with an enum value.
      
              * editing/SetSelectionCommand.cpp: Added.
              (WebCore::SetSelectionCommand::SetSelectionCommand):
              (WebCore::SetSelectionCommand::doApply):
              (WebCore::SetSelectionCommand::doUnapply):
      
              * editing/SetSelectionCommand.h: Added.
              (WebCore::SetSelectionCommand::create):
      
              * editing/mac/SpellingCorrectionCommand.cpp: Added.
              (WebCore::SpellingCorrectionRecordUndoCommand::create):
              (WebCore::SpellingCorrectionRecordUndoCommand::SpellingCorrectionRecordUndoCommand):
              (WebCore::SpellingCorrectionRecordUndoCommand::doApply):
              (WebCore::SpellingCorrectionRecordUndoCommand::doUnapply):
              (WebCore::SpellingCorrectionCommand::SpellingCorrectionCommand):
              (WebCore::SpellingCorrectionCommand::doApply):
      
              * editing/mac/SpellingCorrectionCommand.h: Added.
              (WebCore::SpellingCorrectionCommand::create):
      
              * loader/EmptyClients.h: Updated for the new function declared in EditorClient.
              (WebCore::EmptyEditorClient::recordAutocorrectionResponse):
      
              * manual-tests/autocorrection/undo-autocorrection.html: Added.
      
              * page/ContextMenuController.cpp:
              (WebCore::ContextMenuController::contextMenuItemSelected): Adopted new signature of ReplaceSelectionCommand::create().
      
              * page/DragController.cpp:
              (WebCore::DragController::concludeEditDrag): Ditto.
      
              * page/EditorClient.h: Added EditorClient::recordAutocorrectionResponse().
      2011-02-15  Jia Pu  <jpu@apple.com>
      
              Reviewed by Darin Adler.
      
              Autocorrection should respect undo.
              https://bugs.webkit.org/show_bug.cgi?id=52221
              <rdar://problem/8663399>
      
              Please see WebCore/ChangeLog for detailed description.
      
              * WebProcess/WebCoreSupport/WebEditorClient.h: Updated for the new function declared in EditorClient.
      
              * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
              (WebKit::WebEditorClient::recordAutocorrectionResponse): Ditto.
      
              * WebProcess/WebPage/WebPage.cpp:
              (WebKit::WebPage::replaceSelectionWithText): Adopted new signature of ReplaceSelectionCommand::create().
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@78632 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      060d7a1a
    • rniwa@webkit.org's avatar
      2011-02-07 Ryosuke Niwa <rniwa@webkit.org> · 545c070f
      rniwa@webkit.org authored
              Reviewed by Adam Barth.
      
              Add EditorClient callbacks to override isDOMPasteAllowed and javaScriptCanAccessClipboard
              https://bugs.webkit.org/show_bug.cgi?id=52417
      
              Added two callback functions, canCopyCut and canPaste to EditorClient. They are currently
              not implemented.
      
              * src/EditorClientImpl.cpp:
              (WebKit::EditorClientImpl::canCopyCut): Added.
              (WebKit::EditorClientImpl::canPaste): Added.
              * src/EditorClientImpl.h:
      2011-02-07  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Adam Barth.
      
              Add EditorClient callbacks to override isDOMPasteAllowed and javaScriptCanAccessClipboard
              https://bugs.webkit.org/show_bug.cgi?id=52417
      
              Added two callback functions, canCopyCut and canPaste to EditorClient. They are currently
              not implemented.
      
              * WebCoreSupport/EditorClientQt.cpp:
              (WebCore::EditorClientQt::canCopyCut): Added.
              (WebCore::EditorClientQt::canPaste): Added.
              * WebCoreSupport/EditorClientQt.h:
      2011-02-07  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Adam Barth.
      
              Add EditorClient callbacks to override isDOMPasteAllowed and javaScriptCanAccessClipboard
              https://bugs.webkit.org/show_bug.cgi?id=52417
      
              Added two callback functions, canCopyCut and canPaste to EditorClient. They are currently
              not implemented.
      
              * WebCoreSupport/EditorClientGtk.cpp:
              (WebKit::EditorClient::canCopyCut): Added.
              (WebKit::EditorClient::canPaste): Added.
              * WebCoreSupport/EditorClientGtk.h:
      2011-02-07  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Adam Barth.
      
              Add EditorClient callbacks to override isDOMPasteAllowed and javaScriptCanAccessClipboard
              https://bugs.webkit.org/show_bug.cgi?id=52417
      
              Added two callback functions, canCopyCut and canPaste to EditorClient. They are currently
              not implemented.
      
              * WebCoreSupport/WebEditorClient.cpp:
              (WebEditorClient::canCopyCut): Added.
              (WebEditorClient::canPaste): Added.
              * WebCoreSupport/WebEditorClient.h:
      2011-02-07  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Adam Barth.
      
              Add EditorClient callbacks to override isDOMPasteAllowed and javaScriptCanAccessClipboard
              https://bugs.webkit.org/show_bug.cgi?id=52417
      
              Added two callback functions, canCopyCut and canPaste to EditorClient. They are currently
              not implemented.
      
              * WebKitSupport/EditorClientWx.cpp:
              (WebCore::EditorClientWx::canCopyCut): Added.
              (WebCore::EditorClientWx::canPaste): Added.
              * WebKitSupport/EditorClientWx.h:
      2011-02-07  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Adam Barth.
      
              Add EditorClient callbacks to override isDOMPasteAllowed and javaScriptCanAccessClipboard
              https://bugs.webkit.org/show_bug.cgi?id=52417
      
              Added two callback functions, canCopyCut and canPaste to EditorClient. They are currently
              not implemented.
      
              * WebCoreSupport/WebEditorClient.h:
              * WebCoreSupport/WebEditorClient.mm:
              (WebEditorClient::canCopyCut): Added.
              (WebEditorClient::canPaste): Added.
      2011-02-07  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Adam Barth.
      
              Add EditorClient callbacks to override isDOMPasteAllowed and javaScriptCanAccessClipboard
              https://bugs.webkit.org/show_bug.cgi?id=52417
      
              Added two callback functions, canCopyCut and canPaste to EditorClient. They are currently
              not implemented.
      
              * WebCoreSupport/EditorClientHaiku.cpp:
              (WebCore::EditorClientHaiku::canCopyCut): Added.
              (WebCore::EditorClientHaiku::canPaste): Added.
              * WebCoreSupport/EditorClientHaiku.h:
      2011-02-07  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Adam Barth.
      
              Add EditorClient callbacks to override isDOMPasteAllowed and javaScriptCanAccessClipboard
              https://bugs.webkit.org/show_bug.cgi?id=52417
      
              Added two callback functions, canCopyCut and canPaste to EditorClient. They are currently
              not implemented.
      
              * WebCoreSupport/EditorClientWinCE.cpp:
              (WebKit::EditorClientWinCE::canCopyCut): Added.
              (WebKit::EditorClientWinCE::canPaste): Added.
              * WebCoreSupport/EditorClientWinCE.h:
      2011-02-07  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Adam Barth.
      
              Add EditorClient callbacks to override isDOMPasteAllowed and javaScriptCanAccessClipboard
              https://bugs.webkit.org/show_bug.cgi?id=52417
      
              Added two callback functions, canCopyCut and canPaste to EditorClient. They are currently
              not implemented.
      
              * WebCoreSupport/EditorClientEfl.cpp:
              (WebCore::EditorClientEfl::canCopyCut): Added.
              (WebCore::EditorClientEfl::canPaste): Added.
              * WebCoreSupport/EditorClientEfl.h:
      2011-02-07  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Adam Barth.
      
              Add EditorClient callbacks to override isDOMPasteAllowed and javaScriptCanAccessClipboard
              https://bugs.webkit.org/show_bug.cgi?id=52417
      
              Added two callback functions, canCopyCut and canPaste to EditorClient. These functions
              returns true iff the current frame should be able to copy/cut and paste respectively.
              They take the default value determined by isDOMPasteAllowed and javaScriptCanAccessClipboard.
      
              These callbacks allows embedders to decide whether or not copy/cut/paste should be enabled
              per frame and thus per origin rather than per page.
      
              No new tests are added since this is a WebKit/WebCore interface change.
      
              * editing/EditorCommand.cpp:
              (WebCore::supportedCopyCut): Calls canCopyCut.
              (WebCore::supportedPaste): Calls canPaste.
              * loader/EmptyClients.h:
              (WebCore::EmptyEditorClient::canCopyCut): Added.
              (WebCore::EmptyEditorClient::canPaste): Added.
              * page/EditorClient.h:
      2011-02-07  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Adam Barth.
      
              Add EditorClient callbacks to override isDOMPasteAllowed and javaScriptCanAccessClipboard
              https://bugs.webkit.org/show_bug.cgi?id=52417
      
              Added two callback functions, canCopyCut and canPaste to EditorClient. They are currently
              not implemented.
      
              * WebProcess/WebCoreSupport/WebEditorClient.cpp:
              (WebKit::WebEditorClient::canCopyCut): Added.
              (WebKit::WebEditorClient::canPaste): Added.
              * WebProcess/WebCoreSupport/WebEditorClient.h:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@78532 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      545c070f
  13. 31 Jan, 2011 1 commit
    • darin@apple.com's avatar
      2011-01-31 Darin Adler <darin@apple.com> · f4a3b87a
      darin@apple.com authored
              Reviewed by Adele Peterson.
      
              WKView should support scrollPageDown:, scrollPageUp:, scrollToBeg and other similar selectors
              https://bugs.webkit.org/show_bug.cgi?id=53460
      
              * editing/EditorCommand.cpp:
              (WebCore::executeScrollPageBackward): Added.
              (WebCore::executeScrollPageForward): Added.
              (WebCore::executeScrollToBeginningOfDocument): Added.
              (WebCore::executeScrollToEndOfDocument): Added.
              (WebCore::createCommandMap): Added the four commands above to the map.
      2011-01-31  Darin Adler  <darin@apple.com>
      
              Reviewed by Adele Peterson.
      
              WKView should support scrollPageDown:, scrollPageUp:, scrollToBeg and other similar selectors
              https://bugs.webkit.org/show_bug.cgi?id=53460
      
              * UIProcess/API/mac/WKView.mm: Added WEBCORE_COMMAND macro for lots of editor commands that
              are implemented in WebCore so they will get forwarded. Many of these will probably work without
              any further changes required. Added comments about the methods that we do not yet forward.
              (createSelectorExceptionMap): Map scrollPageDown: to ScrollPageForward and
              scrollPageUp: to ScrollPageBackward because we want the page up and page down
              keys to follow the document logical order, not physical order. This is equivalent
              to what we do in WebPage::performDefaultBehaviorForKeyEvent.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@77182 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      f4a3b87a
  14. 18 Jan, 2011 1 commit
    • morrita@google.com's avatar
      2011-01-18 MORITA Hajime <morrita@google.com> · 84a352ad
      morrita@google.com authored
              Refactoring: EventHandler::handleTextInputEvent should accept an enum instead of bools.
              https://bugs.webkit.org/show_bug.cgi?id=52608
      
              No new tests. no behavioral change.
      
              * GNUmakefile.am:
              * WebCore.gypi:
              * WebCore.pro:
              * WebCore.vcproj/WebCore.vcproj:
              * WebCore.xcodeproj/project.pbxproj:
              * dom/TextEvent.cpp:
              (WebCore::TextEvent::create):
              (WebCore::TextEvent::createForDrop):
              (WebCore::TextEvent::TextEvent):
              * dom/TextEvent.h:
              (WebCore::TextEvent::isLineBreak):
              (WebCore::TextEvent::isBackTab):
              (WebCore::TextEvent::isPaste):
              (WebCore::TextEvent::isDrop):
              * dom/TextEventInputType.h: Added. Extracted from TextEvent::TextInputType.
              * editing/EditorCommand.cpp:
              (WebCore::executeInsertBacktab):
              (WebCore::executeInsertLineBreak):
              (WebCore::executeInsertNewline):
              (WebCore::executeInsertTab):
              * page/EventHandler.cpp:
              (WebCore::EventHandler::handleTextInputEvent):
              * page/EventHandler.h:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76098 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      84a352ad
  15. 14 Jan, 2011 1 commit
  16. 08 Jan, 2011 1 commit
  17. 23 Dec, 2010 4 commits
    • mitz@apple.com's avatar
      Build fix. · 5347d3f6
      mitz@apple.com authored
      * editing/EditorCommand.cpp:
      (WebCore::enabledDismissCorrectionPanel):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74590 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      5347d3f6
    • darin@apple.com's avatar
      Try to fix crash seen on GTK bot. · 4c3ca313
      darin@apple.com authored
      * editing/EditorCommand.cpp:
      (WebCore::internalCommand): Add back empty string check I accidentally deleted in r74580.
      
      * WebCore.xcodeproj/project.pbxproj: Let Xcode edit the file.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74589 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      4c3ca313
    • darin@apple.com's avatar
      2010-12-23 Darin Adler <darin@apple.com> · 50fec70c
      darin@apple.com authored
              Reviewed by Sam Weinig.
      
              WKView should not try to do asynchronous validation for selectors that are not editor commands
              https://bugs.webkit.org/show_bug.cgi?id=51555
      
              * WebCore.exp.in: Added commandIsSupportedFromMenuOrKeyBinding.
              * editing/Editor.h: Reordered arguments in the Editor::Command constructor
              and the data members too so the frame is last. Added
              commandIsSupportedFromMenuOrKeyBinding.
      
              * editing/EditorCommand.cpp:
              (WebCore::supported): Removed the EditorCommandSource argument. These
              functions are now only used when called from DOM.
              (WebCore::supportedFromMenuOrKeyBinding): Ditto.
              (WebCore::supportedCopyCut): Ditto.
              (WebCore::supportedPaste): Ditto.
              (WebCore::enabledDismissCorrectionPanel): Changed the supported function to
              an enabled function. It was incorrect to say that this is "supported" only
              when the correction panel is up. Correct to say that it is "enabled" only
              then. And also probably OK to enable it even when the selection is not in
              editable text, as long as the panel is up.
              (WebCore::createCommandMap): Moved conditional commands out of the main
              array into a separate section at the end.
              (WebCore::internalCommand): Added.
              (WebCore::Editor::command): Changed to use the new internalCommand function
              and simplified by relying on the null check in the Command constructor.
              (WebCore::Editor::commandIsSupportedFromMenuOrKeyBinding): Added.
              (WebCore::Editor::Command::Command): Removed unneeded initialization of
              m_source, which is never looked at if m_command is 0. Added feature of
              passing a null command pointer to the non-default constructor.
              (WebCore::Editor::Command::isSupported): Changed to only call the
              per-command isSupported function when the command source is DOM.
              Accordingly that function is now called isSupportedFromDOM.
      2010-12-23  Darin Adler  <darin@apple.com>
      
              Reviewed by Sam Weinig.
      
              WKView should not try to do asynchronous validation for selectors that are not editor commands
              https://bugs.webkit.org/show_bug.cgi?id=51555
      
              * UIProcess/API/mac/WKView.mm:
              (-[WKView validateUserInterfaceItem:]): Removed the special case for startSpeaking.
              Added call to commandIsSupportedFromMenuOrKeyBinding so we only try to do validation
              for commands that are supported. Tweaked comments and added some bug numbers.
              (-[WKView _setUserInterfaceItemState:enabled:state:]): Tweaked comment and added
              bug number.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74580 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      50fec70c
    • 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
  18. 16 Dec, 2010 1 commit
    • rniwa@webkit.org's avatar
      2010-12-16 Ryosuke Niwa <rniwa@webkit.org> · 52d6c2db
      rniwa@webkit.org authored
              Reviewed by Darin Adler.
      
              execCommand('styleWithCSS') is ignored when selection isn't inside a contenteditable area
              https://bugs.webkit.org/show_bug.cgi?id=51164
      
              Fixed the bug by always enabling the StyleWithCSS command.
      
              Test: editing/style/stylewithcss-without-selection.html
      
              * editing/EditorCommand.cpp:
              (WebCore::createCommandMap): StyleWithCSS is enabled rather than enabledInRichlyEditableText.
      2010-12-16  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Darin Adler.
      
              execCommand('styleWithCSS') is ignored when selection isn't inside a contenteditable area
              https://bugs.webkit.org/show_bug.cgi?id=51164
      
              Added a test to ensure WebKit accepts StyleWithCSS command even if the current selection
              isn't inside a contenteditable region.
      
              * editing/style/stylewithcss-without-selection-expected.txt: Added.
              * editing/style/stylewithcss-without-selection.html: Added.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74204 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      52d6c2db
  19. 13 Dec, 2010 1 commit
    • mario@webkit.org's avatar
      2010-12-13 Mario Sanchez Prada <msanchez@igalia.com> · a9d36ce2
      mario@webkit.org authored
              Reviewed by Xan Lopez.
      
              [Gtk] Additional support is needed for caret browsing
              https://bugs.webkit.org/show_bug.cgi?id=25526
      
              New layout test to check the "MoveTo{Beginninng|End}OfDocument"
              commands when caret browsing is enabled.
      
              * platform/gtk/editing/selection/caret-mode-document-begin-end-expected.txt: Added.
              * platform/gtk/editing/selection/caret-mode-document-begin-end.html: Added.
      2010-12-13  Mario Sanchez Prada  <msanchez@igalia.com>
      
              Reviewed by Xan Lopez.
      
              [Gtk] Additional support is needed for caret browsing
              https://bugs.webkit.org/show_bug.cgi?id=25526
      
              Enable "MoveTo{Beginninng|End}OfDocument" commands when caret
              browsing is enabled.
      
              This change impacts the GTK-port only as caret browsing is a
              feature only used in that platform so far.
      
              Test: platform/gtk/editing/selection/caret-mode-document-begin-end.html
      
              * editing/EditorCommand.cpp:
              (WebCore::createCommandMap): Enable the commads when in caret browsing.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73918 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      a9d36ce2
  20. 09 Dec, 2010 1 commit
    • mjs@apple.com's avatar
      2010-12-09 Maciej Stachowiak <mjs@apple.com> · 32fd6197
      mjs@apple.com authored
              Reviewed by Dan Bernstein.
      
              Implement "Use Selection for Find" in WebKit2
              https://bugs.webkit.org/show_bug.cgi?id=50737
              <rdar://problem/8564881>
      
              Implement a TakeFindStringFromSelection editor command. This is
              used solely to implement the "Use Selection for Find" menu command
              on Mac, and is not made available to script. On WebKit2, it is
              very convenient to reuse the editing machinery since this command
              is very similar to Copy.
      
              * editing/Editor.h:
              * editing/EditorCommand.cpp:
              (WebCore::executeTakeFindStringFromSelection): Call to a mac-only Editor function.
              (WebCore::enabledTakeFindStringFromSelection): Check using Editor::canCopyExcludingStandaloneImage
              (WebCore::createCommandMap): Add "TakeFindStringFromSelection" command.
              * editing/mac/EditorMac.mm:
              (WebCore::Editor::canCopyExcludingStandaloneImages): Helper function; we can't use Editor::canCopy
              since it would make no sense to enable "Use Selection for Find" when viewing a standalone image
              document.
              (WebCore::Editor::takeFindStringFromSelection): Implement by copying the selected text
              to the special Find pasteboard.
      2010-12-09  Maciej Stachowiak  <mjs@apple.com>
      
              Reviewed by Dan Bernstein.
      
              Implement "Use Selection for Find" in WebKit2
              https://bugs.webkit.org/show_bug.cgi?id=50737
              <rdar://problem/8564881>
              
              * UIProcess/API/mac/WKView.mm: Add support for the takeFindStringFromSelection:
              selector as a command.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73621 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      32fd6197
  21. 21 Nov, 2010 1 commit
    • paroga@webkit.org's avatar
      2010-11-21 Patrick Gansterer <paroga@webkit.org> · f27e2eb1
      paroga@webkit.org authored
              Reviewed by Csaba Osztrogonác.
      
              Use WTF_ARRAY_LENGTH in WebCore directory
              https://bugs.webkit.org/show_bug.cgi?id=49882
      
              * accessibility/AccessibilityObject.cpp:
              (WebCore::createARIARoleMap):
              * bindings/js/JSDOMWindowBase.cpp:
              (WebCore::JSDOMWindowBase::JSDOMWindowBase):
              * bindings/scripts/CodeGeneratorV8.pm:
              * bindings/scripts/test/V8/V8TestObj.cpp:
              (WebCore::ConfigureV8TestObjTemplate):
              * css/CSSComputedStyleDeclaration.cpp:
              * css/CSSMutableStyleDeclaration.cpp:
              (WebCore::CSSMutableStyleDeclaration::getPropertyValue):
              * css/CSSParser.cpp:
              (WebCore::CSSParser::parseAnimationShorthand):
              (WebCore::CSSParser::parseTransitionShorthand):
              * css/CSSPropertyLonghand.cpp:
              (WebCore::initShorthandMap):
              * dom/ExceptionCode.cpp:
              (WebCore::getExceptionCodeDescription):
              * editing/ApplyStyleCommand.cpp:
              (WebCore::ApplyStyleCommand::removeImplicitlyStyledElement):
              * editing/EditingStyle.cpp:
              * editing/Editor.cpp:
              (WebCore::triStateOfStyle):
              * editing/EditorCommand.cpp:
              (WebCore::createCommandMap):
              * editing/MarkupAccumulator.cpp:
              (WebCore::appendCharactersReplacingEntities):
              * html/canvas/WebGLBuffer.cpp:
              (WebCore::WebGLBuffer::getCachedMaxIndex):
              (WebCore::WebGLBuffer::setCachedMaxIndex):
              * loader/FTPDirectoryParser.cpp:
              (WebCore::parseOneFTPLine):
              * mathml/RenderMathMLOperator.cpp:
              (WebCore::RenderMathMLOperator::updateFromElement):
              * page/animation/AnimationBase.cpp:
              (WebCore::addShorthandProperties):
              * rendering/RenderTextControl.cpp:
              (WebCore::RenderTextControl::hasValidAvgCharWidth):
              * rendering/break_lines.cpp:
              * svg/SVGTransformable.cpp:
              (WebCore::parseAndSkipType):
              * svg/SVGViewSpec.cpp:
              (WebCore::SVGViewSpec::parseViewSpec):
              * svg/SVGZoomAndPan.cpp:
              (WebCore::SVGZoomAndPan::parseZoomAndPan):
              * xml/XPathFunctions.cpp:
              (WebCore::XPath::createFunctionMap):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@72500 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      f27e2eb1
  22. 04 Nov, 2010 2 commits
    • tonikitoo@webkit.org's avatar
      2010-10-20 Chang Shu <chang.shu@nokia.com>, Antonio Gomes <tonikitoo@webkit.org> · 75764085
      tonikitoo@webkit.org authored
              Reviewed by Simon Fraser.
      
              Spatial Navigation: add support to <input type=text> and <textarea>
              https://bugs.webkit.org/show_bug.cgi?id=37153
      
              Before this patch, the focus cannot move away from input box once it is in. This patch allows focus
              move to neighbor nodes when the caret reaches the edge of the texts. This patch does not support yet
              cases where the focused <input> has a JS handler for the arrow keys.
      
              WebCore:
      
              Tests: fast/events/spatial-navigation/snav-input.html
              fast/events/spatial-navigation/snav-textarea.html
      
              * editing/EditorCommand.cpp:
              (WebCore::executeMoveDown):
              (WebCore::executeMoveLeft):
              (WebCore::executeMoveRight):
              (WebCore::executeMoveUp):
              * editing/SelectionController.cpp:
              (WebCore::SelectionController::modify):
      
              WebKit/qt:
      
              * WebCoreSupport/EditorClientQt.cpp:
              WebCore::EditorClientQt::handleKeyboardEvent):
      
              LayoutTests:
      
              * fast/events/spatial-navigation/snav-input-expected.txt: Added.
              * fast/events/spatial-navigation/snav-input.html: Added.
              * fast/events/spatial-navigation/snav-textarea-expected.txt: Added.
              * fast/events/spatial-navigation/snav-textarea.html: Added.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@71388 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      75764085
    • mitz@apple.com's avatar
      reversion bubble in WebViews · f82f4ad6
      mitz@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=47630
      <rdar://problem/8530960>
      
      Patch by Jia Pu <jpu@apple.com> on 2010-11-04
      Reviewed by Dan Bernstein.
      
      WebCore: 
      
      Added manual test:
      manual-tests/autocorrection/continue-typing-to-dismiss-reversion.html
      manual-tests/autocorrection/delete-to-dismiss-reversion.html
      manual-tests/autocorrection/delete-to-end-of-word-to-show-reversion.html
      manual-tests/autocorrection/move-to-end-of-word-to-show-reversion.html
      manual-tests/autocorrection/type-whitespace-to-dismiss-reversion.html
      
      We can only manully test this feature for two reasons:
      1. On Mac OS X, the result of spell checking is partly determined by past user usage. We can't
         realiably generating test cases until we can disable user custom data during spell checking.
      2. To exerciese this feature, we need a minimum of 0.3 second delay using WebCore timer.
      
      This patch is to add reversion to correction panel. It consists of following major code changes:
      1. Collected all autocorrection related member variables in Editor into a CorrectionPanelInfo
         class to improve readability.
      2. Changed signature of Editor::startCorrectionPanelTimer() to allow caller to specify the
         type of correction panel--regular correction or reversion.
      3. Made necessary changes to adopt reversion API in AppKit.
      4. Use SUPPORT_CORRECTION_PANEL macro to improve readability.
      
      * GNUmakefile.am: Added CorrectionPanelInfo.h.
      * WebCore.gypi: Ditto.
      * WebCore.pro: Ditto.
      * WebCore.vcproj/WebCore.vcproj: Ditto.
      * WebCore.xcodeproj/project.pbxproj:
      * editing/CorrectionPanelInfo.h: Added.
      * editing/Editor.cpp:
      (WebCore::Editor::respondToChangedSelection): Start correction panel timer for reversion when
        the new selection is a caret selection at end of a previously corrected word.
      (WebCore::Editor::appliedEditing): Stop timer at the beginning of the method instead of at the end.
      (WebCore::Editor::~Editor): Adopted new method dismissCorrectionPanel().
      (WebCore::Editor::markMisspellingsAfterTypingToPosition): Adopted new method applyCorrectionPanelInfo().
      (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges): Code change for new m_correctionPanelInfo
        member variable.
      (WebCore::Editor::correctionPanelTimerFired): Change to handle reversion panel type.
      (WebCore::Editor::handleRejectedCorrection): Ditto.
      (WebCore::Editor::startCorrectionPanelTimer): Changed signature to allow passing in panel type.
      (WebCore::Editor::stopCorrectionPanelTimer): Adopted macro SUPPORT_CORRECTION_PANEL.
      (WebCore::Editor::handleCancelOperation): Ditto.
      (WebCore::Editor::isShowingCorrectionPanel): Ditto.
      (WebCore::Editor::dismissCorrectionPanel): Update m_correctionPanelInfo when correction panel
        is dismissed.
      (WebCore::Editor::applyCorrectionPanelInfo): Factored out code that applies autocorrection.
      (WebCore::Editor::changeSelectionAfterCommand): Adopt macro SUPPORT_CORRECTION_PANEL.
      * editing/Editor.h: Adopted CorrectionPanelInfo and add new member methods.
      * editing/EditorCommand.cpp: Adopted macro SUPPORT_CORRECTION_PANEL
      (WebCore::createCommandMap):
      * editing/TypingCommand.cpp: Adopted macro SUPPORT_CORRECTION_PANEL and new signature of
        startCorrectionPanelTimer().
      (WebCore::TypingCommand::markMisspellingsAfterTyping):
      * loader/EmptyClients.h:
      (WebCore::EmptyEditorClient::showCorrectionPanel): Adopted new signature of base class method.
      (WebCore::EmptyEditorClient::dismissCorrectionPanel):  Ditto.
      * manual-tests/autocorrection/continue-typing-to-dismiss-reversion.html: Added.
      * manual-tests/autocorrection/delete-to-dismiss-reversion.html: Added.
      * manual-tests/autocorrection/delete-to-end-of-word-to-show-reversion.html: Added.
      * manual-tests/autocorrection/move-to-end-of-word-to-show-reversion.html: Added.
      * manual-tests/autocorrection/type-whitespace-to-dismiss-reversion.html: Added.
      * page/EditorClient.h: Changed signature of showCorrectionPanel() and dismissCorrectionPanel().
      * platform/graphics/mac/GraphicsContextMac.mm: Added comment to improve readability.
      (WebCore::GraphicsContext::drawLineForTextChecking):
      
      WebKit/mac: 
      
      This patch is to add reversion to correction panel. Please see WebCore/ChangeLog for detail.
      
      * WebCoreSupport/WebEditorClient.h: Adopted new signature of base class method.
      * WebCoreSupport/WebEditorClient.mm: Adopted new signature of base class method. And code
        change to use new reversion API in AppKit.
      (WebEditorClient::WebEditorClient):
      (WebEditorClient::~WebEditorClient):
      (WebEditorClient::respondToChangedSelection):
      (WebEditorClient::showCorrectionPanel):
      (WebEditorClient::dismissCorrectionPanel):
      (WebEditorClient::isShowingCorrectionPanel):
      
      WebKit2: 
      
      This patch is to add reversion to correction panel. Please see WebCore/ChangeLog for detail.
      
      * WebProcess/WebCoreSupport/WebEditorClient.h: Adopted new signature of base class method.
      * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm: Ditto.
      (WebKit::WebEditorClient::showCorrectionPanel):
      (WebKit::WebEditorClient::dismissCorrectionPanel):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@71385 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      f82f4ad6
  23. 28 Oct, 2010 1 commit
    • rniwa@webkit.org's avatar
      2010-10-28 Ryosuke Niwa <rniwa@webkit.org> · 66e8b3db
      rniwa@webkit.org authored
              Reviewed by Darin Adler.
      
              queryCommandValue should fall back to queryCommandState
              https://bugs.webkit.org/show_bug.cgi?id=48479
      
              Added a fallback to Command::value so that commands with a state function without a value function
              returns the value returned by the state function as a string.
      
              * editing/EditorCommand.cpp:
              (WebCore::Editor::Command::value):
      2010-10-28  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Darin Adler.
      
              queryCommandValue should fall back to queryCommandState
              https://bugs.webkit.org/show_bug.cgi?id=48479
      
              Modified the existing tests to ensure queryCommandValue returns 'true' or 'false'
              for commands that supports queryCommandState.
      
              * editing/execCommand/script-tests/query-command-state.js:
              (testQueryCommandState):
              * editing/execCommand/script-tests/query-text-alignment.js:
              (isEquivalentBoolean):
              (queryTextAlignment):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@70810 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      66e8b3db
  24. 15 Oct, 2010 1 commit
    • rniwa@webkit.org's avatar
      2010-10-15 Ryosuke Niwa <rniwa@webkit.org> · a3f9d34e
      rniwa@webkit.org authored
              Reviewed by Darin Adler.
      
              Match the elements supported by execCommand('formatBlock') and queryCommandValue('formatBlock')
              https://bugs.webkit.org/show_bug.cgi?id=47712
      
              Extended queryCommandValue('formatBlock', false, null) to support article, aside, blockquote, dd, dl,
              div, dl, dt, dl, footer, header, hgroup, nav, and section. Because this makes isElementForFormatBlockCommand
              in Editor.cpp and FormatBlockCommand::isElementToApplyInFormatBlockCommand identical, they are merged and moved
              to FormatBlockCommand.cpp
      
              Tests are added to editing/execCommand/query-format-block.html
      
              * editing/Editor.cpp: Removed isElementForFormatBlockCommand and Editor::elementForFormatBlockCommand.
              * editing/Editor.h:
              * editing/EditorCommand.cpp:
              (WebCore::executeFormatBlock): Removed the check of tag name; the check is moved into FormatBlockCommand.
              (WebCore::valueFormatBlock): Calls FormatBlockCommand::elementForFormatBlockCommand.
              * editing/FormatBlockCommand.cpp:
              (WebCore::isElementForFormatBlock):
              (WebCore::FormatBlockCommand::FormatBlockCommand):
              (WebCore::FormatBlockCommand::formatSelection): Added to check the tag name. Exit early if the specified tag name
              is not what FormatBlock should apply. Set m_didApply true if m_didApply did apply the element.
              (WebCore::FormatBlockCommand::formatRange): Moved from Editor.cpp.  Takes Range* instead of accessing selection directly.
              (WebCore::FormatBlockCommand::elementForFormatBlockCommand): Moved from Editor.cpp
              (WebCore::enclosingBlockToSplitTreeTo): Calls isElementForFormatBlock.
              * editing/FormatBlockCommand.h:
              (WebCore::FormatBlockCommand::didApply): Added.
      2010-10-15  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Darin Adler.
      
              Match the elements supported by execCommand('formatBlock') and queryCommandValue('formatBlock')
              https://bugs.webkit.org/show_bug.cgi?id=47712
      
              Added queryCommandValue('formatBlock') tests for support article, aside, blockquote, dd, dl, div,
              dl, dt, dl, footer, header, hgroup, nav, and section.
      
              Also added tests to ensure we don't return tag name for a subset of unsupported elements.
      
              * editing/execCommand/query-format-block-expected.txt:
              * editing/execCommand/script-tests/query-format-block.js:
              (queryFormatBlock):
              (selectFirstPosition):
              (selectMiddleOfHelloWorld):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@69876 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      a3f9d34e
  25. 14 Oct, 2010 1 commit
    • rniwa@webkit.org's avatar
      2010-10-14 Ryosuke Niwa <rniwa@webkit.org> · aeeef960
      rniwa@webkit.org authored
              Reviewed by Tony Chang and Darin Adler.
      
              execCommand FormatBlock creates lots of blockquotes
              https://bugs.webkit.org/show_bug.cgi?id=19795
      
              The bug was caused by WebKit's not reusing the block node added by previous iteration
              and its inserting block node at wrong places.
      
              Fixed the bug by rewriting FormatBlockCommand::formatRange.  New code resembles that of
              IndentOutdentCommand::indentIntoBlockquote.  The difference between two is that formatRange
              avoids the existing block elements when replacing blocks and it also adds a placeholder
              when removing the existing block caused paragraphs to collapse.
      
              Also fixed a bug in moveParagraphWithClones where erroneous br is added to the start of
              the block element to which the paragraph is moved if the block element is the start of a paragraph
              and not the end of a paragraph.
      
              Tests: editing/execCommand/format-block-multiple-paragraphs.html
                     editing/execCommand/format-block-table.html
      
              * editing/CompositeEditCommand.cpp:
              (WebCore::CompositeEditCommand::moveParagraphWithClones): No longer adds erroneous br.
              * editing/EditorCommand.cpp:
              (WebCore::executeFormatBlock):
              * editing/FormatBlockCommand.cpp:
              (WebCore::FormatBlockCommand::formatRange): Rewritten; see above.
              (WebCore::FormatBlockCommand::isElementToApplyInFormatBlockCommand): Renamed from validBlockElement
              and moved from htmlediting.cpp.
              (WebCore::enclosingBlockToSplitTreeTo): Added.
              * editing/FormatBlockCommand.h:
              * editing/VisiblePosition.cpp:
              (WebCore::enclosingBlockFlowElement): Changed the return type to Element*
              * editing/VisiblePosition.h:
      2010-10-14  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Tony Chang and Darin Adler.
      
              execCommand FormatBlock creates lots of blockquotes
              https://bugs.webkit.org/show_bug.cgi?id=19795
      
              Added tests to ensure WebKit does not add multiple block elements when applying block element to
              multiple paragraphs.  Also added a test to ensure formatBlock works with tables.
      
              * fast/html/nav-element-expected.txt: Preserved new lines and removed redundant br.
              * editing/execCommand/format-block-expected.txt: Preserved span and removed erroneous br.
              * editing/execCommand/format-block-from-range-selection-expected.txt: Merged dl's and removed erroneous br.
              * editing/execCommand/format-block-multiple-paragraphs-expected.txt: Added.
              * editing/execCommand/format-block-multiple-paragraphs.html: Added.
              * editing/execCommand/format-block-table-expected.txt: Added.
              * editing/execCommand/format-block-table.html: Added.
              * editing/execCommand/format-block-with-braces-expected.txt: Removed erroneous br.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@69836 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      aeeef960
  26. 13 Oct, 2010 2 commits
    • commit-queue@webkit.org's avatar
      2010-10-12 Sheriff Bot <webkit.review.bot@gmail.com> · 93d722a2
      commit-queue@webkit.org authored
              Unreviewed, rolling out r69639.
              http://trac.webkit.org/changeset/69639
              https://bugs.webkit.org/show_bug.cgi?id=47575
      
              "regressed nav-element.html" (Requested by rniwa on #webkit).
      
              * editing/execCommand/format-block-expected.txt:
              * editing/execCommand/format-block-from-range-selection-expected.txt:
              * editing/execCommand/format-block-multiple-paragraphs-expected.txt: Removed.
              * editing/execCommand/format-block-multiple-paragraphs.html: Removed.
              * editing/execCommand/format-block-table-expected.txt: Removed.
              * editing/execCommand/format-block-table.html: Removed.
              * editing/execCommand/format-block-with-braces-expected.txt:
      2010-10-12  Sheriff Bot  <webkit.review.bot@gmail.com>
      
              Unreviewed, rolling out r69639.
              http://trac.webkit.org/changeset/69639
              https://bugs.webkit.org/show_bug.cgi?id=47575
      
              "regressed nav-element.html" (Requested by rniwa on #webkit).
      
              * editing/ApplyBlockElementCommand.cpp:
              (WebCore::ApplyBlockElementCommand::formatSelection):
              * editing/EditorCommand.cpp:
              (WebCore::executeFormatBlock):
              * editing/FormatBlockCommand.cpp:
              (WebCore::FormatBlockCommand::formatRange):
              * editing/FormatBlockCommand.h:
              (WebCore::FormatBlockCommand::editingAction):
              * editing/VisiblePosition.cpp:
              (WebCore::enclosingBlockFlowElement):
              * editing/VisiblePosition.h:
              * editing/htmlediting.cpp:
              (WebCore::validBlockTag):
              * editing/htmlediting.h:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@69640 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      93d722a2
    • rniwa@webkit.org's avatar
      2010-10-12 Ryosuke Niwa <rniwa@webkit.org> · 65f41609
      rniwa@webkit.org authored
              Reviewed by Tony Chang.
      
              execCommand FormatBlock creates lots of blockquotes
              https://bugs.webkit.org/show_bug.cgi?id=19795
      
              The bug was caused by WebKit's not reusing the block node added by previous iteration
              and its inserting block node at wrong places.
      
              Fixed the bug by rewriting FormatBlockCommand::formatRange.  New code resembles that of
              IndentOutdentCommand::indentIntoBlockquote.  The difference between two is that formatRange
              avoids the existing block elements when replacing blocks and it also adds a placeholder
              when removing the existing block caused paragraphs to collapse.
      
              Tests: editing/execCommand/format-block-multiple-paragraphs.html
                     editing/execCommand/format-block-table.html
      
              * editing/EditorCommand.cpp:
              (WebCore::executeFormatBlock):
              * editing/FormatBlockCommand.cpp:
              (WebCore::FormatBlockCommand::formatRange): Rewritten; see above.
              (WebCore::FormatBlockCommand::isElementToApplyInFormatBlockCommand): Renamed from validBlockElement
              and moved from htmlediting.cpp.
              (WebCore::FormatBlockCommand::enclosingBlockToSplitTreeTo): Added.
              * editing/FormatBlockCommand.h:
              * editing/VisiblePosition.cpp:
              (WebCore::enclosingBlockFlowElement): Changed the return type to Element*
              * editing/VisiblePosition.h:
      2010-10-12  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Tony Chang.
      
              execCommand FormatBlock creates lots of blockquotes
              https://bugs.webkit.org/show_bug.cgi?id=19795
      
              Added tests to ensure WebKit does not add multiple block elements when applying block element to
              multiple paragraphs.  Also added a test to ensure formatBlock works with tables.
      
              * editing/execCommand/format-block-expected.txt: Preserved span and removed erroneous br.
              * editing/execCommand/format-block-from-range-selection-expected.txt: Merged dl's and removed erroneous br.
              * editing/execCommand/format-block-multiple-paragraphs-expected.txt: Added.
              * editing/execCommand/format-block-multiple-paragraphs.html: Added.
              * editing/execCommand/format-block-table-expected.txt: Added.
              * editing/execCommand/format-block-table.html: Added.
              * editing/execCommand/format-block-with-braces-expected.txt: Removed erroneous br.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@69639 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      65f41609
  27. 01 Oct, 2010 2 commits
    • rniwa@webkit.org's avatar
      2010-10-01 Ryosuke Niwa <rniwa@webkit.org> · 850699fa
      rniwa@webkit.org authored
              Reviewed by Darin Adler.
      
              FormatBlockCommand and IndentOutdentCommand should use the same code to iterate paragraphs
              https://bugs.webkit.org/show_bug.cgi?id=46840
      
              Added ApplyBlockElementCommand, which is an abstract class inherited by FormatBlockCommand
              and IndentOutdentCommand.  It is intended to be inherited by InsertListCommand as well.
      
              ApplyBlockElementCommand's doApply verifies the current selection and exits early
              if it's invalid or orphaned or if the current selection is outside editable region.
              It then calls formatSelection to apply the block element after which doApply restores the selection.
              formatSelection iterates through paragraphs and calls formatParagraph, a pure virtual function
              implemented by FormatBlockCommand and IndentOutdentCommand, on each paragraph.
      
              No new tests are added since this is a refactoring.
      
              * Android.mk: Added ApplyBlockElementCommand.cpp.
              * CMakeLists.txt: Ditto.
              * GNUmakefile.am: Added ApplyBlockElementCommand.cpp and ApplyBlockElementCommand.h.
              * WebCore.gypi: Ditto.
              * WebCore.pro: Ditto.
              * WebCore.xcodeproj/project.pbxproj: Ditto.
              * editing/ApplyBlockElementCommand.cpp: Added.
              (WebCore::countParagraphs): Moved from IndentOutdentCommand.cpp
              (WebCore::ApplyBlockElementCommand::ApplyBlockElementCommand): Added.
              (WebCore::ApplyBlockElementCommand::doApply): Moved from IndentOutdentCommand::doApply.
              (WebCore::ApplyBlockElementCommand::formatSelection): Moved from IndentOutdentCommand::indentRegion.
              (WebCore::ApplyBlockElementCommand::createBlockElement): Added.
              (WebCore::ApplyBlockElementCommand::splitTextNodes): Moved from IndentOutdentCommand::splitTextNodes.
              * editing/ApplyBlockElementCommand.h: Added.
              * editing/EditingAllInOne.cpp:
              * editing/EditorCommand.cpp:
              (WebCore::executeFormatBlock):
              * editing/FormatBlockCommand.cpp: Removed doApply.
              (WebCore::FormatBlockCommand::FormatBlockCommand): Calls ApplyBlockElementCommand's constructor.
              (WebCore::FormatBlockCommand::formatParagraph): Renamed from doApplyForSingleParagraph.
              * editing/FormatBlockCommand.h: FormatBlockCommand inherits from ApplyBlockElementCommand.
              (WebCore::FormatBlockCommand::create): Uses QualifiedName for the tag name instead of AtomicString.
              * editing/IndentOutdentCommand.cpp: Removed doApply, indentIntoBlockquote, and splitTextNodes.
              (WebCore::IndentOutdentCommand::IndentOutdentCommand): Calls ApplyBlockElementCommand's constructor.
              (WebCore::IndentOutdentCommand::indentIntoBlockquote): The code to nullify targetBlockquote
              when the next paragraph is in a different table cell is moved to ApplyBlockElementCommand::formatSelection.
              (WebCore::IndentOutdentCommand::formatSelection): Added. Calls outdentRegion when outdenting.
              (WebCore::IndentOutdentCommand::formatParagraph): Added. Calls tryIndentingAsListItem and indentIntoBlockquote.
              * editing/IndentOutdentCommand.h: IndentOutdentCommand inherits from ApplyBlockElementCommand.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68972 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      850699fa
    • rniwa@webkit.org's avatar
      2010-09-30 Ryosuke Niwa <rniwa@webkit.org> · a23cf764
      rniwa@webkit.org authored
              Reviewed by Darin Adler.
      
              Implement queryCommandState('justifyFull')
              https://bugs.webkit.org/show_bug.cgi?id=46954
      
              Implemented queryCommandState('justifyFull').
              New tests are added to editing/style/inline-style-container.html
      
              * editing/ApplyStyleCommand.cpp:
              (WebCore::getTextAlignment): Added support for CSSValueJustify.
              * editing/EditorCommand.cpp:
              (WebCore::stateJustifyFull): Added.
              (WebCore::createCommandMap): Added stateJustifyFull.
      2010-09-30  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Darin Adler.
      
              Implement queryCommandState('justifyFull')
              https://bugs.webkit.org/show_bug.cgi?id=46954
      
              Added tests for queryCommandState('justifyFull') to editing/execCommand/query-text-alignment.html
      
              * editing/execCommand/query-text-alignment-expected.txt:
              * editing/execCommand/script-tests/query-text-alignment.js:
              (queryTextAlignment):
              (runRangeTests):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68904 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      a23cf764
  28. 29 Sep, 2010 1 commit
    • rniwa@webkit.org's avatar
      2010-09-29 Ryosuke Niwa <rniwa@webkit.org> · 0156bfab
      rniwa@webkit.org authored
              Reviewed by Darin Adler.
      
              queryCommandValue "formatBlock" always returns false
              https://bugs.webkit.org/show_bug.cgi?id=21305
      
              Implemented queryCommandValue('formatBlock'). We match the Firefox's behavior exactly
              because Firefox and Internet Explorer support the same set of elements
              (address, h1, h2, h3, h4, h5, h6, and p) and Firefox's behavior is more compatible with Opera.
              See the bug for the detailed discussion.
      
              WebKit's implementation returns the local name of the lowest common ancestor
              of the selection with the tag name address, h1, h2, h3, h4, h5, h6, or p.
              It returns "" when there is no such an ancestor or there is no selection.
      
              Test: editing/execCommand/query-format-block.html
      
              * editing/Editor.cpp:
              (WebCore::isElementForFormatBlockCommand):
              (WebCore::Editor::elementForFormatBlockCommand):
              * editing/Editor.h:
              * editing/EditorCommand.cpp:
              (WebCore::valueFormatBlock):
              (WebCore::createCommandMap):
      2010-09-29  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Darin Adler.
      
              queryCommandValue "formatBlock" always returns false
              https://bugs.webkit.org/show_bug.cgi?id=21305
      
              Added a test for queryCommandValue('formatBlock').
      
              * editing/execCommand/query-format-block-expected.txt: Added.
              * editing/execCommand/query-format-block.html: Added.
              * editing/execCommand/script-tests/query-format-block.js: Added.
              (queryFormatBlock):
              (selectFirstPosition):
              (selectMiddleOfHelloWorld):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68670 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      0156bfab
  29. 27 Sep, 2010 2 commits
    • rniwa@webkit.org's avatar
      2010-09-27 Ryosuke Niwa <rniwa@webkit.org> · 06f1791f
      rniwa@webkit.org authored
              Reviewed by Darin Adler.
      
              queryCommandState with justifyCenter, justifyLeft, and justifyRight always return false
              https://bugs.webkit.org/show_bug.cgi?id=45910
      
              Implemented queryCommandState for justifyCenter, justifyLeft, and justifyRight commands.
              Added getTextAlignment to convert -webkit-center, -webkit-left, and -webkit-right to
              center, left, and right respectively because they can be treated equally for editing purposes.
      
              Test: editing/execCommand/query-text-alignment.html
      
              * editing/ApplyStyleCommand.cpp:
              (WebCore::getTextAlignment): Added.
              (WebCore::getPropertiesNotIn): Uses getTextAlignment.
              * editing/EditorCommand.cpp:
              (WebCore::stateJustifyCenter): Added.
              (WebCore::stateJustifyLeft): Added.
              (WebCore::stateJustifyRight): Added.
              (WebCore::createCommandMap): Refers to stateJustifyCenter, stateJustifyLeft, and stateJustifyRight.
      2010-09-27  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Darin Adler.
      
              queryCommandState with justifyCenter, justifyLeft, and justifyRight always return false
              https://bugs.webkit.org/show_bug.cgi?id=45910
      
              Added tests for queryCommandState with justifyCenter, justifyLeft, and justifyRight commands.
      
              * editing/execCommand/query-text-alignment-expected.txt: Added.
              * editing/execCommand/query-text-alignment.html: Added.
              * editing/execCommand/script-tests/query-text-alignment.js: Added.
              (queryTextAlignment):
              (selectFirstPosition):
              (selectMiddleOfHelloWorld):
              (runRangeTests):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68465 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      06f1791f
    • rniwa@webkit.org's avatar
      2010-09-27 Ryosuke Niwa <rniwa@webkit.org> · 5c713d95
      rniwa@webkit.org authored
              Reviewed by Antonio Gomes.
      
              stateStyle (@EditorCommand.cpp) should ask EditingBehavior for platform specific behavior
              https://bugs.webkit.org/show_bug.cgi?id=41989
      
              queryCommandState returns true even when in the mixed state
              https://bugs.webkit.org/show_bug.cgi?id=46382
      
              Fixed stateStyle so that it calls selectionStartHasStyle when shouldToggleStyleBasedOnStartOfSelection
              is true (Mac platforms) and calls selectionHasStyle otherwise (non-Mac platforms).
      
              Also fixed queryCommandState so that it only returns true when the state is TrueTriState
              as supposed to returning true whenever the state is not FalseTriState. New behavior matches that of
              other browsers such as Firefox and Internet Explorer.
      
              * dom/Document.cpp:
              (WebCore::Document::queryCommandState):
              * editing/EditorCommand.cpp:
              (WebCore::executeToggleStyle):
              (WebCore::stateStyle):
      2010-09-27  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Antonio Gomes.
      
              stateStyle (@EditorCommand.cpp) should ask EditingBehavior for platform specific behavior
              https://bugs.webkit.org/show_bug.cgi?id=41989
      
              Added a test to ensure queryCommandState returns correct values on Mac and Windows.
      
              * editing/execCommand/query-command-state-expected.txt: Added.
              * editing/execCommand/script-tests/query-command-state.js: Added.
              (testQueryCommandState):
              (selectAll):
              (selectSecondWord):
              (selectFirstTwoWords):
              (runTests):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68423 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      5c713d95
  30. 23 Sep, 2010 1 commit
    • commit-queue@webkit.org's avatar
      2010-09-23 Mario Sanchez Prada <msanchez@igalia.com> · 6efb3553
      commit-queue@webkit.org authored
              Reviewed by Chris Fleizach.
      
              [Regression][Gtk] Left and Right Arrows no longer function when caret browsing is enabled
              https://bugs.webkit.org/show_bug.cgi?id=45375
      
              Added the following test to make sure key navigation across a
              paragraph always work as expected, both with and without the shift
              and ctrl modifiers.
      
              * platform/gtk/editing/selection/caret-mode-paragraph-keys-navigation-expected.txt: Added.
              * platform/gtk/editing/selection/caret-mode-paragraph-keys-navigation.html: Added.
      2010-09-23  Mario Sanchez Prada  <msanchez@igalia.com>
      
              Reviewed by Chris Fleizach.
      
              [Regression][Gtk] Left and Right Arrows no longer function when caret browsing is enabled
              https://bugs.webkit.org/show_bug.cgi?id=45375
      
              Consider caret browsing for Move commands.
      
              Test: platform/gtk/editing/selection/caret-mode-left-right-arrows.html
      
              * editing/EditorCommand.cpp:
              (WebCore::createCommandMap): Use "caret browsing aware functions"
              as isEnabled() function for those commands moving the caret
              forward and backward across characters, words, lines or paragraphs,
              not just left and right, as it was the case so far.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68149 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      6efb3553
  31. 22 Sep, 2010 1 commit
    • rniwa@webkit.org's avatar
      2010-09-22 Ryosuke Niwa <rniwa@webkit.org> · f3008f6d
      rniwa@webkit.org authored
              Reviewed by Darin Adler.
      
              queryCommandState returns false for Underline command when no selection is made
              https://bugs.webkit.org/show_bug.cgi?id=17594
      
              The bug was caused by selectionComputedStyle's adding -webkit-text-decorations-in-effect property
              to a dummy span used to obtain the computed style when there is a typing style.
              Since this property is for internal use only, the CSS parser always stripped the property.
              As a result, we were always ignoring the text decorations set by the typing style.
      
              Fixed the bug by making selectionComputedStyle directly merge the computed style of the current
              caret position and the typing style. This also eliminates the need for a dummy span element.
              Due to the merge, the return value of selectionComputedStyle had to be changed to CSSMutableStyleDeclaration
              from CSSComputedStyleDeclaration.
      
              Test: editing/execCommand/query-text-decoration-with-typing-style.html
      
              * editing/ApplyStyleCommand.cpp:
              (WebCore::StyleChange::init): Calls getPropertiesNotIn.
              (WebCore::getPropertiesNotIn): Renamed from getPropertiesNotInComputedStyle since it takes
              CSSStyleDeclaration* instead of CSSComputedStyleDeclaration* for the second argument.
              (WebCore::ApplyStyleCommand::removeNonEditingProperties): Extracted from editingStyleAtPosition.
              (WebCore::ApplyStyleCommand::editingStyleAtPosition): Calls removeNonEditingProperties.
              * editing/ApplyStyleCommand.h:
              * editing/Editor.cpp:
              (WebCore::triStateOfStyle): Calls getPropertiesNotIn. Renamed from triStateOfStyleInComputedStyle
              since it no longer takes CSSComputedStyleDeclaration.
              (WebCore::Editor::selectionStartHasStyle): Calls selectionComputedStyle and triStateOfStyle.
              (WebCore::Editor::selectionHasStyle): Ditto.
              (WebCore::Editor::selectionStartCSSPropertyValue): Calls selectionComputedStyle.
              (WebCore::Editor::selectionComputedStyle): See above.
              * editing/Editor.h:
              * editing/EditorCommand.cpp:
              (WebCore::executeToggleStyleInList): Calls selectionComputedStyle.
      2010-09-22  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Darin Adler.
      
              queryCommandState returns false for Underline command when no selection is made
              https://bugs.webkit.org/show_bug.cgi?id=17594
      
              Added a test to ensure queryCommandValue('underline') and queryCommandValue('strikeThrough')
              correctly incorporates the typing style.
      
              * editing/execCommand/query-text-decoration-with-typing-style-expected.txt: Added.
              * editing/execCommand/query-text-decoration-with-typing-style.html: Added.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68059 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      f3008f6d
  32. 14 Sep, 2010 1 commit
    • commit-queue@webkit.org's avatar
      2010-09-14 Jia Pu <jpu@apple.com> · 53ca92bb
      commit-queue@webkit.org authored
              Reviewed by Dan Bernstein.
      
              Only intercept ESC key press when autocorrection UI is visible.
              https://bugs.webkit.org/show_bug.cgi?id=45071
      
              Only intercept ESC key when autocorrection panel is shown. Otherwise pressing
              ESC will cancel current loading like usual.
      
              * editing/Editor.cpp:
              (WebCore::Editor::isShowingCorrectionPanel): Query editor client whether autocorrection
                panel is shown.
      
              * editing/Editor.h: Added declaration of isShowingCorrectionPanel().
      
              * editing/EditorCommand.cpp:
              (WebCore::supportedDismissCorrectionPanel): Only support executeCancelOperation()
                when autocorrection panel is shown.
              (WebCore::createCommandMap): Replaced isSupported function pointer for
                executeCancelOperation() command with supportedDismissCorrectionPanel().
      
              * loader/EmptyClients.h:
              (WebCore::EmptyEditorClient::isShowingCorrectionPanel): Dummy implementation of
                new member method declared in base class.
      
              * page/EditorClient.h: Declared new member method isShowingCorrectionPanel().
      2010-09-14  Jia Pu  <jpu@apple.com>
      
              Reviewed by Dan Bernstein.
      
              Only intercept ESC key press when autocorrection UI is visible.
              https://bugs.webkit.org/show_bug.cgi?id=45071
      
              * WebCoreSupport/WebEditorClient.h: Added declaration of isShowingCorrectionPanel(),
                which provides an inteface to query whether autocorrection panel is shown.
      
              * WebCoreSupport/WebEditorClient.mm:
              (WebEditorClient::WebEditorClient): Defined a constant, InvalidCorrectionPanelTag,
                for invalid correction panel tag. Replaced -1 with this constant.
              (WebEditorClient::dismissCorrectionPanel): Ditto
              (WebEditorClient::isShowingCorrectionPanel): Query whether autocorrection panel is shown.
      2010-09-14  Jia Pu  <jpu@apple.com>
      
              Reviewed by Dan Bernstein.
      
              Only intercept ESC key press when autocorrection UI is visible.
              https://bugs.webkit.org/show_bug.cgi?id=45071
      
              * WebProcess/WebCoreSupport/WebEditorClient.cpp:
              (WebKit::WebEditorClient::isShowingCorrectionPanel): Dummy implementation.
      
              * WebProcess/WebCoreSupport/WebEditorClient.h: Adopt new method delcared in base class.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@67534 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      53ca92bb