WebKit Bugzilla
Attachment 372874 Details for
Bug 199211
: Selection highlight not shown on programmatic focus after initial load
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
First stab
WIP.patch (text/plain), 3.68 KB, created by
Daniel Bates
on 2019-06-25 16:39:24 PDT
(
hide
)
Description:
First stab
Filename:
MIME Type:
Creator:
Daniel Bates
Created:
2019-06-25 16:39:24 PDT
Size:
3.68 KB
patch
obsolete
>diff --git a/LayoutTests/editing/selection/ios/show-selection-view-on-programmatic-selection-after-initial-load-expected.txt b/LayoutTests/editing/selection/ios/show-selection-view-on-programmatic-selection-after-initial-load-expected.txt >new file mode 100644 >index 00000000000..866643e350c >--- /dev/null >+++ b/LayoutTests/editing/selection/ios/show-selection-view-on-programmatic-selection-after-initial-load-expected.txt >@@ -0,0 +1,10 @@ >+Tests that we have a UI selection rect when programmatically selecting text after the initial page load. >+ >+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". >+ >+ >+PASS have 1 UI selection rect >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+ >diff --git a/LayoutTests/editing/selection/ios/show-selection-view-on-programmatic-selection-after-initial-load.html b/LayoutTests/editing/selection/ios/show-selection-view-on-programmatic-selection-after-initial-load.html >new file mode 100644 >index 00000000000..7a77267700f >--- /dev/null >+++ b/LayoutTests/editing/selection/ios/show-selection-view-on-programmatic-selection-after-initial-load.html >@@ -0,0 +1,32 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<script src="../../../resources/js-test.js"></script> >+<script src="../../../resources/ui-helper.js"></script> >+</head> >+<body> >+<p id="test">Here's to the crazy ones.</p> >+<script> >+let testElement = document.getElementById("test"); >+let selection = window.getSelection(); >+ >+async function runTest() >+{ >+ await UIHelper.callFunctionAndWaitForEvent(() => selection.setBaseAndExtent(testElement.firstChild, 0, testElement.firstChild, 3), document, "selectionchange"); >+ >+ let rects = await UIHelper.getUISelectionViewRects(); >+ if (rects.length == 1) >+ testPassed("have 1 UI selection rect"); >+ else >+ testFailed("Should have 1 UI selection rect. But have " + rects.length); >+ >+ document.body.removeChild(testElement); >+ finishJSTest(); >+} >+ >+window.jsTestIsAsync = true; >+description("Tests that we have a UI selection rect when programmatically selecting text after the initial page load."); >+runTest(); >+</script> >+</body> >+</html> >diff --git a/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm b/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >index b3e16f2417b..51f49a85071 100644 >--- a/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >+++ b/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >@@ -5762,10 +5762,8 @@ - (void)_selectionChanged > [self _updateSelectionAssistantSuppressionState]; > > _selectionNeedsUpdate = YES; >- // If we are changing the selection with a gesture there is no need >- // to wait to paint the selection. >- if (_usingGestureForSelection) >- [self _updateChangedSelection]; >+ >+ [self _updateChangedSelection]; > > #if USE(UIKIT_KEYBOARD_ADDITIONS) > if (_candidateViewNeedsUpdate) { >@@ -5826,15 +5824,17 @@ - (void)_updateChangedSelection:(BOOL)force > } > } > >- if (postLayoutData.isStableStateUpdate && _needsDeferredEndScrollingSelectionUpdate && _page->inStableState()) { >- [[self selectionInteractionAssistant] showSelectionCommands]; >+ if (postLayoutData.isStableStateUpdate && _page->inStableState()) { >+ if (_usingGestureForSelection) >+ [[self selectionInteractionAssistant] showSelectionCommands]; > > if (!_suppressSelectionAssistantReasons) > [_textSelectionAssistant activateSelection]; > >- [_textSelectionAssistant didEndScrollingOverflow]; >- >- _needsDeferredEndScrollingSelectionUpdate = NO; >+ if (_needsDeferredEndScrollingSelectionUpdate) { >+ [_textSelectionAssistant didEndScrollingOverflow]; >+ _needsDeferredEndScrollingSelectionUpdate = NO; >+ } > } > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
ews-watchlist
:
commit-queue-
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 199211
: 372874 |
372890
|
372939
|
372945