Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: b4bb6216f8304dd9e2bab2648aad261546d4dad5
      
https://github.com/WebKit/WebKit/commit/b4bb6216f8304dd9e2bab2648aad261546d4dad5
  Author: Sihui Liu <[email protected]>
  Date:   2024-07-09 (Tue, 09 Jul 2024)

  Changed paths:
    M Source/WebCore/Headers.cmake
    M Source/WebCore/WebCore.xcodeproj/project.pbxproj
    M Source/WebCore/dom/Document.cpp
    A Source/WebCore/html/Allowlist.h
    A Source/WebCore/html/OwnerPermissionsPolicyData.h
    M Source/WebCore/html/PermissionsPolicy.cpp
    M Source/WebCore/html/PermissionsPolicy.h
    M Source/WebCore/page/LocalFrame.h

  Log Message:
  -----------
  Create PermissionsPolicy from Document
https://bugs.webkit.org/show_bug.cgi?id=276353
rdar://131357201

Reviewed by Youenn Fablet.

This patch makes a few changes that will help add support for permissions 
policy with site isolation:
1. Replace BitSet with HashSet for InheritedPolicy in PermissionsPolicy, so 
that we could use strongly typed enum for
getting and setting, which makes the code easier to understand and it is more 
safe to use it in IPC later. (We will
need to pass the policy between UI process and web processes).
2. Introduce OwnerPermissionsPolicyData struct, which contains information that 
Document needs from its owner element to
compute permissions policy. With site isolation, Document may not have access 
to owner element, so we need to store the
information elsewhere. In this patch, we store it in LocalFrame.
3. Allow PermissionsPolicy to be created from Document, and PermissionsPolicy 
can decide whether to construct object
from owner element or owner policy.
4. Split Allowlist from PermissionsPolicy so that it's easier to add IPC 
serialization format for it later.

The owner policy of LocalFrame is not set yet, so there is no behavior change.

* Source/WebCore/Headers.cmake:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/dom/Document.cpp:
(WebCore::Document::permissionsPolicy const):
* Source/WebCore/html/Allowlist.h: Added.
(WebCore::Allowlist::Allowlist):
(WebCore::Allowlist::origins const):
(WebCore::Allowlist::matches const):
* Source/WebCore/html/OwnerPermissionsPolicyData.h: Added.
(WebCore::OwnerPermissionsPolicyData::OwnerPermissionsPolicyData):
* Source/WebCore/html/PermissionsPolicy.cpp:
(WebCore::forEachFeature):
(WebCore::parseAllowlist):
(WebCore::PermissionsPolicy::processPermissionsPolicyAttribute):
(WebCore::featureValueForOrigin):
(WebCore::PermissionsPolicy::computeInheritedPolicyValueInContainer const):
(WebCore::PermissionsPolicy::inheritedPolicyValueForFeature const):
(WebCore::PermissionsPolicy::PermissionsPolicy):
(WebCore::PermissionsPolicy::Allowlist::matches const): Deleted.
(WebCore::index): Deleted.
* Source/WebCore/html/PermissionsPolicy.h:
(WebCore::PermissionsPolicy::PermissionsPolicy):
(WebCore::PermissionsPolicy::inheritedPolicy const):
(): Deleted.
(WebCore::PermissionsPolicy::Allowlist::Allowlist): Deleted.
* Source/WebCore/page/LocalFrame.h:

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to