Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Programmatically set selection should not have direction on Mac
https://bugs.webkit.org/show_bug.cgi?id=60529 Patch by Wyatt Carss <wcarss@chromium.org> on 2011-08-12 Reviewed by Ryosuke Niwa. Source/WebCore: Modified default value of VisibleSelection->m_isDirectional from 'true' to 'false' by adding a defaulted argument to several VisibleSelection constructors to make programmatic selection be directionless by default on Mac. Also modified several calls to VisibleSelection's constructors to correctly preserve directionality. Near the end of FrameSelection::modify (presently FrameSelection.cpp:869) a call to setExtent triggers an editing delegate that uses the FrameSelection. The direction here should have been preserved from before, but setIsDirectional was not called until after FrameSelection.cpp:869. It has been moved up to make things behave. * WebCore.exp.in: * editing/ApplyBlockElementCommand.cpp: (WebCore::ApplyBlockElementCommand::doApply): (WebCore::ApplyBlockElementCommand::formatSelection): * editing/ApplyStyleCommand.cpp: (WebCore::ApplyStyleCommand::updateStartEnd): * editing/BreakBlockquoteCommand.cpp: (WebCore::BreakBlockquoteCommand::doApply): * editing/CompositeEditCommand.cpp: (WebCore::CompositeEditCommand::moveParagraphWithClones): (WebCore::CompositeEditCommand::moveParagraphs): (WebCore::CompositeEditCommand::breakOutOfEmptyListItem): (WebCore::CompositeEditCommand::breakOutOfEmptyMailBlockquotedParagraph): * editing/CreateLinkCommand.cpp: (WebCore::CreateLinkCommand::doApply): * editing/DeleteSelectionCommand.cpp: (WebCore::DeleteSelectionCommand::setStartingSelectionOnSmartDelete): (WebCore::DeleteSelectionCommand::doApply): * editing/Editor.cpp: (WebCore::Editor::selectionForCommand): * editing/FrameSelection.cpp: (WebCore::shouldAlwaysUseDirectionalSelection): (WebCore::FrameSelection::FrameSelection): (WebCore::FrameSelection::moveTo): (WebCore::FrameSelection::setNonDirectionalSelectionIfNeeded): (WebCore::FrameSelection::modify): (WebCore::FrameSelection::setBase): (WebCore::FrameSelection::setExtent): * editing/FrameSelection.h: * editing/InsertLineBreakCommand.cpp: (WebCore::InsertLineBreakCommand::doApply): * editing/InsertListCommand.cpp: (WebCore::InsertListCommand::doApply): * editing/InsertParagraphSeparatorCommand.cpp: (WebCore::InsertParagraphSeparatorCommand::doApply): * editing/InsertTextCommand.cpp: (WebCore::InsertTextCommand::performTrivialReplace): (WebCore::InsertTextCommand::doApply): * editing/MoveSelectionCommand.cpp: (WebCore::MoveSelectionCommand::doApply): * editing/ReplaceSelectionCommand.cpp: (WebCore::ReplaceSelectionCommand::completeHTMLReplacement): * editing/TypingCommand.cpp: (WebCore::TypingCommand::makeEditableRootEmpty): (WebCore::TypingCommand::deleteKeyPressed): (WebCore::TypingCommand::forwardDeleteKeyPressed): * editing/VisibleSelection.cpp: (WebCore::VisibleSelection::VisibleSelection): * editing/VisibleSelection.h: * page/EventHandler.cpp: (WebCore::EventHandler::updateSelectionForMouseDownDispatchingSelectStart): (WebCore::EventHandler::updateSelectionForMouseDrag): LayoutTests: Added editing/selection/programmatic-selection-on-mac-is-directionless to test selection direction in programmatically set selections on windows, unix, and mac, in plain text, editable divs, text-input fields, and textareas. Modified text baselines for many editing tests, which had a delegate change as a result of the cpp patch. * editing/deleting/delete-ligature-003-expected.txt: * editing/deleting/paragraph-in-preserveNewline-expected.txt: * editing/deleting/whitespace-pre-1-expected.txt: * editing/selection/after-line-break-expected.txt: * platform/mac/editing/deleting/delete-all-text-in-text-field-assertion-expected.txt: * platform/mac/editing/deleting/delete-and-undo-expected.txt: * platform/mac/editing/deleting/delete-at-paragraph-boundaries-008-expected.txt: * platform/mac/editing/deleting/delete-br-002-expected.txt: * platform/mac/editing/deleting/delete-br-004-expected.txt: * platform/mac/editing/deleting/delete-br-005-expected.txt: * platform/mac/editing/deleting/delete-br-006-expected.txt: * platform/mac/editing/deleting/delete-br-009-expected.txt: * platform/mac/editing/deleting/delete-br-010-expected.txt: * platform/mac/editing/deleting/delete-br-011-expected.txt: * platform/mac/editing/deleting/delete-ws-fixup-003-expected.txt: * platform/mac/editing/deleting/delete-ws-fixup-004-expected.txt: * platform/mac/editing/deleting/smart-delete-002-expected.txt: * platform/mac/editing/inserting/insert-3800346-fix-expected.txt: * platform/mac/editing/inserting/insert-at-end-01-expected.txt: * platform/mac/editing/inserting/insert-at-end-02-expected.txt: * platform/mac/editing/inserting/insert-div-010-expected.txt: * platform/mac/editing/inserting/insert-div-013-expected.txt: * platform/mac/editing/inserting/insert-div-015-expected.txt: * platform/mac/editing/inserting/insert-div-019-expected.txt: * platform/mac/editing/inserting/insert-paragraph-03-expected.txt: * platform/mac/editing/pasteboard/3976872-expected.txt: * platform/mac/editing/pasteboard/4076267-2-expected.txt: * platform/mac/editing/pasteboard/4076267-expected.txt: * platform/mac/editing/pasteboard/drag-selected-image-to-contenteditable-expected.txt: * platform/mac/editing/pasteboard/emacs-ctrl-a-k-y-expected.txt: * platform/mac/editing/pasteboard/emacs-ctrl-k-y-001-expected.txt: * platform/mac/editing/pasteboard/paste-text-014-expected.txt: * platform/mac/editing/pasteboard/paste-text-015-expected.txt: * platform/mac/editing/pasteboard/smart-paste-008-expected.txt: * platform/mac/editing/selection/4932260-1-expected.txt: * platform/mac/editing/selection/anchor-focus2-expected.txt: * platform/mac/editing/selection/anchor-focus3-expected.txt: * platform/mac/editing/selection/expanding-selections-expected.txt: * platform/mac/editing/selection/expanding-selections2-expected.txt: * platform/mac/editing/selection/fake-drag-expected.txt: * platform/mac/editing/selection/move-by-word-001-expected.txt: * platform/mac/editing/selection/transformed-selection-rects-expected.txt: * platform/mac/editing/selection/triple-click-in-pre-expected.txt: * platform/mac/editing/style/create-block-for-style-008-expected.txt: * platform/mac/editing/undo/4063751-expected.txt: * platform/mac/editing/undo/undo-forward-delete-boundary-expected.txt: * platform/mac/editing/undo/undo-forward-delete-expected.txt: Canonical link: https://commits.webkit.org/82146@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@93134 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information