[webkit-changes] [WebKit/WebKit] 2173fe: Skip user activation check in requestStorageAccess...

Sihui noreply at github.com
Fri Feb 16 15:10:39 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 2173fe1250ad9034b35bac7d1495e7ae2fdcacdc
      https://github.com/WebKit/WebKit/commit/2173fe1250ad9034b35bac7d1495e7ae2fdcacdc
  Author: Sihui Liu <sihui_liu at apple.com>
  Date:   2024-02-16 (Fri, 16 Feb 2024)

  Changed paths:
    M LayoutTests/http/tests/storageAccess/request-throw-exception-on-grant-until-reload.html
    M LayoutTests/http/tests/storageAccess/resources/request-throw-exception-on-grant-until-reload-iframe.html
    M Source/WebCore/dom/DocumentStorageAccess.cpp
    M Source/WebCore/page/LocalFrame.cpp
    M Source/WebCore/page/LocalFrame.h

  Log Message:
  -----------
  Skip user activation check in requestStorageAccess if frame ever gets NoModificationAllowedError
https://bugs.webkit.org/show_bug.cgi?id=269557

Reviewed by Alex Christensen.

If an iframe gets NoModificationAllowedError on requestStorageAccess, it means the request is granted but iframe needs
to reload to get the access. However, after reloading, the iframe would lose user activation, which stops it from
invoking requestStorageAccess again (Storage Access API requires user activation). To solve this, frame now stores user
activation for domains that ever get NoModificationAllowedError. If document does not have active user activation, but
its domain has user activation based on frame's records, then we will not reject the storage access request.

Updated test: http/tests/storageAccess/request-throw-exception-on-grant-until-reload.html. The test is modified to
invoke requestStorageAccess automatically (without another click) after reload.

* LayoutTests/http/tests/storageAccess/request-throw-exception-on-grant-until-reload.html:
* LayoutTests/http/tests/storageAccess/resources/request-throw-exception-on-grant-until-reload-iframe.html:
* Source/WebCore/dom/DocumentStorageAccess.cpp:
(WebCore::DocumentStorageAccess::requestStorageAccessQuickCheck):
(WebCore::DocumentStorageAccess::requestStorageAccess):
* Source/WebCore/page/LocalFrame.cpp:
(WebCore::LocalFrame::storageAccessExceptionReceivedForDomain):
(WebCore::LocalFrame::requestSkipUserActivationCheckForStorageAccess):
* Source/WebCore/page/LocalFrame.h:

Canonical link: https://commits.webkit.org/274887@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