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. 04 May, 2011 1 commit
    • joepeck@webkit.org's avatar
      2011-05-04 Joseph Pecoraro <joepeck@webkit.org> · 4df1260f
      joepeck@webkit.org authored
              Reviewed by Darin Adler.
      
              Unable to Paste After Deleting Text from Input due to -webkit-user-select
              https://bugs.webkit.org/show_bug.cgi?id=60219
      
              * editing/pasteboard/paste-placeholder-input-expected.txt: Added.
              * editing/pasteboard/paste-placeholder-input.html: Added.
      
      2011-05-04  Joseph Pecoraro  <joepeck@webkit.org>
      
              Reviewed by Darin Adler.
      
              Unable to Paste After Deleting Text from Input due to -webkit-user-select
              https://bugs.webkit.org/show_bug.cgi?id=60219
      
              When deleting all the text inside the input a placeholder <br>
              element was inserted for the selection point. However, when
              pasting, the test run computes the -webkit-user-select for the
              <br> element, instead of what would be the text inside the
              <input> and incorrectly disallows selection and prevented
              the paste.
      
              Test: editing/pasteboard/paste-placeholder-input.html
      
              * editing/ReplaceSelectionCommand.cpp:
              (WebCore::ReplacementFragment::insertFragmentForTestRendering): skip
              <br> elements above us as those are likely placeholder elements.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@85818 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      4df1260f
  4. 26 Apr, 2011 1 commit
    • leviw@chromium.org's avatar
      2011-04-25 Levi Weintraub <leviw@chromium.org> · 966db6f2
      leviw@chromium.org authored
              Reviewed by Ryosuke Niwa.
      
              REGRESSION: a character appears after tab span when typing immediately before the tab span
              https://bugs.webkit.org/show_bug.cgi?id=58132
      
              Correcting the order of operations we use to avoid inserting into invalid positions in
              ReplaceSelectionCommand to avoid inserting into tab-spans.
      
              Test: editing/pasteboard/paste-before-tab-span.html
      
              * editing/ReplaceSelectionCommand.cpp:
              (WebCore::ReplaceSelectionCommand::doApply): Moving positionOutsideTabSpan to after
              positionAvoidingPrecedingNodes, since that function could once again put our position
              inside a tab span.
      2011-04-25  Levi Weintraub  <leviw@chromium.org>
      
              Reviewed by Ryosuke Niwa.
      
              REGRESSION: a character appears after tab span when typing immediately before the tab span
              https://bugs.webkit.org/show_bug.cgi?id=58132
      
              Correcting the order of operations we use to avoid inserting into invalid positions in
              ReplaceSelectionCommand to avoid inserting into tab-spans.
      
              * editing/pasteboard/paste-before-tab-span-expected.txt: Added.
              * editing/pasteboard/paste-before-tab-span.html: Added.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@84885 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      966db6f2
  5. 08 Apr, 2011 1 commit
    • rniwa@webkit.org's avatar
      2011-04-08 Ryosuke Niwa <rniwa@webkit.org> · 8073bff2
      rniwa@webkit.org authored
              Reviewed by Tony Chang, Darin Adler, and Enrica Casucci.
      
              REGRESSION(r81887): Crash in SplitElement
              https://bugs.webkit.org/show_bug.cgi?id=57743
      
              The crash was caused by ReplaceSelectionCommand::doApply's calling splitElement with computeNodeAfterPosition
              even when the position was after the last node in it container. Since all we are doing here is to splitting tree
              up until the highest ancestor with isInlineNodeWithStyle, replaced the while loop by calls to splitTreeToNode
              and highestEnclosingNodeOfType.
      
              Also fixed a bug in splitTreeToNode not to check the difference in visible position when splitting the ancestor,
              which would have introduced unnecessary nodes when splitting tree and a bug in highestEnclosingNodeOfType that
              it incorrectly called deprecatedNode instead of containerNode.
      
              Test: editing/inserting/insert-images-in-pre-x-crash.html
      
              * editing/CompositeEditCommand.cpp:
              (WebCore::CompositeEditCommand::splitTreeToNode):
              * editing/ReplaceSelectionCommand.cpp:
              (WebCore::ReplaceSelectionCommand::doApply):
              * editing/htmlediting.cpp:
              (WebCore::highestEnclosingNodeOfType):
      2011-04-08  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Tony Chang, Darin Adler, and Enrica Casucci.
      
              REGRESSION(r81887): Crash in SplitElement
              https://bugs.webkit.org/show_bug.cgi?id=57743
      
              Added a regression test for a crash in ReplaceSelectionCommand.
      
              * editing/inserting/insert-images-in-pre-x-crash-expected.txt: Added.
              * editing/inserting/insert-images-in-pre-x-crash.html: Added.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@83322 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      8073bff2
  6. 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
  7. 24 Mar, 2011 1 commit
    • enrica@apple.com's avatar
      Source/WebCore: Repeated copy and paste-in-place operation results in increasingly verbose HTML. · f8d20922
      enrica@apple.com authored
      <rdar://problem/8690506>
      https://bugs.webkit.org/show_bug.cgi?id=56874
              
      Reviewed by Darin Adler.
      
      When we calculate the style to apply at the insertion point we compare the initial
      style at the insertion point against the style calculated at the span we wrap the
      copied markup fragment with. We could end up with a series of unnecessary spans
      to remove the initial style that simply grow our markup.
      The consists in moving the insertion point outside any inline element that could
      affect the fragment being inserted when we are not pasting and matching the style.
      
      Test: editing/pasteboard/paste-text-with-style.html
      
      * editing/ReplaceSelectionCommand.cpp:
      (WebCore::isInlineNodeWithStyle): Added.
      (WebCore::ReplaceSelectionCommand::doApply): Added logic to change the insertion
      point according to the new rules.
      
      LayoutTests: Repeated copy and paste-in-place operation results in increasingly verbose HTML.
      <rdar://problem/8690506>
      https://bugs.webkit.org/show_bug.cgi?id=56874
      
      Reviewed by Darin Adler.
      
      * editing/pasteboard/paste-text-with-style-expected.txt: Added.
      * editing/pasteboard/paste-text-with-style.html: Added.
      The following are new results for existing tests that now produce
      a different markup.
      * platform/mac/editing/pasteboard/5065605-expected.txt:
      * platform/mac/editing/pasteboard/display-block-on-spans-expected.txt:
      * platform/mac/editing/pasteboard/paste-text-011-expected.txt:
      * platform/mac/editing/pasteboard/paste-text-at-tabspan-001-expected.txt:
      * platform/mac/editing/pasteboard/paste-text-at-tabspan-002-expected.txt:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@81887 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      f8d20922
  8. 17 Mar, 2011 1 commit
    • rniwa@webkit.org's avatar
      2011-03-17 Ryosuke Niwa <rniwa@webkit.org> · b369662c
      rniwa@webkit.org authored
              Reviewed by Adele Peterson and Enrica Casucci.
      
              Assert that editing does not ignore position's anchorNode if position is an offset in anchor
              https://bugs.webkit.org/show_bug.cgi?id=56027
      
              Debug build fix.
      
              * dom/Element.cpp:
              (WebCore::Element::updateFocusAppearance): "this" can be an input element so can't always instantiate
              a position inside the node. Call firstPositionInOrBeforeNode instead.
              * editing/ReplaceSelectionCommand.cpp:
              (WebCore::positionAvoidingPrecedingNodes): Exit early when a node's content is ignored by editing instead
              of just when the node is br.
              * editing/htmlediting.cpp:
              (WebCore::lastEditablePositionBeforePositionInRoot): The shadow ancestor node is usually an input element
              so don't instantiate a position inside it. Call firstPositionInOrBeforeNode instead.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@81384 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      b369662c
  9. 16 Mar, 2011 1 commit
    • rniwa@webkit.org's avatar
      2011-03-16 Ryosuke Niwa <rniwa@webkit.org> · 24bd1d35
      rniwa@webkit.org authored
              Reviewed by Tony Chang.
      
              Get rid of nearestMailBlockquote
              https://bugs.webkit.org/show_bug.cgi?id=56439
      
              Removed nearestMailBlockquote and replaced the calls to the function by calls
              to enclosingNodeOfType and highestEnclosingNodeOfType.
              
              Also fixed a bug in BreakBlockquoteCommand and DeleteSelectionCommand not to
              respect editing boundaries.  Added a test for the former command.
      
              Test: editing/execCommand/break-non-editable-blockquote.html
      
              * editing/BreakBlockquoteCommand.cpp:
              (WebCore::BreakBlockquoteCommand::doApply): No longer crosses editing boundary
              when looking for a Mail blockquote.
              * editing/DeleteSelectionCommand.cpp:
              (WebCore::DeleteSelectionCommand::saveTypingStyleState): Ditto.
              (WebCore::DeleteSelectionCommand::calculateTypingStyleAfterDelete):
              * editing/ReplaceSelectionCommand.cpp:
              (WebCore::hasMatchingQuoteLevel):
              (WebCore::handleStyleSpansBeforeInsertion):
              (WebCore::ReplaceSelectionCommand::handleStyleSpans):
              (WebCore::ReplaceSelectionCommand::doApply):
              * editing/htmlediting.cpp:
              (WebCore::enclosingNodeOfType): Check rule upfront to improve the performance.
              (WebCore::highestEnclosingNodeOfType): Ditto; also add the missing check.
              * editing/htmlediting.h:
              (WebCore::firstPositionInOrBeforeNode): Added a null pointer check.
              (WebCore::lastPositionInOrAfterNode): Ditto.
              * editing/markup.cpp:
              (WebCore::highestAncestorToWrapMarkup):
              (WebCore::createMarkup):
      2011-03-16  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Tony Chang.
      
              Get rid of nearestMailBlockquote
              https://bugs.webkit.org/show_bug.cgi?id=56439
      
              Added a test to ensure WebKi doesn't crash when inserting newline in quoted contents,
              which is enclosed by a non-editable blockquote.
      
              * editing/execCommand/break-non-editable-blockquote-expected.txt: Added.
              * editing/execCommand/break-non-editable-blockquote.html: Added.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@81295 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      24bd1d35
  10. 15 Mar, 2011 1 commit
    • leviw@chromium.org's avatar
      2011-03-08 Levi Weintraub <leviw@chromium.org> · 1f95362b
      leviw@chromium.org authored
              Reviewed by Ryosuke Niwa.
      
              Get rid of firstDeepEditingPositionForNode and lastDeepEditingPositionForNode
              https://bugs.webkit.org/show_bug.cgi?id=52642
      
              Replacing calls to first/lastDeepEditingPositionForNode with calls to their analogous
              functions that create new positions. Also fixing various parts of editing code that
              incorrectly handled the new positions now being created.
      
              No new tests as this is refactoring/cleanup.
      
              * accessibility/AccessibilityRenderObject.cpp:
              (WebCore::AccessibilityRenderObject::visiblePositionRange):
              * dom/Position.cpp:
              (WebCore::Position::parentAnchoredEquivalent):
              (WebCore::Position::previous):
              (WebCore::Position::next):
              (WebCore::Position::atFirstEditingPositionForNode):
              (WebCore::Position::atLastEditingPositionForNode):
              (WebCore::Position::upstream):
              (WebCore::Position::isCandidate):
              (WebCore::Position::getInlineBoxAndOffset):
              * dom/Position.h:
              (WebCore::operator==):
              * dom/PositionIterator.cpp:
              (WebCore::PositionIterator::operator Position):
              * editing/ApplyBlockElementCommand.cpp:
              (WebCore::ApplyBlockElementCommand::rangeForParagraphSplittingTextNodesIfNeeded):
              * editing/CompositeEditCommand.cpp:
              (WebCore::CompositeEditCommand::positionAvoidingSpecialElementBoundary):
              * editing/DeleteSelectionCommand.cpp:
              (WebCore::isTableCellEmpty):
              (WebCore::DeleteSelectionCommand::removeNode):
              * editing/InsertLineBreakCommand.cpp:
              (WebCore::InsertLineBreakCommand::doApply):
              * editing/InsertListCommand.cpp:
              (WebCore::InsertListCommand::unlistifyParagraph):
              * editing/ReplaceSelectionCommand.cpp:
              (WebCore::ReplaceSelectionCommand::positionAtEndOfInsertedContent):
              * editing/TypingCommand.cpp:
              (WebCore::TypingCommand::forwardDeleteKeyPressed):
              * editing/VisibleSelection.cpp:
              (WebCore::VisibleSelection::selectionFromContentsOfNode):
              (WebCore::VisibleSelection::adjustSelectionToAvoidCrossingEditingBoundaries):
              * editing/htmlediting.cpp:
              (WebCore::firstEditablePositionAfterPositionInRoot):
              (WebCore::lastEditablePositionBeforePositionInRoot):
              (WebCore::enclosingEmptyListItem):
              * editing/htmlediting.h:
              * editing/visible_units.cpp:
              (WebCore::startOfParagraph):
              (WebCore::endOfParagraph):
              (WebCore::startOfEditableContent):
              (WebCore::endOfEditableContent):
              * rendering/RenderBox.cpp:
              (WebCore::RenderBox::positionForPoint):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@81165 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      1f95362b
  11. 10 Mar, 2011 1 commit
    • rniwa@webkit.org's avatar
      2011-03-10 Ryosuke Niwa <rniwa@webkit.org> · ea702bae
      rniwa@webkit.org authored
              Reviewed by Tony Chang.
      
              VisiblePosition's next and previous should take an enum instead of a boolean
              https://bugs.webkit.org/show_bug.cgi?id=56135
      
              SelectionController::isAll now takes EditingBoundaryCrossingRule instead of
              StayInEditableContent.
      
              * WebView/WebView.mm:
              (-[WebView _selectionIsAll]):
      2011-03-10  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Tony Chang.
      
              VisiblePosition's next and previous should take an enum instead of a boolean
              https://bugs.webkit.org/show_bug.cgi?id=56135
      
              Changed the argument type of VisiblePosition::next and VisiblePosition::previous
              from bool to EditingBoundaryCrossingRule. Also got rid of StayInEditableContent enum
              in VisibleSelection and replaced it by EditingBoundaryCrossingRule because the enum
              was only used in VisiblePosition::isAll and subsequently in SelectionController::isAll
              to call VisiblePosition::next and VisiblePosition::previous.
      
              * WebCore.exp.in:
              * dom/Position.cpp:
              (WebCore::Position::trailingWhitespacePosition):
              * editing/ApplyBlockElementCommand.cpp:
              (WebCore::ApplyBlockElementCommand::doApply):
              * editing/CompositeEditCommand.cpp:
              (WebCore::CompositeEditCommand::breakOutOfEmptyMailBlockquotedParagraph):
              * editing/InsertListCommand.cpp:
              (WebCore::InsertListCommand::doApply):
              (WebCore::InsertListCommand::listifyParagraph):
              * editing/ReplaceSelectionCommand.cpp:
              (WebCore::ReplaceSelectionCommand::shouldMergeStart):
              (WebCore::ReplaceSelectionCommand::shouldMergeEnd):
              (WebCore::ReplaceSelectionCommand::doApply):
              * editing/SelectionController.cpp:
              (WebCore::SelectionController::modifyExtendingRight):
              (WebCore::SelectionController::modifyExtendingForward):
              (WebCore::SelectionController::modifyMovingForward):
              (WebCore::SelectionController::modifyExtendingLeft):
              (WebCore::SelectionController::modifyExtendingBackward):
              (WebCore::SelectionController::modifyMovingBackward):
              * editing/SelectionController.h:
              (WebCore::SelectionController::isAll):
              * editing/TypingCommand.cpp:
              (WebCore::TypingCommand::deleteKeyPressed):
              (WebCore::TypingCommand::forwardDeleteKeyPressed):
              * editing/VisiblePosition.cpp:
              (WebCore::VisiblePosition::next):
              (WebCore::VisiblePosition::previous):
              * editing/VisiblePosition.h:
              * editing/VisibleSelection.cpp:
              (WebCore::VisibleSelection::isAll):
              (WebCore::VisibleSelection::setStartAndEndFromBaseAndExtentRespectingGranularity):
              * editing/VisibleSelection.h:
              * editing/htmlediting.cpp:
              (WebCore::selectionForParagraphIteration):
              * editing/visible_units.cpp:
              (WebCore::startOfNextParagraph):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@80752 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      ea702bae
  12. 01 Mar, 2011 1 commit
    • leviw@chromium.org's avatar
      2011-03-01 Levi Weintraub <leviw@chromium.org> · ca40abff
      leviw@chromium.org authored
              Reviewed by Ryosuke Niwa.
      
              Stop instantiating legacy editing Positions in VisiblePosition
              https://bugs.webkit.org/show_bug.cgi?id=52919
      
              Changing usage of legacy VisiblePosition constructor. Since we were dealing
              with positions from DOM Ranges, we're guaranteed a parent-anchored position.
      
              * WebView/WebFrame.mm:
              (-[WebFrame _caretRectAtPosition:affinity:]):
              * WebView/WebFrameInternal.h:
              * WebView/WebTextCompletionController.mm:
              (-[WebTextCompletionController doCompletion]):
      2011-03-01  Levi Weintraub  <leviw@chromium.org>
      
              Reviewed by Ryosuke Niwa.
      
              Stop instantiating legacy editing Positions in VisiblePosition
              https://bugs.webkit.org/show_bug.cgi?id=52919
      
              Changing VisiblePosition completely away from legacy positions.
      
              No new tests since this is functionaly equivalent.
      
              * WebCore.exp.in: Removing the legacy VisiblePosition constructor and
              adding the PositionIsOffsetInAnchor symbol. If we must create VisiblePositions
              outside of WebCore, they should be parent anchored.
              * accessibility/AXObjectCache.cpp:
              (WebCore::AXObjectCache::visiblePositionForTextMarkerData):
              * accessibility/AccessibilityObject.cpp:
              (WebCore::startOfStyleRange):
              (WebCore::endOfStyleRange):
              * accessibility/AccessibilityRenderObject.cpp:
              (WebCore::AccessibilityRenderObject::visiblePositionForIndex):
              * accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:
              (objectAndOffsetUnignored):
              * dom/Position.cpp:
              (WebCore::Position::document): Added this inline function to avoid the necessity
              of calling anchorNode to assure a document from a Position.
              (WebCore::Position::upstream): Fixed to correctly respect PositionIsAfterAnchor
              (WebCore::Position::downstream): ditto
              * dom/Range.cpp:
              (WebCore::Range::editingStartPosition):
              * editing/Editor.cpp:
              (WebCore::Editor::canDeleteRange):
              * editing/ReplaceSelectionCommand.cpp:
              (WebCore::ReplaceSelectionCommand::doApply):
              * editing/SelectionController.cpp:
              (WebCore::SelectionController::selectFrameElementInParentIfFullySelected):
              (WebCore::SelectionController::setSelectedRange):
              * editing/TextIterator.cpp:
              (WebCore::TextIterator::shouldRepresentNodeOffsetZero):
              * editing/TypingCommand.cpp:
              (WebCore::TypingCommand::deleteKeyPressed):
              * editing/VisiblePosition.cpp:
              (WebCore::VisiblePosition::leftVisuallyDistinctCandidate):
              (WebCore::VisiblePosition::rightVisuallyDistinctCandidate):
              (WebCore::VisiblePosition::canonicalPosition):
              (WebCore::VisiblePosition::characterAfter):
              (WebCore::VisiblePosition::localCaretRect):
              (WebCore::makeRange):
              (WebCore::startVisiblePosition):
              (WebCore::endVisiblePosition):
              (WebCore::setStart):
              (WebCore::setEnd):
              (WebCore::isFirstVisiblePositionInNode):
              (WebCore::isLastVisiblePositionInNode):
              * editing/VisiblePosition.h:
              (WebCore::VisiblePosition::VisiblePosition):
              * editing/htmlediting.cpp:
              (WebCore::firstInSpecialElement):
              (WebCore::lastInSpecialElement):
              (WebCore::visiblePositionBeforeNode):
              (WebCore::visiblePositionAfterNode):
              * editing/visible_units.cpp:
              (WebCore::startPositionForLine):
              (WebCore::endPositionForLine):
              (WebCore::previousLinePosition):
              (WebCore::nextLinePosition):
              (WebCore::startOfParagraph):
              (WebCore::endOfParagraph):
              (WebCore::endOfBlock):
              (WebCore::startOfDocument):
              (WebCore::endOfDocument):
              (WebCore::logicalStartPositionForLine):
              (WebCore::logicalEndPositionForLine):
              * page/DOMSelection.cpp:
              (WebCore::DOMSelection::collapse):
              (WebCore::DOMSelection::setBaseAndExtent):
              (WebCore::DOMSelection::setPosition):
              (WebCore::DOMSelection::extend):
              * page/EventHandler.cpp:
              (WebCore::EventHandler::handleMousePressEventSingleClick):
              * rendering/RenderObject.cpp:
              (WebCore::RenderObject::createVisiblePosition):
              * rendering/RenderTextControl.cpp:
              (WebCore::RenderTextControl::visiblePositionForIndex):
              * svg/SVGTextContentElement.cpp:
              (WebCore::SVGTextContentElement::selectSubString):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@80059 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      ca40abff
  13. 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
  14. 21 Feb, 2011 1 commit
    • rniwa@webkit.org's avatar
      2011-02-17 Ryosuke Niwa <rniwa@webkit.org> · 62b16970
      rniwa@webkit.org authored
              Reviewed by Kent Tamura.
      
              Rename Position::node() to Position::deprecatedNode()
              https://bugs.webkit.org/show_bug.cgi?id=54622
      
              Done the rename. All calls to node() are replaced by calls to deprecatedNode().
      
              * src/WebViewImpl.cpp:
              (WebKit::WebViewImpl::setComposition): Check the nullity of startContainer() instead of startPosition()->node().
              (WebKit::WebViewImpl::confirmComposition): Ditto.
              (WebKit::WebViewImpl::textInputType):
              (WebKit::WebViewImpl::caretOrSelectionBounds):
      2011-02-17  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Kent Tamura.
      
              Rename Position::node() to Position::deprecatedNode()
              https://bugs.webkit.org/show_bug.cgi?id=54622
      
              Replaced the call to node() by a call to containerNode() because the returned node is
              used to determine whether or not the selected contents are editable and such a check
              must be done against the container node.
      
              * WebCoreSupport/EditorClientQt.cpp:
              (WebCore::EditorClientQt::handleKeyboardEvent):
      2011-02-17  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Kent Tamura.
      
              Rename Position::node() to Position::deprecatedNode()
              https://bugs.webkit.org/show_bug.cgi?id=54622
      
              Done the rename. All calls to node() are replaced by calls to deprecatedNode().
      
              * webkit/webkitwebview.cpp:
              (webkit_web_view_popup_menu_handler):
      2011-02-17  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Kent Tamura.
      
              Rename Position::node() to Position::deprecatedNode()
              https://bugs.webkit.org/show_bug.cgi?id=54622
      
              * WebView/WebFrame.mm:
              (-[WebFrame _smartDeleteRangeForProposedRange:]):
      2011-02-17  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Kent Tamura.
      
              Rename Position::node() to Position::deprecatedNode()
              https://bugs.webkit.org/show_bug.cgi?id=54622
      
              Replaced the call to node() by a call to containerNode() because the returned node is
              used to determine whether or not the selected contents are editable and such a check
              must be done against the container node.
      
              * WebCoreSupport/EditorClientHaiku.cpp:
              (WebCore::EditorClientHaiku::handleKeyboardEvent):
      2011-02-17  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Kent Tamura.
      
              Rename Position::node() to Position::deprecatedNode()
              https://bugs.webkit.org/show_bug.cgi?id=54622
      
              Done the rename. All calls to node() are replaced by calls to deprecatedNode() except when
              calls were of the form node()->document() and node()->inDocument() in which case they were
              replaced by anchorNode()->document() and anchorNode()->inDocument() respectively.
      
              * WebCore.exp.in: Added Position::containerNode.
      
              The rest abbreviated for simplicity. Please see svn log.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@79196 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      62b16970
  15. 15 Feb, 2011 1 commit
    • 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
  16. 09 Feb, 2011 1 commit
    • yael.aharon@nokia.com's avatar
      2011-02-09 Yael Aharon <yael.aharon@nokia.com> · 3be82c17
      yael.aharon@nokia.com authored
              Reviewed by Darin Adler.
      
              Replace static_cast<HTMLElement*> with toHTMLElement
              https://bugs.webkit.org/show_bug.cgi?id=54117
      
              No new tests since no new functionality was introduced.
      
              * accessibility/AccessibilityListBox.cpp:
              (WebCore::AccessibilityListBox::addChildren):
              * accessibility/AccessibilityMenuListPopup.cpp:
              (WebCore::AccessibilityMenuListPopup::addChildren):
              * accessibility/AccessibilityRenderObject.cpp:
              (WebCore::accessibleNameForNode):
              (WebCore::AccessibilityRenderObject::accessibilityDescription):
              * accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:
              (webkit_accessible_get_name):
              (webkit_accessible_get_description):
              * bindings/gobject/WebKitDOMBinding.cpp:
              (WebKit::createWrapper):
              (WebKit::kit):
              * bindings/js/JSElementCustom.cpp:
              (WebCore::toJSNewlyCreated):
              * bindings/js/JSHTMLFrameSetElementCustom.cpp:
              (WebCore::JSHTMLFrameSetElement::nameGetter):
              * bindings/js/JSNodeCustom.cpp:
              (WebCore::createWrapperInline):
              * bindings/v8/custom/V8ElementCustom.cpp:
              (WebCore::toV8):
              * dom/Document.cpp:
              (WebCore::Document::body):
              * dom/Element.cpp:
              (WebCore::Element::deprecatedCreateContextualFragment):
              * dom/Range.cpp:
              (WebCore::Range::createContextualFragment):
              * editing/ApplyStyleCommand.cpp:
              (WebCore::ApplyStyleCommand::applyBlockStyle):
              (WebCore::ApplyStyleCommand::applyRelativeFontStyleChange):
              (WebCore::ApplyStyleCommand::splitAncestorsWithUnicodeBidi):
              (WebCore::ApplyStyleCommand::applyInlineStyleToNodeRange):
              (WebCore::ApplyStyleCommand::removeStyleFromRunBeforeApplyingStyle):
              (WebCore::ApplyStyleCommand::highestAncestorWithConflictingInlineStyle):
              (WebCore::ApplyStyleCommand::applyInlineStyleToPushDown):
              (WebCore::ApplyStyleCommand::pushDownInlineStyleAroundNode):
              (WebCore::ApplyStyleCommand::removeInlineStyle):
              (WebCore::ApplyStyleCommand::shouldSplitTextElement):
              (WebCore::ApplyStyleCommand::addInlineStyleIfNeeded):
              * editing/DeleteButtonController.cpp:
              (WebCore::enclosingDeletableElement):
              (WebCore::DeleteButtonController::show):
              * editing/Editor.cpp:
              (WebCore::Editor::setBaseWritingDirection):
              * editing/InsertListCommand.cpp:
              (WebCore::InsertListCommand::mergeWithNeighboringLists):
              * editing/ReplaceSelectionCommand.cpp:
              (WebCore::ReplaceSelectionCommand::negateStyleRulesThatAffectAppearance):
              (WebCore::ReplaceSelectionCommand::handleStyleSpans):
              (WebCore::ReplaceSelectionCommand::copyStyleToChildren):
              * editing/SelectionController.cpp:
              (WebCore::scanForForm):
              (WebCore::SelectionController::currentForm):
              * editing/htmlediting.cpp:
              (WebCore::enclosingList):
              (WebCore::enclosingListChild):
              (WebCore::embeddedSublist):
              (WebCore::appendedSublist):
              * editing/markup.cpp:
              (WebCore::StyledMarkupAccumulator::appendElement):
              * html/HTMLCollection.cpp:
              (WebCore::HTMLCollection::checkForNameMatch):
              (WebCore::HTMLCollection::updateNameCache):
              * html/HTMLElement.cpp:
              (WebCore::HTMLElement::setOuterHTML):
              (WebCore::HTMLElement::shadowAncestorOwnerForm):
              * html/HTMLFormElement.cpp:
              (WebCore::HTMLFormElement::formElementIndex):
              * html/HTMLSelectElement.cpp:
              (WebCore::HTMLSelectElement::setOption):
              (WebCore::HTMLSelectElement::setLength):
              * inspector/InspectorDOMAgent.cpp:
              (WebCore::InspectorDOMAgent::getOuterHTML):
              (WebCore::InspectorDOMAgent::setOuterHTML):
              * page/EventHandler.cpp:
              (WebCore::EventHandler::handleMouseMoveEvent):
              * rendering/RenderMeter.cpp:
              (WebCore::RenderMeter::createPart):
              * rendering/RenderTextControl.cpp:
              (WebCore::RenderTextControl::createSubtreeIfNeeded):
              * rendering/RenderTextControlSingleLine.cpp:
              (WebCore::RenderTextControlSingleLine::createSubtreeIfNeeded):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@78150 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      3be82c17
  17. 08 Feb, 2011 2 commits
    • leviw@chromium.org's avatar
      2011-02-08 Sheriff Bot <webkit.review.bot@gmail.com> · 0f9d6132
      leviw@chromium.org authored
              Unreviewed, rolling out r77980.
              http://trac.webkit.org/changeset/77980
              https://bugs.webkit.org/show_bug.cgi?id=54043
      
              "Crashes on Windows and Linux..." (Requested by leviw on
              #webkit).
      
              * WebView/WebFrame.mm:
              (-[WebFrame _caretRectAtNode:offset:affinity:]):
              * WebView/WebFrameInternal.h:
              * WebView/WebTextCompletionController.mm:
              (-[WebTextCompletionController doCompletion]):
      2011-02-08  Sheriff Bot  <webkit.review.bot@gmail.com>
      
              Unreviewed, rolling out r77980.
              http://trac.webkit.org/changeset/77980
              https://bugs.webkit.org/show_bug.cgi?id=54043
      
              "Crashes on Windows and Linux..." (Requested by leviw on
              #webkit).
      
              * WebCore.exp.in:
              * accessibility/AXObjectCache.cpp:
              (WebCore::AXObjectCache::visiblePositionForTextMarkerData):
              * accessibility/AccessibilityObject.cpp:
              (WebCore::startOfStyleRange):
              (WebCore::endOfStyleRange):
              * accessibility/AccessibilityRenderObject.cpp:
              (WebCore::AccessibilityRenderObject::visiblePositionForIndex):
              * accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:
              (objectAndOffsetUnignored):
              * dom/Position.cpp:
              (WebCore::Position::upstream):
              (WebCore::Position::downstream):
              * dom/Range.cpp:
              (WebCore::Range::editingStartPosition):
              * editing/Editor.cpp:
              (WebCore::Editor::canDeleteRange):
              * editing/ReplaceSelectionCommand.cpp:
              (WebCore::ReplaceSelectionCommand::doApply):
              * editing/SelectionController.cpp:
              (WebCore::SelectionController::selectFrameElementInParentIfFullySelected):
              (WebCore::SelectionController::setSelectedRange):
              * editing/TextIterator.cpp:
              (WebCore::TextIterator::shouldRepresentNodeOffsetZero):
              * editing/TypingCommand.cpp:
              (WebCore::TypingCommand::deleteKeyPressed):
              * editing/VisiblePosition.cpp:
              (WebCore::VisiblePosition::VisiblePosition):
              (WebCore::VisiblePosition::leftVisuallyDistinctCandidate):
              (WebCore::VisiblePosition::rightVisuallyDistinctCandidate):
              (WebCore::VisiblePosition::canonicalPosition):
              (WebCore::VisiblePosition::characterAfter):
              (WebCore::VisiblePosition::localCaretRect):
              (WebCore::makeRange):
              (WebCore::startVisiblePosition):
              (WebCore::endVisiblePosition):
              (WebCore::setStart):
              (WebCore::setEnd):
              (WebCore::isFirstVisiblePositionInNode):
              (WebCore::isLastVisiblePositionInNode):
              * editing/VisiblePosition.h:
              * editing/htmlediting.cpp:
              (WebCore::firstInSpecialElement):
              (WebCore::lastInSpecialElement):
              (WebCore::visiblePositionBeforeNode):
              (WebCore::visiblePositionAfterNode):
              * editing/visible_units.cpp:
              (WebCore::startPositionForLine):
              (WebCore::endPositionForLine):
              (WebCore::previousLinePosition):
              (WebCore::nextLinePosition):
              (WebCore::startOfParagraph):
              (WebCore::endOfParagraph):
              (WebCore::endOfBlock):
              (WebCore::startOfDocument):
              (WebCore::endOfDocument):
              (WebCore::logicalStartPositionForLine):
              (WebCore::logicalEndPositionForLine):
              * page/DOMSelection.cpp:
              (WebCore::DOMSelection::collapse):
              (WebCore::DOMSelection::setBaseAndExtent):
              (WebCore::DOMSelection::setPosition):
              (WebCore::DOMSelection::extend):
              * page/EventHandler.cpp:
              (WebCore::EventHandler::handleMousePressEventSingleClick):
              * rendering/RenderObject.cpp:
              (WebCore::RenderObject::createVisiblePosition):
              * rendering/RenderTextControl.cpp:
              (WebCore::RenderTextControl::visiblePositionForIndex):
              * svg/SVGTextContentElement.cpp:
              (WebCore::SVGTextContentElement::selectSubString):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@77997 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      0f9d6132
    • leviw@chromium.org's avatar
      2011-02-08 Levi Weintraub <leviw@chromium.org> · ddcb501f
      leviw@chromium.org authored
              Reviewed by Ryosuke Niwa.
      
              Stop instantiating legacy editing Positions in VisiblePosition
              https://bugs.webkit.org/show_bug.cgi?id=52919
      
              Changing usage of legacy VisiblePosition constructor. Since we were dealing
              with positions from DOM Ranges, we're guaranteed a parent-anchored position.
      
              * WebView/WebFrame.mm:
              (-[WebFrame _caretRectAtPosition:affinity:]):
              * WebView/WebFrameInternal.h:
              * WebView/WebTextCompletionController.mm:
              (-[WebTextCompletionController doCompletion]):
      2011-02-08  Levi Weintraub  <leviw@chromium.org>
      
              Reviewed by Ryosuke Niwa.
      
              Stop instantiating legacy editing Positions in VisiblePosition
              https://bugs.webkit.org/show_bug.cgi?id=52919
      
              Changing VisiblePosition completely away from legacy positions.
      
              No new tests since this is functionaly equivalent.
      
              * WebCore.exp.in: Removing the legacy VisiblePosition constructor and
              adding the PositionIsOffsetInAnchor symbol. If we must create VisiblePositions
              outside of WebCore, they should be parent anchored.
              * accessibility/AXObjectCache.cpp:
              (WebCore::AXObjectCache::visiblePositionForTextMarkerData):
              * accessibility/AccessibilityObject.cpp:
              (WebCore::startOfStyleRange):
              (WebCore::endOfStyleRange):
              * accessibility/AccessibilityRenderObject.cpp:
              (WebCore::AccessibilityRenderObject::visiblePositionForIndex):
              * accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:
              (objectAndOffsetUnignored):
              * dom/Position.cpp:
              (WebCore::Position::upstream): Fixed to correctly respect PositionIsAfterAnchor
              (WebCore::Position::downstream): ditto
              * dom/Range.cpp:
              (WebCore::Range::editingStartPosition):
              * editing/Editor.cpp:
              (WebCore::Editor::canDeleteRange):
              * editing/ReplaceSelectionCommand.cpp:
              (WebCore::ReplaceSelectionCommand::doApply):
              * editing/SelectionController.cpp:
              (WebCore::SelectionController::selectFrameElementInParentIfFullySelected):
              (WebCore::SelectionController::setSelectedRange):
              * editing/TextIterator.cpp:
              (WebCore::TextIterator::shouldRepresentNodeOffsetZero):
              * editing/TypingCommand.cpp:
              (WebCore::TypingCommand::deleteKeyPressed):
              * editing/VisiblePosition.cpp:
              (WebCore::VisiblePosition::leftVisuallyDistinctCandidate):
              (WebCore::VisiblePosition::rightVisuallyDistinctCandidate):
              (WebCore::VisiblePosition::canonicalPosition):
              (WebCore::VisiblePosition::characterAfter):
              (WebCore::VisiblePosition::localCaretRect):
              (WebCore::makeRange):
              (WebCore::startVisiblePosition):
              (WebCore::endVisiblePosition):
              (WebCore::setStart):
              (WebCore::setEnd):
              (WebCore::isFirstVisiblePositionInNode):
              (WebCore::isLastVisiblePositionInNode):
              * editing/VisiblePosition.h:
              (WebCore::VisiblePosition::VisiblePosition):
              * editing/htmlediting.cpp:
              (WebCore::firstInSpecialElement):
              (WebCore::lastInSpecialElement):
              (WebCore::visiblePositionBeforeNode):
              (WebCore::visiblePositionAfterNode):
              * editing/visible_units.cpp:
              (WebCore::startPositionForLine):
              (WebCore::endPositionForLine):
              (WebCore::previousLinePosition):
              (WebCore::nextLinePosition):
              (WebCore::startOfParagraph):
              (WebCore::endOfParagraph):
              (WebCore::endOfBlock):
              (WebCore::startOfDocument):
              (WebCore::endOfDocument):
              (WebCore::logicalStartPositionForLine):
              (WebCore::logicalEndPositionForLine):
              * page/DOMSelection.cpp:
              (WebCore::DOMSelection::collapse):
              (WebCore::DOMSelection::setBaseAndExtent):
              (WebCore::DOMSelection::setPosition):
              (WebCore::DOMSelection::extend):
              * page/EventHandler.cpp:
              (WebCore::EventHandler::handleMousePressEventSingleClick):
              * rendering/RenderObject.cpp:
              (WebCore::RenderObject::createVisiblePosition):
              * rendering/RenderTextControl.cpp:
              (WebCore::RenderTextControl::visiblePositionForIndex):
              * svg/SVGTextContentElement.cpp:
              (WebCore::SVGTextContentElement::selectSubString):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@77980 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      ddcb501f
  18. 24 Jan, 2011 1 commit
    • rniwa@webkit.org's avatar
      2011-01-24 Ryosuke Niwa <rniwa@webkit.org> · 175c44be
      rniwa@webkit.org authored
              Reviewed by Eric Seidel.
      
              Stop instantiating legacy editing positions in InsertTextCommand, MoveSelectionCommand,
              ReplaceSelectionCommand, SelectionController, SpellChecker, TypingCommand, and markup.cpp
              https://bugs.webkit.org/show_bug.cgi?id=52676
      
              Stop instantiating legacy editing positions in the following files.
      
              * editing/InsertTextCommand.cpp:
              (WebCore::InsertTextCommand::prepareForTextInsertion):
              (WebCore::InsertTextCommand::performTrivialReplace):
              (WebCore::InsertTextCommand::input):
              (WebCore::InsertTextCommand::insertTab):
              * editing/MoveSelectionCommand.cpp:
              (WebCore::MoveSelectionCommand::doApply):
              * editing/ReplaceSelectionCommand.cpp:
              (WebCore::ReplaceSelectionCommand::removeUnrenderedTextNodesAtEnds):
              (WebCore::ReplaceSelectionCommand::mergeEndIfNeeded):
              (WebCore::ReplaceSelectionCommand::doApply):
              (WebCore::ReplaceSelectionCommand::shouldRemoveEndBR):
              (WebCore::ReplaceSelectionCommand::performTrivialReplace):
              * editing/SelectionController.cpp:
              (WebCore::SelectionController::setSelectionFromNone):
              * editing/SpellChecker.cpp:
              (WebCore::SpellChecker::didCheck):
              * editing/TypingCommand.cpp:
              (WebCore::TypingCommand::makeEditableRootEmpty):
              (WebCore::TypingCommand::deleteKeyPressed):
              (WebCore::TypingCommand::forwardDeleteKeyPressed):
              * editing/markup.cpp:
              (WebCore::StyledMarkupAccumulator::appendText):
              (WebCore::StyledMarkupAccumulator::serializeNodes):
              (WebCore::highestAncestorToWrapMarkup):
              (WebCore::createMarkup):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76560 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      175c44be
  19. 20 Jan, 2011 1 commit
    • ossy@webkit.org's avatar
      Refactoring of the custom allocation framework · 95c1bc42
      ossy@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=49897
      
      Patch by Zoltan Horvath <zoltan@webkit.org> on 2011-01-20
      Reviewed by Csaba Osztrogonác.
      
      Source/JavaScriptCore:
      
      Inheriting from FastAllocBase can result in objects getting larger (bug #33896, #46589).
      The modification replaces Noncopyable and FastAllocBase classes and these inherits with their
      equivalent macro implementation at the necessary places.
      
      * wtf/FastAllocBase.h: Turn FastAllocBase's implementation into a macro.
      
      Source/WebCore:
      
      Inheriting from FastAllocBase can result in objects getting larger (bug #33896, #46589).
      The modification replaces Noncopyable and FastAllocBase classes and these inherits with their
      equivalent macro implementation at the necessary places.
      
      Source/WebKit:
      
      Inheriting from FastAllocBase can result in objects getting larger (bug #33896, #46589).
      The modification replaces Noncopyable and FastAllocBase classes and these inherits with their
      equivalent macro implementation at the necessary places.
      
      Source/WebKit2:
      
      Inheriting from FastAllocBase can result in objects getting larger (bug #33896, #46589).
      The modification replaces Noncopyable and FastAllocBase classes and these inherits with their
      equivalent macro implementation at the necessary places.
      
      Tools:
      
      Inheriting from FastAllocBase can result in objects getting larger (bug #33896, #46589).
      The modification replaces Noncopyable and FastAllocBase classes and these inherits with their
      equivalent macro implementation at the necessary places.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76248 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      95c1bc42
  20. 19 Jan, 2011 1 commit
    • commit-queue@webkit.org's avatar
      2011-01-19 Levi Weintraub <leviw@google.com> · c56f5de7
      commit-queue@webkit.org authored
              Reviewed by Ryosuke Niwa.
      
              Replaced rangeCompliantEquivalent with Position::parentAnchoredEquivalent
              and simplified the logic a bit. Unfortunately, Tables and some legacy
              editing positions still need to be handled specifically.
      
              remove rangeCompliantEquivalent and replace it with Position methods
              https://bugs.webkit.org/show_bug.cgi?id=25057
      
              No new tests as this is a refactor that doesn't change behavior.
      
              * WebCore.exp.in:
              * dom/Document.cpp:
              (WebCore::Document::caretRangeFromPoint):
              * dom/Position.cpp:
              (WebCore::Position::parentAnchoredEquivalent):
              * dom/Position.h:
              * editing/ApplyStyleCommand.cpp:
              (WebCore::ApplyStyleCommand::applyBlockStyle):
              * editing/CompositeEditCommand.cpp:
              (WebCore::CompositeEditCommand::insertNodeAt):
              (WebCore::CompositeEditCommand::moveParagraphs):
              * editing/DeleteSelectionCommand.cpp:
              (WebCore::DeleteSelectionCommand::initializePositionData):
              (WebCore::DeleteSelectionCommand::mergeParagraphs):
              * editing/Editor.cpp:
              (WebCore::Editor::textDirectionForSelection):
              (WebCore::Editor::advanceToNextMisspelling):
              * editing/InsertLineBreakCommand.cpp:
              (WebCore::InsertLineBreakCommand::shouldUseBreakElement):
              * editing/InsertParagraphSeparatorCommand.cpp:
              (WebCore::InsertParagraphSeparatorCommand::doApply):
              * editing/ReplaceSelectionCommand.cpp:
              (WebCore::handleStyleSpansBeforeInsertion):
              * editing/VisiblePosition.cpp:
              (WebCore::makeRange):
              (WebCore::setStart):
              (WebCore::setEnd):
              * editing/VisibleSelection.cpp:
              (WebCore::VisibleSelection::firstRange):
              (WebCore::VisibleSelection::toNormalizedRange):
              (WebCore::makeSearchRange):
              * editing/htmlediting.cpp:
              (WebCore::indexForVisiblePosition):
              * editing/htmlediting.h:
              * editing/visible_units.cpp:
              (WebCore::previousBoundary):
              (WebCore::nextBoundary):
              * page/DOMSelection.cpp:
              (WebCore::anchorPosition):
              (WebCore::focusPosition):
              (WebCore::basePosition):
              (WebCore::extentPosition):
      2011-01-19  Levi Weintraub  <leviw@google.com>
      
              Reviewed by Ryosuke Niwa.
      
              Updating to use Position::parentAnchoredEquivalent instead of
              the old htmlediting rangeCompliantEquivalent.
      
              remove rangeCompliantEquivalent and replace it with Position methods
              https://bugs.webkit.org/show_bug.cgi?id=25057
      
              * WebView/WebFrame.mm:
              (-[WebFrame _smartDeleteRangeForProposedRange:]):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76107 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      c56f5de7
  21. 08 Jan, 2011 1 commit
  22. 10 Dec, 2010 1 commit
  23. 06 Dec, 2010 1 commit
    • rniwa@webkit.org's avatar
      2010-12-06 Ryosuke Niwa <rniwa@webkit.org> · 5359dff3
      rniwa@webkit.org authored
              Reviewed by Tony Chang.
      
              ApplyStyleCommand should take EditingStyle instead of CSSStyleDeclaration
              https://bugs.webkit.org/show_bug.cgi?id=49938
      
              Modified ApplyStyleCommand::ApplyStyleCommand and ApplyStyleCommand::create to take EditingStyle*
              instead of CSSStyleDeclaration*. Also replaced much of code in Editor::computeAndSetTypingStyle
              by calls to EditingStyle's member functions and extracted EditingStyle::overrideWith and
              EditingStyle::extractAndRemoveBlockProperties.
      
              No new tests are added since this is a refactoring.
      
              * WebCore.exp.in: Added SelectionController::copyTypingStyle and EditingStyle::~EditingStyle.
              * css/CSSMutableStyleDeclaration.cpp: Made CSSMutableStyleDeclaration* in the argument list const.
              (WebCore::CSSMutableStyleDeclaration::merge):
              * css/CSSMutableStyleDeclaration.h:
              * editing/ApplyStyleCommand.cpp:
              (WebCore::ApplyStyleCommand::ApplyStyleCommand): Takes EditingStyle* instead of CSSStyleDeclaration*.
              (WebCore::ApplyStyleCommand::doApply): Uses EditingStyle.
              * editing/ApplyStyleCommand.h: m_style is now a ref-pointer to EditingStyle instead of CSSMutableStyleDeclaration.
              (WebCore::ApplyStyleCommand::create): Takes EditingStyle* instead of CSSStyleDeclaration*.
              * editing/CompositeEditCommand.cpp:
              (WebCore::CompositeEditCommand::applyStyle): Ditto.
              (WebCore::CompositeEditCommand::moveParagraphs): Calls applyStyle.
              (WebCore::CompositeEditCommand::breakOutOfEmptyListItem): Ditto.
              * editing/CompositeEditCommand.h:
              * editing/DeleteSelectionCommand.cpp:
              (WebCore::DeleteSelectionCommand::calculateTypingStyleAfterDelete): Ditto.
              * editing/EditCommand.cpp:
              * editing/EditCommand.h:
              * editing/EditingStyle.cpp:
              (WebCore::EditingStyle::~EditingStyle): Added.
              (WebCore::EditingStyle::overrideWithStyle): Extracted from Editor::calculateTypingStyleAfterDelete.
              (WebCore::EditingStyle::copy): Added.
              (WebCore::EditingStyle::extractAndRemoveBlockProperties): Extracted from Editor::calculateTypingStyleAfterDelete.
              * editing/EditingStyle.h:
              * editing/Editor.cpp:
              (WebCore::Editor::applyStyle): Calls ApplyStyleCommand::create.
              (WebCore::Editor::applyParagraphStyle): Ditto.
              (WebCore::Editor::computeAndSetTypingStyle): Ditto.
              * editing/InsertLineBreakCommand.cpp:
              (WebCore::InsertLineBreakCommand::doApply): Calls applyStyle.
              * editing/InsertParagraphSeparatorCommand.cpp:
              (WebCore::InsertParagraphSeparatorCommand::applyStyleAfterInsertion): Ditto.
              * editing/InsertTextCommand.cpp:
              (WebCore::InsertTextCommand::input): Ditto.
              * editing/RemoveFormatCommand.cpp:
              (WebCore::RemoveFormatCommand::doApply): Calls ApplyStyleCommand::create.
              * editing/ReplaceSelectionCommand.cpp:
              (WebCore::ReplaceSelectionCommand::completeHTMLReplacement): Calls applyStyle.
              * editing/SelectionController.cpp:
              (WebCore::SelectionController::copyTypingStyle): Moved from SelectionController.h
              * editing/SelectionController.h:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73416 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      5359dff3
  24. 08 Nov, 2010 1 commit
    • rniwa@webkit.org's avatar
      2010-11-08 Ryosuke Niwa <rniwa@webkit.org> · 0d96cf61
      rniwa@webkit.org authored
              Reviewed by Darin Adler.
      
              Remove the remaining editing-style functions from ApplyStyleCommand
              https://bugs.webkit.org/show_bug.cgi?id=49155
      
              Replaced removeNonEditingProperties, editingStyleAtPosition, prepareEditingStyleToApplyAt,
              and removeStylesAddedByNode in ApplyStyleCommand.cpp by removeNonEditingProperties, EditingStyle::create,
              prepareToApplyAt, and removeStyleAddedByNode in EditingStyle.cpp.
      
              Also removed unnecessary header includes from various cpp files.
      
              No tests are added since this is a cleanup.
      
              * editing/ApplyStyleCommand.cpp: Removed removeNonEditingProperties, editingStyleAtPosition,
              prepareEditingStyleToApplyAt, and removeStylesAddedByNode.
              * editing/ApplyStyleCommand.h: Ditto.
              * editing/DeleteSelectionCommand.cpp: Removed removeEnclosingAnchorStyle.
              (WebCore::DeleteSelectionCommand::saveTypingStyleState): Calls removeStylesAddedByNode instead.
              * editing/EditingStyle.cpp:
              (WebCore::copyEditingProperties): Moved and renamed ApplyStyleCommand::removeNonEditingProperties.
              (WebCore::editingStyleFromComputedStyle): Calls copyEditingProperties. Changed the argument to PassRefPtr
              as supposed to a raw pointer for convenience.
              (WebCore::EditingStyle::init): Calls editingStyleFromComputedStyle.
              (WebCore::EditingStyle::removeStyleAddedByNode): Added.
              (WebCore::EditingStyle::removeStyleConflictingWithStyleOfNode): Added.
              (WebCore::EditingStyle::removeNonEditingProperties): Added.
              (WebCore::editingStyleIncludingTypingStyle): Calls copyEditingProperties.
              * editing/EditingStyle.h: Added prototypes.
              * editing/Editor.cpp:
              (WebCore::Editor::selectionComputedStyle): Uses EditingStyle.
              * editing/InsertParagraphSeparatorCommand.cpp:
              (WebCore::InsertParagraphSeparatorCommand::calculateStyleBeforeInsertion): Ditto.
              (WebCore::InsertParagraphSeparatorCommand::applyStyleAfterInsertion): Ditto.
              * editing/InsertParagraphSeparatorCommand.h:
              * editing/RemoveFormatCommand.cpp:
              (WebCore::RemoveFormatCommand::doApply): Ditto.
              * editing/ReplaceSelectionCommand.cpp:
              (WebCore::handleStyleSpansBeforeInsertion): Ditto.
              (WebCore::ReplaceSelectionCommand::handleStyleSpans): Ditto.
              (WebCore::ReplaceSelectionCommand::doApply): Ditto.
              (WebCore::ReplaceSelectionCommand::completeHTMLReplacement): Ditto.
              * editing/ReplaceSelectionCommand.h:
              * editing/markup.cpp: Removed removeEnclosingMailBlockquoteStyle and removeDefaultStyles.
              (WebCore::createMarkup): Uses EditingStyle.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@71556 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      0d96cf61
  25. 05 Nov, 2010 1 commit
  26. 03 Nov, 2010 1 commit
    • tony@chromium.org's avatar
      2010-11-03 Tony Chang <tony@chromium.org> · ff101615
      tony@chromium.org authored
              Reviewed by Ojan Vafai.
      
              Undo r54932 which inappropriately adjusts font sizes on zoomed pages
              https://bugs.webkit.org/show_bug.cgi?id=48890
      
              When copying zoomed text, we used to write to the clipboard the zoomed
              font size.  r54932 worked around this at paste time by scaling the
              font size based on the zoom.
      
              In r67568, Erik fixed getComputedStyle to return the original value
              rather than the zoomed font size.  This makes the work around added
              by r54932 unnecessary.
      
              The code in r54932 was busted in the first place since it only worked
              when in quirks mode since it didn't add units to the font size.
      
              * editing/inserting/page-zoom-font-size-expected.txt: Added.
              * editing/inserting/page-zoom-font-size.html: Added.
      2010-11-03  Tony Chang  <tony@chromium.org>
      
              Reviewed by Ojan Vafai.
      
              Undo r54932 which inappropriately adjusts font sizes on zoomed pages
              https://bugs.webkit.org/show_bug.cgi?id=48890
      
              Test: editing/inserting/page-zoom-font-size.html
      
              * editing/ReplaceSelectionCommand.cpp:
              (WebCore::ReplaceSelectionCommand::negateStyleRulesThatAffectAppearance):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@71252 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      ff101615
  27. 18 Oct, 2010 1 commit
    • darin@apple.com's avatar
      2010-10-18 Darin Adler <darin@apple.com> · 67b0c2d8
      darin@apple.com authored
              Reviewed by Alexey Proskuryakov.
      
              Remove some functions from class Node and make a few others non-virtual
              https://bugs.webkit.org/show_bug.cgi?id=47735
      
              Refactoring. No new tests.
      
              * bindings/js/JSNodeCustom.cpp:
              (WebCore::JSNode::markChildren): Added a FIXME about the use of the virtual
              ownerDocument function.
      
              * dom/ContainerNode.cpp:
              (WebCore::ContainerNode::removeChildren): Removed the unused return value.
      
              * dom/ContainerNode.h: Made insertBefore, replaceChild, removeChild, and
              appendChild non-virtual for clarity and performance. Made removeChildren
              non-virtual and removed its return value. Moved the inline Node functions
              that call through to ContainerNode into this file since the old way involved
              an extra level of inline function but otherwise had no advantages.
      
              * dom/Element.h: Moved isMathMLElement here because there is no call site
              that needs to call it on a Node*. We can always move it back if we need to,
              but it's better to have less in the Node class.
      
              * dom/Node.cpp:
              (WebCore::Node::insertBefore): Added an isContainerNode check so this can
              be non-virtual. There are very few callers who call this function on Node.
              If we want to optimize them further we can make the isContainerNode check
              inline in the future.
              (WebCore::Node::replaceChild): Ditto.
              (WebCore::Node::removeChild): Ditto.
              (WebCore::Node::appendChild): Ditto.
              (WebCore::Node::remove): Removed unneeded ref/unref because
              ContainerNode::removeChild already does this.
              (WebCore::Node::createRendererIfNeeded): Removed #if around call to
              childShouldCreateRenderer since it's needed even without SVG and XHTMLMP.
      
              * dom/Node.h: Moved definitions of inline functions that depend on
              ContainerNode to the ContainerNode.h header. They already required inclusion
              of that header, so there is no functional change. Made insertBefore,
              replaceChild, removeChild, and appendChild non-virtual. There are very few
              callers of these functions on this class. Moved isMathMLElement to Element.
              Added a FIXME about the name of eventAncestors. Fixed comment formatting.
              Eliminated unused isEditableBlock function. Moved the body of the
              enclosingInlineElement function to the editing file that was the only
              call site. Removed the previousEditable and nextEditable functions,
              incorporating their bodies into the one place they were called.
              Took the childShouldCreateRenderer function out of #if since it's
              now used by the implementation of the <noscript> element.
      
              * dom/Position.cpp:
              (WebCore::nextRenderedEditable): Rewrote the function to use nextLeafNode
              instead of nextEditable.
              (WebCore::previousRenderedEditable): Rewrote the function to use
              previousLeafNode instead of previousEditable.
      
              * editing/ReplaceSelectionCommand.cpp:
              (WebCore::enclosingInline): Moved function here from the Node class. Also
              fixed an incorrect cast this function did, which assumed the function
              result was always an element, which the function does not guarantee.
              (WebCore::ReplaceSelectionCommand::doApply): Call the function above.
      
              * history/HistoryItem.cpp: Added include of MathExtras.h.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@69987 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      67b0c2d8
  28. 15 Oct, 2010 1 commit
    • darin@apple.com's avatar
      2010-10-14 Darin Adler <darin@apple.com> · 601d44bd
      darin@apple.com authored
              Reviewed by Alexey Proskuryakov.
      
              Use more specific types for node pointers, especially when calling node insertion and removal functions
              https://bugs.webkit.org/show_bug.cgi?id=47702
      
              Refactoring. No new tests.
      
              While developing this patch I temporarily removed the node insertion and
              removal member functions from the Node class and fixed almost all call sites
              so they call it directly on the ContainerNode class, which will be important
              once we make the functions non-virtual.
      
              * css/CSSStyleSelector.cpp:
              (WebCore::CSSStyleSelector::SelectorChecker::checkSelector):
              * dom/ContainerNode.cpp:
              (WebCore::ContainerNode::insertBefore):
              (WebCore::ContainerNode::replaceChild):
              (WebCore::ContainerNode::appendChild):
              * dom/Document.cpp:
              (WebCore::Document::caretRangeFromPoint):
              * dom/DynamicNodeList.cpp:
              (WebCore::DynamicNodeList::itemWithName):
              * dom/Position.cpp:
              (WebCore::Position::previous):
              (WebCore::Position::next):
              * dom/Text.cpp:
              (WebCore::Text::replaceWholeText):
              * dom/TreeWalker.cpp:
              (WebCore::TreeWalker::firstChild):
              (WebCore::TreeWalker::lastChild):
              (WebCore::TreeWalker::previousNode):
              * dom/XMLDocumentParserLibxml2.cpp:
              (WebCore::XMLDocumentParser::XMLDocumentParser):
              * editing/BreakBlockquoteCommand.cpp:
              (WebCore::BreakBlockquoteCommand::doApply):
              * editing/CompositeEditCommand.h:
              * editing/DeleteButtonController.cpp:
              (WebCore::isDeletableElement):
              * editing/IndentOutdentCommand.cpp:
              (WebCore::IndentOutdentCommand::outdentParagraph):
              * editing/InsertNodeBeforeCommand.cpp:
              (WebCore::InsertNodeBeforeCommand::doApply):
              * editing/JoinTextNodesCommand.cpp:
              (WebCore::JoinTextNodesCommand::doApply):
              (WebCore::JoinTextNodesCommand::doUnapply):
              * editing/MergeIdenticalElementsCommand.cpp:
              (WebCore::MergeIdenticalElementsCommand::doUnapply):
              * editing/RemoveNodeCommand.cpp:
              (WebCore::RemoveNodeCommand::doApply):
              (WebCore::RemoveNodeCommand::doUnapply):
              * editing/RemoveNodeCommand.h:
              * editing/SplitElementCommand.cpp:
              (WebCore::SplitElementCommand::executeApply):
              * editing/SplitTextNodeCommand.cpp:
              (WebCore::SplitTextNodeCommand::doApply):
              (WebCore::SplitTextNodeCommand::doReapply):
              * editing/TextIterator.cpp:
              (WebCore::parentCrossingShadowBoundaries):
              * editing/htmlediting.cpp:
              (WebCore::enclosingList):
              * editing/markup.cpp:
              (WebCore::serializeNodes):
              (WebCore::ancestorToRetainStructureAndAppearance):
              (WebCore::createMarkup):
              * html/HTMLAreaElement.cpp:
              (WebCore::HTMLAreaElement::updateFocusAppearance):
              * html/HTMLEmbedElement.cpp:
              (WebCore::HTMLEmbedElement::rendererIsNeeded):
              * html/HTMLFormElement.cpp:
              (WebCore::HTMLFormElement::rendererIsNeeded):
              * html/HTMLFrameSetElement.cpp:
              (WebCore::HTMLFrameSetElement::attach):
              * html/HTMLImageElement.cpp:
              (WebCore::HTMLImageElement::insertedIntoTree):
              * html/HTMLLegendElement.cpp:
              (WebCore::HTMLLegendElement::associatedControl):
              * html/HTMLOptGroupElement.cpp:
              (WebCore::HTMLOptGroupElement::recalcSelectOptions):
              (WebCore::HTMLOptGroupElement::ownerSelectElement):
              * html/HTMLOptionElement.cpp:
              (WebCore::HTMLOptionElement::ownerSelectElement):
              * html/HTMLTableCellElement.cpp:
              (WebCore::HTMLTableCellElement::additionalAttributeStyleDecls):
              * html/HTMLTableColElement.cpp:
              (WebCore::HTMLTableColElement::additionalAttributeStyleDecls):
              * html/HTMLTableElement.cpp:
              (WebCore::HTMLTableElement::insertRow):
              * html/HTMLTableRowElement.cpp:
              (WebCore::HTMLTableRowElement::rowIndex):
              * html/HTMLTableSectionElement.cpp:
              (WebCore::HTMLTableSectionElement::additionalAttributeStyleDecls):
              * page/DOMSelection.cpp:
              (WebCore::DOMSelection::getRangeAt):
              (WebCore::DOMSelection::containsNode):
              * rendering/RenderSVGGradientStop.cpp:
              (WebCore::RenderSVGGradientStop::gradientElement):
              * svg/SVGElement.cpp:
              (WebCore::SVGElement::ownerSVGElement):
              (WebCore::SVGElement::viewportElement):
              * svg/SVGFELightElement.cpp:
              (WebCore::SVGFELightElement::svgAttributeChanged):
              (WebCore::SVGFELightElement::childrenChanged):
              * svg/SVGFEMergeNodeElement.cpp:
              (WebCore::SVGFEMergeNodeElement::svgAttributeChanged):
              * svg/SVGFontFaceFormatElement.cpp:
              (WebCore::SVGFontFaceFormatElement::childrenChanged):
              * svg/SVGFontFaceUriElement.cpp:
              (WebCore::SVGFontFaceUriElement::childrenChanged):
              * svg/SVGGlyphElement.cpp:
              (WebCore::SVGGlyphElement::invalidateGlyphCache):
              * svg/SVGHKernElement.cpp:
              (WebCore::SVGHKernElement::insertedIntoDocument):
              (WebCore::SVGHKernElement::removedFromDocument):
              * svg/SVGLocatable.cpp:
              (WebCore::SVGLocatable::nearestViewportElement):
              (WebCore::SVGLocatable::farthestViewportElement):
              * svg/SVGUseElement.cpp:
              (WebCore::SVGUseElement::updateContainerOffsets):
              * svg/SVGVKernElement.cpp:
              (WebCore::SVGVKernElement::insertedIntoDocument):
              (WebCore::SVGVKernElement::removedFromDocument):
              * svg/animation/SVGSMILElement.cpp:
              (WebCore::SVGSMILElement::targetElement):
              * wml/WMLDoElement.cpp:
              (WebCore::WMLDoElement::insertedIntoDocument):
              (WebCore::WMLDoElement::removedFromDocument):
              * wml/WMLNoopElement.cpp:
              (WebCore::WMLNoopElement::insertedIntoDocument):
              * wml/WMLOptionElement.cpp:
              (WebCore::ownerSelectElement):
              * wml/WMLPostfieldElement.cpp:
              (WebCore::WMLPostfieldElement::insertedIntoDocument):
              (WebCore::WMLPostfieldElement::removedFromDocument):
              * wml/WMLSetvarElement.cpp:
              (WebCore::WMLSetvarElement::insertedIntoDocument):
              (WebCore::WMLSetvarElement::removedFromDocument):
              * wml/WMLTaskElement.cpp:
              (WebCore::WMLTaskElement::insertedIntoDocument):
              (WebCore::WMLTaskElement::removedFromDocument):
              * wml/WMLTimerElement.cpp:
              (WebCore::WMLTimerElement::insertedIntoDocument):
              (WebCore::WMLTimerElement::removedFromDocument):
              * xml/XPathStep.cpp:
              (WebCore::XPath::Step::nodesInAxis):
              Use ContainerNode* for the result of the parentNode function now that
              it returns a ContainerNode*. In the past it used to return just Node*.
      
              * dom/ContainerNode.h: Added toContainerNode.
      
              * dom/Element.h: Use ContainerNode*. Added toElement.
      
              * dom/Element.cpp:
              (WebCore::Element::deprecatedCreateContextualFragment): Explcitly
              cast to HTMLElement* in the case that handles <html> and <body>
              elements.
              (WebCore::Element::baseURI): Use ContainerNode*.
      
              * dom/Node.cpp:
              (WebCore::Node::markAncestorsWithChildNeedsStyleRecalc): Use ContainerNode*.
              (WebCore::Node::isDescendantOf): Ditto.
              (WebCore::Node::createRendererIfNeeded): Ditto.
              (WebCore::Node::setTextContent): Use already-typecast pointer in a call to
              appendChild.
              (WebCore::Node::ancestorElement): Use ContainerNode*.
      
              * dom/Range.cpp:
              (WebCore::Range::compareNode): Use ContainerNode*.
              (WebCore::Range::intersectsNode): Ditto.
              (WebCore::Range::processContents): Cast to ContainerNode* in a couple cases
              where we previously checked that the node in question has a child. Any node
              that returns a non-zero value for firstChild is a ContainerNode.
              (WebCore::Range::checkNodeBA): Ditto.
              (WebCore::Range::selectNode): Ditto.
              (WebCore::Range::surroundContents): Ditto.
      
              * dom/XMLDocumentParser.cpp:
              (WebCore::XMLDocumentParser::insertErrorMessageBlock): Rewrote code to use
              more specific types, document instead of doc, and paragraph instead of par.
      
              * editing/ApplyStyleCommand.cpp:
              (WebCore::ApplyStyleCommand::removeStyleFromRunBeforeApplyingStyle):
              Use ContainerNode*.
              (WebCore::ApplyStyleCommand::replaceWithSpanOrRemoveIfWithoutAttributes):
              Use replaceElementWithSpanPreservingChildrenAndAttributes; the old function
              took a Node argument and had Node in its name.
      
              * editing/CompositeEditCommand.cpp:
              (WebCore::CompositeEditCommand::removeNodeAndPruneAncestors): Use ContainerNode.
              (WebCore::CompositeEditCommand::replaceElementWithSpanPreservingChildrenAndAttributes):
              Renamed and changed to take HTMLElement. Also use ContainerNode.
              (WebCore::CompositeEditCommand::prune): Ditto.
              (WebCore::CompositeEditCommand::breakOutOfEmptyListItem): Ditto.
              (WebCore::CompositeEditCommand::breakOutOfEmptyMailBlockquotedParagraph): Ditto.
      
              * editing/ReplaceNodeWithSpanCommand.cpp:
              (WebCore::ReplaceNodeWithSpanCommand::ReplaceNodeWithSpanCommand): Take an
              HTMLElement instead of a Node. Call it m_elementToReplace instead of m_node.
              (WebCore::swapInNodePreservingAttributesAndChildren): Take HTMLElement.
              (WebCore::ReplaceNodeWithSpanCommand::doApply): Updated for name changes.
              (WebCore::ReplaceNodeWithSpanCommand::doUnapply): Ditto.
              * editing/ReplaceNodeWithSpanCommand.h: Ditto.
      
              * editing/ReplaceSelectionCommand.cpp:
              (WebCore::ReplacementFragment::ReplacementFragment): Use StyledElement for result
              of insertFragmentForTestRendering since that's what it returns.
              (WebCore::ReplacementFragment::removeNode): Use ContainerNode.
              (WebCore::ReplacementFragment::insertNodeBefore): Ditto.
              (WebCore::ReplacementFragment::insertFragmentForTestRendering): Return StyledElement.
              Use HTMLElement for body.
              (WebCore::ReplacementFragment::restoreTestRenderingNodesToFragment): Take
              StyledElement.
              (WebCore::ReplaceSelectionCommand::handleStyleSpans): Use ContainerNode.
              (WebCore::ReplaceSelectionCommand::copyStyleToChildren): Use HTMLElement for
              the cloned span, since the clone will be a sspan too.
              (WebCore::ReplaceSelectionCommand::insertAsListItems): Use ContainerNode since
              the list item has a child, and that proves it is a ContainerNode.
      
              * editing/SelectionController.cpp:
              (WebCore::SelectionController::selectFrameElementInParentIfFullySelected):
              Use ContainerNode and also removed an unnneded local variable.
      
              * html/HTMLElement.cpp:
              (WebCore::HTMLElement::setOuterText): Use ContainerNode.
              (WebCore::HTMLElement::insertAdjacent): Use ContainerNode and also use && to make
              the logic a little simpler.
              (WebCore::contextElementForInsertion): Use ContainerNode.
              (WebCore::HTMLElement::findFormAncestor): Ditto.
      
              * inspector/InspectorDOMAgent.cpp:
              (WebCore::InspectorDOMAgent::removeNode): Use ContainerNode.
              (WebCore::InspectorDOMAgent::changeTagName): Ditto.
              (WebCore::InspectorDOMAgent::setOuterHTML): Ditto.
              (WebCore::InspectorDOMAgent::innerParentNode): Use isDocumentNode instead of
              nodeType. We should almost never use nodeType inside the engine.
              (WebCore::InspectorDOMAgent::didInsertDOMNode): Use ContainerNode.
              (WebCore::InspectorDOMAgent::didRemoveDOMNode): Ditto.
      
              * wml/WMLOptGroupElement.cpp: Removed unneeded overrides of insertBefore,
              replaceChild, removeChild, appendChild, and removeChildren functions.
              Ths already overrides childrenChanged, that is called by all of the above,
              and it does the same thing these functions did.
              (WebCore::ownerSelectElement): Use ContainerNode.
              * wml/WMLOptGroupElement.h: Ditto.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@69868 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      601d44bd
  29. 16 Sep, 2010 1 commit
    • darin@apple.com's avatar
      2010-09-16 Darin Adler <darin@apple.com> · a6cb255b
      darin@apple.com authored
              Reviewed by Andreas Kling.
      
              Reduce use of HTMLInputElement::inputType so we can remove it later
              https://bugs.webkit.org/show_bug.cgi?id=45903
      
              * src/DOMUtilitiesPrivate.cpp:
              (WebKit::elementHasLegalLinkAttribute): Use isImageButton.
              * src/WebPasswordFormUtils.cpp:
              (WebKit::findPasswordFormFields): Use isPasswordField.
              * src/WebSearchableFormData.cpp:
              (WebCore::IsInDefaultState): Use isCheckbox and isRadioButton.
              (WebCore::HasSuitableTextElement): Use isFileUpload and isPasswordField.
      2010-09-16  Darin Adler  <darin@apple.com>
      
              Reviewed by Andreas Kling.
      
              Reduce use of HTMLInputElement::inputType so we can remove it later
              https://bugs.webkit.org/show_bug.cgi?id=45903
      
              * WebCoreSupport/DumpRenderTreeSupportQt.cpp:
              (DumpRenderTreeSupportQt::elementDoesAutoCompleteForElementWithId):
              Use isPasswordField.
      2010-09-16  Darin Adler  <darin@apple.com>
      
              Reviewed by Andreas Kling.
      
              Reduce use of HTMLInputElement::inputType so we can remove it later
              https://bugs.webkit.org/show_bug.cgi?id=45903
      
              * WebFrame.cpp:
              (WebFrame::elementDoesAutoComplete): Use isPasswordField.
              (WebFrame::elementIsPassword): Use isPasswordField.
      2010-09-16  Darin Adler  <darin@apple.com>
      
              Reviewed by Andreas Kling.
      
              Reduce use of HTMLInputElement::inputType so we can remove it later
              https://bugs.webkit.org/show_bug.cgi?id=45903
      
              * WebView/WebHTMLRepresentation.mm:
              (-[WebHTMLRepresentation elementDoesAutoComplete:]): Use isPasswordField.
              (-[WebHTMLRepresentation elementIsPassword:]): Use isPasswordField.
      2010-09-16  Darin Adler  <darin@apple.com>
      
              Reviewed by Andreas Kling.
      
              Reduce use of HTMLInputElement::inputType so we can remove it later
              https://bugs.webkit.org/show_bug.cgi?id=45903
      
              * accessibility/AccessibilityRenderObject.cpp:
              (WebCore::AccessibilityRenderObject::isFileUploadButton): Use isFileUpload.
              (WebCore::AccessibilityRenderObject::isInputImage): Use isImageButton.
              (WebCore::AccessibilityRenderObject::determineAccessibilityRole): Use
              isCheckbox and isRadioButton.
      
              * css/CSSStyleSelector.cpp:
              (WebCore::CSSStyleSelector::adjustRenderStyle): Use isImageButton.
      
              * editing/Editor.cpp:
              (WebCore::Editor::setBaseWritingDirection): Use isTextField.
      
              * editing/ReplaceSelectionCommand.cpp:
              (WebCore::ReplaceSelectionCommand::doApply): Use isPasswordField.
      
              * editing/SelectionController.cpp:
              (WebCore::SelectionController::isInPasswordField): Use isPasswordField.
      
              * html/HTMLInputElement.h: Added isFileUpload, isImageButton, and isSubmitButton.
      
              * page/Chrome.cpp:
              (WebCore::Chrome::setToolTip): Use isSubmitButton and isFileUpload.
      
              * page/DragController.cpp:
              (WebCore::asFileInput): Use isFileUpload.
      
              * page/EventHandler.cpp:
              (WebCore::isSubmitImage): Use isImageButton.
      
              * rendering/RenderFileUploadControl.cpp:
              (WebCore::RenderFileUploadControl::updateFromElement): Use isFileUpload.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@67653 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      a6cb255b
  30. 10 Sep, 2010 1 commit
    • darin@apple.com's avatar
      2010-09-09 Darin Adler <darin@apple.com> · b17ec2f7
      darin@apple.com authored
              Reviewed by Adam Barth.
      
              Move functions from Frame to SelectionController as planned
              https://bugs.webkit.org/show_bug.cgi?id=45508
      
              * src/WebFrameImpl.cpp:
              (WebKit::WebFrameImpl::selectionBoundsRect):
              Call functions on selection().
      2010-09-09  Darin Adler  <darin@apple.com>
      
              Reviewed by Adam Barth.
      
              Move functions from Frame to SelectionController as planned
              https://bugs.webkit.org/show_bug.cgi?id=45508
      
              * WebView.cpp:
              (WebView::selectionRect):
              (WebView::centerSelectionInVisibleArea):
              Call functions on selection().
      2010-09-09  Darin Adler  <darin@apple.com>
      
              Reviewed by Adam Barth.
      
              Move functions from Frame to SelectionController as planned
              https://bugs.webkit.org/show_bug.cgi?id=45508
      
              * WebView/WebFrame.mm:
              (-[WebFrame _selectionGranularity]):
              (-[WebFrame _insertParagraphSeparatorInQuotedContent]):
              (-[WebFrame _typingStyle]):
              (-[WebFrame _replaceSelectionWithFragment:selectReplacement:smartReplace:matchStyle:]):
              * WebView/WebHTMLRepresentation.mm:
              (-[WebHTMLRepresentation currentForm]):
              * WebView/WebHTMLView.mm:
              (-[WebHTMLView jumpToSelection:]):
              (-[WebHTMLView centerSelectionInVisibleArea:]):
              (-[WebHTMLView _canSmartCopyOrDelete]):
              (-[WebHTMLView _lookUpInDictionaryFromMenu:]):
              (-[WebHTMLView selectionRect]):
              (-[WebHTMLView selectionTextRects]):
              (-[WebHTMLView selectionImageRect]):
              * WebView/WebView.mm:
              (-[WebView setEditable:]):
              Call functions on selection().
      2010-09-09  Darin Adler  <darin@apple.com>
      
              Reviewed by Adam Barth.
      
              Move functions from Frame to SelectionController as planned
              https://bugs.webkit.org/show_bug.cgi?id=45508
      
              Also removed Frame::dragCaretController since it just called Page::dragCaretController.
      
              * editing/SelectionController.cpp:
              (WebCore::SelectionController::setSelection):
              (WebCore::SelectionController::modify):
              (WebCore::SelectionController::selectFrameElementInParentIfFullySelected):
              (WebCore::SelectionController::selectAll):
              (WebCore::SelectionController::focusedOrActiveStateChanged):
              (WebCore::SelectionController::notifyRendererOfSelectionChange):
              (WebCore::isFrameElement):
              (WebCore::SelectionController::setFocusedNodeIfNeeded):
              (WebCore::SelectionController::paintDragCaret):
              (WebCore::SelectionController::shouldDeleteSelection):
              (WebCore::SelectionController::selectionBounds):
              (WebCore::SelectionController::selectionTextRects):
              (WebCore::scanForForm):
              (WebCore::SelectionController::currentForm):
              (WebCore::SelectionController::revealSelection):
              (WebCore::SelectionController::setSelectionFromNone):
              (WebCore::SelectionController::shouldChangeSelection):
              * editing/SelectionController.h:
              Moved functions here from Frame.
      
              * page/Frame.cpp:
              * page/Frame.h:
              Moved functions to SelectionController.
              Reorganized header to be easier to read and a bit more logical.
      
              * WebCore.exp.in: Updated.
      
              * dom/Document.cpp:
              (WebCore::Document::nodeChildrenWillBeRemoved):
              (WebCore::Document::nodeWillBeRemoved):
              Call Page::dragCaretController directly.
      
              * dom/Element.cpp:
              (WebCore::Element::updateFocusAppearance):
              * dom/InputElement.cpp:
              (WebCore::InputElement::updateFocusAppearance):
              * editing/ApplyStyleCommand.cpp:
              (WebCore::ApplyStyleCommand::editingStyleAtPosition):
              * editing/DeleteSelectionCommand.cpp:
              (WebCore::DeleteSelectionCommand::calculateTypingStyleAfterDelete):
              * editing/Editor.cpp:
              (WebCore::Editor::canSmartCopyOrDelete):
              (WebCore::Editor::textDirectionForSelection):
              (WebCore::Editor::appliedEditing):
              (WebCore::Editor::insertTextWithoutSendingTextEvent):
              (WebCore::Editor::advanceToNextMisspelling):
              (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges):
              (WebCore::Editor::revealSelectionAfterEditingOperation):
              (WebCore::Editor::transpose):
              (WebCore::Editor::changeSelectionAfterCommand):
              (WebCore::Editor::computeAndSetTypingStyle):
              (WebCore::Editor::selectionComputedStyle):
              (WebCore::Editor::styleForSelectionStart):
              (WebCore::Editor::findString):
              * editing/EditorCommand.cpp:
              (WebCore::executeDelete):
              * editing/InsertLineBreakCommand.cpp:
              (WebCore::InsertLineBreakCommand::doApply):
              * editing/InsertTextCommand.cpp:
              (WebCore::InsertTextCommand::input):
              * editing/RemoveFormatCommand.cpp:
              (WebCore::RemoveFormatCommand::doApply):
              * editing/ReplaceSelectionCommand.cpp:
              (WebCore::ReplaceSelectionCommand::doApply):
              * editing/TypingCommand.cpp:
              (WebCore::TypingCommand::insertTextRunWithoutNewlines):
              (WebCore::TypingCommand::deleteKeyPressed):
              (WebCore::TypingCommand::forwardDeleteKeyPressed):
              * html/HTMLTextAreaElement.cpp:
              (WebCore::HTMLTextAreaElement::updateFocusAppearance):
              * page/ContextMenuController.cpp:
              (WebCore::ContextMenuController::contextMenuItemSelected):
              * page/DragController.cpp:
              (WebCore::DragController::concludeEditDrag):
              (WebCore::dragLocForSelectionDrag):
              * page/EventHandler.cpp:
              (WebCore::EventHandler::selectClosestWordFromMouseEvent):
              (WebCore::EventHandler::selectClosestWordOrLinkFromMouseEvent):
              (WebCore::EventHandler::handleMousePressEventTripleClick):
              (WebCore::EventHandler::handleMousePressEventSingleClick):
              (WebCore::EventHandler::updateSelectionForMouseDrag):
              (WebCore::EventHandler::handleMouseReleaseEvent):
              * page/FocusController.cpp:
              (WebCore::FocusController::advanceFocusInDocumentOrder):
              * page/chromium/EventHandlerChromium.cpp:
              (WebCore::EventHandler::passMousePressEventToSubframe):
              * page/chromium/FrameChromium.cpp:
              (WebCore::Frame::dragImageForSelection):
              * page/mac/FrameMac.mm:
              (WebCore::Frame::selectionImage):
              * platform/mac/ClipboardMac.mm:
              (WebCore::ClipboardMac::writeRange):
              * rendering/RenderBlock.cpp:
              (WebCore::RenderBlock::paintCaret):
              Call functions on selection().
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@67238 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      b17ec2f7
  31. 29 Aug, 2010 1 commit
    • enrica@apple.com's avatar
      WebCore: Crash when dragging text in Google Docs · 5eea7a83
      enrica@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=20471
      <rdar://problem/7783629>
              
      Reviewed by Adele Peterson.
      
      This fixes the crash but also fixes the generated markup when
      performing a replacement at the border with an inline, to avoid the 
      new content being merged into the inline.
      The crash is happening when doApply detects the need of merging
      the start and the end of the new paragraph and the destination position
      is moved inside an inline.
              
      I've added new test cases to an existing layout test.
              
      * editing/ReplaceSelectionCommand.cpp:
      (WebCore::ReplaceSelectionCommand::doApply): When the situation described above is detected,
      we insert a placeholder to avoid merging into the inline.
      
      LayoutTests: Crash when dragging text in Google Docs
      https://bugs.webkit.org/show_bug.cgi?id=20471
      <rdar://problem/7783629>
      
      Reviewed by Adele Peterson.
      
      Added new test cases to an exisisting file and updated the result to reflect
      the correct behavior.
              
      * editing/selection/replace-selection-crash-expected.txt:
      * editing/selection/replace-selection-crash.html:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@66344 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      5eea7a83
  32. 27 Aug, 2010 1 commit
    • hyatt@apple.com's avatar
      https://bugs.webkit.org/show_bug.cgi?id=44788, implement HTML5-compliant doctype switching. · ce8ee2a4
      hyatt@apple.com authored
      Reviewed by Simon Fraser.
      
      WebCore: 
      
      Rename the various modes to match the HTML5 specification:
          ParseMode -> CompatibilityMode
          CompatMode -> QuirksMode
          AlmostStrictMode -> LimitedQuirksMode
          StrictMode -> NoQuirksMode
                  
      Remove the htmlHacks() accessor from RenderStyle and make rendering code just go to the document
      instead.  This makes switching modes avoid forcing all RenderStyles to detect as changed.
              
      Clean up user stylesheets to minimize style recalculation when the mode is switched.
              
      Fix bugs with the propagation of correct modes in the HTML5 parser.  Make sure the
      dummy document created for fragment parsing properly inherits the real document's CompatibilityMode.
      Make sure the tree builder properly changes the insertion mode to "BeforeHTML" after handling
      a doctype token.
              
      determineParseMode -> setCompatibilityModeFromDoctype, and it now implements the HTML5 algorithm
      precisely.
              
      * WebCore.exp.in:
      * css/CSSStyleSelector.cpp:
      (WebCore::CSSStyleSelector::styleForDocument):
      (WebCore::CSSStyleSelector::applyProperty):
      (WebCore::CSSStyleSelector::fontSizeForKeyword):
      * dom/ClassNodeList.cpp:
      (WebCore::ClassNodeList::ClassNodeList):
      * dom/DecodedDataDocumentParser.cpp:
      (WebCore::DecodedDataDocumentParser::appendBytes):
      * dom/Document.cpp:
      (WebCore::Document::Document):
      (WebCore::Document::setCompatibilityMode):
      (WebCore::Document::setDocType):
      (WebCore::Document::unscheduleStyleRecalc):
      (WebCore::Document::recalcStyle):
      (WebCore::Document::updateStyleIfNeeded):
      (WebCore::Document::createStyleSelector):
      (WebCore::Document::implicitOpen):
      (WebCore::Document::pageUserSheet):
      (WebCore::Document::clearPageUserSheet):
      (WebCore::Document::updatePageUserSheet):
      (WebCore::Document::pageGroupUserSheets):
      (WebCore::Document::clearPageGroupUserSheets):
      (WebCore::Document::updatePageGroupUserSheets):
      (WebCore::Document::findAnchor):
      * dom/Document.h:
      (WebCore::Document::):
      (WebCore::Document::setCompatibilityModeFromDoctype):
      (WebCore::Document::lockCompatibilityMode):
      (WebCore::Document::compatibilityMode):
      (WebCore::Document::inQuirksMode):
      (WebCore::Document::inLimitedQuirksMode):
      (WebCore::Document::inNoQuirksMode):
      * dom/Element.cpp:
      (WebCore::Element::clientWidth):
      (WebCore::Element::clientHeight):
      (WebCore::Element::webkitMatchesSelector):
      * dom/NamedNodeMap.cpp:
      (WebCore::NamedNodeMap::setClass):
      * dom/Node.cpp:
      (WebCore::Node::querySelector):
      (WebCore::Node::querySelectorAll):
      * dom/OptionElement.cpp:
      (WebCore::OptionElement::collectOptionLabelOrText):
      * dom/SelectorNodeList.cpp:
      (WebCore::createSelectorNodeList):
      * dom/StyleElement.cpp:
      (WebCore::StyleElement::createSheet):
      * dom/StyledElement.cpp:
      (WebCore::StyledElement::createInlineStyleDecl):
      (WebCore::StyledElement::parseMappedAttribute):
      * editing/ReplaceSelectionCommand.cpp:
      (WebCore::ReplaceSelectionCommand::shouldRemoveEndBR):
      * html/HTMLBodyElement.cpp:
      (WebCore::HTMLBodyElement::createLinkDecl):
      * html/HTMLCanvasElement.cpp:
      (WebCore::HTMLCanvasElement::getContext):
      * html/HTMLConstructionSite.cpp:
      (WebCore::HTMLConstructionSite::insertDoctype):
      * html/HTMLDocument.cpp:
      (WebCore::HTMLDocument::HTMLDocument):
      (WebCore::HTMLDocument::compatMode):
      (WebCore::HTMLDocument::setCompatibilityModeFromDoctype):
      * html/HTMLDocument.h:
      * html/HTMLLinkElement.cpp:
      (WebCore::HTMLLinkElement::setCSSStyleSheet):
      * html/HTMLTreeBuilder.cpp:
      (WebCore::HTMLTreeBuilder::HTMLTreeBuilder):
      (WebCore::HTMLTreeBuilder::FragmentParsingContext::FragmentParsingContext):
      (WebCore::HTMLTreeBuilder::processDoctypeToken):
      (WebCore::HTMLTreeBuilder::processStartTagForInBody):
      (WebCore::HTMLTreeBuilder::defaultForInitial):
      * html/HTMLViewSourceDocument.cpp:
      (WebCore::HTMLViewSourceDocument::HTMLViewSourceDocument):
      * loader/DocumentWriter.cpp:
      (WebCore::DocumentWriter::replaceDocument):
      (WebCore::DocumentWriter::reportDataReceived):
      * loader/DocumentWriter.h:
      * loader/ImageDocument.cpp:
      (WebCore::ImageDocument::ImageDocument):
      * loader/MediaDocument.cpp:
      (WebCore::MediaDocument::MediaDocument):
      * loader/PluginDocument.cpp:
      (WebCore::PluginDocument::PluginDocument):
      * loader/SinkDocument.cpp:
      (WebCore::SinkDocument::SinkDocument):
      * loader/TextDocument.cpp:
      (WebCore::TextDocument::TextDocument):
      * page/Page.cpp:
      (WebCore::Page::userStyleSheetLocationChanged):
      * page/PageGroup.cpp:
      (WebCore::PageGroup::resetUserStyleCacheInAllFrames):
      * page/Settings.cpp:
      (WebCore::Settings::Settings):
      (WebCore::Settings::setEnforceCSSMIMETypeInNoQuirksMode):
      * page/Settings.h:
      (WebCore::Settings::enforceCSSMIMETypeInNoQuirksMode):
      * rendering/AutoTableLayout.cpp:
      (WebCore::AutoTableLayout::recalcColumn):
      * rendering/FixedTableLayout.cpp:
      (WebCore::FixedTableLayout::calcPrefWidths):
      * rendering/InlineFlowBox.cpp:
      (WebCore::InlineFlowBox::paintBoxDecorations):
      (WebCore::InlineFlowBox::paintMask):
      (WebCore::InlineFlowBox::paintTextDecorations):
      * rendering/InlineTextBox.cpp:
      (WebCore::InlineTextBox::paint):
      * rendering/RenderBlock.cpp:
      (WebCore::RenderBlock::isSelfCollapsingBlock):
      (WebCore::RenderBlock::collapseMargins):
      (WebCore::RenderBlock::handleBottomOfBlock):
      (WebCore::RenderBlock::calcInlinePrefWidths):
      (WebCore::RenderBlock::calcBlockPrefWidths):
      * rendering/RenderBlockLineLayout.cpp:
      (WebCore::createInlineBoxForRenderer):
      (WebCore::RenderBlock::findNextLineBreak):
      * rendering/RenderBox.cpp:
      (WebCore::RenderBox::calcPercentageHeight):
      (WebCore::RenderBox::calcAbsoluteHorizontal):
      (WebCore::RenderBox::calcAbsoluteHorizontalReplaced):
      * rendering/RenderBox.h:
      (WebCore::RenderBox::stretchesToViewHeight):
      * rendering/RenderListItem.cpp:
      (WebCore::getParentOfFirstLineBox):
      * rendering/RenderTable.cpp:
      (WebCore::RenderTable::layout):
      * rendering/RenderTableSection.cpp:
      (WebCore::RenderTableSection::calcRowHeight):
      * rendering/RootInlineBox.cpp:
      (WebCore::RootInlineBox::verticallyAlignBoxes):
      * rendering/style/RenderStyle.cpp:
      (WebCore::RenderStyle::diff):
      * rendering/style/RenderStyle.h:
      (WebCore::):
      (WebCore::InheritedFlags::setBitDefaults):
      
      WebKit/mac: 
      
      Rename the various modes to match the HTML5 specification:
          ParseMode -> CompatibilityMode
          CompatMode -> QuirksMode
          AlmostStrictMode -> LimitedQuirksMode
          StrictMode -> NoQuirksMode
                  
      Remove the htmlHacks() accessor from RenderStyle and make rendering code just go to the document
      instead.  This makes switching modes avoid forcing all RenderStyles to detect as changed.
              
      Clean up user stylesheets to minimize style recalculation when the mode is switched.
              
      Fix bugs with the propagation of correct modes in the HTML5 parser.  Make sure the
      dummy document created for fragment parsing properly inherits the real document's CompatibilityMode.
      Make sure the tree builder properly changes the insertion mode to "BeforeHTML" after handling
      a doctype token.
              
      determineParseMode -> setCompatibilityModeFromDoctype, and it now implements the HTML5 algorithm
      precisely.
      
      * WebView/WebView.mm:
      (-[WebView _preferencesChangedNotification:]):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@66247 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      ce8ee2a4
  33. 25 Aug, 2010 1 commit
    • rniwa@webkit.org's avatar
      2010-08-25 Ryosuke Niwa <rniwa@webkit.org> · d39a1e73
      rniwa@webkit.org authored
              Reviewed by Darin Adler.
      
              Various designmode=&quot;on&quot;/&quot;off&quot; &amp; execCommand(&quot;Undo&quot;) NULL pointer crashes
              https://bugs.webkit.org/show_bug.cgi?id=32823
      
              The bug was caused by changeSelectionAfterCommand which updates the selection
              without checking the whether new selection is valid or not.
      
              Fixed changeSelectionAfterCommand so that it won't update the selection
              when either end of the new selection is orphaned. Also fixed various editing commands
              to exit early if either end of the selection is orphaned.
      
              Tests: editing/undo/orphaned-selection-crash-bug32823-1.html
                     editing/undo/orphaned-selection-crash-bug32823-2.html
                     editing/undo/orphaned-selection-crash-bug32823-3.html
                     editing/undo/orphaned-selection-crash-bug32823-4.html
      
              * editing/Editor.cpp:
              (WebCore::Editor::changeSelectionAfterCommand): No longer sets orphaned selection.
              * editing/VisibleSelection.h:
              (WebCore::VisibleSelection::isNonOrphanedRange): Added.
              (WebCore::VisibleSelection::isNonOrphanedCaretOrRange): Added.
              * editing/DeleteSelectionCommand.cpp:
              (WebCore::DeleteSelectionCommand::doApply): Added an early exist. See above.
              * editing/FormatBlockCommand.cpp:
              (WebCore::FormatBlockCommand::doApply): Ditto.
              * editing/IndentOutdentCommand.cpp:
              (WebCore::IndentOutdentCommand::doApply): Ditto.
              * editing/InsertLineBreakCommand.cpp:
              (WebCore::InsertLineBreakCommand::doApply): Ditto.
              * editing/InsertListCommand.cpp:
              (WebCore::InsertListCommand::doApply): Ditto.
              * editing/InsertParagraphSeparatorCommand.cpp:
              (WebCore::InsertParagraphSeparatorCommand::doApply): Ditto.
              * editing/InsertTextCommand.cpp:
              (WebCore::InsertTextCommand::input): Ditto.
              * editing/MoveSelectionCommand.cpp:
              (WebCore::MoveSelectionCommand::doApply): Ditto.
              * editing/RemoveFormatCommand.cpp:
              (WebCore::RemoveFormatCommand::doApply): Ditto.
              * editing/ReplaceSelectionCommand.cpp:
              (WebCore::ReplaceSelectionCommand::doApply): Ditto.
              * editing/TypingCommand.cpp:
              (WebCore::TypingCommand::doApply): Ditto.
              * editing/UnlinkCommand.cpp:
              (WebCore::UnlinkCommand::doApply): Ditto.
      2010-08-25  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Darin Adler.
      
              Various designmode="on"/"off" & execCommand("Undo") NULL pointer crashes
              https://bugs.webkit.org/show_bug.cgi?id=32823
      
              These tests ensure WebKit doesn't crash when undoing some editing commands failed
              and either end of endingSelection() became orphaned.
              All tests are copied from the bug to prevent regression.
      
              * editing/undo/orphaned-selection-crash-bug32823-1-expected.txt: Added.
              * editing/undo/orphaned-selection-crash-bug32823-1.html: Added.
              * editing/undo/orphaned-selection-crash-bug32823-2-expected.txt: Added.
              * editing/undo/orphaned-selection-crash-bug32823-2.html: Added.
              * editing/undo/orphaned-selection-crash-bug32823-3-expected.txt: Added.
              * editing/undo/orphaned-selection-crash-bug32823-3.html: Added.
              * editing/undo/orphaned-selection-crash-bug32823-4-expected.txt: Added.
              * editing/undo/orphaned-selection-crash-bug32823-4.html: Added.
              * editing/undo/redo-split-text-with-removal-expected.txt: Caret is restored.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@66032 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      d39a1e73
  34. 21 May, 2010 1 commit
    • hyatt@apple.com's avatar
      WebCore: https://bugs.webkit.org/show_bug.cgi?id=39420, :visited not working with background-color. · 36bdcfa6
      hyatt@apple.com authored
      Reviewed by Dan Bernstein.
      
      Make the RenderStyle color accessors private.  This forces callers to use visitedDependentColor
      instead (or to make the decision to become friends of the RenderStyle class in order to get access
      to the real style information).
      
      Modified history/self-is-visited.html to also test background colors.
      
      * WebCore.base.exp:
      * accessibility/AccessibilityTable.cpp:
      (WebCore::AccessibilityTable::isTableExposableThroughAccessibility):
      * accessibility/mac/AccessibilityObjectWrapper.mm:
      (AXAttributeStringSetStyle):
      * css/CSSComputedStyleDeclaration.cpp:
      (WebCore::CSSComputedStyleDeclaration::currentColorOrValidColor):
      * css/CSSComputedStyleDeclaration.h:
      * css/SVGCSSStyleSelector.cpp:
      (WebCore::colorFromSVGColorCSSValue):
      * editing/ApplyStyleCommand.cpp:
      (WebCore::ApplyStyleCommand::editingStyleAtPosition):
      (WebCore::prepareEditingStyleToApplyAt):
      (WebCore::removeStylesAddedByNode):
      (WebCore::fontColorChangesComputedStyle):
      (WebCore::ApplyStyleCommand::addInlineStyleIfNeeded):
      * editing/ApplyStyleCommand.h:
      (WebCore::):
      * editing/CompositeEditCommand.cpp:
      (WebCore::CompositeEditCommand::moveParagraphs):
      (WebCore::CompositeEditCommand::breakOutOfEmptyListItem):
      * editing/DeleteButtonController.cpp:
      (WebCore::isDeletableElement):
      * editing/DeleteSelectionCommand.cpp:
      (WebCore::DeleteSelectionCommand::saveTypingStyleState):
      * editing/InsertParagraphSeparatorCommand.cpp:
      (WebCore::InsertParagraphSeparatorCommand::calculateStyleBeforeInsertion):
      * editing/RemoveFormatCommand.cpp:
      (WebCore::RemoveFormatCommand::doApply):
      * editing/ReplaceSelectionCommand.cpp:
      (WebCore::handleStyleSpansBeforeInsertion):
      (WebCore::ReplaceSelectionCommand::handleStyleSpans):
      (WebCore::ReplaceSelectionCommand::doApply):
      * editing/SelectionController.cpp:
      (WebCore::SelectionController::paintCaret):
      * editing/markup.cpp:
      (WebCore::createMarkup):
      * page/animation/AnimationBase.cpp:
      (WebCore::AnimationBase::ensurePropertyMap):
      * page/animation/AnimationBase.h:
      * page/mac/FrameMac.mm:
      (WebCore::Frame::fontAttributesForSelectionStart):
      * rendering/EllipsisBox.cpp:
      (WebCore::EllipsisBox::paint):
      (WebCore::EllipsisBox::paintSelection):
      * rendering/InlineTextBox.cpp:
      (WebCore::InlineTextBox::paint):
      * rendering/RenderBox.cpp:
      (WebCore::RenderBox::styleDidChange):
      (WebCore::RenderBox::paintRootBoxDecorations):
      (WebCore::RenderBox::paintBoxDecorationsWithSize):
      * rendering/RenderBoxModelObject.cpp:
      (WebCore::RenderBoxModelObject::paintBoxShadow):
      * rendering/RenderFieldset.cpp:
      (WebCore::RenderFieldset::paintBoxDecorations):
      * rendering/RenderFileUploadControl.cpp:
      (WebCore::RenderFileUploadControl::paintObject):
      * rendering/RenderFrameSet.cpp:
      (WebCore::RenderFrameSet::paintColumnBorder):
      (WebCore::RenderFrameSet::paintRowBorder):
      * rendering/RenderImage.cpp:
      (WebCore::RenderImage::paintReplaced):
      * rendering/RenderLayerBacking.cpp:
      (WebCore::RenderLayerBacking::rendererBackgroundColor):
      * rendering/RenderLayerBacking.h:
      * rendering/RenderListBox.cpp:
      (WebCore::RenderListBox::paintItemForeground):
      (WebCore::RenderListBox::paintItemBackground):
      * rendering/RenderListMarker.cpp:
      (WebCore::RenderListMarker::paint):
      * rendering/RenderMenuList.cpp:
      (WebCore::RenderMenuList::itemStyle):
      (WebCore::RenderMenuList::itemBackgroundColor):
      (WebCore::RenderMenuList::menuStyle):
      * rendering/RenderObject.cpp:
      (WebCore::RenderObject::selectionBackgroundColor):
      (WebCore::RenderObject::selectionForegroundColor):
      * rendering/RenderSVGResource.cpp:
      (WebCore::RenderSVGResource::adjustColorForPseudoRules):
      (WebCore::RenderSVGResource::fillPaintingResource):
      (WebCore::RenderSVGResource::strokePaintingResource):
      * rendering/RenderSVGResource.h:
      * rendering/RenderTable.cpp:
      (WebCore::RenderTable::paintBoxDecorations):
      * rendering/RenderTable.h:
      (WebCore::RenderTable::bgColor):
      * rendering/RenderTableCell.cpp:
      (WebCore::RenderTableCell::paintBackgroundsBehindCell):
      * rendering/RenderTextControl.cpp:
      (WebCore::RenderTextControl::adjustInnerTextStyle):
      * rendering/RenderTextControlSingleLine.cpp:
      (WebCore::RenderTextControlSingleLine::menuStyle):
      * rendering/RenderTheme.cpp:
      (WebCore::RenderTheme::isControlStyled):
      * rendering/RenderThemeMac.mm:
      (WebCore::RenderThemeMac::paintMenuListButton):
      * rendering/RenderTreeAsText.cpp:
      (WebCore::RenderTreeAsText::writeRenderObject):
      (WebCore::write):
      * rendering/RenderTreeAsText.h:
      * rendering/SVGInlineTextBox.cpp:
      (WebCore::SVGInlineTextBox::paintSelection):
      * rendering/SVGRenderTreeAsText.cpp:
      (WebCore::writeRenderSVGTextBox):
      * rendering/style/RenderStyle.cpp:
      (WebCore::RenderStyle::colorIncludingFallback):
      (WebCore::RenderStyle::visitedDependentColor):
      * rendering/style/RenderStyle.h:
      (WebCore::):
      (WebCore::InheritedFlags::hasBackground):
      (WebCore::InheritedFlags::borderLeftStyle):
      (WebCore::InheritedFlags::borderRightStyle):
      (WebCore::InheritedFlags::borderTopStyle):
      (WebCore::InheritedFlags::borderBottomStyle):
      (WebCore::InheritedFlags::textShadow):
      (WebCore::InheritedFlags::textStrokeWidth):
      (WebCore::InheritedFlags::hasNormalColumnGap):
      (WebCore::InheritedFlags::borderLeftColor):
      (WebCore::InheritedFlags::borderRightColor):
      (WebCore::InheritedFlags::borderTopColor):
      (WebCore::InheritedFlags::borderBottomColor):
      (WebCore::InheritedFlags::backgroundColor):
      (WebCore::InheritedFlags::color):
      (WebCore::InheritedFlags::columnRuleColor):
      (WebCore::InheritedFlags::outlineColor):
      (WebCore::InheritedFlags::textFillColor):
      (WebCore::InheritedFlags::textStrokeColor):
      * svg/SVGAnimationElement.cpp:
      (WebCore::adjustForCurrentColor):
      
      WebKit/mac: https://bugs.webkit.org/show_bug.cgi?id=39420
      
      Reviewed by Dan Bernstein.
      
      Make sure everyone who needs to is using visitedDependentColor rather than accessing styles
      directly.
      
      * Misc/WebNSAttributedStringExtras.mm:
      (+[NSAttributedString _web_attributedStringFromRange:]):
      * WebView/WebFrame.mm:
      (-[WebFrame _bodyBackgroundColor]):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@59956 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      36bdcfa6
  35. 09 Mar, 2010 1 commit
    • tony@chromium.org's avatar
      2010-03-09 Tony Chang <tony@chromium.org> · 8c8fa6ce
      tony@chromium.org authored
              Reviewed by Adam Barth.
      
              https://bugs.webkit.org/show_bug.cgi?id=21840
              https://bugs.webkit.org/show_bug.cgi?id=23993
      
              Fix an editing bug where replacing a selection would result in the
              new text ending up inside nodes that were not visibly included in the
              selection.  Instead, move our destination position out of nodes that
              were not visibly included.
      
              Two new tests to verify the new behavior.  Because we're now inserting
              outside of some formatting nodes, some span tags are no longer necessary
              for undoing formatting caused by these formatting nodes.
      
              * editing/deleting/backspace-avoid-preceding-style-expected.txt: Added.
              * editing/deleting/backspace-avoid-preceding-style.html: Added.
              * editing/inserting/replace-at-visible-boundary-expected.txt: Added.
              * editing/inserting/replace-at-visible-boundary.html: Added.
              * platform/mac/editing/deleting/delete-3857753-fix-expected.txt:
              * platform/mac/editing/inserting/insert-div-026-expected.txt:
              * platform/mac/editing/pasteboard/paste-text-at-tabspan-001-expected.txt:
              * platform/mac/editing/pasteboard/paste-text-at-tabspan-002-expected.txt:
              * platform/mac/editing/style/font-family-with-space-expected.txt:
              * platform/mac/editing/style/smoosh-styles-001-expected.txt:
              * platform/mac/editing/style/style-boundary-005-expected.txt:
      2010-03-09  Tony Chang  <tony@chromium.org>
      
              Reviewed by Adam Barth.
      
              https://bugs.webkit.org/show_bug.cgi?id=21840
              https://bugs.webkit.org/show_bug.cgi?id=23993
      
              Fix an editing bug where replacing a selection would result in the
              new text ending up inside nodes that were not visibly included in the
              selection.  Instead, move our destination position out of nodes that
              were not visibly included.
      
              Tests: editing/deleting/backspace-avoid-preceding-style.html
                     editing/inserting/replace-at-visible-boundary.html
      
              * editing/ReplaceSelectionCommand.cpp:
              (WebCore::positionAvoidingPrecedingNodes):
              (WebCore::ReplaceSelectionCommand::doApply):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55762 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      8c8fa6ce
  36. 23 Feb, 2010 3 commits
  37. 18 Feb, 2010 1 commit
    • tony@chromium.org's avatar
      2010-02-17 Tony Chang <tony@chromium.org> · 2509fab1
      tony@chromium.org authored
              Reviewed by Eric Seidel.
      
              https://bugs.webkit.org/show_bug.cgi?id=26937
              No longer allow span styles to surround block elements like
              divs when pasting (see paste-text-012 and 5065605 which had divs in
              spans).  This also causes a few cases of empty spans to be removed
              (see 19089 and 5245519).
      
              * editing/execCommand/19089-expected.txt:
              * editing/pasteboard/5245519-expected.txt:
              * editing/pasteboard/5245519.html:
              * platform/mac/editing/pasteboard/5065605-expected.txt:
              * platform/mac/editing/pasteboard/paste-text-011-expected.txt:
              * platform/mac/editing/pasteboard/paste-text-012-expected.txt:
      2010-02-17  Tony Chang  <tony@chromium.org>
      
              Reviewed by Eric Seidel.
      
              Copying and pasting into a contenteditable area can create <div>s surrounded by <span>s
              https://bugs.webkit.org/show_bug.cgi?id=26937
      
              This happens because of a span added when we copy that is used to
              preserve styles.  To avoid this, when we paste, make sure to apply
              the styles to the span's children and then remove the style span.
      
              This change is covered by existing layout tests.
      
              * editing/ReplaceSelectionCommand.cpp:
              (WebCore::ReplaceSelectionCommand::handleStyleSpans):
              (WebCore::ReplaceSelectionCommand::copyStyleToChildren):
              * editing/ReplaceSelectionCommand.h:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54933 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      2509fab1