[webkit-changes] [WebKit/WebKit] cfd869: REGRESSION (271805 at main): [iOS] Updating options i...

Aditya Keerthi noreply at github.com
Tue Mar 19 08:54:08 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: cfd86982fcdf69b0a1585024e43a477ffe8e7288
      https://github.com/WebKit/WebKit/commit/cfd86982fcdf69b0a1585024e43a477ffe8e7288
  Author: Aditya Keerthi <akeerthi at apple.com>
  Date:   2024-03-19 (Tue, 19 Mar 2024)

  Changed paths:
    M LayoutTests/fast/forms/ios/select-option-removed-update.html
    A LayoutTests/fast/forms/ios/select-option-update-1000-expected.txt
    A LayoutTests/fast/forms/ios/select-option-update-1000.html
    M Source/WebKit/WebProcess/WebPage/WebPage.cpp
    M Source/WebKit/WebProcess/WebPage/WebPage.h
    M Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm

  Log Message:
  -----------
  REGRESSION (271805 at main): [iOS] Updating options in a visible <select> menu can result in hangs
https://bugs.webkit.org/show_bug.cgi?id=271138
rdar://124576235

Reviewed by Abrar Rahman Protyasha.

271805 at main introduced logic that would update a visible <select> menu's options
as they are changed. Currently, the logic sends an update every time an option is
added or removed. This is problematic when options are added in a loop, as (n - 1)
unnecessary IPC messages are sent, and O(n^2) menu items are constructed in the UI
process. Additionally, there is further overhead from auto layout. Consequently,
adding options in a loop can result in a hang when there is a visible <select> menu.

Fix by adding a debouncing mechanism, so that changes to options can be coalesced
into a single update.

* LayoutTests/fast/forms/ios/select-option-removed-update.html:
* LayoutTests/fast/forms/ios/select-option-update-1000-expected.txt: Added.
* LayoutTests/fast/forms/ios/select-option-update-1000.html: Added.
* Source/WebKit/WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::close):
(WebKit::WebPage::elementDidFocus):
(WebKit::WebPage::focusedSelectElementDidChangeOptions):
* Source/WebKit/WebProcess/WebPage/WebPage.h:

Use a `DeferrableOneShotTimer` to ensure that any changes that happen within 100ms
are coalesced into a single update.

* Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::updateFocusedElementInformation):

Canonical link: https://commits.webkit.org/276349@main



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list