[webkit-changes] [WebKit/WebKit] 8e5dde: evaluateJavaScript: and callAsyncJavaScript: shoul...

Brady Eidson noreply at github.com
Wed Jun 14 15:30:42 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 8e5ddea16577b402cf55978e7e1132f33d60fee9
      https://github.com/WebKit/WebKit/commit/8e5ddea16577b402cf55978e7e1132f33d60fee9
  Author: Brady Eidson <beidson at apple.com>
  Date:   2023-06-14 (Wed, 14 Jun 2023)

  Changed paths:
    M Source/WTF/wtf/cocoa/RuntimeApplicationChecksCocoa.cpp
    M Source/WTF/wtf/cocoa/RuntimeApplicationChecksCocoa.h
    M Source/WebCore/bindings/js/ScriptController.cpp
    M Source/WebCore/dom/UserGestureIndicator.cpp
    M Source/WebCore/dom/UserGestureIndicator.h
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/AsyncFunction.mm

  Log Message:
  -----------
  evaluateJavaScript: and callAsyncJavaScript: should not leave behind transient activation
https://bugs.webkit.org/show_bug.cgi?id=258037
rdar://107102031

Reviewed by Ben Nham.

JavaScript evaluated by the client app is executed as if from a user gesture, which is fine for now.
But before this change, such JS left behind transient user activation for (currently) 5 seconds, which is not fine.

Let's remove that sticky side effect.

* Source/WTF/wtf/cocoa/RuntimeApplicationChecksCocoa.cpp:
(WTF::computeSDKAlignedBehaviors):
* Source/WTF/wtf/cocoa/RuntimeApplicationChecksCocoa.h:

* Source/WebCore/bindings/js/ScriptController.cpp:
(WebCore::ScriptController::executeScriptInWorld):
(WebCore::ScriptController::executeAsynchronousUserAgentScriptInWorld):

* Source/WebCore/dom/UserGestureIndicator.cpp:
(WebCore::UserGestureToken::forEachImpactedDocument):
* Source/WebCore/dom/UserGestureIndicator.h:

* Tools/TestWebKitAPI/Tests/WebKitCocoa/AsyncFunction.mm:
(TestWebKitAPI::TEST):

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




More information about the webkit-changes mailing list