From b8ef061fb7e833ceb333d202c24f0d6f73fd898b Mon Sep 17 00:00:00 2001 From: Eric Portis Date: Thu, 24 Jan 2019 08:47:54 -0800 Subject: [PATCH] =?UTF-8?q?Add=20"Should=20request=20be=20allowed=20to=20u?= =?UTF-8?q?se=20feature"=C2=A0algorithm?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.bs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/index.bs b/index.bs index 01e96849..dd590862 100644 --- a/index.bs +++ b/index.bs @@ -1058,6 +1058,22 @@ partial interface HTMLIFrameElement { Note: This algorithm should be called when a feature policy has been violated. +
+

Should request be allowed to use feature?

+

Given a feature (feature) and a request (request), this algorithm returns true if the request should be allowed to use feature, and false otherwise.

+
    +
  1. Set |window| to |request|’s window.
  2. +
  3. If |window| is not a {{Window}}, return false. +
    Feature Policy within `no-window` contexts ({{WorkerGlobalScope}} or {{WorkletGlobalScope}}) is being figured out in issue #207. After that’s resolved, update this algorithm to allow fetches initiated within these contexts to use policy-controlled features. *Until* that’s resolved, disallow all policy-controlled features (e.g., sending Client Hints to third parties) in these contexts.
    +
  4. +
  5. Set |document| to |window|’s associated `Document`.
  6. +
  7. Let |origin| be |request|’s origin.
  8. +
  9. Let |result| be the result of executing Is feature enabled in document for origin? on |feature|, |document|, and |origin|. +
  10. +
  11. If |result| is "Enabled", return true.
  12. +
  13. Otherwise, return false.
  14. +
+