Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 64f47a5b81e8fe71cd2d443fb33001b6d63849a1
https://github.com/WebKit/WebKit/commit/64f47a5b81e8fe71cd2d443fb33001b6d63849a1
Author: Darin Adler <[email protected]>
Date: 2025-01-25 (Sat, 25 Jan 2025)
Changed paths:
M Source/WebCore/editing/ApplyBlockElementCommand.cpp
M Source/WebCore/editing/ApplyStyleCommand.cpp
M Source/WebCore/editing/BreakBlockquoteCommand.cpp
M Source/WebCore/editing/CompositeEditCommand.cpp
M Source/WebCore/editing/CreateLinkCommand.cpp
M Source/WebCore/editing/DeleteSelectionCommand.cpp
M Source/WebCore/editing/Editor.cpp
M Source/WebCore/editing/FrameSelection.cpp
M Source/WebCore/editing/InsertLineBreakCommand.cpp
M Source/WebCore/editing/InsertListCommand.cpp
M Source/WebCore/editing/InsertParagraphSeparatorCommand.cpp
M Source/WebCore/editing/InsertTextCommand.cpp
M Source/WebCore/editing/MoveSelectionCommand.cpp
M Source/WebCore/editing/ReplaceSelectionCommand.cpp
M Source/WebCore/editing/TypingCommand.cpp
M Source/WebCore/editing/VisibleSelection.cpp
M Source/WebCore/editing/VisibleSelection.h
M Source/WebCore/html/HTMLTextFormControlElement.cpp
M Source/WebCore/page/DOMSelection.cpp
M Source/WebCore/page/EventHandler.cpp
Log Message:
-----------
Refactor selection directionality to prepare to introduce "weak"
https://bugs.webkit.org/show_bug.cgi?id=284262
rdar://141133014
Reviewed by Wenson Hsieh.
Mouse selection code is never setting "is directional" on Apple platforms.
To do this and preserve editing behavior we need to separate the concept of
directional,
which is specified unambiguously, and the direction-based editing behavior that
is part
of the Mac and iOS platforms. So we will have "weak directionality", which does
not affect
editing behavior, based on making a selection with the mouse, and "strong
directionality",
which does affect editing behavior. This refactor prepares us to add that
concept.
* Source/WebCore/editing/ApplyBlockElementCommand.cpp:
(WebCore::ApplyBlockElementCommand::doApply): Use directionality instead of
isDirectional.
(WebCore::ApplyBlockElementCommand::formatSelection): Ditto.
* Source/WebCore/editing/ApplyStyleCommand.cpp:
(WebCore::ApplyStyleCommand::updateStartEnd): Ditto.
* Source/WebCore/editing/BreakBlockquoteCommand.cpp:
(WebCore::BreakBlockquoteCommand::doApply): Ditto.
* Source/WebCore/editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::moveParagraphs): Ditto.
* Source/WebCore/editing/CreateLinkCommand.cpp:
(WebCore::CreateLinkCommand::doApply): Ditto.
* Source/WebCore/editing/DeleteSelectionCommand.cpp:
(WebCore::DeleteSelectionCommand::setStartingSelectionOnSmartDelete): Ditto.
(WebCore::DeleteSelectionCommand::doApply): Ditto.
* Source/WebCore/editing/Editor.cpp:
(WebCore::Editor::selectionForCommand): Ditto.
* Source/WebCore/editing/FrameSelection.cpp:
(WebCore::FrameSelection::FrameSelection): Ditto.
(WebCore::FrameSelection::moveTo): Ditto.
(WebCore::FrameSelection::moveWithoutValidationTo): Ditto.
(WebCore::FrameSelection::setSelectionByMouseIfDifferent): Ditto.
(WebCore::FrameSelection::setSelectionWithoutUpdatingAppearance): Ditto.
(WebCore::FrameSelection::textWasReplaced): Ditto.
(WebCore::FrameSelection::willBeModified): Ditto.
(WebCore::FrameSelection::modify): Ditto.
(WebCore::FrameSelection::setBase): Ditto.
(WebCore::FrameSelection::setExtent): Ditto.
* Source/WebCore/editing/InsertLineBreakCommand.cpp:
(WebCore::InsertLineBreakCommand::doApply): Ditto.
* Source/WebCore/editing/InsertListCommand.cpp:
(WebCore::InsertListCommand::doApply): Ditto.
* Source/WebCore/editing/InsertParagraphSeparatorCommand.cpp:
(WebCore::InsertParagraphSeparatorCommand::doApply): Ditto.
* Source/WebCore/editing/InsertTextCommand.cpp:
(WebCore::InsertTextCommand::setEndingSelectionWithoutValidation): Ditto.
(WebCore::InsertTextCommand::performTrivialReplace): Ditto.
(WebCore::InsertTextCommand::performOverwrite): Ditto.
(WebCore::InsertTextCommand::doApply): Ditto.
* Source/WebCore/editing/MoveSelectionCommand.cpp:
(WebCore::MoveSelectionCommand::doApply): Ditto.
* Source/WebCore/editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplaceSelectionCommand::completeHTMLReplacement): Ditto.
* Source/WebCore/editing/TypingCommand.cpp:
(WebCore::TypingCommand::makeEditableRootEmpty): Ditto.
(WebCore::TypingCommand::deleteKeyPressed): Ditto.
(WebCore::TypingCommand::forwardDeleteKeyPressed): Ditto.
* Source/WebCore/editing/VisibleSelection.cpp:
(WebCore::VisibleSelection::VisibleSelection): Ditto.
* Source/WebCore/editing/VisibleSelection.h: Added directionality and removed
isDirectional.
* Source/WebCore/html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::computeSelectionDirection const):
Use directionality instead of isDirectional.
* Source/WebCore/page/DOMSelection.cpp:
(WebCore::DOMSelection::direction const): Changed to return the direction
for both weak and strong directionality. This is only place where weak
directionality currently has any effect, other code treats it as
non-directional.
* Source/WebCore/page/EventHandler.cpp:
(WebCore::EventHandler::handleMousePressEventSingleClick): Use directionality
instead of isDirectional.
Canonical link: https://commits.webkit.org/289387@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes