Migrate sticky and history-action user activation to explicit boolean flags - #66459
Conversation
|
EWS run on previous version of this PR (hash 05222b5) Details |
05222b5 to
d1898cf
Compare
|
EWS run on previous version of this PR (hash d1898cf) Details |
d1898cf to
d1ae363
Compare
|
EWS run on previous version of this PR (hash d1ae363) Details |
d1ae363 to
d5ade5f
Compare
|
EWS run on previous version of this PR (hash d5ade5f) Details |
d5ade5f to
697c44d
Compare
|
EWS run on previous version of this PR (hash 697c44d) Details |
|
Hi, Anne suggested you might be a good person to review this, as you're more familiar with this area of the code. Would you mind taking a look when you have a chance? This PR implements just the user-activation data-model change from whatwg/html#11454 (https://github.com/whatwg/html/pull/11454/changes) — migrating sticky and history-action activation from timestamp-derived state to explicit boolean flags on LocalDOMWindow. It's behavior-preserving and not gated. I'd like to land this refactor first, before the actual "preserve sticky activation" feature, which is in a separate PR (#63952). Note: the CI site-isolation timeouts are unrelated — the changed code only runs on an actual user activation and is behavior-preserving, and the failing tests trigger no activation (they also reproduce on unrelated commits, so they're pre-existing on the base). Thanks so much! 🙏 |
| if (RefPtr window = localFrame->window()) { | ||
| window->setLastActivationTimestamp(activationTime); | ||
| window->setHasStickyActivation(true); | ||
| window->setHasHistoryActionActivation(true); |
There was a problem hiding this comment.
I would tend to introduce a routine that updates both time and the two booleans in a single method.
How about something like updateActivation(MonotonicTime)?
| // https://html.spec.whatwg.org/multipage/interaction.html#sticky-activation | ||
| // The published spec still derives sticky activation from the last activation | ||
| // timestamp; we track it as an explicit boolean per the proposed | ||
| // whatwg/html#11454 (https://github.com/whatwg/html/pull/11454). |
There was a problem hiding this comment.
It would be slightly better to wait for the PR to get merged.
| MonotonicTime m_lastActivationTimestamp { MonotonicTime::infinity() }; | ||
| MonotonicTime m_lastHistoryActionActivationTimestamp { MonotonicTime::infinity() }; | ||
| bool m_hasStickyActivation { false }; | ||
| bool m_hasHistoryActionActivation { false }; |
There was a problem hiding this comment.
We could move these bools just after m_lastUserClickEvent so that they are next to other bools.
697c44d to
f9614cc
Compare
|
EWS run on previous version of this PR (hash f9614cc) Details |
f9614cc to
46c0ae9
Compare
|
EWS run on previous version of this PR (hash 46c0ae9) Details |
46c0ae9 to
d2874f9
Compare
|
EWS run on current version of this PR (hash d2874f9) Details |
|
The failing win-tests (9) and ios-wk2 (~60) results are pre-existing, unrelated to this change. The identical failures appear across many unrelated PRs on the same queues (e.g. win-tests builds #92998–#93005 all show the same 9 failures; ios-wk2 builds #34853–#34878 share ~57/60). This patch only migrates sticky/history-action user activation to boolean flags on LocalDOMWindow and touches none of these areas. Switching to unsafe-merge-queue. |
… flags https://bugs.webkit.org/show_bug.cgi?id=316317 Reviewed by Youenn Fablet. Per the user-activation data model change in the proposed whatwg/html#11454, track sticky activation and history-action activation as explicit booleans on LocalDOMWindow instead of deriving them from the last activation timestamp. m_lastActivationTimestamp continues to drive transient activation only. notifyActivated and its ancestor/descendant propagation, consume-history- action, and WebPage::updateUserActivationTimestamps now update the booleans alongside the timestamp. This is not gated behind a preference. Behavior is preserved, except that consuming transient activation no longer resurrects an already-consumed history-action activation, which matches the proposed explicit boolean model. * Source/WebCore/page/LocalDOMWindow.cpp: (WebCore::LocalDOMWindow::hasStickyActivation const): (WebCore::LocalDOMWindow::hasHistoryActionActivation const): (WebCore::LocalDOMWindow::consumeHistoryActionUserActivation): (WebCore::LocalDOMWindow::notifyActivated): * Source/WebCore/page/LocalDOMWindow.h: (WebCore::LocalDOMWindow::setHasStickyActivation): (WebCore::LocalDOMWindow::setHasHistoryActionActivation): * Source/WebKit/UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didNotifyUserActivation): * Source/WebKit/WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updateUserActivationState): * Source/WebKit/WebProcess/WebPage/WebPage.h: * Source/WebKit/WebProcess/WebPage/WebPage.messages.in: Canonical link: https://commits.webkit.org/315598@main
d2874f9 to
a96f40e
Compare
|
Committed 315598@main (a96f40e): https://commits.webkit.org/315598@main Reviewed commits have been landed. Closing PR #66459 and removing active labels. |
a96f40e
d2874f9
🧪 ios-wk2-wpt