Return trustedObject.
@@ -1979,7 +2056,7 @@ This algorithm will return a string that can be used with an injection sink, optionally unwrapping it from a matching Trusted Type.
-It will ensure that the Trusted Type enforcement rules were respected.
+It will ensure that the Trusted Type enforcement rules were respected.
Given a TrustedType
type (expectedType), a global object (global), TrustedType
or a string (input), a string (sink) and a string (sinkGroup), run these steps:
-
Let cspList be the global’s CSP list.
-
If cspList is null
or does not contain a policy which directive set containing a directive with a name "require-trusted-types-for"
,
-or that directive does not contain a trusted-types-sink-group which is a match for a value sinkGroup,
+or that directive does not contain a trusted-types-sink-group which is a match for a value sinkGroup,
return stringified input and abort these steps.
-
If input has type expectedType, return stringified input and abort these steps.
@@ -2025,7 +2102,7 @@ Note: This step assures that the default policy rejection will be reported, but ignored in a report-only mode.
+
Note: This step assures that the default policy rejection will be reported, but ignored in a report-only mode.
-
Throw a TypeError and abort further steps.
@@ -2047,7 +2124,7 @@ regular operation argument that the type annotated with the [StringContext
] extended
attribute appears in is its related construct.
A type that is not DOMString
or USVString
must not be associated with the [StringContext
] extended attribute.
- See the rules for converting ECMAScript values to the IDL types in Web IDL § 3.2.10 DOMString for the specific requirements that the use of [StringContext
] entails.
+ See the rules for converting ECMAScript values to the IDL types in Web IDL § 3.2.10 DOMString for the specific requirements that the use of [StringContext
] entails.
In the following IDL fragment,
a variadic operation is declared
that uses the [StringContext
] extended attribute on all its arguments:
interface Document {
- undefined write([StringContext=html] DOMString... text);
+ undefined write([StringContext=TrustedHTML] DOMString... text);
};
@@ -2138,14 +2215,14 @@ <
[LegacyNullToEmptyString
].
4.2.2. Type conversion
-
This specification modifies the algorithm implementing the conversion to DOMString in Web IDL § 3.2.10 DOMString:
+ This specification modifies the algorithm implementing the conversion to DOMString in Web IDL § 3.2.10 DOMString:
An ECMAScript value V is converted to an IDL DOMString
value by running the following algorithm:
-
If the conversion is to an IDL type associated with the
[
StringContext
] extended attribute, then set V to the result of validate the string in context, passing this, V, the StringContext
extended attribute identifier, and the identifier of the [StringContext
] extended attribute related construct.
- Note: That algorithm may throw a TypeError.
+ Note: That algorithm may throw a TypeError.
-
If V is null and the conversion is to an IDL type
@@ -2157,8 +2234,8 @@
Return the IDL DOMString
value that represents the same sequence of code units as the one the ECMAScript String value x represents.
4.2.3. Validate the string in context
- This specification adds a following section to Web IDL § 3.5 Security.
- Certain algorithms in Web IDL § 3.2 ECMAScript type mapping are defined to validate the string in context on a given
+
This specification adds a following section to Web IDL § 3.5 Security.
+ Certain algorithms in Web IDL § 3.2 JavaScript type mapping are defined to validate the string in context on a given
value. This check is used to determine whether a given value
is appropriate for its StringContext
. This validation takes the following four inputs:
@@ -2173,12 +2250,12 @@ identifier of the operation or attribute.
The algorithm returns an ECMAScript String value, or throws a TypeError.
- Note: The HTML Standard defines how the validation is performed. [HTML]
+ Note: The HTML Standard defines how the validation is performed. [HTML]
4.3. Integration with HTML
- Window
and Worker
objects have a trusted type policy factory,
+
Window
and Worker
objects have a trusted type policy factory,
which is a TrustedTypePolicyFactory
object.
4.3.1. Extensions to the WindowOrWorkerGlobalScope interface
- This document extends the WindowOrWorkerGlobalScope
interface defined by HTML:
+ This document extends the WindowOrWorkerGlobalScope
interface defined by HTML:
partial interface mixin WindowOrWorkerGlobalScope {
readonly attribute TrustedTypePolicyFactory trustedTypes
;
};
@@ -2186,8 +2263,8 @@ trustedTypes getter steps are to return this's relevant global object's trusted
type policy factory.
4.3.2. Extensions to the Document interface
-
This document modifies the Document
interface defined by HTML:
-partial interface Document {
+ This document modifies the Document
interface defined by HTML:
+partial interface Document {
[CEReactions] undefined write
(HTMLString... text
);
[CEReactions] undefined writeln
(HTMLString... text
);
};
@@ -2210,17 +2287,29 @@ This document modifies how HTMLScriptElement
child text content can be set to allow applications to control dynamically created scripts. It does so by
adding the innerText
and textContent
attributes directly on HTMLScriptElement
. The behavior of the attributes remains the same
as in their original counterparts, apart from additional behavior triggered by the StringContext
extended attribute presence.
- Note: Using these IDL attributes is the recommended way of dynamically setting URL or a text of a script. Manipulating attribute nodes or text nodes directly will call a default policy on the final value when the script is prepared.
+ Note: Using these IDL attributes is the recommended way of dynamically setting URL or a text of a script. Manipulating attribute nodes or text nodes directly will call a default policy on the final value when the script is prepared.
Figure out what to do with script.setAttribute('src'). See DOM#789.
-partial interface HTMLScriptElement {
+partial interface HTMLScriptElement {
[CEReactions] attribute [LegacyNullToEmptyString] ScriptString innerText
;
[CEReactions] attribute ScriptString? textContent
;
[CEReactions] attribute ScriptURLString src
;
[CEReactions] attribute ScriptString text
;
};
- On setting, the innerText
, textContent
and text
IDL attributes perform the regular steps, and then set [[ScriptText]]
internal slot value with the stringified value.
- On setting, the src
IDL attribute performs the usual steps, and then sets [[ScriptURL]]
internal slot value to its src
content attribute value.
+ On setting the innerText
, textContent
and text
IDL attributes execute the following algorithm:
+
+ -
+
Set [[ScriptText]]
internal slot value to the stringified attribute value.
+ -
+
Perform the usual attribute setter steps.
+
+ On setting the src
IDL attribute, execute the following algorithm:
+
+ -
+
Set [[ScriptURL]]
internal slot value to the stringified attribute value.
+ -
+
Perform the usual attribute setter steps.
+
4.3.3.3. Slot value verification
The first few steps of the prepare the script element algorithm are modified as follows:
@@ -2274,7 +2363,7 @@
4.3.4. Enforcement in element attributes
This document modifies following IDL attributes of various DOM elements:
-partial interface HTMLIFrameElement {
+partial interface HTMLIFrameElement {
[CEReactions] attribute HTMLString srcdoc
;
};
@@ -2289,7 +2378,7 @@
4.3.5. Enforcement in timer functions
This document modifies the WindowOrWorkerGlobalScope
interface mixin:
-typedef (ScriptString or Function) TrustedTimerHandler
;
+typedef (ScriptString or Function) TrustedTimerHandler
;
partial interface mixin WindowOrWorkerGlobalScope {
long setTimeout
(TrustedTimerHandler handler
, optional long timeout
= 0, any... arguments
);
@@ -2313,10 +2402,10 @@ Note: This matches the logic that the extended attribute would apply.
+
Note: This matches the logic that the extended attribute would apply.
- Note: This makes sure that a TrustedScript
is passed to timer
+
Note: This makes sure that a TrustedScript
is passed to timer
functions in place of a string when Trusted Types are enforced, but
also unconditionally accepts any Function
object.
4.3.6. Enforcement in event handler content attributes
@@ -2334,14 +2423,14 @@ concatenating the list « element’s local name, localName » with "."
as a separator.
-
Note: For example, document.createElement('div').onclick = value
will result in sink being 'div.onclick'
.
+ Note: For example, document.createElement('div').onclick = value
will result in sink being 'div.onclick'
.
eventTarget’s relevant global object as global,
If the algorithm throws an error, abort these steps.
- Note: This also applies to events in SVG 2 § 15.8 Event attributes.
+ Note: This also applies to events in SVG 2 § 15.8 Event attributes.
// Content-Security-Policy: require-trusted-types-for 'script'
@@ -2351,7 +2440,7 @@ 4.3.7. Validate the string in context
- This specification defines the validate the string in context algorithm in HTML § 7.2.1 Integration with IDL.
+ This specification defines the validate the string in context algorithm in HTML § 7.2.1.1 Integration with IDL.
When validate the string in context is invoked, with platformObject, value, stringContext, and identifier run these steps:
-
@@ -2394,7 +2483,7 @@
4.3.8. Web Workers
This specification modifies the Worker constuctors and importScripts
function to require ScriptURLString
.
-[Exposed=(Window,Worker)]
+[Exposed=(Window,Worker)]
partial interface Worker : EventTarget {
constructor
(ScriptURLString scriptURL
, optional WorkerOptions options
= {});
};
@@ -2411,14 +2500,14 @@ 4.4. Integration with Service Workers
This document modifies the IDL for registering service workers, requiring ScriptURLString
:
-[SecureContext, Exposed=(Window,Worker)]
+[SecureContext, Exposed=(Window,Worker)]
partial interface ServiceWorkerContainer : EventTarget {
[NewObject] Promise<ServiceWorkerRegistration> register
(ScriptURLString scriptURL
, optional RegistrationOptions options
= {});
};
4.5. Integration with SVG
This document modifies the SVGAnimatedString
interface to enforce Trusted Types:
-[Exposed=Window]
+[Exposed=Window]
partial interface mixin SVGAnimatedString {
attribute (DOMString or TrustedScriptURL) baseVal
;
};
@@ -2451,7 +2540,7 @@
- Note: SVG does not have a complete script processing model yet. Trusted Types assumes that the attribute and text body modification protections behave similarly to ones for HTML scripts outlined in § 4.3.3 Enforcement for scripts.
+ Note: SVG does not have a complete script processing model yet. Trusted Types assumes that the attribute and text body modification protections behave similarly to ones for HTML scripts outlined in § 4.3.3 Enforcement for scripts.
4.6. Integration with DOM
This document modifies the Element
interface, adding attribute validation steps:
@@ -2491,61 +2580,54 @@
Callers of this algorithm are changed accordingly.
Remove when DOM #809 is merged.
4.7. Integration with DOM Parsing
- This document modifies the following interfaces defined by [DOM-Parsing]:
-partial interface Element {
- [CEReactions, LegacyNullToEmptyString] attribute HTMLString outerHTML
;
+ This document modifies the following interfaces defined by [DOM-Parsing]:
+partial interface Element {
+ [CEReactions, LegacyNullToEmptyString] attribute HTMLString outerHTML
;
[CEReactions] undefined insertAdjacentHTML
(DOMString position
, HTMLString text
);
+ [CEReactions] undefined setHTMLUnsafe
(HTMLString html
);
};
partial interface mixin InnerHTML { // specified in a draft version at https://w3c.github.io/DOM-Parsing/#the-innerhtml-mixin
- [CEReactions] attribute [LegacyNullToEmptyString] HTMLString innerHTML
;
+ [CEReactions] attribute [LegacyNullToEmptyString] HTMLString innerHTML
;
};
partial interface Range {
- [CEReactions, NewObject] DocumentFragment createContextualFragment
(HTMLString fragment
);
+ [CEReactions, NewObject] DocumentFragment createContextualFragment
(HTMLString fragment
);
+};
+
+partial interface ShadowRoot {
+ [CEReactions] undefined setHTMLUnsafe
(HTMLString html
);
};
[Exposed=Window]
interface DOMParser
{
constructor
();
- [NewObject] Document parseFromString
(HTMLString str
, SupportedType type
);
+ [NewObject] Document parseFromString
(HTMLString str
, SupportedType type
);
+};
+
+partial interface Document {
+ static Document parseHTMLUnsafe
(HTMLString html
);
};
4.8. Integration with execCommand
This document modifies the following interfaces defined by the unofficial execCommand document:
-partial interface Document {
- [CEReactions, RaisesException] boolean execCommand
(DOMString commandId
, optional boolean showUI
= false, optional (DOMString or TrustedHTML) value
= "");
+partial interface Document {
+ [CEReactions, RaisesException] boolean execCommand
(DOMString commandId
, optional boolean showUI
= false, optional (DOMString or TrustedHTML) value
= "");
};
The implementation of the insertHTML execCommand passes the unmodified value from its third argument
instance to the createContextualFragment()
algorithm.
4.9. Integration with Content Security Policy
4.9.1. require-trusted-types-for directive
-
This document defines require-trusted-types-for - a new Content Security Policy directive.
- require-trusted-types-for directive configures the Trusted
+
require-trusted-types-for directive configures the Trusted
Types framework for all the injection sinks of certain groups in a current realm.
Specifically, it defines what should be the behavior when a string value is passed to an injection sink of a given group (i.e. should the type-based enforcement be enabled for such sinks).
- Note: Currently, only the enforcement for § 2.1.2 DOM XSS injection sinks is specified.
+ Note: Currently, only the enforcement for § 2.1.1 DOM XSS injection sinks is specified.
The syntax for the directive’s name and value is described by the following
ABNF:
directive-name = "require-trusted-types-for"
-directive-value = trusted-types-sink-group *( required-ascii-whitespace trusted-types-sink-group)
+directive-value = trusted-types-sink-group *( required-ascii-whitespace trusted-types-sink-group)
trusted-types-sink-group = "'script'"
@@ -2655,7 +2721,7 @@ directive which name
is "require-trusted-types-for"
- If directive’s value does not contain a trusted-types-sink-group which is a match
+
If directive’s value does not contain a trusted-types-sink-group which is a match
for a value sinkGroup, skip to the next policy.
Let violation be the result of executing Create a violation object for global, policy, and directive on global, policy and "require-trusted-types-for"
@@ -2692,16 +2758,16 @@ <
If directive’s value only contains a tt-keyword which
is a match for a value 'none'
, set createViolation to true.
- Note: Like in other CSP directives, 'none' keyword will be ignored if other keywords or policy names are present.
+ Note: Like in other CSP directives, 'none' keyword will be ignored if other keywords or policy names are present.
If createdPolicyNames contains policyName and directive’s value does not contain a tt-keyword which is a match
for a value 'allow-duplicates'
, set createViolation to true.
- Note: trusted-types policyA policyB 'allow-duplicates'
allows authors to create policies with
+
Note: trusted-types policyA policyB 'allow-duplicates'
allows authors to create policies with
duplicated names.
If directive’s value does not contain a tt-policy-name,
which value is policyName, and directive’s value does not contain a tt-wildcard, set createViolation to true.
- Note: trusted-types *
allows authors to create policies with any unique names. To allow for multiple policies with the same name, use trusted-types * 'allow-duplicates'
or don’t set the trusted-types
directive at all.
+ Note: trusted-types *
allows authors to create policies with any unique names. To allow for multiple policies with the same name, use trusted-types * 'allow-duplicates'
or don’t set the trusted-types
directive at all.
If createViolation is false, skip to the next policy.
@@ -2722,7 +2788,7 @@ Violation object resource also allows "trusted-types-policy"
and "trusted-types-sink"
as values.
4.9.6. Support for dynamic code compilation
This document modifies the EnsureCSPDoesNotBlockStringCompilation which is reproduced in its entirety below with additions and deletions.
- Note: This is based on dynamic-code-brand-checks and
+
Note: This is based on dynamic-code-brand-checks and
assumes additional arguments are passed to this algorithm from ECMAScript.
See also TC39/ecma262 issue #938.
@@ -2791,7 +2857,7 @@
ASCII case-insensitive match for the string "'unsafe-eval'
" then:
-
-
Let violation be the result of executing Content Security Policy § 2.4.1 Create a violation object for global, policy, and directive on global, policy, and "script-src
".
+ Let violation be the result of executing Content Security Policy 3 § 2.4.1 Create a violation object for global, policy, and directive on global, policy, and "script-src
".
-
Set violation’s resource to "inline
".
-
@@ -2805,7 +2871,7 @@
-
-
Execute Content Security Policy § 5.5 Report a violation on violation.
+ Execute Content Security Policy 3 § 5.5 Report a violation on violation.
-
If policy’s disposition is "enforce
", then set result to
"Blocked
".
@@ -2816,7 +2882,7 @@
Return sourceString.
- Note: returning sourceString means that the string that gets
+
Note: returning sourceString means that the string that gets
compiled is that returned by any default policy in the course of
executing Get Trusted Type compliant string.
5. Security Considerations
@@ -2835,7 +2901,7 @@ Blob from strings and navigate to it.
- CSP propagation rules (see Content Security Policy § 7.8 CSP Inheriting to avoid bypasses partially address this
+
CSP propagation rules (see Content Security Policy 3 § 7.8 CSP Inheriting to avoid bypasses partially address this
issue, as new local scheme documents will inherit the same set of restrictions,
so - for example - script-src
restrictions could be used to make sure injections
into Blob
contents would not execute scripts. To address this issue
@@ -2895,7 +2961,7 @@
[html-design-principles]. Specifically, extensions SHOULD be able to pass strings
+the user’s priority over page authors, as espoused in [html-design-principles]. Specifically, extensions SHOULD be able to pass strings
to the injection sinks without triggering default policy execution, violation generation, or the rejection of the value.
@@ -2910,7 +2976,7 @@
[RFC2119]
+ except sections explicitly marked as non-normative, examples, and notes. [RFC2119]
Examples in this specification are introduced with the words “for example”
or are set apart from the normative text
with class="example"
,
@@ -2924,20 +2990,30 @@
,
like this:
Note, this is an informative note.
- Conformant Algorithms
- Requirements phrased in the imperative as part of algorithms
+
+ Tests
+ Tests relating to the content of this specification
+ may be documented in “Tests” blocks like this one.
+ Any such block is non-normative.
+
+
+
+
+ Conformant Algorithms
+ Requirements phrased in the imperative as part of algorithms
(such as "strip any leading space characters"
or "return false and abort these steps")
are to be interpreted with the meaning of the key word
("must", "should", "may", etc)
used in introducing the algorithm.
- Conformance requirements phrased as algorithms or specific steps
+
Conformance requirements phrased as algorithms or specific steps
can be implemented in any manner,
so long as the end result is equivalent.
In particular, the algorithms defined in this specification
are intended to be easy to understand
and are not intended to be performant.
Implementers are encouraged to optimize.
+
Index
@@ -3022,6 +3098,7 @@ outerHTML, in § 4.7
parseFromString(str, type), in § 4.7
+ parseHTMLUnsafe(html), in § 4.7
Policies, in § 2.3
Prepare the script URL and text, in § 3.7
Process value with a default policy, in § 3.6
@@ -3034,6 +3111,12 @@ [[ScriptURL]], in § 4.3.3.1
ScriptURLString, in § 4
serialized-tt-configuration, in § 4.9.2
+
+ setHTMLUnsafe(html)
+
setInterval(handler), in § 4.3.5
setInterval(handler, timeout), in § 4.3.5
setInterval(handler, timeout, ...arguments), in § 4.3.5
@@ -3093,987 +3176,185 @@ writeln(...text), in § 4.3.2
write(...text), in § 4.3.2
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Terms defined by reference
-
[CSP3] defines the following terms:
- - 'report-sample'
-
- 'unsafe-eval'
-
- content security policy object
-
-
-
- csp list
-
- directive set
-
- directives
-
- disposition
-
- inline check
-
- name
-
- object-src
-
- pre-navigation check
-
- resource
-
- sample
-
- script-src
-
- source expression
-
- value
-
- violation
+
- 'report-sample'
+
- 'unsafe-eval'
+
- content security policy object
+
- content-security-policy-report-only
+
- csp list
+
- directive set
+
- directives
+
- disposition
+
- inline check
+
- name
+
- object-src
+
- pre-navigation check
+
- resource
+
- sample
+
- script-src
+
- source expression
+
- value
+
- violation
-
[DOM] defines the following terms:
- - Document
-
- DocumentFragment
-
- Element
-
- EventTarget
-
- Range
-
- append
-
- attribute
-
- attribute change steps
-
- attribute list
-
- child text content
-
- create an element
-
- element (for Attr)
-
- element interface
-
- handle attribute changes
-
- local name (for Element)
-
- namespace
-
- other applicable specifications
-
- textContent
-
- value
+
- Document
+
- DocumentFragment
+
- Element
+
- EventTarget
+
- Range
+
- ShadowRoot
+
- append
+
- attribute
+
- attribute change steps
+
- attribute list
+
- child text content
+
- create an element
+
- element
+
- element (for Attr)
+
- element interface
+
- handle attribute changes
+
- local name (for Attr)
+
- local name (for Element)
+
- namespace
+
- other applicable specifications
+
- textContent
+
- value
-
[DOM-Parsing] defines the following terms:
- - InnerHTML
-
- SupportedType
-
- fragment parsing algorithm
+
- InnerHTML
+
- SupportedType
+
- fragment parsing algorithm
-
[ECMASCRIPT] defines the following terms:
- - Get
-
- ToString
-
- current realm record
+
- Get
+
- ToString
+
- current realm record
-
[Fetch] defines the following terms:
- - client
-
- local scheme
-
- request
-
- url
+
- client
+
- local scheme
+
- request
+
- url
-
[FileAPI] defines the following terms:
-
[HTML] defines the following terms:
- - CEReactions
-
- HTMLEmbedElement
-
- HTMLIFrameElement
-
- HTMLObjectElement
-
- HTMLScriptElement
-
- HTMLTemplateElement
-
- SharedWorker
-
- Window
-
- WindowOrWorkerGlobalScope
-
- Worker
-
- WorkerGlobalScope
-
- WorkerOptions
-
- associated document
-
- current global object
-
- global object (for environment settings object)
-
- html fragment serialization algorithm
-
- innerText
-
- prepare the script element
-
- realm
-
- reflect
-
- relevant global object
-
- src (for script)
+
- CEReactions
+
- HTMLEmbedElement
+
- HTMLIFrameElement
+
- HTMLObjectElement
+
- HTMLScriptElement
+
- HTMLTemplateElement
+
- SharedWorker
+
- Window
+
- WindowOrWorkerGlobalScope
+
- Worker
+
- WorkerGlobalScope
+
- WorkerOptions
+
- associated document
+
- current global object
+
- global object (for environment settings object)
+
- global object (for realm)
+
- html fragment serialization algorithm
+
- innerText
+
- prepare the script element
+
- realm
+
- reflect
+
- relevant global object
+
- src (for embed)
+
- src (for script)
-
[INFRA] defines the following terms:
- - append
-
- ascii case-insensitive
-
- ascii lowercase
-
- concatenate
-
- contain
-
- html namespace
-
- ordered set
+
- append
+
- ascii case-insensitive
+
- ascii lowercase
+
- concatenate
+
- contain
+
- html namespace
+
- ordered set
-
- [SERVICE-WORKERS-1] defines the following terms:
+ [SERVICE-WORKERS] defines the following terms:
- - RegistrationOptions
-
- ServiceWorkerContainer
-
- ServiceWorkerRegistration
+
- RegistrationOptions
+
- ServiceWorkerContainer
+
- ServiceWorkerRegistration
-
[SVG2] defines the following terms:
- - SVGAnimatedString
-
- SVGScriptElement
+
- SVGAnimatedString
+
- SVGScriptElement
-
[URL] defines the following terms:
- - scheme
-
- url parser
-
- url serializer
+
- scheme
+
- url parser
+
- url serializer
-
[WEBIDL] defines the following terms:
- - AllowShared
-
- Clamp
-
- DOMString
-
- EnforceRange
-
- EvalError
-
- Exposed
-
- Function
-
- LegacyNullToEmptyString
-
- NewObject
-
- Promise
-
- SecureContext
-
- TypeError
-
- USVString
-
- any
-
- attribute
-
- boolean
-
- converted to an idl value
-
- extended attribute
-
- identifier
-
- idl fragment
-
- include
-
- interface mixin
-
- long
-
- object
-
- operation
-
- platform object
-
- read only
-
- regular attribute
-
- regular operation
-
- takes an identifier
-
- this
-
- undefined
-
- variadic
+
- AllowShared
+
- Clamp
+
- DOMString
+
- EnforceRange
+
- EvalError
+
- Exposed
+
- Function
+
- LegacyNullToEmptyString
+
- NewObject
+
- Promise
+
- SecureContext
+
- TypeError
+
- USVString
+
- any
+
- attribute
+
- boolean
+
- converted to an idl value
+
- extended attribute
+
- identifier
+
- idl fragment
+
- include
+
- interface mixin
+
- long
+
- object
+
- operation
+
- platform object
+
- read only
+
- regular attribute
+
- regular operation
+
- takes an identifier
+
- this
+
- undefined
+
- variadic
References
Normative References
- [CSP3]
-
- Content Security Policy Level 3 URL: https://www.w3.org/TR/CSP3/
+
- Mike West; Antonio Sartori. Content Security Policy Level 3. URL: https://w3c.github.io/webappsec-csp/
- [DOM]
- Anne van Kesteren. DOM Standard. Living Standard. URL: https://dom.spec.whatwg.org/
- [DOM-Parsing]
@@ -4083,17 +3364,17 @@
N
- [Fetch]
- Anne van Kesteren. Fetch Standard. Living Standard. URL: https://fetch.spec.whatwg.org/
- [FileAPI]
-
- Marijn Kruisselbrink; Arun Ranganathan. File API. URL: https://w3c.github.io/FileAPI/
+
- Marijn Kruisselbrink. File API. URL: https://w3c.github.io/FileAPI/
- [HTML]
-
- A vocabulary and associated APIs for HTML and XHTML URL: https://html.spec.whatwg.org/multipage/
+
- Anne van Kesteren; et al. HTML Standard. Living Standard. URL: https://html.spec.whatwg.org/multipage/
- [HTML5]
- Ian Hickson; et al. HTML5. URL: https://www.w3.org/html/wg/drafts/html/master/
- [INFRA]
- Anne van Kesteren; Domenic Denicola. Infra Standard. Living Standard. URL: https://infra.spec.whatwg.org/
- [RFC2119]
- S. Bradner. Key words for use in RFCs to Indicate Requirement Levels. March 1997. Best Current Practice. URL: https://datatracker.ietf.org/doc/html/rfc2119
-
- [SERVICE-WORKERS-1]
-
- Alex Russell; et al. Service Workers 1. URL: https://w3c.github.io/ServiceWorker/
+
- [SERVICE-WORKERS]
+
- Jake Archibald; Marijn Kruisselbrink. Service Workers. URL: https://w3c.github.io/ServiceWorker/
- [SVG2]
- Amelia Bellamy-Royds; et al. Scalable Vector Graphics (SVG) 2. URL: https://svgwg.org/svg2-draft/
- [URL]
@@ -4116,655 +3397,1284 @@
Remove when DOM #809 is merged. ↵
Refer to the external document on secure policy design.
↵
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
-
\ No newline at end of file
+ }
+ });
+ const overview = document.querySelector(".wpt-overview");
+ if(overview) {
+ overview.appendChild(el('ul',{}, ...browsers.map(formatWptResult)));
+ document.head.appendChild(el('style', {},
+ `.wpt-overview ul { display: flex; flex-flow: row wrap; gap: .2em; justify-content: start; list-style: none; padding: 0; margin: 0;}
+ .wpt-overview li { padding: .25em 1em; color: black; text-align: center; }
+ .wpt-overview img { height: 1.5em; height: max(1.5em, 32px); background: transparent; }
+ .wpt-overview .browser { font-weight: bold; }
+ .wpt-overview .passes-none { background: #e57373; }
+ .wpt-overview .passes-hardly { background: #ffb74d; }
+ .wpt-overview .passes-a-few { background: #ffd54f; }
+ .wpt-overview .passes-half { background: #fff176; }
+ .wpt-overview .passes-lots { background: #dce775; }
+ .wpt-overview .passes-most { background: #aed581; }
+ .wpt-overview .passes-all { background: #81c784; }`));
+ }
+});
+function el(name, attrs, ...content) {
+ const x = document.createElement(name);
+ for(const [k,v] of Object.entries(attrs)) {
+ x.setAttribute(k, v);
+ }
+ for(let child of content) {
+ if(typeof child == "string") child = document.createTextNode(child);
+ try {
+ x.appendChild(child);
+ } catch(e) { console.log({x, child}); }
+ }
+ return x;
+}
+function formatWptResult({name, version, passes, total}) {
+ const passRate = passes/total;
+ let passClass = "";
+ if(passRate == 0) passClass = "passes-none";
+ else if(passRate < .2) passClass = "passes-hardly";
+ else if(passRate < .4) passClass = "passes-a-few";
+ else if(passRate < .6) passClass = "passes-half";
+ else if(passRate < .8) passClass = "passes-lots";
+ else if(passRate < 1) passClass = "passes-most";
+ else passClass = "passes-all";
+
+ name = name[0].toUpperCase() + name.slice(1);
+ const shortVersion = /^\d+/.exec(version);
+ const icon = []
+
+ if(name == "Chrome") icon.push(el('img', {alt:"", src:"https://wpt.fyi/static/chrome_64x64.png"}));
+ if(name == "Edge") icon.push(el('img', {alt:"", src:"https://wpt.fyi/static/edge_64x64.png"}));
+ if(name == "Safari") icon.push(el('img', {alt:"", src:"https://wpt.fyi/static/safari_64x64.png"}));
+ if(name == "Firefox") icon.push(el('img', {alt:"", src:"https://wpt.fyi/static/firefox_64x64.png"}));
+
+ return el('li', {"class":passClass},
+ el('nobr', {'class':'browser'}, ...icon, ` ${name} ${shortVersion}`),
+ el('br', {}),
+ el('nobr', {'class':'pass-rate'}, `${passes}/${total}`)
+ );
+}
+
\ No newline at end of file