Skip to content

Commit

Permalink
[Unified Text Replacement] Swap characters view should be shown even …
Browse files Browse the repository at this point in the history
…when there is no selection

https://bugs.webkit.org/show_bug.cgi?id=274734
rdar://128712983

Reviewed by Wenson Hsieh.

* Source/WebKit/UIProcess/mac/WebViewImpl.mm:
(WebKit::WebViewImpl::selectionDidChange):

Canonical link: https://commits.webkit.org/279387@main
  • Loading branch information
rr-codes committed May 28, 2024
1 parent 4d646a4 commit efa4d47
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Source/WebKit/UIProcess/mac/WebViewImpl.mm
Original file line number Diff line number Diff line change
Expand Up @@ -2794,8 +2794,10 @@ static String commandNameForSelector(SEL selector)
#endif

#if ENABLE(UNIFIED_TEXT_REPLACEMENT)
if (m_page->editorState().hasPostLayoutData() && wantsCompleteUnifiedTextReplacementBehavior() && m_page->editorState().selectionIsRange) {
auto selectionRect = m_page->editorState().postLayoutData->selectionBoundingRect;
if (wantsCompleteUnifiedTextReplacementBehavior()) {
auto isRange = m_page->editorState().hasPostLayoutData() && m_page->editorState().selectionIsRange;
auto selectionRect = isRange ? m_page->editorState().postLayoutData->selectionBoundingRect : IntRect { };

scheduleShowSwapCharactersViewForSelectionRectOfView(selectionRect, m_view.getAutoreleased());
}
#endif
Expand Down

0 comments on commit efa4d47

Please sign in to comment.