WebKit icon indicating copy to clipboard operation
WebKit copied to clipboard

REGRESSION (278484@main): [ iOS ] editing/selection/ios/place-selection-in-overflow-area.html is a consistent timeout

Open whsieh opened this issue 9 months ago โ€ข 4 comments

250f418f2b304fedc196a58ef65adeab4a39370d

REGRESSION (278484@main): [ iOS ] editing/selection/ios/place-selection-in-overflow-area.html is a consistent timeout
https://bugs.webkit.org/show_bug.cgi?id=274180
rdar://128086114

Reviewed by NOBODY (OOPS!).

After the changes in 278484@main, this test began to intermittently fail, but only when run after
another layout test that ends with a selection rect over the tap location, `(25, 25)`. This is
because the new logic to clear out the UI-side cached editor state in `278484@main` leaves the
editor state without post-layout or visual data. This means that the `_lastSelectionDrawingInfo` on
`WKContentView` isn't updated to reflect the fact that there's no more selection after committing
the load.

Subsequently, `-_shouldToggleSelectionCommandsAfterTapAt:` returns `YES` since we (incorrectly)
think the user is still tapping a selection rect, which should toggle the edit menu instead of being
handled as a synthetic click.

To fix this, clear out the stale `_lastSelectionDrawingInfo` (along with `_cachedSelectedTextRange`)
from the previous page upon transitioning to a new page.

* LayoutTests/editing/selection/ios/persist-selection-after-tapping-on-element-with-mousedown-handler.html:

Drive-by fix: remove a redundant call to `testRunner.notifyDone()`. This test currently ends faster
than intended, since it doesn't wait for the keyboard to be dismissed.

* LayoutTests/platform/ios/TestExpectations:

Remove failing test expectations.

* Source/WebKit/UIProcess/PageClient.h:
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::clearEditorStateAfterPageTransition):

Add a separate client method to call out to `WKContentView` (on iOS) to invalidate selection drawing
info when transitioning to a new page.

* Source/WebKit/UIProcess/ios/PageClientImplIOS.h:
* Source/WebKit/UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::didClearEditorStateAfterPageTransition):
* Source/WebKit/UIProcess/ios/WKContentViewInteraction.h:
* Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _didClearEditorStateAfterPageTransition]): See comments above.

https://github.com/WebKit/WebKit/commit/250f418f2b304fedc196a58ef65adeab4a39370d

Misc iOS, tvOS & watchOS macOS Linux Windows
โณ ๐Ÿงช style โœ… ๐Ÿ›  ios loading-orange ๐Ÿ›  mac โŒ ๐Ÿ›  wpe โณ ๐Ÿ›  wincairo
โณ ๐Ÿงช bindings โœ… ๐Ÿ›  ios-sim โŒ ๐Ÿ›  mac-AS-debug โŒ ๐Ÿงช wpe-wk2
โณ ๐Ÿงช webkitperl โณ ๐Ÿงช ios-wk2 loading-orange ๐Ÿงช api-mac โŒ ๐Ÿงช api-wpe
โณ ๐Ÿงช ios-wk2-wpt loading-orange ๐Ÿงช mac-wk1 โณ ๐Ÿ›  wpe-skia
โณ ๐Ÿ›  ๐Ÿงช jsc โณ ๐Ÿงช api-ios loading-orange ๐Ÿงช mac-wk2 โŒ ๐Ÿ›  gtk
โณ ๐Ÿ›  tv โŒ ๐Ÿงช mac-AS-debug-wk2 โŒ ๐Ÿงช gtk-wk2
โณ ๐Ÿ›  tv-sim loading-orange ๐Ÿงช mac-wk2-stress โŒ ๐Ÿงช api-gtk
โณ ๐Ÿ›  watch
โณ ๐Ÿ›  watch-sim

whsieh avatar May 16 '24 18:05 whsieh

Oh dear, it looks like the API test failure (ScrollViewScrollabilityTests.ScrollableWithOverflowHiddenWhenZoomed) is real :/

I might need to adjust the approach here...

whsieh avatar May 16 '24 21:05 whsieh

I suppose the other PageClientImpls need stubs for didClearEditorStateAfterPageTransition

aprotyas avatar May 16 '24 21:05 aprotyas

Committed 278902@main (24339c7cdb41): https://commits.webkit.org/278902@main

Reviewed commits have been landed. Closing PR #28664 and removing active labels.

webkit-commit-queue avatar May 17 '24 03:05 webkit-commit-queue