[webkit-changes] [WebKit/WebKit] 2da2a5: [iPadOS] Walmart adds the wrong item color to the ...
Wenson Hsieh
noreply at github.com
Tue Oct 29 22:09:59 PDT 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 2da2a5540fc4fc2021ba467d7959c81d770541af
https://github.com/WebKit/WebKit/commit/2da2a5540fc4fc2021ba467d7959c81d770541af
Author: Wenson Hsieh <wenson_hsieh at apple.com>
Date: 2024-10-29 (Tue, 29 Oct 2024)
Changed paths:
M Source/WebCore/page/Quirks.cpp
M Source/WebCore/page/Quirks.h
M Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm
Log Message:
-----------
[iPadOS] Walmart adds the wrong item color to the cart after switching colors more than once
https://bugs.webkit.org/show_bug.cgi?id=282311
rdar://123734840
Reviewed by Richard Robinson.
On walmart.com, when tapping to change the color or appearance of a shopping item, the page swaps
out a `div` containing the preview `img` for another container underneath the scope of the synthetic
`mousemove` event dispatch. The content change observer (correctly) identifies this as a significant
layout/style change, which causes the tap to be handled as only hover (mouse movement) rather than a
click. However, this results in a confusing user experience where the preview image shows the new
item that was just tapped, but the old item is still selected; subsequently, clicking "Add to cart"
adds the old selected item, instead of the new one shown in the preview.
Since this is effectively indistinguishable from the case where hovering an element shows important
UI and stopping at mouse hover is desirable, work around this with a site-specific hack that targets
this specific UI on Walmart.
* Source/WebCore/page/Quirks.cpp:
(WebCore::Quirks::shouldIgnoreContentObservationForClick const):
Cache a flag that represents whether content observation quirks _may_ be required for the current
top domain, in `m_mayNeedToIgnoreContentObservation`. This guarantees that we'll only perform the
registrable domain lookup once when tapping on any website that does not contain an element affected
by this quirk.
The actual quirk on walmart.com looks for a click target element with `role=button`, immediately
underneath a parent element with `role=listitem`.
* Source/WebCore/page/Quirks.h:
* Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::handleSyntheticClick):
Canonical link: https://commits.webkit.org/285881@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