Skip to content

Commit

Permalink
[Unified Text Replacement] Only show swap characters view when web vi…
Browse files Browse the repository at this point in the history
…ew is editable

https://bugs.webkit.org/show_bug.cgi?id=270231
rdar://123762150

Reviewed by Aditya Keerthi.

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

Canonical link: https://commits.webkit.org/275471@main
  • Loading branch information
rr-codes committed Feb 28, 2024
1 parent 16d05a3 commit cf3a779
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Source/WebKit/UIProcess/mac/WebViewImpl.mm
Original file line number Diff line number Diff line change
Expand Up @@ -2731,7 +2731,8 @@ static String commandNameForSelector(SEL selector)
#endif

#if ENABLE(UNIFIED_TEXT_REPLACEMENT)
if (m_page->editorState().hasPostLayoutData()) {
// FIXME: (rdar://123767495) Remove the `isEditable() && m_page->editorState().selectionIsRange` restriction when possible.
if (m_page->editorState().hasPostLayoutData() && isEditable() && m_page->editorState().selectionIsRange) {
auto selectionRect = m_page->editorState().postLayoutData->selectionBoundingRect;
scheduleShowSwapCharactersViewForSelectionRectOfView(selectionRect, m_view.getAutoreleased());
}
Expand Down

0 comments on commit cf3a779

Please sign in to comment.