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. 11 May, 2011 1 commit
    • jpu@apple.com's avatar
      2011-05-11 Jia Pu <jpu@apple.com> · fd2014cc
      jpu@apple.com authored
              Reviewed by Darin Adler.
      
              Autocorrection persists after deleting and retyping the same word at same location.
              https://bugs.webkit.org/show_bug.cgi?id=60555
              <rdar://problem/9373915>
      
              See WebCore/ChangeLog for detail.
      
              * platform/mac-leopard/Skipped:
              * platform/mac-snowleopard/Skipped:
              * platform/mac/editing/spelling/delete-autocorrected-word-2-expected.png: Added.
              * platform/mac/editing/spelling/delete-autocorrected-word-2-expected.txt: Added.
              * platform/mac/editing/spelling/delete-autocorrected-word-2.html: Added.
      2011-05-11  Jia Pu  <jpu@apple.com>
      
              Reviewed by Darin Adler.
      
              Autocorrection persists after deleting and retyping the same word at same location.
              https://bugs.webkit.org/show_bug.cgi?id=60555
              <rdar://problem/9373915>
      
              This patch intends to alleviate the issue of repetitively applying the same autocorrection
              when user delete and retype the same word at the same location. This scenario is especially
              common when autocorrection modifies the first letter of the word.
      
              This patch consists following major changes:
              1. Added a new marker type, DeletedAutocorrection. This marker is added to the whitespace that
                 precedes a deleted autocorrection. If the user later types the same original word at after
                 this whitespace, the autocorrection will not be applied again.
              2. In DeleteSelectionCommand, added code to notify SpellingCorrectionController about the
                 autocorrection that has just been deleted.
              3. In Editor and SpellingCorrectionController, added code to apply the marker and to suppress
                 autocorrection when necessary.
              4. The change in CompositeEditCommand::replaceTextInNode is necessary for preserving markers.
                 Otherwise, we will loose the DeletedAutocorrection on the whitespace, when inserting text
                 after the whitespace.
      
              Test: platform/mac/editing/spelling/delete-autocorrected-word-2.html
      
              * dom/DocumentMarker.h: Added new marker type DeletedAutocorrection.
              (WebCore::DocumentMarker::AllMarkers::AllMarkers):
              * dom/DocumentMarkerController.cpp:
              (WebCore::DocumentMarkerController::markersInRange): Support querying multiple marker types.
              * dom/DocumentMarkerController.h:
              * editing/CompositeEditCommand.cpp:
              (WebCore::CompositeEditCommand::replaceTextInNodeAndPreserveMarkers):
              (WebCore::CompositeEditCommand::rebalanceWhitespaceOnTextSubstring):
              (WebCore::CompositeEditCommand::prepareWhitespaceAtPositionForSplit):
              * editing/CompositeEditCommand.h:
              * editing/DeleteSelectionCommand.cpp:
              (WebCore::DeleteSelectionCommand::DeleteSelectionCommand):
              (WebCore::DeleteSelectionCommand::fixupWhitespace):
              (WebCore::DeleteSelectionCommand::originalStringForAutocorrectionAtBeginningOfSelection): Extracting
                 the original string if we are deleting an autocorrection.
              (WebCore::DeleteSelectionCommand::doApply): Notify editor about the deleted autocorrection and its position.
              * editing/DeleteSelectionCommand.h:
              * editing/Editor.cpp:
              (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges): Moved all logic of determining
                 when to suppress an autocorrection into SpellingCorrectionController.
              (WebCore::Editor::deletedAutocorrectionAtPosition):
              * editing/Editor.h:
              * editing/InsertParagraphSeparatorCommand.cpp:
              (WebCore::InsertParagraphSeparatorCommand::doApply):
              * editing/SpellingCorrectionController.cpp:
              (WebCore::SpellingCorrectionController::respondToAppliedEditing):
              (WebCore::SpellingCorrectionController::deletedAutocorrectionAtPosition):
              (WebCore::SpellingCorrectionController::markPrecedingWhitespaceForDeletedAutocorrectionAfterCommand):
              (WebCore::SpellingCorrectionController::processMarkersOnTextToBeReplacedByResult):
              * editing/SpellingCorrectionController.h:
              (WebCore::SpellingCorrectionController::UNLESS_ENABLED):
              * editing/visible_units.cpp:
              (WebCore::isStartOfWord):
              * editing/visible_units.h:
              * manual-tests/autocorrection/spell-checking-after-reversion.html:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@86295 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      fd2014cc
  3. 31 Mar, 2011 1 commit
    • xji@chromium.org's avatar
      2011-03-30 Xiaomei Ji <xji@chromium.org> · 429dd21b
      xji@chromium.org authored
              Reviewed by Ryosuke Niwa.
      
              Experiment with moving caret by word in visual order.
              https://bugs.webkit.org/show_bug.cgi?id=57336
      
              * editing/selection/move-by-word-visually-expected.txt: Added.
              * editing/selection/move-by-word-visually.html: Added.
      2011-03-30  Xiaomei Ji  <xji@chromium.org>
      
              Reviewed by Ryosuke Niwa.
      
              Experiment with moving caret by word in visual order.
              https://bugs.webkit.org/show_bug.cgi?id=57336
      
              Follow Firefox's convention in Windows, 
              In LTR block, word break visually moves cursor to the left boundary of words,
              In RTL block, word break visually moves cursor to the right boundary of words.
      
              This is the 1st version of implementing "move caret by word in visual order".
              It only works in the following situation:
              1. For a LTR box in a LTR block or a RTL box in RTL block, 
              when caret is at the left boundary of the box and we are looking for 
              the word boundary in right.
              2. For a LTR or RTL box in a LTR block, when caret is at the left boundary
              of the box and we are looking for the word boundary in left and 
              previous box is a LTR box.
              3. For a LTR or RTL box in a RTL block, when the caret is at the right 
              boundary of the box and we are looking for the word boundary in right and next box is RTL box.
      
              An experimental granularity is introduced, as a side effect, functions having switch statements
              to handle those granularities have to add more one case to handle this new granularity.
              The experimental granularity is exposed though JS by '-webkit-visual-word".
      
              The overall algorithm is looping through inline boxes visually and looking
              for the visually nearest word break position. 
      
              Test: editing/selection/move-by-word-visually.html
      
              * editing/SelectionController.cpp:
              (WebCore::SelectionController::modifyExtendingRight):
              (WebCore::SelectionController::modifyExtendingForward):
              (WebCore::SelectionController::modifyMovingRight):
              (WebCore::SelectionController::modifyMovingForward):
              (WebCore::SelectionController::modifyExtendingLeft):
              (WebCore::SelectionController::modifyExtendingBackward):
              (WebCore::SelectionController::modifyMovingLeft):
              (WebCore::SelectionController::modifyMovingBackward):
              * editing/TextGranularity.h:
              * editing/VisibleSelection.cpp:
              (WebCore::VisibleSelection::setStartAndEndFromBaseAndExtentRespectingGranularity):
              * editing/visible_units.cpp:
              (WebCore::previousWordBreakInBoxInsideBlockWithSameDirectionality):
              (WebCore::wordBoundaryInBox):
              (WebCore::wordBoundaryInAdjacentBoxes):
              (WebCore::leftWordBoundary):
              (WebCore::rightWordBoundary):
              (WebCore::leftWordPosition):
              (WebCore::rightWordPosition):
              * editing/visible_units.h:
              * page/DOMSelection.cpp:
              (WebCore::DOMSelection::modify):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@82588 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      429dd21b
  4. 30 Mar, 2011 1 commit
    • leviw@chromium.org's avatar
      2011-03-30 Levi Weintraub <leviw@chromium.org> · 42ccdc9e
      leviw@chromium.org authored
              Reviewed by Ryosuke Niwa.
      
              Clicking below last line of right-to-left editable text that puts caret in the wrong place
              https://bugs.webkit.org/show_bug.cgi?id=38087
      
              Moving getLogical[Start/End]BoxWithNode to RootInlineBox and using it in positionForPointWithInlineChildren
              instead of lastLeafChild, which wasn't correct in the RTL case.
      
              Test: editing/selection/click-below-rtl-text.html
      
              * editing/visible_units.cpp:
              (WebCore::logicalStartPositionForLine): Moved to RootInlineBox.
              (WebCore::logicalEndPositionForLine): Ditto.
              * editing/visible_units.h:
              * rendering/RenderBlock.cpp:
              (WebCore::RenderBlock::positionForPointWithInlineChildren): Useing getLogicalEndBoxWithNode instead
              of lastLeafChild.
              * rendering/RootInlineBox.cpp:
              (WebCore::RootInlineBox::getLogicalStartBoxWithNode): Moved and refactored.
              (WebCore::RootInlineBox::getLogicalEndBoxWithNode): Ditto.
              * rendering/RootInlineBox.h:
      2011-03-30  Levi Weintraub  <leviw@chromium.org>
      
              Reviewed by Ryosuke Niwa.
      
              Clicking below last line of right-to-left editable text that puts caret in the wrong place
              https://bugs.webkit.org/show_bug.cgi?id=38087
      
              Doing the right thing when clicking below the last line box in RTL editable content.
      
              * editing/selection/click-below-rtl-text-expected.txt: Added.
              * editing/selection/click-below-rtl-text.html: Added.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@82447 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      42ccdc9e
  5. 10 Mar, 2011 2 commits
    • rniwa@webkit.org's avatar
      2011-03-10 Ryosuke Niwa <rniwa@webkit.org> · 45ecbafb
      rniwa@webkit.org authored
              Reviewed by Tony Chang.
      
              startOfBlock and endOfBlock may return a position inside hr
              https://bugs.webkit.org/show_bug.cgi?id=56025
      
              Replaced calls to enclosingBlockFlowElement in startOfBlock and endOfBlock by
              calls to enclosingBlock. Added EditingBoundaryCrossingRule to the argument lists
              of startOfBlock, endOfBlock, and enclosingBlock. Also replaced the last boolean
              argument variable of enclosingNodeOfType by EditingBoundaryCrossingRule.
      
              Also replaced calls to enclosingBlockFlowElement in inSameBlock by calls to
              enclosingBlock to be consitent with startOfBlock and endOfBlock.
      
              This patch also replaced calls to deprecatedNode in startOfBlock, endOfBlock,
              and inSameBlock by calls to containerNode because the enclosing block of a position
              should never be before or after the position.
      
              No tests are added because this change only affects WebCore internally.
      
              * editing/DeleteSelectionCommand.cpp:
              (WebCore::DeleteSelectionCommand::initializePositionData): Calls enclosingNodeOfType.
              Pass CanCrossEditingBoundary instead of false.
              * editing/htmlediting.cpp:
              (WebCore::unsplittableElementForPosition): Ditto.
              (WebCore::enclosingBlock): Takes EditingBoundaryCrossingRule and passes it to
              enclosingNodeOfType.
              (WebCore::enclosingNodeOfType): Takes EditingBoundaryCrossingRule instead of boolean.
              Fixed a bug that it stops walking the tree when it reached the root editable node
              even when the editing boundary crossing rule is CanCrossEditingBoundary.
              * editing/htmlediting.h: Prototype changes.
              * editing/visible_units.cpp:
              (WebCore::startOfBlock): Calls enclosingBlock instead of enclosingBlockFlowElement.
              Also added an early exit when there's no enclosing block.
              (WebCore::endOfBlock): Ditto. The early exist in this case prevents crash in
              lastPositionInNode.
              (WebCore::inSameBlock): Calls enclosingBlock instead of enclosingBlockFlowElement.
              (WebCore::isStartOfBlock): Calls startOfBlock with CanCrossEditingBoundary because
              we don't care where the start of block is when we're comparing against the given position.
              (WebCore::isEndOfBlock): Ditto.
              * editing/visible_units.h:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@80793 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      45ecbafb
    • leviw@chromium.org's avatar
      2011-03-10 Levi Weintraub <leviw@chromium.org> · 8f26e14c
      leviw@chromium.org authored
              Reviewed by Ryosuke Niwa.
      
              InsertUnorderedList over a non-editable region and multiple lines enters an infinite loop
              https://bugs.webkit.org/show_bug.cgi?id=53409
      
              Avoiding crashes and infinite loops when listifying content with mixed-editability
      
              * editing/execCommand/insert-list-with-noneditable-content-expected.txt: Added.
              * editing/execCommand/insert-list-with-noneditable-content.html: Added.
      2011-03-10  Levi Weintraub  <leviw@chromium.org>
      
              Reviewed by Ryosuke Niwa.
      
              InsertUnorderedList over a non-editable region and multiple lines enters an infinite loop
              https://bugs.webkit.org/show_bug.cgi?id=53409
      
              Fixing broken handling of mixed-editability content for InsertListCommand. Previously, if the selection
              spanned non-contenteditable regions, it would get stuck endlessly iterating the same region as the algorithm
              didn't skip the editable boundary.
      
              Test: editing/execCommand/insert-list-with-noneditable-content.html
      
              * editing/CompositeEditCommand.cpp:
              (WebCore::CompositeEditCommand::cleanupAfterDeletion): Changed signature to take the destination
              position for the active editing command. Without this, there are cases when the destination happens
              to be a placeholder, and we remove it.
              (WebCore::CompositeEditCommand::moveParagraphs):
              * editing/CompositeEditCommand.h:
              * editing/InsertListCommand.cpp:
              (WebCore::InsertListCommand::doApply): Added logic to the paragraph iteration loop to handle pockets of
              non-editable content in an editable context. Previously, this could cause an infinite loop.
              * editing/visible_units.cpp:
              (WebCore::startOfParagraph): Added a mode of operation where we'll jump across non-editable
              content in the same paragraph to reach the actual editable paragraph start.
              (WebCore::endOfParagraph): Ditto.
              (WebCore::startOfNextParagraph): Now uses the aforementioned non-editable content skipping mode of
              endOfParagraph.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@80780 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      8f26e14c
  6. 08 Jan, 2011 1 commit
  7. 04 Jan, 2011 1 commit
  8. 30 Dec, 2010 1 commit
  9. 27 Nov, 2010 1 commit
    • commit-queue@webkit.org's avatar
      2010-11-27 Benjamin Kalman <kalman@chromium.org> · f362872b
      commit-queue@webkit.org authored
              Reviewed by Darin Adler.
      
              Move Position::EditingBoundaryCrossingRule to a new header file
              https://bugs.webkit.org/show_bug.cgi?id=49630
      
              * GNUmakefile.am:
              * WebCore.exp.in:
              * WebCore.gypi:
              * WebCore.pro:
              * WebCore.vcproj/WebCore.vcproj:
              * WebCore.xcodeproj/project.pbxproj:
              * dom/Position.cpp:
              (WebCore::downstreamIgnoringEditingBoundaries):
              (WebCore::upstreamIgnoringEditingBoundaries):
              * dom/Position.h:
              * editing/DeleteSelectionCommand.cpp:
              (WebCore::DeleteSelectionCommand::doApply):
              * editing/EditingBoundary.h: Added.
              * editing/visible_units.cpp:
              (WebCore::startOfParagraph):
              (WebCore::endOfParagraph):
              (WebCore::isStartOfParagraph):
              (WebCore::isEndOfParagraph):
              * editing/visible_units.h:
              * rendering/RenderObject.cpp:
              (WebCore::RenderObject::createVisiblePosition):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@72777 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      f362872b
  10. 29 Oct, 2010 1 commit
    • commit-queue@webkit.org's avatar
      2010-10-29 Benjamin Kalman <kalman@google.com> · 1d836ce2
      commit-queue@webkit.org authored
              Reviewed by Tony Chang.
      
              Deleting contenteditable text to the left of a non-contenteditable span inserts unnecessary placeholder <br/>
              https://bugs.webkit.org/show_bug.cgi?id=48658
      
              * editing/deleting/5390681-expected.txt: Update test for changed behaviour.
              * editing/deleting/5390681.html: Ditto (update comment).
              * editing/deleting/delete-mixed-editable-content-001-expected.txt: Ditto.
              * editing/pasteboard/copy-backslash-with-euc-expected.txt: Ditto.
      2010-10-29  Benjamin Kalman  <kalman@google.com>
      
              Reviewed by Tony Chang.
      
              Deleting contenteditable text to the left of a non-contenteditable span inserts unnecessary placeholder <br/>
              https://bugs.webkit.org/show_bug.cgi?id=48658
      
              * WebCore.exp.in: Update is{Start,End}OfParagraph symbols.
              * editing/DeleteSelectionCommand.cpp:
              (WebCore::DeleteSelectionCommand::doApply): Cross editability boundaries when determining whether to insert placeholder.
              * editing/visible_units.cpp: Allow editability boundary to be crossed in {start,end,isStart,isEnd}OfParagraph.
              (WebCore::startOfParagraph): Also, avoid returning a position where renderer can't accept caret, like in endOfParagraph.
              (WebCore::endOfParagraph):
              (WebCore::isStartOfParagraph):
              (WebCore::isEndOfParagraph):
              * editing/visible_units.h: Ditto.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@70932 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      1d836ce2
  11. 29 Apr, 2009 3 commits
    • mitz@apple.com's avatar
      WebCore: · 1f71fe22
      mitz@apple.com authored
      2009-04-29  Xiaomei Ji  <xji@chromium.org>
      
              Reviewed by Dan Bernstein.
      
              Fix https://bugs.webkit.org/show_bug.cgi?id=24168
              RTL: Home/End key does not behave correctly in mixed bidi text in RTL document
      
              Test: editing/selection/home-end.html
      
              * editing/SelectionController.cpp:
              (WebCore::SelectionController::modifyExtendingForward): Change calling endOfLine()
              to logicalEndOfLine() when granularity is LineBoundary.
              (WebCore::SelectionController::modifyMovingForward): Change calling endOfLine()
              to logicalEndOfLine() when granularity is LineBoundary
              (WebCore::SelectionController::modifyExtendingBackward): Change calling 
              startOfLine() to logicalStartOfLine() when granularity is LineBoundary.
              (WebCore::SelectionController::modifyMovingBackward): Change calling startOfLine() 
              to logicalStartOfLine() when granularity is LineBoundary.
              * editing/visible_units.cpp:
              (WebCore::getLeafBoxesInLogicalOrder): Added. Reconstruct leaf boxes in logical order.
              (WebCore::getLogicalStartBoxAndNode): Added.
              (WebCore::getLogicalEndBoxAndNode): Added.
              (WebCore::logicalStartPositionForLine): Added. Similar to startPositionForLine.
              (WebCore::logicalStartOfLine): Added. Similar to startOfLine.
              (WebCore::logicalEndPositionForLine): Added. Similar to endPositionForLine.
              (WebCore::inSameLogicalLine): Added.
              (WebCore::logicalEndOfLine): Added. Similar to endOfLine.
              * editing/visible_units.h:
      
      LayoutTests:
      
      2009-04-29  Xiaomei Ji  <xji@chromium.org>
      
              Reviewed by Dan Bernstein.
      
              Fix https://bugs.webkit.org/show_bug.cgi?id=24168
              RTL: Home/End key does not behave correctly in mixed bidi text in RTL document
      
              * editing/selection/extend-selection-expected.txt: Added result for extend in
              lineBoundary.
              * editing/selection/extend-selection.html: Added test cases and script for extend
              in lineBoundary.
              * editing/selection/home-end-expected.txt: Added.
              * editing/selection/home-end.html: Added.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@43032 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      1f71fe22
    • eric@webkit.org's avatar
      2009-04-29 Eric Seidel <eric@webkit.org> · 037bfe8f
      eric@webkit.org authored
              No review, rolling out a patch.
      
              Revert http://trac.webkit.org/changeset/43019
      
              New tests failed because I removed the tabs from them
              when landing (since we avoid tabs in WebKit files).
              I couldn't tell if the new results were correct with
              spaces or not.
      
              * editing/SelectionController.cpp:
              (WebCore::SelectionController::modifyExtendingForward):
              (WebCore::SelectionController::modifyMovingForward):
              (WebCore::SelectionController::modifyExtendingBackward):
              (WebCore::SelectionController::modifyMovingBackward):
              * editing/visible_units.cpp:
              * editing/visible_units.h:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@43028 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      037bfe8f
    • eric@webkit.org's avatar
      2009-04-29 Xiaomei Ji <xji@chromium.org> · 78c1356a
      eric@webkit.org authored
              Reviewed by Dan Bernstein.
      
              Fix https://bugs.webkit.org/show_bug.cgi?id=24168
              RTL: Home/End key does not behave correctly in mixed bidi text in RTL document
      
              Test: editing/selection/home-end.html
      
              * editing/SelectionController.cpp:
              (WebCore::SelectionController::modifyExtendingForward): Change calling endOfLine()
              to logicalEndOfLine() when granularity is LineBoundary.
              (WebCore::SelectionController::modifyMovingForward): Change calling endOfLine()
              to logicalEndOfLine() when granularity is LineBoundary
              (WebCore::SelectionController::modifyExtendingBackward): Change calling
              startOfLine() to logicalStartOfLine() when granularity is LineBoundary.
              (WebCore::SelectionController::modifyMovingBackward): Change calling startOfLine()
              to logicalStartOfLine() when granularity is LineBoundary.
              * editing/visible_units.cpp:
              (WebCore::getLeafBoxesInLogicalOrder): Added. Reconstruct leaf boxes in logical order.
              (WebCore::getLogicalStartBoxAndNode): Added.
              (WebCore::getLogicalEndBoxAndNode): Added.
              (WebCore::logicalStartPositionForLine): Added. Similar to startPositionForLine.
              (WebCore::logicalStartOfLine): Added. Similar to startOfLine.
              (WebCore::logicalEndPositionForLine): Added. Similar to endPositionForLine.
              (WebCore::inSameLogicalLine): Added.
              (WebCore::logicalEndOfLine): Added. Similar to endOfLine.
              * editing/visible_units.h:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@43019 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      78c1356a
  12. 20 Dec, 2007 1 commit
    • justin.garcia@apple.com's avatar
      WebCore: · 8d84be1f
      justin.garcia@apple.com authored
              Reviewed by Oliver Hunt.
      
              <rdar://problem/5543472> GoogleDocs: Safari hangs when creating a list from a particular selection
              
              Still need to fix similar issues with the other operations that iterate 
              over selected paragraphs, like FormatBlock, Indent and Outdent (<rdar://problem/5658933>).
      
              * editing/IndentOutdentCommand.cpp:
              (WebCore::IndentOutdentCommand::indentRegion): Added a FIXME.
              * editing/IndentOutdentCommand.h: Removed an unused function.
              * editing/InsertListCommand.cpp:
              (WebCore::InsertListCommand::modifyRange): 
              Renamed visibleStart to startOfSelection and visibleEnd to endOfSelection.
              Call the new selectionForParagraphIteration, which a) prevents operations like this
              one from being performed on a table that isn't fully selected (where the selection
              starts just before the table and ends inside it), and b) helps prevent paragraph
              iteration from going past the end of the selection.
              Call the new startOfNextParagraph, instead of using endOfParagraph(v).next(),
              since when v is in the last paragraph of the last cell of a table, that expression 
              will return the position after the table, not the start of the next paragraph.
              * editing/htmlediting.cpp:
              (WebCore::enclosingListChild): Don't go above a table cell, so that list operations
              take effect inside the table cell where they are performed.
              (WebCore::selectionForParagraphIteration): Added, see above.
              (WebCore::indexForVisiblePosition): Moved from IndentOutdentCommand.cpp.
              * editing/htmlediting.h:
              * editing/visible_units.cpp:
              (WebCore::startOfNextParagraph): Added, see above.
              * editing/visible_units.h:
              * editing/TextIterator.h:
              (WebCore::TextIterator::exitNode): Added a FIXME.
      
      LayoutTests:
      
              Reviewed by Oliver Hunt.
              
              <rdar://problem/5543472> GoogleDocs: Safari hangs when creating a list from a particular selection
      
              * editing/execCommand/5543472-1-expected.txt: Added.
              * editing/execCommand/5543472-1.html: Added.
              * editing/execCommand/5543472-2-expected.txt: Added.
              * editing/execCommand/5543472-2.html: Added.
              * editing/execCommand/5543472-3-expected.txt: Added.
              * editing/execCommand/5543472-3.html: Added.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@28924 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      8d84be1f
  13. 14 Sep, 2006 1 commit
    • justing's avatar
      LayoutTests: · 50dad02e
      justing authored
              Reviewed by harrison
              
              <rdar://problem/4655880> Up/Down arrows skip over To Do
      
              * editing/selection/mixed-editability-3-expected.checksum: Added.
              * editing/selection/mixed-editability-3-expected.png: Added.
              * editing/selection/mixed-editability-3-expected.txt: Added.
              * editing/selection/mixed-editability-3.html: Added.
              * editing/selection/mixed-editability-4-expected.checksum: Added.
              * editing/selection/mixed-editability-4-expected.png: Added.
              * editing/selection/mixed-editability-4-expected.txt: Added.
              * editing/selection/mixed-editability-4.html: Added.
              * editing/selection/mixed-editability-5-expected.checksum: Added.
              * editing/selection/mixed-editability-5-expected.png: Added.
              * editing/selection/mixed-editability-5-expected.txt: Added.
              * editing/selection/mixed-editability-5.html: Added.
      
      WebCore:
      
              Reviewed by harrison
              
              <rdar://problem/4655880> Up/Down arrows skip over To Do
      
              * bridge/mac/WebCoreFrameBridge.mm:
              (-[WebCoreFrameBridge canDeleteRange:]): Added a FIXME.
              * dom/Node.cpp: Removed the unused inSameRootEditableElement.
              * dom/Node.h:
              * editing/SelectionController.cpp:
              (WebCore::SelectionController::modify): Added documentboundary to granularities in order test a fix.
              * editing/visible_units.cpp:
              (WebCore::previousLinePosition): Use highestEditableRoot so that this function can move from
              editable content into editable content that's embedded in non-editable content.
              (WebCore::nextLinePosition): Ditto.
              (WebCore::startOfEditableContent): Renamed from startOfEditableRoot and use highestEditableRoot.
              This is the behavior that callers desire.  This fixes Command + Up/Down.
              (WebCore::endOfEditableContent): Ditto.
              * editing/visible_units.h:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@16365 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      50dad02e
  14. 21 Aug, 2006 1 commit
    • harrison's avatar
      Reviewed by Justin. · f57e8dc5
      harrison authored
              <rdar://problem/4471481> Represent misspellings in AXAttributedStringForTextMarkerRange
      
              Added support for the NSAccessibilityMisspelledTextAttribute.
              
              Test cases added: None.  Manual AX testing is way too awkward, and automated testing
              is not possible.  See following bug...
                  <rdar://problem/4256882> Need automated testing support for accessibility APIs
      
              * bridge/mac/WebCoreAXObject.mm:
              Lots of trivial formatting in many methods.
              
              (-[WebCoreAXObject accessibilityAttributeValue:]):
              Fixed AXStartTextMarker and AXEndTextMarker to use startOfDocument and endOfDocument, instead of
              of positionForCoordinates. I had seen erroneous endOfDocument results while testing the spelling
              attribute.
      
              (WebCore::AXAttributeStringSetSpelling): 
              New. Adds the NSAccessibilityMisspelledTextAttribute for misspelled words.
      
              (-[WebCoreAXObject AXAttributedStringAppendText:]):
              Added call to AXAttributeStringSetSpelling.
              
              * editing/visible_units.cpp:
              (WebCore::startOfDocument):
              (WebCore::endOfDocument):
              Added for AXStartTextMarker/AXEndTextMarker fix, these forms of the familiar functions take a Node*,
              so a previously existing VisiblePosition is not required.
              
              * editing/visible_units.h:
              Declare new forms of startOfDocument and endOfDocument.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@15959 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      f57e8dc5
  15. 09 Jul, 2006 1 commit
    • darin's avatar
      Rubber stamped by Maciej (kinda). · b53ebdcb
      darin authored
              - did the next pass of renaming (used do-webcore-rename script)
                this takes care of most of the remaining KWQ names (almost all)
      
              * WebCore+SVG/DOMList.h:
              * WebCore.vcproj/WebCore/WebCore.vcproj:
              * WebCore.xcodeproj/project.pbxproj:
              * WebCoreSources.bkl:
              * bindings/js/kjs_dom.cpp:
              * bindings/js/kjs_window.cpp:
              * bindings/objc/DOMHTML.mm:
              * bridge/mac/FrameMac.h:
              * bridge/mac/FrameMac.mm:
              * bridge/mac/WebCoreFrameBridge.mm:
              * bridge/mac/WebCoreSettings.h:
              * bridge/mac/WebCoreSettings.mm:
              * bridge/win/FrameWin.cpp:
              * css/CSSPrimitiveValue.cpp:
              * css/CSSValueKeywords.in:
              * css/MediaQueryEvaluator.cpp:
              * css/cssparser.cpp:
              * css/cssstyleselector.cpp:
              * css/cssstyleselector.h:
              * dom/CharacterData.cpp:
              * dom/CharacterData.h:
              * dom/Document.cpp:
              * dom/Element.cpp:
              * dom/Element.h:
              * dom/EventTargetNode.cpp:
              * dom/EventTargetNode.h:
              * dom/Node.cpp:
              * dom/Node.h:
              * dom/Position.cpp:
              * dom/ProcessingInstruction.cpp:
              * dom/QualifiedName.cpp:
              * dom/QualifiedName.h:
              * dom/XMLTokenizer.cpp: Added.
              * dom/xml_tokenizer.cpp: Removed.
              * dom/xml_tokenizer.h: Removed.
              * editing/EditAction.h:
              * editing/HTMLInterchange.cpp:
              * editing/HTMLInterchange.h:
              * editing/Selection.h:
              * editing/SelectionController.h:
              * editing/TextAffinity.h:
              * editing/TextIterator.cpp:
              * editing/TextIterator.h:
              * editing/VisiblePosition.h:
              * editing/htmlediting.cpp:
              * editing/markup.cpp:
              * editing/markup.h:
              * editing/visible_units.cpp:
              * editing/visible_units.h:
              * html/HTMLDocument.cpp:
              * html/HTMLFontElement.cpp:
              * html/HTMLInputElement.cpp:
              * html/HTMLKeygenElement.cpp:
              * html/HTMLSelectElement.h:
              * html/HTMLTextAreaElement.cpp:
              * html/HTMLTextFieldInnerElement.cpp:
              * html/HTMLTokenizer.cpp:
              * html/HTMLTokenizer.h:
              * kcanvas/KCanvasContainer.cpp: Removed.
              * kcanvas/KCanvasContainer.h: Removed.
              * kcanvas/KCanvasCreator.cpp:
              * kcanvas/KCanvasFilters.cpp:
              * kcanvas/KCanvasFilters.h:
              * kcanvas/KCanvasMatrix.cpp:
              * kcanvas/KCanvasMatrix.h:
              * kcanvas/KCanvasPath.cpp:
              * kcanvas/KCanvasPath.h:
              * kcanvas/KCanvasResources.cpp:
              * kcanvas/KCanvasResources.h:
              * kcanvas/KCanvasTreeDebug.cpp:
              * kcanvas/KCanvasTreeDebug.h:
              * kcanvas/RenderForeignObject.cpp:
              * kcanvas/RenderForeignObject.h:
              * kcanvas/RenderPath.cpp:
              * kcanvas/RenderPath.h:
              * kcanvas/RenderSVGContainer.cpp: Added.
              * kcanvas/RenderSVGContainer.h: Added.
              * kcanvas/RenderSVGImage.cpp:
              * kcanvas/RenderSVGImage.h:
              * kcanvas/RenderSVGText.cpp:
              * kcanvas/RenderSVGText.h:
              * kcanvas/device/KRenderingPaintServer.h:
              * kcanvas/device/KRenderingPaintServerGradient.cpp:
              * kcanvas/device/KRenderingPaintServerGradient.h:
              * kcanvas/device/KRenderingPaintServerPattern.cpp:
              * kcanvas/device/KRenderingPaintServerPattern.h:
              * kcanvas/device/KRenderingPaintServerSolid.cpp:
              * kcanvas/device/KRenderingPaintServerSolid.h:
              * kcanvas/device/quartz/KCanvasFilterQuartz.mm:
              * kcanvas/device/quartz/KCanvasItemQuartz.h:
              * kcanvas/device/quartz/KCanvasResourcesQuartz.h:
              * kcanvas/device/quartz/KRenderingDeviceQuartz.mm:
              * kcanvas/device/quartz/KRenderingPaintServerGradientQuartz.mm:
              * kcanvas/device/quartz/KRenderingPaintServerQuartz.mm:
              * ksvg2/css/CSSValueKeywords.in:
              * ksvg2/css/SVGRenderStyleDefs.cpp:
              * ksvg2/misc/KCanvasRenderingStyle.cpp:
              * ksvg2/misc/KSVGTimeScheduler.cpp:
              * ksvg2/svg/SVGAElement.cpp:
              * ksvg2/svg/SVGAnimateTransformElement.cpp:
              * ksvg2/svg/SVGAnimateTransformElement.h:
              * ksvg2/svg/SVGGElement.cpp:
              * ksvg2/svg/SVGHelper.cpp:
              * ksvg2/svg/SVGHelper.h:
              * ksvg2/svg/SVGImageElement.cpp:
              * ksvg2/svg/SVGLinearGradientElement.cpp:
              * ksvg2/svg/SVGMarkerElement.cpp:
              * ksvg2/svg/SVGMaskElement.cpp:
              * ksvg2/svg/SVGMatrix.cpp:
              * ksvg2/svg/SVGMatrix.h:
              * ksvg2/svg/SVGPatternElement.cpp:
              * ksvg2/svg/SVGRadialGradientElement.cpp:
              * ksvg2/svg/SVGSVGElement.cpp:
              * ksvg2/svg/SVGStyledElement.h:
              * ksvg2/svg/SVGStyledTransformableElement.cpp:
              * ksvg2/svg/SVGStyledTransformableElement.h:
              * ksvg2/svg/SVGSwitchElement.cpp:
              * ksvg2/svg/SVGTextElement.cpp:
              * ksvg2/svg/SVGTransformable.h:
              * ksvg2/svg/SVGUseElement.cpp:
              * kwq/AffineTransform.cpp: Added.
              * kwq/AffineTransform.h: Added.
              * kwq/DeprecatedCString.cpp: Added.
              * kwq/DeprecatedCString.h: Added.
              * kwq/DeprecatedPtrQueue.h: Added.
              * kwq/FileButton.h: Added.
              * kwq/FileButton.mm: Added.
              * kwq/FormDataMac.mm: Added.
              * kwq/KWQCString.cpp: Removed.
              * kwq/KWQCString.h: Removed.
              * kwq/KWQComboBox.h: Removed.
              * kwq/KWQComboBox.mm: Removed.
              * kwq/KWQEditCommand.h: Removed.
              * kwq/KWQEditCommand.mm: Removed.
              * kwq/KWQFileButton.h: Removed.
              * kwq/KWQFileButton.mm: Removed.
              * kwq/KWQFormData.h: Removed.
              * kwq/KWQFormData.mm: Removed.
              * kwq/KWQKHTMLSettings.h: Removed.
              * kwq/KWQKIOGlobal.h: Removed.
              * kwq/KWQKSSLKeyGen.h: Removed.
              * kwq/KWQKSSLKeyGen.mm: Removed.
              * kwq/KWQLineEdit.h: Removed.
              * kwq/KWQLineEdit.mm: Removed.
              * kwq/KWQListBox.h: Removed.
              * kwq/KWQListBox.mm: Removed.
              * kwq/KWQLoader.h: Removed.
              * kwq/KWQLoader.mm: Removed.
              * kwq/KWQPageState.h: Removed.
              * kwq/KWQPageState.mm: Removed.
              * kwq/KWQPtrQueue.h: Removed.
              * kwq/KWQResourceLoader.h: Removed.
              * kwq/KWQResourceLoader.mm: Removed.
              * kwq/KWQScrollBar.h: Removed.
              * kwq/KWQScrollBar.mm: Removed.
              * kwq/KWQSlider.h: Removed.
              * kwq/KWQSlider.mm: Removed.
              * kwq/KWQTextEdit.h: Removed.
              * kwq/KWQTextEdit.mm: Removed.
              * kwq/KWQTextStream.cpp: Removed.
              * kwq/KWQTextStream.h: Removed.
              * kwq/KWQWMatrix.cpp: Removed.
              * kwq/KWQWMatrix.h: Removed.
              * kwq/ListBox.h: Added.
              * kwq/ListBox.mm: Added.
              * kwq/LoaderFunctions.h: Added.
              * kwq/LoaderFunctions.mm: Added.
              * kwq/PopUpButton.h: Added.
              * kwq/PopUpButton.mm: Added.
              * kwq/SSLKeyGenerator.h: Added.
              * kwq/SSLKeyGenerator.mm: Added.
              * kwq/Settings.h: Added.
              * kwq/TextBox.h: Added.
              * kwq/TextBox.mm: Added.
              * kwq/TextField.h: Added.
              * kwq/TextField.mm: Added.
              * kwq/TextStream.cpp: Added.
              * kwq/TextStream.h: Added.
              * kwq/WebCoreEditCommand.h: Added.
              * kwq/WebCoreEditCommand.mm: Added.
              * kwq/WebCorePageState.h: Added.
              * kwq/WebCorePageState.mm: Added.
              * kwq/WebCoreResourceLoaderImp.h: Added.
              * kwq/WebCoreResourceLoaderImp.mm: Added.
              * kwq/WebCoreScrollBar.h: Added.
              * kwq/WebCoreScrollBar.mm: Added.
              * kwq/WebCoreSlider.h: Added.
              * kwq/WebCoreSlider.mm: Added.
              * loader/Cache.h:
              * loader/CachedCSSStyleSheet.cpp:
              * loader/CachedImage.cpp:
              * loader/CachedObject.h:
              * loader/CachedObjectClientWalker.h:
              * loader/CachedResource.h:
              * loader/CachedResourceClientWalker.h:
              * loader/CachedScript.h:
              * loader/CachedXBLDocument.h:
              * loader/Decoder.h:
              * loader/DocLoader.cpp:
              * loader/DocLoader.h:
              * loader/FormData.h:
              * loader/ImageDocument.cpp:
              * loader/PluginDocument.cpp:
              * loader/TextDocument.cpp:
              * loader/loader.cpp:
              * loader/loader.h:
              * page/Frame.cpp:
              * page/Frame.h:
              * page/FramePrivate.h:
              * page/Page.cpp:
              * page/Page.h:
              * platform/DeprecatedPtrList.h:
              * platform/DeprecatedPtrListImpl.cpp:
              * platform/DeprecatedPtrListImpl.h:
              * platform/DeprecatedString.cpp:
              * platform/DeprecatedString.h:
              * platform/DeprecatedStringList.cpp:
              * platform/DeprecatedStringList.h:
              * platform/DeprecatedValueList.h:
              * platform/DeprecatedValueListImpl.cpp:
              * platform/DeprecatedValueListImpl.h:
              * platform/FloatSize.h:
              * platform/Font.cpp:
              * platform/KURL.cpp:
              * platform/RegularExpression.cpp:
              * platform/RegularExpression.h:
              * platform/SegmentedString.h:
              * platform/StreamingTextDecoder.cpp:
              * platform/String.cpp:
              * platform/StringImpl.cpp:
              * platform/TextEncoding.cpp:
              * platform/TransferJob.cpp:
              * platform/TransferJob.h:
              * platform/TransferJobInternal.h:
              * platform/gdk/FrameGdk.cpp:
              * platform/gdk/TemporaryLinkStubs.cpp:
              * platform/mac/ClipboardMac.h:
              * platform/mac/ClipboardMac.mm:
              * platform/mac/CursorMac.mm:
              * platform/mac/DeprecatedStringMac.mm: Added.
              * platform/mac/FontCacheMac.mm:
              * platform/mac/FontMac.mm:
              * platform/mac/FoundationExtras.h:
              * platform/mac/ImageMac.mm:
              * platform/mac/KURLMac.mm:
              * platform/mac/MouseEventMac.mm: Removed.
              * platform/mac/QStringListMac.mm: Removed.
              * platform/mac/QStringMac.mm: Removed.
              * platform/mac/TransferJobMac.mm:
              * platform/mac/WebCoreTextArea.h:
              * platform/mac/WebCoreTextArea.mm:
              * platform/mac/WebCoreTextField.h:
              * platform/mac/WebCoreTextField.mm:
              * platform/mac/WidgetMac.mm:
              * platform/win/TemporaryLinkStubs.cpp:
              * rendering/DataRef.h:
              * rendering/DeprecatedRenderSelect.cpp:
              * rendering/DeprecatedRenderSelect.h:
              * rendering/DeprecatedSlider.cpp:
              * rendering/InlineFlowBox.cpp:
              * rendering/RenderApplet.cpp:
              * rendering/RenderBlock.cpp:
              * rendering/RenderBlock.h:
              * rendering/RenderContainer.cpp:
              * rendering/RenderFileButton.cpp:
              * rendering/RenderFlexibleBox.cpp:
              * rendering/RenderFlow.cpp:
              * rendering/RenderFormElement.cpp:
              * rendering/RenderFrameSet.cpp:
              * rendering/RenderFrameSet.h:
              * rendering/RenderImage.cpp:
              * rendering/RenderInline.cpp:
              * rendering/RenderLayer.cpp:
              * rendering/RenderLayer.h:
              * rendering/RenderLineEdit.cpp:
              * rendering/RenderListItem.cpp:
              * rendering/RenderListMarker.cpp:
              * rendering/RenderObject.cpp:
              * rendering/RenderObject.h:
              * rendering/RenderPartObject.cpp:
              * rendering/RenderReplaced.cpp:
              * rendering/RenderStyle.cpp: Added.
              * rendering/RenderStyle.h: Added.
              * rendering/RenderTable.cpp:
              * rendering/RenderTable.h:
              * rendering/RenderTableCell.cpp:
              * rendering/RenderTableCell.h:
              * rendering/RenderTableCol.cpp:
              * rendering/RenderTableCol.h:
              * rendering/RenderTableRow.cpp:
              * rendering/RenderTableSection.cpp:
              * rendering/RenderTableSection.h:
              * rendering/RenderText.cpp:
              * rendering/RenderText.h:
              * rendering/RenderTextArea.cpp:
              * rendering/RenderTextControl.cpp: Added.
              * rendering/RenderTextControl.h: Added.
              * rendering/RenderTextField.cpp: Removed.
              * rendering/RenderTextField.h: Removed.
              * rendering/RenderTheme.cpp:
              * rendering/RenderThemeMac.mm:
              * rendering/RenderTreeAsText.cpp:
              * rendering/RenderTreeAsText.h:
              * rendering/RenderView.cpp:
              * rendering/RenderWidget.cpp:
              * rendering/bidi.cpp:
              * rendering/render_style.cpp: Removed.
              * rendering/render_style.h: Removed.
              * xml/XSLStyleSheet.cpp:
              * xml/XSLTProcessor.cpp:
              * xml/xmlhttprequest.cpp:
              * xpath/impl/XPathParser.cpp:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@15253 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      b53ebdcb
  16. 12 Apr, 2006 1 commit
    • harrison's avatar
      Reviewed by Darin. · 81fe3881
      harrison authored
              <rdar://problem/4386640> AX: AXPreviousSentenceStartTextMarkerForTextMarker does not respect paragraph boundary
              <rdar://problem/4414575> AX: Dictionary popup cannot find some words on Dictionary.app
      
              AXPreviousSentenceStartTextMarkerForTextMarker failed to stop at the beginning a block because
              SimplifiedBackwardsTextIterator::handleNonTextNode() emitted a space when exiting the block.
              Fixed by emitting a newline instead.
              
              Word boundary failed to stop at the beginning of a block because no character at all was emitted
              when leaving the block, because the exitNode was checking specific html tags to decide whether the
              node is block, but the node was xml.  Fixed by using the node's renderer, if present.
              
              (see related changes in WebKit)
              
              Tests added:
              * editing/selection/extend-by-sentence-001.html: Added.
              * fast/dom/inner-text-001.html: Added.
              
              * bridge/mac/WebCoreFrameBridge.h:
              * bridge/mac/WebCoreFrameBridge.mm:
              (-[WebCoreFrameBridge alterCurrentSelection:direction:granularity:]):
              Add sentence navigation/selection.
              
              * editing/Selection.cpp:
              (WebCore::Selection::validate):
              Add sentence navigation/selection.
      
              * editing/SelectionController.cpp:
              (WebCore::SelectionController::modifyExtendingRightForward):
              (WebCore::SelectionController::modifyMovingRightForward):
              (WebCore::SelectionController::modifyExtendingLeftBackward):
              (WebCore::SelectionController::modifyMovingLeftBackward):
              (WebCore::SelectionController::modify):
              Add sentence navigation/selection.
      
              * editing/TextGranularity.h:
              (WebCore::):
              Add SentenceGranularity and SentenceBoundary.
      
              * editing/TextIterator.cpp:
              (WebCore::isTableCell):
              (WebCore::shouldEmitTabBeforeNode):
              (WebCore::shouldEmitNewlineForNode):
              (WebCore::shouldEmitNewlinesBeforeAndAfterNode):
              (WebCore::shouldEmitExtraNewlineForNode):
              New utility functions that prefer renderers over html tag names.
      
              (WebCore::TextIterator::handleNonTextNode):
              (WebCore::TextIterator::exitNode):
              (WebCore::SimplifiedBackwardsTextIterator::advance):
              Use new utility functions.
              
              (WebCore::SimplifiedBackwardsTextIterator::handleNonTextNode):
              Use new utility functions.  Also emit linefeed instead of space,
              so sentence parsing works across block boundaries.
              
              (WebCore::SimplifiedBackwardsTextIterator::exitNode):
              Use new utility functions.
      
              (WebCore::SimplifiedBackwardsTextIterator::emitNewline):
              Renamed from emitNewlineForBROrText because it is not always for BR or text.
              
              * editing/TextIterator.h:
              Renamed emitNewlineForBROrText to emitNewline.
              
              * editing/visible_units.cpp:
              * editing/visible_units.h:
              (WebCore::previousBoundary):
              (WebCore::nextBoundary):
              (WebCore::previousSentencePosition):
              (WebCore::nextSentencePosition):
              Add sentence navigation/selection.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@13849 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      81fe3881
  17. 19 Mar, 2006 1 commit
  18. 14 Feb, 2006 1 commit
    • darin's avatar
      Rubber-stamped by Eric. · a68e043d
      darin authored
              - moved editing sources from khtml/editing to editing, and renamed files with single classes
      
              * WebCore.xcodeproj/project.pbxproj: Added new, removed old.
              * WebCore.vcproj/WebCore/WebCore.vcproj: Ditto.
      
              * bridge/mac/MacFrame.mm:
              * bridge/mac/WebCoreFrameBridge.mm:
              * dom/DocumentImpl.cpp:
              * dom/dom2_rangeimpl.cpp:
              * dom/dom_position.cpp:
              * khtml/khtml_events.cpp:
              * kwq/KWQAccObject.mm:
              * kwq/KWQAccObjectCache.h:
              * kwq/KWQEditCommand.mm:
              * page/Frame.cpp:
              * page/FramePrivate.h:
              * rendering/RenderBlock.cpp:
              * rendering/RenderContainer.cpp:
              * rendering/RenderText.cpp:
              * rendering/render_br.cpp:
              * rendering/render_inline.cpp:
              * rendering/render_object.cpp:
              * rendering/render_replaced.cpp:
              Fixed up includes.
      
              * editing: Added.
              * editing/AppendNodeCommand.cpp: Added.
              * editing/AppendNodeCommand.h: Added.
              * editing/ApplyStyleCommand.cpp: Added.
              * editing/ApplyStyleCommand.h: Added.
              * editing/BreakBlockquoteCommand.cpp: Added.
              * editing/BreakBlockquoteCommand.h: Added.
              * editing/CompositeEditCommand.cpp: Added.
              * editing/CompositeEditCommand.h: Added.
              * editing/DeleteFromTextNodeCommand.cpp: Added.
              * editing/DeleteFromTextNodeCommand.h: Added.
              * editing/DeleteSelectionCommand.cpp: Added.
              * editing/DeleteSelectionCommand.h: Added.
              * editing/EditCommand.cpp: Added.
              * editing/EditCommand.h: Added.
              * editing/InsertIntoTextNodeCommand.cpp: Added.
              * editing/InsertIntoTextNodeCommand.h: Added.
              * editing/InsertLineBreakCommand.cpp: Added.
              * editing/InsertLineBreakCommand.h: Added.
              * editing/InsertNodeBeforeCommand.cpp: Added.
              * editing/InsertNodeBeforeCommand.h: Added.
              * editing/InsertParagraphSeparatorCommand.cpp: Added.
              * editing/InsertParagraphSeparatorCommand.h: Added.
              * editing/InsertTextCommand.cpp: Added.
              * editing/InsertTextCommand.h: Added.
              * editing/JoinTextNodesCommand.cpp: Added.
              * editing/JoinTextNodesCommand.h: Added.
              * editing/MergeIdenticalElementsCommand.cpp: Added.
              * editing/MergeIdenticalElementsCommand.h: Added.
              * editing/MoveSelectionCommand.cpp: Added.
              * editing/MoveSelectionCommand.h: Added.
              * editing/RebalanceWhitespaceCommand.cpp: Added.
              * editing/RebalanceWhitespaceCommand.h: Added.
              * editing/RemoveCSSPropertyCommand.cpp: Added.
              * editing/RemoveCSSPropertyCommand.h: Added.
              * editing/RemoveNodeAttributeCommand.cpp: Added.
              * editing/RemoveNodeAttributeCommand.h: Added.
              * editing/RemoveNodeCommand.cpp: Added.
              * editing/RemoveNodeCommand.h: Added.
              * editing/RemoveNodePreservingChildrenCommand.cpp: Added.
              * editing/RemoveNodePreservingChildrenCommand.h: Added.
              * editing/ReplaceSelectionCommand.cpp: Added.
              * editing/ReplaceSelectionCommand.h: Added.
              * editing/Selection.cpp:
              * editing/SelectionController.cpp:
              * editing/SetNodeAttributeCommand.cpp: Added.
              * editing/SetNodeAttributeCommand.h: Added.
              * editing/SplitElementCommand.cpp: Added.
              * editing/SplitElementCommand.h: Added.
              * editing/SplitTextNodeCommand.cpp: Added.
              * editing/SplitTextNodeCommand.h: Added.
              * editing/SplitTextNodeContainingElementCommand.cpp: Added.
              * editing/SplitTextNodeContainingElementCommand.h: Added.
              * editing/TypingCommand.cpp: Added.
              * editing/TypingCommand.h: Added.
              * editing/VisiblePosition.cpp: Added.
              * editing/VisiblePosition.h: Added.
              * editing/VisibleRange.cpp: Added.
              * editing/VisibleRange.h: Added.
              * editing/WrapContentsInDummySpanCommand.cpp: Added.
              * editing/WrapContentsInDummySpanCommand.h: Added.
              * editing/append_node_command.cpp: Removed.
              * editing/append_node_command.h: Removed.
              * editing/apply_style_command.cpp: Removed.
              * editing/apply_style_command.h: Removed.
              * editing/break_blockquote_command.cpp: Removed.
              * editing/break_blockquote_command.h: Removed.
              * editing/composite_edit_command.cpp: Removed.
              * editing/composite_edit_command.h: Removed.
              * editing/delete_from_text_node_command.cpp: Removed.
              * editing/delete_from_text_node_command.h: Removed.
              * editing/delete_selection_command.cpp: Removed.
              * editing/delete_selection_command.h: Removed.
              * editing/edit_command.cpp: Removed.
              * editing/edit_command.h: Removed.
              * editing/htmlediting.cpp:
              * editing/insert_into_text_node_command.cpp: Removed.
              * editing/insert_into_text_node_command.h: Removed.
              * editing/insert_line_break_command.cpp: Removed.
              * editing/insert_line_break_command.h: Removed.
              * editing/insert_node_before_command.cpp: Removed.
              * editing/insert_node_before_command.h: Removed.
              * editing/insert_paragraph_separator_command.cpp: Removed.
              * editing/insert_paragraph_separator_command.h: Removed.
              * editing/insert_text_command.cpp: Removed.
              * editing/insert_text_command.h: Removed.
              * editing/join_text_nodes_command.cpp: Removed.
              * editing/join_text_nodes_command.h: Removed.
              * editing/jsediting.cpp:
              * editing/markup.cpp:
              * editing/merge_identical_elements_command.cpp: Removed.
              * editing/merge_identical_elements_command.h: Removed.
              * editing/move_selection_command.cpp: Removed.
              * editing/move_selection_command.h: Removed.
              * editing/rebalance_whitespace_command.cpp: Removed.
              * editing/rebalance_whitespace_command.h: Removed.
              * editing/remove_css_property_command.cpp: Removed.
              * editing/remove_css_property_command.h: Removed.
              * editing/remove_node_attribute_command.cpp: Removed.
              * editing/remove_node_attribute_command.h: Removed.
              * editing/remove_node_command.cpp: Removed.
              * editing/remove_node_command.h: Removed.
              * editing/remove_node_preserving_children_command.cpp: Removed.
              * editing/remove_node_preserving_children_command.h: Removed.
              * editing/replace_selection_command.cpp: Removed.
              * editing/replace_selection_command.h: Removed.
              * editing/set_node_attribute_command.cpp: Removed.
              * editing/set_node_attribute_command.h: Removed.
              * editing/split_element_command.cpp: Removed.
              * editing/split_element_command.h: Removed.
              * editing/split_text_node_command.cpp: Removed.
              * editing/split_text_node_command.h: Removed.
              * editing/split_text_node_containing_element.cpp: Removed.
              * editing/split_text_node_containing_element_command.h: Removed.
              * editing/typing_command.cpp: Removed.
              * editing/typing_command.h: Removed.
              * editing/visible_position.cpp: Removed.
              * editing/visible_position.h: Removed.
              * editing/visible_range.cpp: Removed.
              * editing/visible_range.h: Removed.
              * editing/visible_units.cpp:
              * editing/wrap_contents_in_dummy_span_command.cpp: Removed.
              * editing/wrap_contents_in_dummy_span_command.h: Removed.
      
              * khtml/editing: Removed.
              * khtml/editing/Selection.cpp: Removed.
              * khtml/editing/Selection.h: Removed.
              * khtml/editing/SelectionController.cpp: Removed.
              * khtml/editing/SelectionController.h: Removed.
              * khtml/editing/append_node_command.cpp: Removed.
              * khtml/editing/append_node_command.h: Removed.
              * khtml/editing/apply_style_command.cpp: Removed.
              * khtml/editing/apply_style_command.h: Removed.
              * khtml/editing/break_blockquote_command.cpp: Removed.
              * khtml/editing/break_blockquote_command.h: Removed.
              * khtml/editing/composite_edit_command.cpp: Removed.
              * khtml/editing/composite_edit_command.h: Removed.
              * khtml/editing/delete_from_text_node_command.cpp: Removed.
              * khtml/editing/delete_from_text_node_command.h: Removed.
              * khtml/editing/delete_selection_command.cpp: Removed.
              * khtml/editing/delete_selection_command.h: Removed.
              * khtml/editing/edit_actions.h: Removed.
              * khtml/editing/edit_command.cpp: Removed.
              * khtml/editing/edit_command.h: Removed.
              * khtml/editing/html_interchange.cpp: Removed.
              * khtml/editing/html_interchange.h: Removed.
              * khtml/editing/htmlediting.cpp: Removed.
              * khtml/editing/htmlediting.h: Removed.
              * khtml/editing/insert_into_text_node_command.cpp: Removed.
              * khtml/editing/insert_into_text_node_command.h: Removed.
              * khtml/editing/insert_line_break_command.cpp: Removed.
              * khtml/editing/insert_line_break_command.h: Removed.
              * khtml/editing/insert_node_before_command.cpp: Removed.
              * khtml/editing/insert_node_before_command.h: Removed.
              * khtml/editing/insert_paragraph_separator_command.cpp: Removed.
              * khtml/editing/insert_paragraph_separator_command.h: Removed.
              * khtml/editing/insert_text_command.cpp: Removed.
              * khtml/editing/insert_text_command.h: Removed.
              * khtml/editing/join_text_nodes_command.cpp: Removed.
              * khtml/editing/join_text_nodes_command.h: Removed.
              * khtml/editing/jsediting.cpp: Removed.
              * khtml/editing/jsediting.h: Removed.
              * khtml/editing/markup.cpp: Removed.
              * khtml/editing/markup.h: Removed.
              * khtml/editing/merge_identical_elements_command.cpp: Removed.
              * khtml/editing/merge_identical_elements_command.h: Removed.
              * khtml/editing/move_selection_command.cpp: Removed.
              * khtml/editing/move_selection_command.h: Removed.
              * khtml/editing/rebalance_whitespace_command.cpp: Removed.
              * khtml/editing/rebalance_whitespace_command.h: Removed.
              * khtml/editing/remove_css_property_command.cpp: Removed.
              * khtml/editing/remove_css_property_command.h: Removed.
              * khtml/editing/remove_node_attribute_command.cpp: Removed.
              * khtml/editing/remove_node_attribute_command.h: Removed.
              * khtml/editing/remove_node_command.cpp: Removed.
              * khtml/editing/remove_node_command.h: Removed.
              * khtml/editing/remove_node_preserving_children_command.cpp: Removed.
              * khtml/editing/remove_node_preserving_children_command.h: Removed.
              * khtml/editing/replace_selection_command.cpp: Removed.
              * khtml/editing/replace_selection_command.h: Removed.
              * khtml/editing/set_node_attribute_command.cpp: Removed.
              * khtml/editing/set_node_attribute_command.h: Removed.
              * khtml/editing/split_element_command.cpp: Removed.
              * khtml/editing/split_element_command.h: Removed.
              * khtml/editing/split_text_node_command.cpp: Removed.
              * khtml/editing/split_text_node_command.h: Removed.
              * khtml/editing/split_text_node_containing_element.cpp: Removed.
              * khtml/editing/split_text_node_containing_element_command.h: Removed.
              * khtml/editing/text_affinity.h: Removed.
              * khtml/editing/text_granularity.h: Removed.
              * khtml/editing/typing_command.cpp: Removed.
              * khtml/editing/typing_command.h: Removed.
              * khtml/editing/visible_position.cpp: Removed.
              * khtml/editing/visible_position.h: Removed.
              * khtml/editing/visible_range.cpp: Removed.
              * khtml/editing/visible_range.h: Removed.
              * khtml/editing/visible_text.cpp: Removed.
              * khtml/editing/visible_text.h: Removed.
              * khtml/editing/visible_units.cpp: Removed.
              * khtml/editing/visible_units.h: Removed.
              * khtml/editing/wrap_contents_in_dummy_span_command.cpp: Removed.
              * khtml/editing/wrap_contents_in_dummy_span_command.h: Removed.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@12803 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      a68e043d
  19. 09 Dec, 2005 1 commit
    • justing's avatar
      <rdar://problem/4370209> Reproducible crash when pasting over whitespace:pre text · 076923db
      justing authored
              <rdar://problem/4370220> Double or triple clicking in whitespace:pre text creates incorrect selections
              Some preparation for a fix for:
              <radar://problem/4364427> triple-click includes first item on next line (www.apple.com, but I think I've seen it elsewhere)
      
              There were a few bugs in endOfParagraph's and endOfLine's handling of IncludeLineBreak.
              The IncludeLinebreak concept also doesn't make sense: when asked to
              IncludeLineBreak, "endOfParagraph" would return the start of the next paragraph.
              Callers that want this funtionality should just call endOfParagraph and then get next()
              if it exists.
              In endOfParagraph's whitespace:pre handling, when the input visible position
              was at the end of a text node with whitespace:pre, that text node was searched
              for '/n'.  It should be skipped.
      
              Reviewed by harrison
      
              Added new layout tests in editing/pasting and editing/selection
      
              * khtml/editing/SelectionController.cpp:
              (khtml::SelectionController::validate):
              * khtml/editing/composite_edit_command.cpp:
              (khtml::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary):
              * khtml/editing/visible_units.cpp:
              (khtml::endOfLine):
              (khtml::isEndOfLine):
              (khtml::endOfParagraph):
              (khtml::isEndOfParagraph):
              * khtml/editing/visible_units.h:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@11514 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      076923db
  20. 09 May, 2005 1 commit
    • mjs's avatar
      Reviewed by Kevin. · 158283b7
      mjs authored
      	- remove isFirstVisiblePositionInBlock and isLastVisiblePositionInBlock, in favor of isStartOfBlock and isEndOfBlock
      
      	It turned out that both isEndOfBlock and isLastVisiblePositionInBlock had (different) bugs,
      	and there was code relying on the bugs of each. So in addition I fixed isEndOfBlock and fixed
      	the parts of the code relying on buggy behavior.
      
      	I also removed the includeEndOfLine parameter to endOfBlock since no one used it and it's not
      	clear if it would ever be useful.
      
              * khtml/editing/htmlediting.cpp:
              (khtml::InsertLineBreakCommand::doApply): Use new calls.
              (khtml::InsertParagraphSeparatorCommand::calculateStyleBeforeInsertion): Don't gratuitously make
      	an UPSTREAM VisiblePosition, as this will cause trouble comparing it to end of block.
              (khtml::InsertParagraphSeparatorCommand::doApply): Use new calls.
              (khtml::ReplaceSelectionCommand::doApply): Use new calls. Also, don't make a position <BR,0> and test
      	if it is the end of a block, that can never be true, although the buggy code in
      	isLastVisiblePositionInBlock would say it is. Make <BR,1> instead.
              * khtml/editing/markup.cpp:
              (khtml::createMarkup): Instead of checking isEndOfBlock on the start position, check if the start's
      	next is in a different block, to avoid relying on the buggy old isEndOfBlock behavior.
              * khtml/editing/visible_position.cpp:
              (khtml::isFirstVisiblePositionInParagraph): Use isStartOfBlock.
              (khtml::isLastVisiblePositionInParagraph): Use isEndOfBlock.
              * khtml/editing/visible_position.h:
              * khtml/editing/visible_units.cpp:
              (khtml::endOfBlock): Greatly simplify, and no longer consider the start of a descendant
      	block to be the end of the block. That's inconsistent with how startOfBlock works. Also
      	remove include end of line parameter.
              (khtml::isEndOfBlock): Don't pass unneeded parameter.
              * khtml/editing/visible_units.h:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@9148 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      158283b7
  21. 16 Mar, 2005 1 commit
    • harrison's avatar
      Reviewed by Maciej. · 344b1c2b
      harrison authored
              <rdar://problem/4048506> Deleting from beginning of editable div deletes other document elements
      
              Also changed WebKit.
      
              * khtml/editing/visible_units.h:
              * khtml/editing/visible_units.cpp:
              (khtml::startOfEditableContent):
              (khtml::endOfEditableContent):
              (khtml::inSameEditableContent):
              (khtml::isStartOfEditableContent):
              (khtml::isEndOfEditableContent):
              New.
      
              * kwq/WebCoreBridge.h:
              * kwq/WebCoreBridge.mm:
              (-[WebCoreBridge canDeleteRange:]):
              New.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@8905 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      344b1c2b
  22. 14 Feb, 2005 1 commit
    • harrison's avatar
      Reviewed by Darin. · fb4fe881
      harrison authored
              <rdar://problem/4004305> REGRESSION (Mail): Command-right-arrow on wrapped text goes to end of previous line
      
              Fixed nextLinePosition to calculate affinity rather than take it as a parameter.  Propagated the parameter change out to related methods.
      
              * khtml/editing/htmlediting.cpp:
              (khtml::DeleteSelectionCommand::initializePositionData):
              (khtml::InsertLineBreakCommand::doApply):
              (khtml::InsertParagraphSeparatorCommand::doApply):
              (khtml::InsertTextCommand::input):
              (khtml::ReplaceSelectionCommand::doApply):
              (khtml::ReplaceSelectionCommand::applyStyleToInsertedNodes):
              * khtml/editing/selection.cpp:
              (khtml::Selection::modifyExtendingRightForward):
              (khtml::Selection::modifyMovingRightForward):
              (khtml::Selection::modifyExtendingLeftBackward):
              (khtml::Selection::modifyMovingLeftBackward):
              (khtml::Selection::modify):
              (khtml::Selection::validate):
              * khtml/editing/visible_position.cpp:
              (khtml::visiblePositionsOnDifferentLines):
              * khtml/editing/visible_units.cpp:
              (khtml::rootBoxForLine):
              (khtml::startOfLine):
              (khtml::endOfLine):
              (khtml::inSameLine):
              (khtml::isStartOfLine):
              (khtml::isEndOfLine):
              (khtml::previousLinePosition):
              (khtml::nextLinePosition):
              (khtml::previousSentencePosition):
              (khtml::nextSentencePosition):
              (khtml::previousParagraphPosition):
              (khtml::nextParagraphPosition):
              * khtml/editing/visible_units.h:
              * khtml/khtml_events.cpp:
              (khtml::MouseEvent::offset):
              * khtml/khtml_part.cpp:
              (KHTMLPart::isPointInsideSelection):
              (KHTMLPart::selectClosestWordFromMouseEvent):
              (KHTMLPart::handleMousePressEventTripleClick):
              (KHTMLPart::handleMousePressEventSingleClick):
              (KHTMLPart::handleMouseMoveEventSelection):
              (KHTMLPart::khtmlMouseReleaseEvent):
              * khtml/rendering/render_block.cpp:
              (khtml::RenderBlock::positionForCoordinates):
              * khtml/rendering/render_block.h:
              * khtml/rendering/render_br.cpp:
              (RenderBR::positionForCoordinates):
              * khtml/rendering/render_br.h:
              * khtml/rendering/render_container.cpp:
              (RenderContainer::positionForCoordinates):
              * khtml/rendering/render_container.h:
              * khtml/rendering/render_inline.cpp:
              (RenderInline::positionForCoordinates):
              * khtml/rendering/render_inline.h:
              * khtml/rendering/render_object.cpp:
              (RenderObject::caretRect):
              (RenderObject::positionForCoordinates):
              * khtml/rendering/render_object.h:
              * khtml/rendering/render_replaced.cpp:
              (RenderReplaced::positionForCoordinates):
              * khtml/rendering/render_replaced.h:
              * khtml/rendering/render_text.cpp:
              (RenderText::positionForCoordinates):
              * khtml/rendering/render_text.h:
              * khtml/xml/dom_position.cpp:
              (DOM::Position::previousCharacterPosition):
              (DOM::Position::nextCharacterPosition):
              (DOM::Position::leadingWhitespacePosition):
              (DOM::Position::trailingWhitespacePosition):
              * khtml/xml/dom_position.h:
              * kwq/KWQAccObject.mm:
              (-[KWQAccObject value]):
              (-[KWQAccObject accessibilityAttributeValue:]):
              (-[KWQAccObject doAXLineForTextMarker:]):
              (-[KWQAccObject doAXTextMarkerRangeForLine:]):
              (-[KWQAccObject doAXTextMarkerForPosition:]):
              (-[KWQAccObject doAXLeftLineTextMarkerRangeForTextMarker:]):
              (-[KWQAccObject doAXRightLineTextMarkerRangeForTextMarker:]):
              (-[KWQAccObject doAXNextLineEndTextMarkerForTextMarker:]):
              (-[KWQAccObject doAXPreviousLineStartTextMarkerForTextMarker:]):
              * kwq/KWQKHTMLPart.mm:
              * kwq/WebCoreBridge.mm:
              (-[WebCoreBridge _visiblePositionForPoint:]):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@8589 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      fb4fe881
  23. 09 Feb, 2005 1 commit
    • harrison's avatar
      Reviewed by Darin. · 3cd8ac37
      harrison authored
              <rdar://problem/3937447> Mail-689: Arrow key navigation in new message body stops working when a line ends with a bold word
      
              Added affinity to VisiblePosition.  Changed Selection code to use affinity more.
      
              (Partial) <rdar://problem/3982096> editing/pasteboard/paste-text-007 is failing
      
              Changed ReplaceSelectionCommand to also pay attention to the top children of the incoming fragment, not just the very last node inserted, when deciding whether to insert a paragraph for the Apple interchange newline.
      
              * khtml/ecma/kjs_window.cpp:
              (SelectionFunc::tryCall):
              * khtml/editing/htmlediting.cpp:
              (khtml::EditCommandPtr::setStartingSelection):
              (khtml::EditCommandPtr::setEndingSelection):
              (khtml::EditCommand::setStartingSelection):
              (khtml::EditCommand::setEndingSelection):
              (khtml::CompositeEditCommand::deleteInsignificantTextDownstream):
              (khtml::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary):
              (khtml::ApplyStyleCommand::splitTextAtStartIfNeeded):
              (khtml::ApplyStyleCommand::splitTextAtEndIfNeeded):
              (khtml::ApplyStyleCommand::splitTextElementAtStartIfNeeded):
              (khtml::ApplyStyleCommand::splitTextElementAtEndIfNeeded):
              (khtml::ApplyStyleCommand::mergeStartWithPreviousIfIdentical):
              (khtml::ApplyStyleCommand::mergeEndWithNextIfIdentical):
              (khtml::ApplyStyleCommand::joinChildTextNodes):
              (khtml::DeleteSelectionCommand::initializePositionData):
              (khtml::DeleteSelectionCommand::handleGeneralDelete):
              (khtml::DeleteSelectionCommand::calculateTypingStyleAfterDelete):
              (khtml::DeleteSelectionCommand::doApply):
              (khtml::InsertLineBreakCommand::doApply):
              (khtml::InsertParagraphSeparatorCommand::doApply):
              (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply):
              (khtml::InsertTextCommand::input):
              (khtml::MoveSelectionCommand::doApply):
              (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand):
              (khtml::ReplaceSelectionCommand::~ReplaceSelectionCommand):
              (khtml::ReplaceSelectionCommand::doApply):
              (khtml::ReplaceSelectionCommand::completeHTMLReplacement):
              (khtml::ReplaceSelectionCommand::updateNodesInserted):
              (khtml::TypingCommand::deleteKeyPressed):
              (khtml::TypingCommand::forwardDeleteKeyPressed):
              (khtml::TypingCommand::markMisspellingsAfterTyping):
              * khtml/editing/htmlediting.h:
              * khtml/editing/selection.cpp:
              (khtml::Selection::Selection):
              (khtml::Selection::init):
              (khtml::Selection::moveTo):
              (khtml::Selection::modifyExtendingRightForward):
              (khtml::Selection::modifyMovingRightForward):
              (khtml::Selection::modifyExtendingLeftBackward):
              (khtml::Selection::modifyMovingLeftBackward):
              (khtml::Selection::modify):
              (khtml::Selection::xPosForVerticalArrowNavigation):
              (khtml::Selection::clear):
              (khtml::Selection::setBase):
              (khtml::Selection::setExtent):
              (khtml::Selection::setBaseAndExtent):
              (khtml::Selection::layout):
              (khtml::Selection::validate):
              * khtml/editing/selection.h:
              (khtml::Selection::startAffinity):
              (khtml::Selection::endAffinity):
              (khtml::Selection::baseAffinity):
              (khtml::Selection::extentAffinity):
              (khtml::operator==):
              * khtml/editing/text_affinity.h:
              (khtml::):
              * khtml/editing/visible_position.cpp:
              (khtml::VisiblePosition::VisiblePosition):
              (khtml::VisiblePosition::init):
              (khtml::VisiblePosition::initUpstream):
              (khtml::VisiblePosition::initDownstream):
              (khtml::VisiblePosition::next):
              (khtml::VisiblePosition::previous):
              (khtml::startVisiblePosition):
              (khtml::endVisiblePosition):
              * khtml/editing/visible_position.h:
              (khtml::VisiblePosition::):
              (khtml::VisiblePosition::VisiblePosition):
              (khtml::VisiblePosition::affinity):
              (khtml::VisiblePosition::setAffinity):
              (khtml::operator==):
              * khtml/editing/visible_units.cpp:
              (khtml::previousBoundary):
              (khtml::nextBoundary):
              (khtml::startOfLine):
              (khtml::endOfLine):
              (khtml::previousLinePosition):
              (khtml::nextLinePosition):
              (khtml::startOfParagraph):
              (khtml::endOfParagraph):
              (khtml::previousParagraphPosition):
              (khtml::nextParagraphPosition):
              (khtml::startOfBlock):
              (khtml::endOfBlock):
              (khtml::startOfDocument):
              (khtml::endOfDocument):
              * khtml/editing/visible_units.h:
              * khtml/khtml_part.cpp:
              (KHTMLPart::findTextNext):
              (KHTMLPart::selectClosestWordFromMouseEvent):
              (KHTMLPart::handleMousePressEventTripleClick):
              (KHTMLPart::handleMousePressEventSingleClick):
              (KHTMLPart::handleMouseMoveEventSelection):
              (KHTMLPart::khtmlMouseReleaseEvent):
              (KHTMLPart::selectAll):
              (KHTMLPart::computeAndSetTypingStyle):
              (KHTMLPart::selectionComputedStyle):
              * khtml/rendering/render_br.cpp:
              (RenderBR::positionForCoordinates):
              * khtml/xml/dom_docimpl.cpp:
              (DocumentImpl::updateSelection):
              * khtml/xml/dom_nodeimpl.cpp:
              (NodeBaseImpl::setFocus):
              * khtml/xml/dom_position.cpp:
              (DOM::Position::previousCharacterPosition):
              (DOM::Position::nextCharacterPosition):
              * khtml/xml/dom_position.h:
              * kwq/KWQAccObject.mm:
              (-[KWQAccObject value]):
              (-[KWQAccObject visiblePositionForStartOfTextMarkerRange:]):
              (-[KWQAccObject visiblePositionForEndOfTextMarkerRange:]):
              (-[KWQAccObject accessibilityAttributeValue:]):
              (-[KWQAccObject doAXLineForTextMarker:]):
              (-[KWQAccObject doAXTextMarkerRangeForLine:]):
              (-[KWQAccObject doAXTextMarkerForPosition:]):
              (-[KWQAccObject doAXLeftLineTextMarkerRangeForTextMarker:]):
              (-[KWQAccObject doAXRightLineTextMarkerRangeForTextMarker:]):
              (-[KWQAccObject doAXNextWordEndTextMarkerForTextMarker:]):
              (-[KWQAccObject doAXPreviousWordStartTextMarkerForTextMarker:]):
              (-[KWQAccObject doAXNextLineEndTextMarkerForTextMarker:]):
              (-[KWQAccObject doAXPreviousLineStartTextMarkerForTextMarker:]):
              (-[KWQAccObject doSetAXSelectedTextMarkerRange:]):
              * kwq/KWQAccObjectCache.mm:
              (KWQAccObjectCache::textMarkerForVisiblePosition):
              (KWQAccObjectCache::visiblePositionForTextMarker):
              * kwq/KWQKHTMLPart.mm:
              (KWQKHTMLPart::findString):
              (KWQKHTMLPart::advanceToNextMisspelling):
              (KWQKHTMLPart::styleForSelectionStart):
              (KWQKHTMLPart::baseWritingDirectionForSelectionStart):
              (KWQKHTMLPart::setSelectionFromNone):
              (KWQKHTMLPart::respondToChangedSelection):
              * kwq/WebCoreBridge.mm:
              (-[WebCoreBridge setSelectedDOMRange:affinity:]):
              (-[WebCoreBridge selectionAffinity]):
              (-[WebCoreBridge setMarkDOMRange:]):
              (-[WebCoreBridge _visiblePositionForPoint:]):
              (-[WebCoreBridge moveDragCaretToPoint:]):
              (-[WebCoreBridge editableDOMRangeForPoint:]):
              (-[WebCoreBridge ensureSelectionVisible]):
              (-[WebCoreBridge rangeOfCharactersAroundCaret]):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@8554 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      3cd8ac37
  24. 31 Jan, 2005 1 commit
    • darin's avatar
      Reviewed by Ken and Harrison. · 6f7e2b93
      darin authored
              - fixed <rdar://problem/3947901> REGRESSION (Mail): Pasting paragraph of rich text leaves insertion point before pasted text
              - fixed <rdar://problem/3949790> hitting return after underlined line results in too much or too little underlined
              - fixed <rdar://problem/3981759> nil-deref and crash when pasting just a paragraph break
              - fixed a couple problems I discovered while working with bug 3949790
      
              * khtml/editing/htmlediting.cpp:
              (khtml::ApplyStyleCommand::applyInlineStyle): Pass StayInBlock to upstream. Without this, we end up going too far
              upstream in the test case in bug 3949790.
              (khtml::ApplyStyleCommand::removeInlineStyle): Pass StayInBlock to upstream and downstream. Same reason as above.
              (khtml::ReplaceSelectionCommand::doApply): Update endPos if inserting a new node and endPos is using that node's
              parent and an offset past the node being inserted. That change fixes a problem with the position of the insertion point
              after pasting into the top level of a document (from test cases in 3947901 and 3949790). When setting insertionPos, use
              code that works when lastNodeInserted is a block rather than a text node. That change fixes a problem where a newline is
              not added when pasting an entire paragraph into the end of a document (from test case in 3949790). Added nil check before
              checking if lastNodeInserted is a <br> element, which fixes the crash when pasting just a paragraph break.
      
              * khtml/editing/visible_units.h: Filled out the set of calls to add some boolean checks for lines (needed for the
              bug fix), and calls for blocks (not yet implemented), and documents. The document checks may need refinement to
              properly handle documents with a mix of editable and non-editable content, but for now they just refactor code
              and make things a little clearer. Also removed the "include line break" parameter from endOfSentence.
              * khtml/editing/visible_units.cpp:
              (khtml::rootBoxForLine): Added.
              (khtml::startOfLine): Added. Algorithm taken from selectionForLine in selection.cpp.
              (khtml::endOfLine): Ditto.
              (khtml::inSameLine): Added.
              (khtml::isStartOfLine): Added.
              (khtml::isEndOfLine): Added.
              (khtml::endOfSentence): Removed "include line break" parameter.
              (khtml::inSameParagraph): Added a null check.
              (khtml::isStartOfParagraph): Ditto.
              (khtml::isEndOfParagraph): Ditto.
              (khtml::startOfBlock): Added.
              (khtml::endOfBlock): Added.
              (khtml::inSameBlock): Added.
              (khtml::isStartOfBlock): Added.
              (khtml::isEndOfBlock): Added.
              (khtml::startOfDocument): Added.
              (khtml::endOfDocument): Added.
              (khtml::inSameDocument): Added.
              (khtml::isStartOfDocument): Added.
              (khtml::isEndOfDocument): Added.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@8480 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      6f7e2b93
  25. 06 Jan, 2005 1 commit
    • harrison's avatar
      Reviewed by Dave Hyatt. · 528c5bb5
      harrison authored
              <rdar://problem/3776056> AX: Editable HTML should not be viewed as AXStaticText
              <rdar://problem/3588548> AX: tabbing does not work correctly with the screen reader and a focused link; need AXFocusedUIElement to work
      
              Many more AX attributes supported.  Numerous fixes to previous AX work.
      
              * khtml/editing/visible_units.cpp:
              (khtml::startSentenceBoundary):
              (khtml::startOfSentence):
              (khtml::endSentenceBoundary):
              (khtml::endOfSentence):
              (khtml::previousSentencePositionBoundary):
              (khtml::previousSentencePosition):
              (khtml::nextSentencePositionBoundary):
              (khtml::nextSentencePosition):
              * khtml/editing/visible_units.h:
              * khtml/khtmlview.cpp:
              (KHTMLView::layout):
              * khtml/misc/helper.cpp:
              (khtml::findSentenceBoundary):
              (khtml::nextSentenceFromIndex):
              * khtml/misc/helper.h:
              * khtml/misc/htmltags.c:
              (hash_tag):
              (findTag):
              * khtml/rendering/render_container.cpp:
              (RenderContainer::removeChildNode):
              (RenderContainer::appendChildNode):
              (RenderContainer::insertChildNode):
              * khtml/rendering/render_object.cpp:
              (RenderObject::remove):
              * khtml/xml/dom_docimpl.cpp:
              (DocumentImpl::getAccObjectCache):
              (DocumentImpl::updateSelection):
              (DocumentImpl::close):
              (DocumentImpl::setFocusNode):
              (DocumentImpl::parentDocument):
              (DocumentImpl::topDocument):
              * khtml/xml/dom_docimpl.h:
              * kwq/KWQAccObject.mm:
              (-[KWQAccObject accessibilityShouldUseUniqueId]):
              (-[KWQAccObject detach]):
              (-[KWQAccObject anchorElement]):
              (-[KWQAccObject firstChild]):
              (-[KWQAccObject lastChild]):
              (-[KWQAccObject previousSibling]):
              (-[KWQAccObject nextSibling]):
              (-[KWQAccObject parentObject]):
              (-[KWQAccObject value]):
              (-[KWQAccObject accessibilityAttributeNames]):
              (-[KWQAccObject accessibilityPerformAction:]):
              (-[KWQAccObject textMarkerForVisiblePosition:]):
              (-[KWQAccObject visiblePositionForTextMarker:]):
              (-[KWQAccObject textMarkerRangeFromVisiblePositions:andEndPos:]):
              (-[KWQAccObject topDocument]):
              (-[KWQAccObject topRenderer]):
              (-[KWQAccObject topView]):
              (-[KWQAccObject accessibilityAttributeValue:]):
              (-[KWQAccObject accessibilityParameterizedAttributeNames]):
              (-[KWQAccObject doAXLineForTextMarker:]):
              (-[KWQAccObject doAXTextMarkerRangeForLine:]):
              (-[KWQAccObject doAXStringForTextMarkerRange:]):
              (-[KWQAccObject doAXTextMarkerForPosition:]):
              (-[KWQAccObject doAXBoundsForTextMarkerRange:]):
              (-[KWQAccObject doAXAttributedStringForTextMarkerRange:]):
              (-[KWQAccObject doAXTextMarkerRangeForUnorderedTextMarkers:]):
              (-[KWQAccObject doAXNextTextMarkerForTextMarker:]):
              (-[KWQAccObject doAXPreviousTextMarkerForTextMarker:]):
              (-[KWQAccObject doAXLeftWordTextMarkerRangeForTextMarker:]):
              (-[KWQAccObject doAXRightWordTextMarkerRangeForTextMarker:]):
              (-[KWQAccObject doAXLeftLineTextMarkerRangeForTextMarker:]):
              (-[KWQAccObject doAXRightLineTextMarkerRangeForTextMarker:]):
              (-[KWQAccObject doAXSentenceTextMarkerRangeForTextMarker:]):
              (-[KWQAccObject doAXParagraphTextMarkerRangeForTextMarker:]):
              (-[KWQAccObject doAXNextWordEndTextMarkerForTextMarker:]):
              (-[KWQAccObject doAXPreviousWordStartTextMarkerForTextMarker:]):
              (-[KWQAccObject doAXNextLineEndTextMarkerForTextMarker:]):
              (-[KWQAccObject doAXPreviousLineStartTextMarkerForTextMarker:]):
              (-[KWQAccObject doAXNextSentenceEndTextMarkerForTextMarker:]):
              (-[KWQAccObject doAXPreviousSentenceStartTextMarkerForTextMarker:]):
              (-[KWQAccObject doAXNextParagraphEndTextMarkerForTextMarker:]):
              (-[KWQAccObject doAXPreviousParagraphStartTextMarkerForTextMarker:]):
              (-[KWQAccObject doAXLengthForTextMarkerRange:]):
              (-[KWQAccObject accessibilityAttributeValue:forParameter:]):
              (-[KWQAccObject accessibilityHitTest:]):
              (-[KWQAccObject accessibilityFocusedUIElement]):
              (-[KWQAccObject accessibilityIsAttributeSettable:]):
              (-[KWQAccObject doSetAXSelectedTextMarkerRange:]):
              (-[KWQAccObject setAccObjectID:]):
              (-[KWQAccObject removeAccObjectID]):
              * kwq/KWQAccObjectCache.h:
              * kwq/KWQAccObjectCache.mm:
              (KWQAccObjectCache::setAccObject):
              (KWQAccObjectCache::removeAccObject):
              (KWQAccObjectCache::visiblePositionForTextMarker):
              (KWQAccObjectCache::postNotificationToTopWebArea):
              (KWQAccObjectCache::postNotification):
              (KWQAccObjectCache::handleFocusedUIElementChanged):
              * kwq/KWQKHTMLPart.mm:
              (KWQKHTMLPart::respondToChangedContents):
              * kwq/KWQTextUtilities.h:
              * kwq/KWQTextUtilities.mm:
              (KWQFindNextWordFromIndex):
              (KWQFindSentenceBoundary):
              (KWQFindNextSentenceFromIndex):
              * kwq/WebCoreBridge.mm:
              (-[WebCoreBridge accessibilityTree]):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@8309 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      528c5bb5
  26. 05 Jan, 2005 1 commit
    • kocienda's avatar
      Reviewed by Hyatt · 96771958
      kocienda authored
              Fix for this bug:
      
              <rdar://problem/3941203> REGRESSION (Mail): Paste inserts content in wrong place
      
              * khtml/editing/htmlediting.cpp:
              (khtml::ReplaceSelectionCommand::doApply): Some cleanup and refinement of the concepts used to make
              this operation work correctly, particularly in the logic to figure out whether to merge content, and
              also performing merges.
              * khtml/editing/visible_position.cpp:
              (khtml::isFirstVisiblePositionInBlock): Simplification of test used to make this determination.
              * khtml/editing/visible_units.cpp:
              (khtml::isStartOfParagraph): New helper, used in khtml::ReplaceSelectionCommand::doApply().
              (khtml::isEndOfParagraph): Ditto.
              * khtml/editing/visible_units.h: Declare new functions.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@8305 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      96771958
  27. 11 Oct, 2004 1 commit
    • kocienda's avatar
      WebCore: · f23cb5a2
      kocienda authored
              Reviewed by Darin
      
              Finish selection affinity implementation. This includes code to set the
              affinity correctly when clicking with the mouse, and clearing the
              affinity when altering the selection using any of the Selection object
              mutation functions.
      
              Each instance of the positionForCoordinates, inlineBox and caretRect
              functions have been changed to include an EAffinity argument to give results
              which take this bit into account.
      
              * khtml/editing/selection.cpp:
              (khtml::Selection::init): Default affinity is now UPSTREAM, to match AppKit.
              (khtml::Selection::modifyAffinity): New function to compute affinity based on
              modification constants.
              (khtml::Selection::moveTo): Reset affinity to UPSTREAM.
              (khtml::Selection::modifyExtendingRightForward): Ditto.
              (khtml::Selection::modifyMovingRightForward): Ditto.
              (khtml::Selection::modifyExtendingLeftBackward): Ditto.
              (khtml::Selection::modifyMovingLeftBackward): Ditto.
              (khtml::Selection::modify): Support saving, restoring, and then calculating new
              affinity value as needed.
              (khtml::Selection::xPosForVerticalArrowNavigation):
              (khtml::Selection::clear): Reset affinity to UPSTREAM.
              (khtml::Selection::setBase): Ditto.
              (khtml::Selection::setExtent): Ditto.
              (khtml::Selection::setBaseAndExtent): Ditto.
              (khtml::Selection::layout): Pass affinity to caretRect().
              (khtml::Selection::validate): Pass along affinity parameter to new functions that
              require it.
              (khtml::startOfFirstRunAt): Changed the way that the y-coordinate search is done, to
              keep this code working with changes made in selectionForLine().
              (khtml::endOfLastRunAt): Ditto.
              (khtml::selectionForLine): Make this function work for all renderers, not just text
              renderers.
              * khtml/editing/selection.h:
              (khtml::operator==): Consider affinity in equality check.
              * khtml/editing/visible_units.cpp:
              (khtml::previousLinePosition): Pass affinity argument to function so it can take this
              information into account while processing.
              (khtml::nextLinePosition): Ditto.
              (khtml::previousParagraphPosition): Ditto.
              (khtml::nextParagraphPosition): Ditto.
              * khtml/editing/visible_units.h: Ditto, for each of the functions listed.
              * khtml/khtml_events.cpp:
              (khtml::MouseEvent::offset): Rework code to remove dependence on NodeImpl::positionForCoordinates,
              as this function is being removed.
              * khtml/khtml_part.cpp:
              (KHTMLPart::isPointInsideSelection): Ditto.
              (KHTMLPart::selectClosestWordFromMouseEvent): Ditto.
              (KHTMLPart::handleMousePressEventTripleClick): Ditto.
              (KHTMLPart::handleMousePressEventSingleClick): Ditto. Plus, pass affinity argument in
              call to positionForCoordinates, and set resulting affinity on the selection.
              (KHTMLPart::handleMouseMoveEventSelection): Rework code to remove dependence on
              NodeImpl::positionForCoordinates, as this function is being removed.
              (KHTMLPart::khtmlMouseReleaseEvent): Ditto.
              * khtml/rendering/render_block.cpp:
              (khtml::RenderBlock::positionForCoordinates): Now takes an affinity argument.
              * khtml/rendering/render_block.h:
              * khtml/rendering/render_box.cpp:
              (RenderBox::caretRect): Ditto.
              * khtml/rendering/render_box.h:
              * khtml/rendering/render_br.cpp:
              (RenderBR::positionForCoordinates): Ditto.
              (RenderBR::caretRect): Ditto.
              (RenderBR::inlineBox): Ditto.
              * khtml/rendering/render_br.h:
              * khtml/rendering/render_container.cpp:
              (RenderContainer::positionForCoordinates): Ditto.
              * khtml/rendering/render_container.h:
              * khtml/rendering/render_flow.cpp:
              (RenderFlow::caretRect): Ditto.
              * khtml/rendering/render_flow.h:
              * khtml/rendering/render_inline.cpp:
              (RenderInline::positionForCoordinates): Ditto.
              * khtml/rendering/render_inline.h:
              * khtml/rendering/render_object.cpp:
              (RenderObject::caretRect): Ditto.
              (RenderObject::positionForCoordinates): Ditto.
              (RenderObject::inlineBox): Ditto.
              * khtml/rendering/render_object.h:
              * khtml/rendering/render_replaced.cpp:
              (RenderReplaced::positionForCoordinates): Ditto.
              * khtml/rendering/render_replaced.h:
              * khtml/rendering/render_text.cpp:
              (RenderText::positionForCoordinates): Ditto.
              (firstRendererOnNextLine): New helper used by caretRect().
              (RenderText::caretRect): Now takes an affinity argument.
              (RenderText::inlineBox): Ditto.
              * khtml/rendering/render_text.h:
              * khtml/xml/dom_nodeimpl.cpp: Remove positionForCoordinates helper.
              * khtml/xml/dom_nodeimpl.h: Ditto.
              * khtml/xml/dom_position.cpp:
              (DOM::Position::previousLinePosition): Now takes an affinity argument.
              (DOM::Position::nextLinePosition): Ditto.
              * khtml/xml/dom_position.h:
              * kwq/WebCoreBridge.h:
              * kwq/WebCoreBridge.mm:
              (-[WebCoreBridge caretRectAtNode:offset:affinity:]): Ditto.
              (-[WebCoreBridge setSelectedDOMRange:affinity:]): Ditto.
              (-[WebCoreBridge _positionForPoint:]): Rework code to remove dependence on
              NodeImpl::positionForCoordinates, as this function is being removed.
      
      WebKit:
      
              Reviewed by Darin
      
              * WebView.subproj/WebHTMLView.m:
              (-[WebTextCompleteController doCompletion]): bridge call to get caret rect at a node
              now takes an affinity: caretRectAtNode:offset:affinity:.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@7810 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      f23cb5a2
  28. 23 Sep, 2004 1 commit
    • darin's avatar
      - renamed · dd7d22a4
      darin authored
                  DOM::CaretPosition -> khtml::VisibleRange
                  DOM::Selection     -> khtml::Selection
      
              - moved all the functions in visible_units.h from DOM to khtml namespace
              - moved the one thing from Selection that KHTMLPart uses into its own header
      
              * WebCore.pbproj/project.pbxproj: Added text_granularity.h.
      
              * ForwardingHeaders/editing/selection.h: Added.
              * WebCore-combined.exp: Regenerated.
              * WebCore-tests.exp: Updated symbol for DOM::Selection debugging.
      
              * khtml/ecma/kjs_window.cpp: Update names and namespaces.
              * khtml/editing/htmlediting.cpp: Ditto.
              * khtml/editing/htmlediting.h: Ditto.
              * khtml/editing/htmlediting_impl.cpp: Ditto.
              * khtml/editing/htmlediting_impl.h: Ditto.
              * khtml/editing/jsediting.cpp: Ditto.
              * khtml/editing/selection.cpp: Ditto.
              * khtml/editing/selection.h: Ditto.
              * khtml/editing/visible_position.cpp: Ditto.
              * khtml/editing/visible_position.h: Ditto.
              * khtml/editing/visible_text.h: Ditto.
              * khtml/editing/visible_units.cpp: Ditto.
              * khtml/editing/visible_units.h: Ditto.
              * khtml/khtml_part.cpp: Ditto.
              * khtml/khtml_part.h: Ditto.
              * khtml/khtmlpart_p.h: Ditto.
              * khtml/rendering/render_block.cpp: Ditto.
              * khtml/xml/dom_docimpl.h: Ditto.
              * khtml/xml/dom_nodeimpl.cpp: Ditto.
              * kwq/KWQKHTMLPart.h: Ditto.
              * kwq/KWQKHTMLPart.mm: Ditto.
              * kwq/KWQRenderTreeDebug.cpp: Ditto.
              * kwq/WebCoreBridge.mm: Ditto.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@7643 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      dd7d22a4
  29. 22 Sep, 2004 1 commit
    • darin's avatar
      - renamed these files: · d65cea1d
      darin authored
                  misc/khtml_text_operations.h   -> editing/visible_text.h
                  misc/khtml_text_operations.cpp -> editing/visible_text.cpp
                  xml/dom_caretposition.cpp      -> editing/visible_position.cpp
                  xml/dom_caretposition.h        -> editing/visible_position.h
                  xml/dom_selection.cpp          -> editing/selection.cpp
                  xml/dom_selection.h            -> editing/selection.h
      
              - broke out the word/line/paragraph part of visible_position.h into visible_units.h
              - removed some unnecessary includes from some header files to reduce the number of
                files that trigger "building the world"
      
              * WebCore.pbproj/project.pbxproj: Added the files under new names, removed the old ones.
      
              * ForwardingHeaders/editing/jsediting.h: Added.
              * ForwardingHeaders/editing/visible_text.h: Added.
              * ForwardingHeaders/misc/khtml_text_operations.h: Removed.
              * ForwardingHeaders/xml/dom_caretposition.h: Removed.
              * ForwardingHeaders/xml/dom_selection.h: Removed.
      
              * khtml/ecma/kjs_window.cpp: Updated or removed #include lines.
              * khtml/editing/htmlediting.cpp: Ditto.
              * khtml/editing/htmlediting.h: Ditto.
              * khtml/editing/htmlediting_impl.cpp: Ditto.
              * khtml/editing/htmlediting_impl.h: Ditto.
              * khtml/editing/jsediting.cpp: Ditto.
              * khtml/editing/selection.cpp: Ditto.
              * khtml/editing/selection.h: Ditto.
              * khtml/editing/visible_position.cpp: Ditto.
              * khtml/editing/visible_position.h: Ditto.
              * khtml/editing/visible_text.cpp: Ditto.
              * khtml/editing/visible_text.h: Ditto.
              * khtml/editing/visible_units.cpp: Added.
              * khtml/editing/visible_units.h: Added.
              * khtml/html/html_elementimpl.cpp: Updated or removed #include lines.
              * khtml/khtml_part.cpp: Ditto.
              * khtml/khtml_part.h: Ditto.
              * khtml/khtmlpart_p.h: Ditto.
              * khtml/khtmlview.cpp: Ditto.
              * khtml/misc/khtml_text_operations.cpp: Removed.
              * khtml/misc/khtml_text_operations.h: Removed.
              * khtml/rendering/render_block.cpp: Updated or removed #include lines.
              * khtml/xml/dom2_rangeimpl.cpp: Ditto.
              * khtml/xml/dom_caretposition.cpp: Removed.
              * khtml/xml/dom_caretposition.h: Removed.
              * khtml/xml/dom_docimpl.cpp: Updated or removed #include lines.
              * khtml/xml/dom_docimpl.h: Ditto.
              * khtml/xml/dom_elementimpl.cpp: Ditto.
              * khtml/xml/dom_nodeimpl.cpp: Ditto.
              * khtml/xml/dom_position.cpp: Ditto.
              * khtml/xml/dom_selection.cpp: Removed.
              * khtml/xml/dom_selection.h: Removed.
              * kwq/KWQKHTMLPart.mm: Updated or removed #include lines.
              * kwq/KWQKHTMLPart.h: Ditto.
              * kwq/KWQRenderTreeDebug.cpp: Ditto.
              * kwq/WebCoreBridge.mm: Ditto.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@7641 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      d65cea1d
  30. 09 Jun, 2004 1 commit
    • darin's avatar
      Reviewed by Maciej. · 0a4ffb12
      darin authored
              - implemented a bunch more execCommand commands
              - fixed <rdar://problem/3684792>: (JavaScript execCommand("paste") presents security issues)
              - fixed <rdar://problem/3675898>: (Make queryCommandEnabled work as specified in the Javascript execCommand Compatibility Plan)
              - fixed <rdar://problem/3675903>: (Make queryCommandSupported work as specified in the Javascript execCommand Compatibility Plan)
              - about half of <rdar://problem/3685231>: (execCommand italic is not implemented)
              - about half of <rdar://problem/3685232>: (execCommand bold is not implemented)
      
              * khtml/editing/jsediting.h: Made constructor inline. Deleted a few unneeded member functions
              that are now just private functions inside jsediting.cpp.
      
              * khtml/editing/jsediting.cpp:
              (commandImp): Changed this around, so the dictionary is a static local to this function,
              and initialized with C++ "first time initialization" rule.
              (DOM::JSEditor::execCommand): Got rid of special case for 0 for function pointer and added const.
              (DOM::JSEditor::queryCommandEnabled): Ditto.
              (DOM::JSEditor::queryCommandIndeterm): Got rid of special case for 0 for function pointer, added const,
              and use a common three-state state function rather than a separate "indeterm" function.
              (DOM::JSEditor::queryCommandState): Ditto.
              (DOM::JSEditor::queryCommandValue): More of the same.
              (execNotImplemented): Added. Used for unimplemented commands; there are only a few left.
              (execCopy): Renamed.
              (execCut): Renamed.
              (execDelete): Renamed.
              (execInsertText): Renamed.
              (execPaste): Renamed, and disabled.
              (execRedo): Renamed.
              (execSelectAll): Renamed.
              (execUndo): Renamed.
              (execStyleChange): Added. Helper function for commands that are style changes.
              (execBold): Added.
              (execItalic): Added.
              (execJustifyCenter): Added.
              (execJustifyFull): Added.
              (execJustifyLeft): Added.
              (execJustifyRight): Added.
              (execSubscript): Added.
              (execSuperscript): Added.
              (execUnselect): Added.
              (stateNotImplemented): Added. Used for unimplemented state queries; there are a few left.
              (noState): Added.
              (valueNotImplemented): Added. Used for unimplemented value queries; there are a few left.
              (nullStringValue): Added.
              (createCommandDictionary): Changed the initDict function into this function. Added implementations
              for many commands and condensed format so it's easier to work with.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@6799 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      0a4ffb12
  31. 07 Jun, 2004 2 commits
    • darin's avatar
      Reviewed by Chris. · 10ad9415
      darin authored
              - fixed <rdar://problem/3682821>: (setTimeout fails when additional parameters are used and timeout function is a string)
      
              * khtml/ecma/kjs_window.cpp: (WindowFunc::tryCall): Ignore excess arguments instead
              of rejecting the argument list for window.scrollBy, scroll, scrollTo, moveBy, moveTo,
              resizeBy, resizeTo, and setTimeout (when the timeout is a string rather than an object).
      
              - did a refinement of JSEditor to be slightly more efficient, and not have to edit
                both the .cpp file and the .h when adding more implementation
      
              * khtml/khtml_part.h: Hack so we can get to the docImpl and xmlDocImpl without being a friend.
              * khtml/editing/jsediting.h: Simplified a bit.
              * khtml/editing/jsediting.cpp: Redid to use a table, and simplified a bit.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@6788 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      10ad9415
    • darin's avatar
      Reviewed by Ken. · e2f6d07e
      darin authored
              * khtml/editing/jsediting.h: Elide some unnecessary namespace prefixes.
              * khtml/editing/jsediting.cpp: Make typed constants instead of macros.
              (DOM::JSEditor::commandDict): Elide unnecessary namespace prefix.
              (DOM::JSEditor::execCommand): Remove xxxNotImplemented functions; just return false instead.
              (DOM::JSEditor::queryCommandEnabled): Ditto.
              (DOM::JSEditor::queryCommandIndeterm): Ditto.
              (DOM::JSEditor::queryCommandState): Ditto.
              (DOM::JSEditor::queryCommandSupported): Ditto.
              (DOM::JSEditor::queryCommandValue): Ditto.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@6782 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      e2f6d07e
  32. 04 Jun, 2004 1 commit
    • kocienda's avatar
      Reviewed by Hyatt · b198c640
      kocienda authored
              Made some progress on this set of related bugs:
      
              <rdar://problem/3675867>: "Make execCommand work as specified in the Javascript execCommand Compatibility Plan"
              <rdar://problem/3675898>: "Make queryCommandEnabled work as specified in the Javascript execCommand Compatibility Plan"
              <rdar://problem/3675899>: "Make queryCommandIndeterm work as specified in the Javascript execCommand Compatibility Plan"
              <rdar://problem/3675901>: "Make queryCommandState work as specified in the Javascript execCommand Compatibility Plan"
              <rdar://problem/3675903>: "Make queryCommandSupported work as specified in the Javascript execCommand Compatibility Plan"
              <rdar://problem/3675904>: "Make queryCommandValue work as specified in the Javascript execCommand Compatibility Plan"
      
              I did several things to move the ahead with the plan:
      
              1. The latter five methods did not appear in the tree at all. Now they do, although
      
              2. I removed the implementation for these editing methods from dom_docimpl.cpp, and moved
                 them out to new js_editing.cpp/js_editing.h files. The remaining code in dom_docimpl.cpp
                 is glue to call over to the new JSEditor object defined in the new files.
      
              3. For a couple of the command implementations in js_editing.cpp, I made a stab at returning sensible values.
                 For others, I just return place-holder values. I have added some comments to describe what has been done and
                 what still needs to be done.
      
              * WebCore.pbproj/project.pbxproj:
              * khtml/dom/dom_doc.cpp: Add call-overs for these methods.
              (DOM::Document::queryCommandEnabled):
              (DOM::Document::queryCommandIndeterm):
              (DOM::Document::queryCommandState):
              (DOM::Document::queryCommandSupported):
              (DOM::Document::queryCommandValue):
              * khtml/dom/dom_doc.h:
              * khtml/ecma/kjs_dom.cpp: Add queryCommandXXX terminology.
              (DOMDocumentProtoFunc::tryCall):
              * khtml/ecma/kjs_dom.h:
              (KJS::DOMDocument::):
              * khtml/ecma/kjs_dom.lut.h:
              (KJS::):
              * khtml/editing/jsediting.cpp: Added. This file implements the guts of editing-related JS methods.
              (DOM::execCommandNotImplemented):
              (DOM::queryBoolNotImplemented):
              (DOM::queryValueNotImplemented):
              (DOM::JSEditor::commandDict):
              (DOM::JSEditor::JSEditor):
              (DOM::JSEditor::~JSEditor):
              (DOM::JSEditor::commandIdentifier):
              (DOM::JSEditor::addCommand):
              (DOM::JSEditor::initDict):
              (DOM::JSEditor::execCommand):
              (DOM::JSEditor::queryCommandEnabled):
              (DOM::JSEditor::queryCommandIndeterm):
              (DOM::JSEditor::queryCommandState):
              (DOM::JSEditor::queryCommandSupported):
              (DOM::JSEditor::queryCommandValue):
              (DOM::JSEditor::execCommandCopy):
              (DOM::JSEditor::execCommandCut):
              (DOM::JSEditor::execCommandDelete):
              (DOM::JSEditor::execCommandInsertText):
              (DOM::JSEditor::execCommandPaste):
              (DOM::JSEditor::execCommandRedo):
              (DOM::JSEditor::execCommandSelectAll):
              (DOM::JSEditor::execCommandUndo):
              (DOM::JSEditor::enabledIfPartNotNull):
              (DOM::JSEditor::enabledIfSelectionNotEmpty):
              (DOM::JSEditor::enabledIfSelectionIsRange):
              (DOM::JSEditor::commandSupported):
              * khtml/editing/jsediting.h: Added.
              (DOM::JSEditor::CommandIdentifier::CommandIdentifier):
              (DOM::JSEditor::document):
              (DOM::JSEditor::part):
              * khtml/xml/dom_docimpl.cpp: Rework JS editing support into glue that calls over into new JSEditor object.
              (DocumentImpl::DocumentImpl):
              (DocumentImpl::~DocumentImpl):
              (DocumentImpl::jsEditor):
              (DocumentImpl::execCommand):
              (DocumentImpl::queryCommandEnabled):
              (DocumentImpl::queryCommandIndeterm):
              (DocumentImpl::queryCommandState):
              (DocumentImpl::queryCommandSupported):
              (DocumentImpl::queryCommandValue):
              * khtml/xml/dom_docimpl.h:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@6765 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      b198c640