|
Lines 1-3
a/Source/WebKit/ChangeLog_sec1
|
|
|
1 |
2020-03-20 Daniel Bates <dabates@apple.com> |
| 2 |
|
| 3 |
Replace "deferred element focus" functionality with alternative solution |
| 4 |
https://bugs.webkit.org/show_bug.cgi?id=201608 |
| 5 |
|
| 6 |
Reviewed by Wenson Hsieh. |
| 7 |
|
| 8 |
This is a partial revert of r190278. Have the web process perform a layout, if needed, when |
| 9 |
computing focus element information and send an editor state update immediately. If layout is |
| 10 |
not needed then explicitly schedule a full editor state update. |
| 11 |
|
| 12 |
Currently, fetching focus element information neither sends an editor state update nor |
| 13 |
schedules one. As a result, when the web process tells the UI process to focus an element the |
| 14 |
UI process may need to defer doing so if the last received update did not include details |
| 15 |
that require up-to-date layout (e.g. the bounding rect of the focused element, which is used |
| 16 |
to scroll and zoom to center the focused element). The UI process then schedules an async message |
| 17 |
to the web process to fetch the full editor state, which will arrive in a layer tree commit message |
| 18 |
from the web process. (Note that the UI process schedules this request to ensure the web process |
| 19 |
knows that it is waiting for a layer tree commit. The web process can use this info to expedite |
| 20 |
a layer tree commit, if needed). This deferral mechanism complicates the element focusing and |
| 21 |
defocusing logic in the UI process and prevents fixing <https://bugs.webkit.org/show_bug.cgi?id=199960>. |
| 22 |
Instead remove this deferral concept and have the web process ensure that a full editor state |
| 23 |
update is sent or will be sent when computing the focus element information. |
| 24 |
|
| 25 |
* UIProcess/WebPageProxy.cpp: |
| 26 |
(WebKit::WebPageProxy::resetStateAfterProcessExited): |
| 27 |
* UIProcess/WebPageProxy.h: |
| 28 |
* UIProcess/ios/WebPageProxyIOS.mm: |
| 29 |
(WebKit::WebPageProxy::didCommitLayerTree): |
| 30 |
(WebKit::WebPageProxy::elementDidFocus): |
| 31 |
(WebKit::WebPageProxy::elementDidBlur): |
| 32 |
Remove bookkeeping code to track a deferred focus event or to perform the deferred event |
| 33 |
on layer tree commit. |
| 34 |
|
| 35 |
* WebProcess/WebPage/WebPage.cpp: |
| 36 |
(WebKit::WebPage::elementDidFocus): |
| 37 |
* WebProcess/WebPage/ios/WebPageIOS.mm: |
| 38 |
(WebKit::WebPage::getFocusedElementInformation): Save off whether a layout is needed then |
| 39 |
tell the page to layout if needed. If a layout was needed then send an editor state update |
| 40 |
immediately (it's an async message): this update will be a "full editor state" update that |
| 41 |
includes up-to-date layout details. Otherwise, schedule a full editor state update. While I |
| 42 |
am here, I updated the code to take out a ref on the focused frame's document before performing |
| 43 |
a layout because layout can cause arbitrary JavaScript execution that could detach the document |
| 44 |
from its frame view as part of destroying the document. Document destruction is detected by |
| 45 |
checking whether the document has been detached from its frame view. If this happens then |
| 46 |
bail out as there is no need to get focus element info. |
| 47 |
|
| 1 |
2020-03-19 Daniel Bates <dabates@apple.com> |
48 |
2020-03-19 Daniel Bates <dabates@apple.com> |
| 2 |
|
49 |
|
| 3 |
Have insertDictatedTextAsync() take an InsertTextOptions |
50 |
Have insertDictatedTextAsync() take an InsertTextOptions |