Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions test/fixtures/wpt/interfaces/FileAPI.idl
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ interface Blob {
[NewObject] ReadableStream stream();
[NewObject] Promise<USVString> text();
[NewObject] Promise<ArrayBuffer> arrayBuffer();
[NewObject] ReadableStream textStream();
[NewObject] Promise<Uint8Array> bytes();
};

Expand Down
1 change: 1 addition & 0 deletions test/fixtures/wpt/interfaces/compression.idl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// Source: Compression Standard (https://compression.spec.whatwg.org/)

enum CompressionFormat {
"brotli",
"deflate",
"deflate-raw",
"gzip",
Expand Down
18 changes: 14 additions & 4 deletions test/fixtures/wpt/interfaces/dom.idl
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ interface DOMImplementation {
[NewObject] XMLDocument createDocument(DOMString? namespace, [LegacyNullToEmptyString] DOMString qualifiedName, optional DocumentType? doctype = null);
[NewObject] Document createHTMLDocument(optional DOMString title);

boolean hasFeature(); // useless; always returns true
boolean hasFeature(); // historical; always returns true
};

[Exposed=Window]
Expand All @@ -347,9 +347,9 @@ interface DocumentFragment : Node {
interface ShadowRoot : DocumentFragment {
readonly attribute ShadowRootMode mode;
readonly attribute boolean delegatesFocus;
readonly attribute boolean serializable;
readonly attribute SlotAssignmentMode slotAssignment;
readonly attribute boolean clonable;
readonly attribute boolean serializable;
readonly attribute Element host;

attribute EventHandler onslotchange;
Expand Down Expand Up @@ -409,9 +409,9 @@ interface Element : Node {
dictionary ShadowRootInit {
required ShadowRootMode mode;
boolean delegatesFocus = false;
boolean serializable = false;
SlotAssignmentMode slotAssignment = "named";
boolean clonable = false;
boolean serializable = false;
CustomElementRegistry? customElementRegistry;
};

Expand All @@ -438,7 +438,7 @@ interface Attr : Node {

readonly attribute Element? ownerElement;

readonly attribute boolean specified; // useless; always returns true
readonly attribute boolean specified; // historical; always returns true
};
[Exposed=Window]
interface CharacterData : Node {
Expand All @@ -464,7 +464,17 @@ interface CDATASection : Text {
};
[Exposed=Window]
interface ProcessingInstruction : CharacterData {
constructor(DOMString target, optional DOMString data = "");

readonly attribute DOMString target;

boolean hasAttributes();
sequence<DOMString> getAttributeNames();
DOMString? getAttribute(DOMString name);
undefined setAttribute(DOMString name, DOMString value);
undefined removeAttribute(DOMString name);
boolean toggleAttribute(DOMString name, optional boolean force);
boolean hasAttribute(DOMString name);
};
[Exposed=Window]
interface Comment : CharacterData {
Expand Down
106 changes: 94 additions & 12 deletions test/fixtures/wpt/interfaces/html.idl
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ typedef (HTMLScriptElement or SVGScriptElement) HTMLOrSVGScriptElement;

[LegacyOverrideBuiltIns]
partial interface Document {
static Document parseHTMLUnsafe((TrustedHTML or DOMString) html);
static Document parseHTMLUnsafe((TrustedHTML or DOMString) html, optional ParseHTMLUnsafeOptions options = {});
static Document parseHTML(DOMString html, optional SetHTMLOptions options = {});

// resource metadata management
[PutForwards=href, LegacyUnforgeable] readonly attribute Location? location;
Expand Down Expand Up @@ -152,14 +153,14 @@ dictionary TogglePopoverOptions : ShowPopoverOptions {

HTMLElement includes GlobalEventHandlers;
HTMLElement includes ElementContentEditable;
HTMLElement includes HTMLOrSVGElement;
HTMLElement includes HTMLOrSVGOrMathMLElement;

[Exposed=Window]
interface HTMLUnknownElement : HTMLElement {
// Note: intentionally no [HTMLConstructor]
};

interface mixin HTMLOrSVGElement {
interface mixin HTMLOrSVGOrMathMLElement {
[SameObject] readonly attribute DOMStringMap dataset;
attribute DOMString nonce; // intentionally no [CEReactions]

Expand Down Expand Up @@ -349,13 +350,10 @@ interface HTMLDivElement : HTMLElement {
interface HTMLAnchorElement : HTMLElement {
[HTMLConstructor] constructor();

[CEReactions, Reflect] attribute DOMString target;
[CEReactions, Reflect] attribute DOMString download;
[CEReactions, Reflect] attribute USVString ping;
[CEReactions, Reflect] attribute DOMString rel;
[SameObject, PutForwards=value, Reflect="rel"] readonly attribute DOMTokenList relList;
[CEReactions, Reflect] attribute DOMString hreflang;
[CEReactions, Reflect] attribute DOMString type;

[CEReactions] attribute DOMString text;

Expand Down Expand Up @@ -403,10 +401,14 @@ interface mixin HyperlinkElementUtils {
[CEReactions] attribute USVString pathname;
[CEReactions] attribute USVString search;
[CEReactions] attribute USVString hash;

[CEReactions, Reflect] attribute DOMString hreflang;
[CEReactions, Reflect] attribute DOMString type;
};

interface mixin HTMLHyperlinkElementUtils {
[CEReactions, ReflectSetter] stringifier attribute USVString href;
[CEReactions, Reflect] attribute DOMString target;
};

[Exposed=Window]
Expand Down Expand Up @@ -447,6 +449,7 @@ interface HTMLImageElement : HTMLElement {
[CEReactions] attribute DOMString? crossOrigin;
[CEReactions, Reflect] attribute DOMString useMap;
[CEReactions, Reflect] attribute boolean isMap;
[CEReactions, Reflect] attribute boolean controls;
[CEReactions, ReflectSetter] attribute unsigned long width;
[CEReactions, ReflectSetter] attribute unsigned long height;
readonly attribute unsigned long naturalWidth;
Expand Down Expand Up @@ -531,6 +534,7 @@ interface HTMLVideoElement : HTMLMediaElement {
readonly attribute unsigned long videoHeight;
[CEReactions, ReflectURL] attribute USVString poster;
[CEReactions, Reflect] attribute boolean playsInline;

};

[Exposed=Window,
Expand Down Expand Up @@ -613,6 +617,7 @@ interface HTMLMediaElement : HTMLElement {
attribute double volume;
attribute boolean muted;
[CEReactions, Reflect="muted"] attribute boolean defaultMuted;
[CEReactions] attribute DOMString loading;

// tracks
[SameObject] readonly attribute AudioTrackList audioTracks;
Expand Down Expand Up @@ -760,7 +765,6 @@ interface HTMLAreaElement : HTMLElement {
[CEReactions, Reflect] attribute DOMString alt;
[CEReactions, Reflect] attribute DOMString coords;
[CEReactions, Reflect] attribute DOMString shape;
[CEReactions, Reflect] attribute DOMString target;
[CEReactions, Reflect] attribute DOMString download;
[CEReactions, Reflect] attribute USVString ping;
[CEReactions, Reflect] attribute DOMString rel;
Expand Down Expand Up @@ -966,7 +970,7 @@ interface HTMLButtonElement : HTMLElement {
[HTMLConstructor] constructor();

[CEReactions, ReflectSetter] attribute DOMString command;
[CEReactions, Reflect] attribute Element? commandForElement;
[CEReactions, Reflect="commandfor"] attribute Element? commandForElement;
[CEReactions, Reflect] attribute boolean disabled;
readonly attribute HTMLFormElement? form;
[CEReactions, ReflectSetter] attribute USVString formAction;
Expand Down Expand Up @@ -1271,10 +1275,12 @@ interface HTMLTemplateElement : HTMLElement {
[HTMLConstructor] constructor();

readonly attribute DocumentFragment content;
[CEReactions, Reflect="for"] attribute DOMString htmlFor;
[CEReactions] attribute DOMString shadowRootMode;
[CEReactions, Reflect] attribute boolean shadowRootDelegatesFocus;
[CEReactions, Reflect] attribute boolean shadowRootClonable;
[CEReactions, Reflect] attribute boolean shadowRootSerializable;
[CEReactions] attribute DOMString shadowRootSlotAssignment;
[CEReactions, Reflect] attribute boolean shadowRootClonable;
[CEReactions, Reflect] attribute DOMString shadowRootCustomElementRegistry;
};

Expand Down Expand Up @@ -1808,7 +1814,7 @@ dictionary DragEventInit : MouseEventInit {
};

interface mixin PopoverTargetAttributes {
[CEReactions, Reflect] attribute Element? popoverTargetElement;
[CEReactions, Reflect="popovertarget"] attribute Element? popoverTargetElement;
[CEReactions] attribute DOMString popoverTargetAction;
};

Expand Down Expand Up @@ -2357,7 +2363,8 @@ Window includes WindowOrWorkerGlobalScope;
WorkerGlobalScope includes WindowOrWorkerGlobalScope;

partial interface Element {
[CEReactions] undefined setHTMLUnsafe((TrustedHTML or DOMString) html);
[CEReactions] undefined setHTML(DOMString html, optional SetHTMLOptions options = {});
[CEReactions] undefined setHTMLUnsafe((TrustedHTML or DOMString) html, optional SetHTMLUnsafeOptions options = {});
DOMString getHTML(optional GetHTMLOptions options = {});

[CEReactions] attribute (TrustedHTML or [LegacyNullToEmptyString] DOMString) innerHTML;
Expand All @@ -2366,12 +2373,25 @@ partial interface Element {
};

partial interface ShadowRoot {
[CEReactions] undefined setHTMLUnsafe((TrustedHTML or DOMString) html);
[CEReactions] undefined setHTML(DOMString html, optional SetHTMLOptions options = {});
[CEReactions] undefined setHTMLUnsafe((TrustedHTML or DOMString) html, optional SetHTMLUnsafeOptions options = {});
DOMString getHTML(optional GetHTMLOptions options = {});

[CEReactions] attribute (TrustedHTML or [LegacyNullToEmptyString] DOMString) innerHTML;
};

enum SanitizerPresets { "default" };
dictionary SetHTMLOptions {
(Sanitizer or SanitizerConfig or SanitizerPresets) sanitizer = "default";
};
dictionary SetHTMLUnsafeOptions {
(Sanitizer or SanitizerConfig or SanitizerPresets) sanitizer = {};
boolean runScripts = false;
};
dictionary ParseHTMLUnsafeOptions {
(Sanitizer or SanitizerConfig or SanitizerPresets) sanitizer = {};
};

dictionary GetHTMLOptions {
boolean serializableShadowRoots = false;
sequence<ShadowRoot> shadowRoots = [];
Expand Down Expand Up @@ -2403,6 +2423,68 @@ interface XMLSerializer {
DOMString serializeToString(Node root);
};

[Exposed=Window]
interface Sanitizer {
constructor(optional (SanitizerConfig or SanitizerPresets) configuration = "default");

// Query configuration:
SanitizerConfig get();

// Modify a Sanitizer's lists and fields:
boolean allowElement(SanitizerElementWithAttributes element);
boolean removeElement(SanitizerElement element);
boolean replaceElementWithChildren(SanitizerElement element);
boolean allowProcessingInstruction(SanitizerPI pi);
boolean removeProcessingInstruction(SanitizerPI pi);
boolean allowAttribute(SanitizerAttribute attribute);
boolean removeAttribute(SanitizerAttribute attribute);
boolean setComments(boolean allow);
boolean setDataAttributes(boolean allow);

// Remove markup that executes script.
boolean removeUnsafe();
};

dictionary SanitizerElementNamespace {
required DOMString name;
DOMString? _namespace = "http://www.w3.org/1999/xhtml";
};

// Used by "elements"
dictionary SanitizerElementNamespaceWithAttributes : SanitizerElementNamespace {
sequence<SanitizerAttribute> attributes;
sequence<SanitizerAttribute> removeAttributes;
};

dictionary SanitizerAttributeNamespace {
required DOMString name;
DOMString? _namespace = null;
};

dictionary SanitizerProcessingInstruction {
required DOMString target;
};

typedef (DOMString or SanitizerElementNamespace) SanitizerElement;
typedef (DOMString or SanitizerElementNamespaceWithAttributes) SanitizerElementWithAttributes;
typedef (DOMString or SanitizerProcessingInstruction) SanitizerPI;
typedef (DOMString or SanitizerAttributeNamespace) SanitizerAttribute;

dictionary SanitizerConfig {
sequence<SanitizerElementWithAttributes> elements;
sequence<SanitizerElement> removeElements;
sequence<SanitizerElement> replaceWithChildrenElements;

sequence<SanitizerPI> processingInstructions;
sequence<SanitizerPI> removeProcessingInstructions;

sequence<SanitizerAttribute> attributes;
sequence<SanitizerAttribute> removeAttributes;

boolean comments;
boolean dataAttributes;
};

[Exposed=Window]
interface Navigator {
// objects implementing this interface also implement the interfaces given below
Expand Down
9 changes: 5 additions & 4 deletions test/fixtures/wpt/interfaces/resource-timing.idl
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ enum RenderBlockingStatusType {
"non-blocking"
};

partial interface Performance { undefined clearResourceTimings ();
undefined setResourceTimingBufferSize (unsigned long maxSize);
attribute EventHandler onresourcetimingbufferfull;
};
partial interface Performance {
undefined clearResourceTimings ();
undefined setResourceTimingBufferSize (unsigned long maxSize);
attribute EventHandler onresourcetimingbufferfull;
};
4 changes: 2 additions & 2 deletions test/fixtures/wpt/interfaces/streams.idl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
interface ReadableStream {
constructor(optional object underlyingSource, optional QueuingStrategy strategy = {});

static ReadableStream from(any asyncIterable);
static ReadableStream from(async_sequence<any> asyncIterable);

readonly attribute boolean locked;

Expand Down Expand Up @@ -114,7 +114,7 @@ interface ReadableByteStreamController {

[Exposed=*]
interface ReadableStreamBYOBRequest {
readonly attribute ArrayBufferView? view;
readonly attribute Uint8Array? view;

undefined respond([EnforceRange] unsigned long long bytesWritten);
undefined respondWithNewView(ArrayBufferView view);
Expand Down
4 changes: 2 additions & 2 deletions test/fixtures/wpt/interfaces/web-locks.idl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ interface mixin NavigatorLocks {
Navigator includes NavigatorLocks;
WorkerNavigator includes NavigatorLocks;

[SecureContext, Exposed=(Window,Worker,SharedStorageWorklet)]
[SecureContext, Exposed=(Window,Worker)]
interface LockManager {
Promise<any> request(DOMString name,
LockGrantedCallback callback);
Expand Down Expand Up @@ -43,7 +43,7 @@ dictionary LockInfo {
DOMString clientId;
};

[SecureContext, Exposed=(Window,Worker,SharedStorageWorklet)]
[SecureContext, Exposed=(Window,Worker)]
interface Lock {
readonly attribute DOMString name;
readonly attribute LockMode mode;
Expand Down
6 changes: 3 additions & 3 deletions test/fixtures/wpt/interfaces/webcrypto-modern-algos.idl
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ partial interface SubtleCrypto {

static boolean supports(DOMString operation,
AlgorithmIdentifier algorithm,
optional unsigned long? length = null);
optional [EnforceRange] unsigned long? length = null);
static boolean supports(DOMString operation,
AlgorithmIdentifier algorithm,
AlgorithmIdentifier additionalAlgorithm);
Expand All @@ -59,7 +59,7 @@ dictionary EncapsulatedBits {
};

partial dictionary JsonWebKey {
// The following fields are defined in draft-ietf-cose-dilithium-08
// The following fields are defined in RFC 9964
DOMString pub;
DOMString priv;
};
Expand Down Expand Up @@ -99,7 +99,7 @@ dictionary KmacImportParams : Algorithm {
};

dictionary KmacKeyAlgorithm : KeyAlgorithm {
required unsigned long length;
required [EnforceRange] unsigned long length;
};

dictionary KmacParams : Algorithm {
Expand Down
Loading
Loading