diff --git a/web/lib/src/dom.dart b/web/lib/src/dom.dart index f7888570..70b9b4d1 100644 --- a/web/lib/src/dom.dart +++ b/web/lib/src/dom.dart @@ -10,9 +10,10 @@ export 'dom/battery_status.dart'; export 'dom/clipboard_apis.dart'; export 'dom/compression.dart'; export 'dom/console.dart'; -export 'dom/cookie_store.dart'; +export 'dom/cookiestore.dart'; export 'dom/credential_management.dart'; export 'dom/csp.dart'; +export 'dom/css_anchor_position.dart'; export 'dom/css_animations.dart'; export 'dom/css_animations_2.dart'; export 'dom/css_cascade.dart'; @@ -33,12 +34,10 @@ export 'dom/css_transitions.dart'; export 'dom/css_transitions_2.dart'; export 'dom/css_typed_om.dart'; export 'dom/css_view_transitions.dart'; -export 'dom/css_view_transitions_2.dart'; export 'dom/cssom.dart'; export 'dom/cssom_view.dart'; export 'dom/digital_credentials.dart'; export 'dom/dom.dart'; -export 'dom/dom_parsing.dart'; export 'dom/encoding.dart'; export 'dom/encrypted_media.dart'; export 'dom/entries_api.dart'; @@ -75,6 +74,8 @@ export 'dom/indexeddb.dart'; export 'dom/intersection_observer.dart'; export 'dom/khr_parallel_shader_compile.dart'; export 'dom/largest_contentful_paint.dart'; +export 'dom/local_network_access.dart'; +export 'dom/login_status.dart'; export 'dom/mathml_core.dart'; export 'dom/media_capabilities.dart'; export 'dom/media_playback_quality.dart'; @@ -107,7 +108,6 @@ export 'dom/permissions.dart'; export 'dom/picture_in_picture.dart'; export 'dom/pointerevents.dart'; export 'dom/pointerlock.dart'; -export 'dom/private_network_access.dart'; export 'dom/push_api.dart'; export 'dom/referrer_policy.dart'; export 'dom/remote_playback.dart'; @@ -120,21 +120,26 @@ export 'dom/scheduling_apis.dart'; export 'dom/screen_capture.dart'; export 'dom/screen_orientation.dart'; export 'dom/screen_wake_lock.dart'; +export 'dom/scroll_animations.dart'; export 'dom/scroll_to_text_fragment.dart'; export 'dom/secure_payment_confirmation.dart'; export 'dom/selection_api.dart'; export 'dom/server_timing.dart'; export 'dom/service_workers.dart'; +export 'dom/shared_storage.dart'; export 'dom/speech_api.dart'; export 'dom/storage.dart'; export 'dom/streams.dart'; export 'dom/svg.dart'; export 'dom/svg_animations.dart'; +export 'dom/svg_paths.dart'; export 'dom/touch_events.dart'; export 'dom/trust_token_api.dart'; export 'dom/trusted_types.dart'; +export 'dom/turtledove.dart'; export 'dom/uievents.dart'; export 'dom/url.dart'; +export 'dom/urlpattern.dart'; export 'dom/user_timing.dart'; export 'dom/vibration.dart'; export 'dom/video_rvfc.dart'; @@ -155,7 +160,8 @@ export 'dom/webcodecs_flac_codec_registration.dart'; export 'dom/webcodecs_hevc_codec_registration.dart'; export 'dom/webcodecs_opus_codec_registration.dart'; export 'dom/webcodecs_vp9_codec_registration.dart'; -export 'dom/webcryptoapi.dart'; +export 'dom/webcrypto.dart'; +export 'dom/webcrypto_modern_algos.dart'; export 'dom/webgl1.dart'; export 'dom/webgl2.dart'; export 'dom/webgl_color_buffer_float.dart'; diff --git a/web/lib/src/dom/cookie_store.dart b/web/lib/src/dom/cookiestore.dart similarity index 94% rename from web/lib/src/dom/cookie_store.dart rename to web/lib/src/dom/cookiestore.dart index eea060be..109f17b3 100644 --- a/web/lib/src/dom/cookie_store.dart +++ b/web/lib/src/dom/cookiestore.dart @@ -90,6 +90,7 @@ extension type CookieInit._(JSObject _) implements JSObject { String path, CookieSameSite sameSite, bool partitioned, + int? maxAge, }); external String get name; @@ -106,6 +107,8 @@ extension type CookieInit._(JSObject _) implements JSObject { external set sameSite(CookieSameSite value); external bool get partitioned; external set partitioned(bool value); + external int? get maxAge; + external set maxAge(int? value); } extension type CookieStoreDeleteOptions._(JSObject _) implements JSObject { external factory CookieStoreDeleteOptions({ @@ -128,30 +131,12 @@ extension type CookieListItem._(JSObject _) implements JSObject { external factory CookieListItem({ String name, String value, - String? domain, - String path, - DOMHighResTimeStamp? expires, - bool secure, - CookieSameSite sameSite, - bool partitioned, }); external String get name; external set name(String value); external String get value; external set value(String value); - external String? get domain; - external set domain(String? value); - external String get path; - external set path(String value); - external double? get expires; - external set expires(DOMHighResTimeStamp? value); - external bool get secure; - external set secure(bool value); - external CookieSameSite get sameSite; - external set sameSite(CookieSameSite value); - external bool get partitioned; - external set partitioned(bool value); } /// @AvailableInWorkers("window_and_service") diff --git a/web/lib/src/dom/credential_management.dart b/web/lib/src/dom/credential_management.dart index ad1708a4..413491ba 100644 --- a/web/lib/src/dom/credential_management.dart +++ b/web/lib/src/dom/credential_management.dart @@ -182,6 +182,7 @@ extension type CredentialCreationOptions._(JSObject _) implements JSObject { AbortSignal signal, PasswordCredentialInit password, FederatedCredentialInit federated, + DigitalCredentialCreationOptions digital, PublicKeyCredentialCreationOptions publicKey, }); @@ -193,6 +194,8 @@ extension type CredentialCreationOptions._(JSObject _) implements JSObject { external set password(PasswordCredentialInit value); external FederatedCredentialInit get federated; external set federated(FederatedCredentialInit value); + external DigitalCredentialCreationOptions get digital; + external set digital(DigitalCredentialCreationOptions value); external PublicKeyCredentialCreationOptions get publicKey; external set publicKey(PublicKeyCredentialCreationOptions value); } diff --git a/web/lib/src/dom/csp.dart b/web/lib/src/dom/csp.dart index 17f307c4..d695a9b6 100644 --- a/web/lib/src/dom/csp.dart +++ b/web/lib/src/dom/csp.dart @@ -16,209 +16,9 @@ library; import 'dart:js_interop'; import 'dom.dart'; -import 'reporting.dart'; typedef SecurityPolicyViolationEventDisposition = String; -/// The `CSPViolationReportBody` interface is an extension of the -/// [Reporting API](https://developer.mozilla.org/en-US/docs/Web/API/Reporting_API) -/// that represents the body of a Content Security Policy (CSP) violation -/// report. -/// -/// CSP violations are thrown when the webpage attempts to load a resource that -/// violates the policy set by the HTTP header. -/// -/// CSP violation reports are returned in the -/// [reports](https://developer.mozilla.org/en-US/docs/Web/API/ReportingObserver/ReportingObserver#reports) -/// parameter of [ReportingObserver] callbacks that have a `type` of -/// `"csp-violation"`. -/// The `body` property of those reports is an instance of -/// `CSPViolationReportBody`. -/// -/// CSP violation reports may also be sent as JSON objects to the endpoint -/// specified in the -/// [`report-to`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/report-to) -/// policy directive of the header. -/// These reports similarly have a `type` of `"csp-violation"`, and a `body` -/// property containing a serialization of an instance of this interface. -/// -/// > [!NOTE] -/// > CSP violation reports sent by the Reporting API, when an endpoint is -/// > specified using the CSP -/// > [`report-to`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/report-to) -/// > directive, are similar (but not identical) to the "CSP report" -/// > [JSON objects](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/report-uri#violation_report_syntax) -/// > sent when endpoints are specified using the -/// > [`report-uri`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/report-uri) -/// > directive. -/// > The Reporting API and `report-to` directive are intended to replace the -/// > older report format and the `report-uri` directive. -/// -/// --- -/// -/// API documentation sourced from -/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/CSPViolationReportBody). -extension type CSPViolationReportBody._(JSObject _) - implements ReportBody, JSObject { - /// The **`toJSON()`** method of the [CSPViolationReportBody] interface is a - /// _serializer_, which returns a JSON representation of the - /// `CSPViolationReportBody` object. - /// - /// The existence of a `toJSON()` method allows `CSPViolationReportBody` - /// objects to be converted to a string using the `JSON.stringify()` method. - /// - /// This is used by the reporting API when creating a serialized version of a - /// violation report to send to a reporting endpoint. - external JSObject toJSON(); - - /// The **`documentURL`** read-only property of the [CSPViolationReportBody] - /// interface is a string that represents the URL of the document or worker - /// that violated the [Content Security Policy - /// (CSP)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP). - external String get documentURL; - - /// The **`referrer`** read-only property of the [CSPViolationReportBody] - /// interface is a string that represents the URL of the referring page of the - /// resource who's [Content Security Policy - /// (CSP)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP) was - /// violated. - /// - /// The referrer is the page that caused the page with the CSP violation to be - /// loaded. For example, if we followed a link to a page with a CSP violation, - /// the `referrer` is the page that we navigated from. - external String? get referrer; - - /// The **`blockedURL`** read-only property of the [CSPViolationReportBody] - /// interface is a string value that represents the resource that was blocked - /// because it violates a [Content Security Policy - /// (CSP)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP). - external String? get blockedURL; - - /// The **`effectiveDirective`** read-only property of the - /// [CSPViolationReportBody] interface is a string that represents the - /// effective [Content Security Policy - /// (CSP)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP) directive - /// that was violated. - /// - /// Note that this contains the specific directive that was effectively - /// violated, such as - /// [`script-src-elem`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/script-src-elem) - /// for violations related to script elements, and not the policy that was - /// specified, which may have been the (more general) - /// [`default-src`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/default-src). - external String get effectiveDirective; - - /// The **`originalPolicy`** read-only property of the - /// [CSPViolationReportBody] interface is a string that represents the - /// [Content Security Policy - /// (CSP)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP) whose - /// enforcement uncovered the violation. - /// - /// This is the string in the HTTP response header that contains the list of - /// [directives](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy#directives) - /// and their values that make the CSP policy. - /// Note that differs from the [CSPViolationReportBody.effectiveDirective], - /// which is the specific directive that is effectively being violated (and - /// which might not be explicitly listed in the policy if `default-src` is - /// used). - external String get originalPolicy; - - /// The **`sourceFile`** read-only property of the [CSPViolationReportBody] - /// interface indicates the URL of the source file that violated the [Content - /// Security Policy - /// (CSP)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP). - /// - /// For a violation triggered by the use of an inline script, `sourceFile` is - /// the URL of the current document. - /// Similarly, if a document successfully loads a script that then violates - /// the document CSP, the `sourceFile` is the URL of the script. - /// - /// Note however that if a document with a CSP that blocks external resources - /// attempts to load an external resource, `sourceFile` will be `null`. - /// This is because the browser extracts the value from _the global object_ of - /// the file that triggered the violation. - /// Because of the CSP restriction the external resource is never loaded, and - /// therefore has no corresponding global object. - /// - /// This property is most useful alongside [CSPViolationReportBody.lineNumber] - /// and [CSPViolationReportBody.columnNumber], which provide the location - /// within the file that resulted in a violation. - external String? get sourceFile; - - /// The **`sample`** read-only property of the [CSPViolationReportBody] - /// interface is a string that contains a part of the resource that violated - /// the [Content Security Policy - /// (CSP)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP). - /// - /// This sample is usually the first 40 characters of the inline script, event - /// handler, or style that violated a CSP restriction. - /// If not populated it is the empty string `""`. - /// - /// Note that this is only populated when attempting to load _inline_ scripts, - /// event handlers, or styles that violate CSP - /// [`script-src*`](/en-US/docs/Web/HTTP/Headers/Content-Security-Policy#script-src) - /// and - /// [`style-src*`](/en-US/docs/Web/HTTP/Headers/Content-Security-Policy#style-src) - /// rules — external resources that violate the CSP will not generate a - /// sample. - /// In addition, a sample is only included if the `Content-Security-Policy` - /// directive that was violated also contains the - /// [`'report-sample'`](/en-US/docs/Web/HTTP/Headers/Content-Security-Policy#report-sample) - /// keyword. - /// - /// > [!NOTE] Violation reports should be considered attacker-controlled data. - /// > The content of this field _in particular_ should be sanitized before - /// > storing or rendering. - external String? get sample; - - /// The **`disposition`** read-only property of the [CSPViolationReportBody] - /// interface indicates whether the user agent is configured to enforce - /// [Content Security Policy - /// (CSP)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP) violations - /// or only report them. - external SecurityPolicyViolationEventDisposition get disposition; - - /// The **`statusCode`** read-only property of the [CSPViolationReportBody] - /// interface is a number representing the - /// [HTTP status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status) - /// of the response to the request that triggered a [Content Security Policy - /// (CSP)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP) violation - /// (when loading a window or worker). - external int get statusCode; - - /// The **`lineNumber`** read-only property of the [CSPViolationReportBody] - /// interface indicates the line number in the source file that triggered the - /// [Content Security Policy - /// (CSP)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP) violation. - /// - /// Note that the browser extracts the value from _the global object_ of the - /// file that triggered the violation. - /// If the resource that triggers the CSP violation is not loaded, the value - /// will be `null`. - /// See [CSPViolationReportBody.sourceFile] for more information. - /// - /// This property is most useful alongside [CSPViolationReportBody.sourceFile] - /// and [CSPViolationReportBody.columnNumber], as it provides the location of - /// the line in that file and the column that resulted in a violation. - external int? get lineNumber; - - /// The **`columnNumber`** read-only property of the [CSPViolationReportBody] - /// interface indicates the column number in the source file that triggered - /// the [Content Security Policy - /// (CSP)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP) violation. - /// - /// Note that the browser extracts the value from _the global object_ of the - /// file that triggered the violation. - /// If the resource that triggers the CSP violation is not loaded, the value - /// will be `null`. - /// See [CSPViolationReportBody.sourceFile] for more information. - /// - /// This property is most useful alongside [CSPViolationReportBody.sourceFile] - /// and [CSPViolationReportBody.lineNumber], as it provides the location of - /// the column in that file and line that resulted in a violation. - external int? get columnNumber; -} - /// The **`SecurityPolicyViolationEvent`** interface inherits from [Event], and /// represents the event object of a `securitypolicyviolation` event sent on an /// [Element.securitypolicyviolation_event], diff --git a/web/lib/src/dom/css_anchor_position.dart b/web/lib/src/dom/css_anchor_position.dart new file mode 100644 index 00000000..3cc20fcc --- /dev/null +++ b/web/lib/src/dom/css_anchor_position.dart @@ -0,0 +1,266 @@ +// Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. +// +// API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). +// Attributions and copyright licensing by Mozilla Contributors is licensed +// under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. + +// Generated from Web IDL definitions. + +// ignore_for_file: constant_identifier_names, non_constant_identifier_names + +@JS() +library; + +import 'dart:js_interop'; + +import 'cssom.dart'; + +/// The **`CSSPositionTryRule`** interface describes an object representing a +/// [at-rule](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_syntax/At-rule). +/// +/// --- +/// +/// API documentation sourced from +/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/CSSPositionTryRule). +extension type CSSPositionTryRule._(JSObject _) implements CSSRule, JSObject { + /// The **`name`** read-only property of the [CSSPositionTryRule] interface + /// represents the name of the position try fallback option specified by the + /// `@position-try` at-rule's . + external String get name; + + /// The **`style`** read-only property of the [CSSPositionTryRule] interface + /// returns a [CSSPositionTryDescriptors] object representing the declarations + /// set in the body of the `@position-try` at-rule. + external CSSPositionTryDescriptors get style; +} + +/// The **`CSSPositionTryDescriptors`** interface defines properties that +/// represent the list of CSS descriptors that can be set in the body of a +/// [at-rule](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_syntax/At-rule). +/// +/// Each descriptor in the body of the corresponding at-rule can be accessed +/// using either its property name in +/// [bracket notation](https://developer.mozilla.org/en-US/docs/Learn_web_development/Core/Scripting/Object_basics#bracket_notation) +/// or the camel-case version of the property name "propertyName" in +/// [dot notation](https://developer.mozilla.org/en-US/docs/Learn_web_development/Core/Scripting/Object_basics#dot_notation). +/// For example, you can access the CSS property "property-name" as +/// `style["property-name"]` or `style.propertyName`, where `style` is a +/// `CSSPositionTryDescriptors` instance. +/// A property with a single-word name like `height` can be accessed using +/// either notation: `style["height"]` or `style.height`. +/// +/// > [!NOTE] +/// > The [CSSPositionTryRule] interface represents a at-rule, and the +/// > [CSSPositionTryRule.style] property is an instance of this object. +/// +/// --- +/// +/// API documentation sourced from +/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/CSSPositionTryDescriptors). +extension type CSSPositionTryDescriptors._(JSObject _) + implements CSSStyleDeclaration, JSObject { + external String get margin; + external set margin(String value); + external String get marginTop; + external set marginTop(String value); + external String get marginRight; + external set marginRight(String value); + external String get marginBottom; + external set marginBottom(String value); + external String get marginLeft; + external set marginLeft(String value); + external String get marginBlock; + external set marginBlock(String value); + external String get marginBlockStart; + external set marginBlockStart(String value); + external String get marginBlockEnd; + external set marginBlockEnd(String value); + external String get marginInline; + external set marginInline(String value); + external String get marginInlineStart; + external set marginInlineStart(String value); + external String get marginInlineEnd; + external set marginInlineEnd(String value); + @JS('margin-top') + external String get margin_top; + @JS('margin-top') + external set margin_top(String value); + @JS('margin-right') + external String get margin_right; + @JS('margin-right') + external set margin_right(String value); + @JS('margin-bottom') + external String get margin_bottom; + @JS('margin-bottom') + external set margin_bottom(String value); + @JS('margin-left') + external String get margin_left; + @JS('margin-left') + external set margin_left(String value); + @JS('margin-block') + external String get margin_block; + @JS('margin-block') + external set margin_block(String value); + @JS('margin-block-start') + external String get margin_block_start; + @JS('margin-block-start') + external set margin_block_start(String value); + @JS('margin-block-end') + external String get margin_block_end; + @JS('margin-block-end') + external set margin_block_end(String value); + @JS('margin-inline') + external String get margin_inline; + @JS('margin-inline') + external set margin_inline(String value); + @JS('margin-inline-start') + external String get margin_inline_start; + @JS('margin-inline-start') + external set margin_inline_start(String value); + @JS('margin-inline-end') + external String get margin_inline_end; + @JS('margin-inline-end') + external set margin_inline_end(String value); + external String get inset; + external set inset(String value); + external String get insetBlock; + external set insetBlock(String value); + external String get insetBlockStart; + external set insetBlockStart(String value); + external String get insetBlockEnd; + external set insetBlockEnd(String value); + external String get insetInline; + external set insetInline(String value); + external String get insetInlineStart; + external set insetInlineStart(String value); + external String get insetInlineEnd; + external set insetInlineEnd(String value); + external String get top; + external set top(String value); + external String get left; + external set left(String value); + external String get right; + external set right(String value); + external String get bottom; + external set bottom(String value); + @JS('inset-block') + external String get inset_block; + @JS('inset-block') + external set inset_block(String value); + @JS('inset-block-start') + external String get inset_block_start; + @JS('inset-block-start') + external set inset_block_start(String value); + @JS('inset-block-end') + external String get inset_block_end; + @JS('inset-block-end') + external set inset_block_end(String value); + @JS('inset-inline') + external String get inset_inline; + @JS('inset-inline') + external set inset_inline(String value); + @JS('inset-inline-start') + external String get inset_inline_start; + @JS('inset-inline-start') + external set inset_inline_start(String value); + @JS('inset-inline-end') + external String get inset_inline_end; + @JS('inset-inline-end') + external set inset_inline_end(String value); + external String get width; + external set width(String value); + external String get minWidth; + external set minWidth(String value); + external String get maxWidth; + external set maxWidth(String value); + external String get height; + external set height(String value); + external String get minHeight; + external set minHeight(String value); + external String get maxHeight; + external set maxHeight(String value); + external String get blockSize; + external set blockSize(String value); + external String get minBlockSize; + external set minBlockSize(String value); + external String get maxBlockSize; + external set maxBlockSize(String value); + external String get inlineSize; + external set inlineSize(String value); + external String get minInlineSize; + external set minInlineSize(String value); + external String get maxInlineSize; + external set maxInlineSize(String value); + @JS('min-width') + external String get min_width; + @JS('min-width') + external set min_width(String value); + @JS('max-width') + external String get max_width; + @JS('max-width') + external set max_width(String value); + @JS('min-height') + external String get min_height; + @JS('min-height') + external set min_height(String value); + @JS('max-height') + external String get max_height; + @JS('max-height') + external set max_height(String value); + @JS('block-size') + external String get block_size; + @JS('block-size') + external set block_size(String value); + @JS('min-block-size') + external String get min_block_size; + @JS('min-block-size') + external set min_block_size(String value); + @JS('max-block-size') + external String get max_block_size; + @JS('max-block-size') + external set max_block_size(String value); + @JS('inline-size') + external String get inline_size; + @JS('inline-size') + external set inline_size(String value); + @JS('min-inline-size') + external String get min_inline_size; + @JS('min-inline-size') + external set min_inline_size(String value); + @JS('max-inline-size') + external String get max_inline_size; + @JS('max-inline-size') + external set max_inline_size(String value); + external String get placeSelf; + external set placeSelf(String value); + external String get alignSelf; + external set alignSelf(String value); + external String get justifySelf; + external set justifySelf(String value); + @JS('place-self') + external String get place_self; + @JS('place-self') + external set place_self(String value); + @JS('align-self') + external String get align_self; + @JS('align-self') + external set align_self(String value); + @JS('justify-self') + external String get justify_self; + @JS('justify-self') + external set justify_self(String value); + external String get positionAnchor; + external set positionAnchor(String value); + @JS('position-anchor') + external String get position_anchor; + @JS('position-anchor') + external set position_anchor(String value); + external String get positionArea; + external set positionArea(String value); + @JS('position-area') + external String get position_area; + @JS('position-area') + external set position_area(String value); +} diff --git a/web/lib/src/dom/css_animations.dart b/web/lib/src/dom/css_animations.dart index f70701c5..f3d91a54 100644 --- a/web/lib/src/dom/css_animations.dart +++ b/web/lib/src/dom/css_animations.dart @@ -92,7 +92,7 @@ extension type CSSKeyframeRule._(JSObject _) implements CSSRule, JSObject { /// The read-only **`CSSKeyframeRule.style`** property is the /// [CSSStyleDeclaration] interface for the declaration block of the /// [CSSKeyframeRule]. - external JSObject get style; + external CSSStyleProperties get style; } /// The **`CSSKeyframesRule`** interface describes an object representing a diff --git a/web/lib/src/dom/css_font_loading.dart b/web/lib/src/dom/css_font_loading.dart index 919a2921..a5ff17a5 100644 --- a/web/lib/src/dom/css_font_loading.dart +++ b/web/lib/src/dom/css_font_loading.dart @@ -136,6 +136,13 @@ extension type FontFace._(JSObject _) implements JSObject { external String get featureSettings; external set featureSettings(String value); + /// The **`variationSettings`** property of the [FontFace] interface retrieves + /// or sets low-level OpenType or TrueType font variations. + /// + /// This property is equivalent to the descriptor. + external String get variationSettings; + external set variationSettings(String value); + /// The **`display`** property of the [FontFace] interface determines how a /// font face is displayed based on whether and when it is downloaded and /// ready to use. diff --git a/web/lib/src/dom/css_nesting.dart b/web/lib/src/dom/css_nesting.dart index c9f6356c..ba14f285 100644 --- a/web/lib/src/dom/css_nesting.dart +++ b/web/lib/src/dom/css_nesting.dart @@ -38,5 +38,5 @@ extension type CSSNestedDeclarations._(JSObject _) implements CSSRule, JSObject { /// The read-only **`style`** property of the [CSSNestedDeclarations] /// interface represents the styles associated with the nested rules. - external JSObject get style; + external CSSStyleProperties get style; } diff --git a/web/lib/src/dom/css_view_transitions.dart b/web/lib/src/dom/css_view_transitions.dart index 6d29c6de..a2629bb2 100644 --- a/web/lib/src/dom/css_view_transitions.dart +++ b/web/lib/src/dom/css_view_transitions.dart @@ -15,9 +15,25 @@ library; import 'dart:js_interop'; -import 'css_view_transitions_2.dart'; +import 'cssom.dart'; typedef ViewTransitionUpdateCallback = JSFunction; +extension type CSSViewTransitionRule._(JSObject _) + implements CSSRule, JSObject { + external String get navigation; + external JSArray get types; +} +extension type StartViewTransitionOptions._(JSObject _) implements JSObject { + external factory StartViewTransitionOptions({ + ViewTransitionUpdateCallback? update, + JSArray? types, + }); + + external ViewTransitionUpdateCallback? get update; + external set update(ViewTransitionUpdateCallback? value); + external JSArray? get types; + external set types(JSArray? value); +} /// The **`ViewTransition`** interface of the [View Transition API] represents /// an active view transition, and provides functionality to react to the @@ -90,3 +106,4 @@ extension type ViewTransition._(JSObject _) implements JSObject { external ViewTransitionTypeSet get types; external set types(ViewTransitionTypeSet value); } +extension type ViewTransitionTypeSet._(JSObject _) implements JSObject {} diff --git a/web/lib/src/dom/css_view_transitions_2.dart b/web/lib/src/dom/css_view_transitions_2.dart deleted file mode 100644 index c7772a02..00000000 --- a/web/lib/src/dom/css_view_transitions_2.dart +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. -// -// API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). -// Attributions and copyright licensing by Mozilla Contributors is licensed -// under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. - -// Generated from Web IDL definitions. - -// ignore_for_file: constant_identifier_names, non_constant_identifier_names - -@JS() -library; - -import 'dart:js_interop'; - -import 'css_view_transitions.dart'; -import 'cssom.dart'; - -extension type CSSViewTransitionRule._(JSObject _) - implements CSSRule, JSObject { - external String get navigation; - external JSArray get types; -} -extension type ViewTransitionTypeSet._(JSObject _) implements JSObject {} -extension type StartViewTransitionOptions._(JSObject _) implements JSObject { - external factory StartViewTransitionOptions({ - ViewTransitionUpdateCallback? update, - JSArray? types, - }); - - external ViewTransitionUpdateCallback? get update; - external set update(ViewTransitionUpdateCallback? value); - external JSArray? get types; - external set types(JSArray? value); -} diff --git a/web/lib/src/dom/cssom.dart b/web/lib/src/dom/cssom.dart index fa8e6424..5b0363e1 100644 --- a/web/lib/src/dom/cssom.dart +++ b/web/lib/src/dom/cssom.dart @@ -450,7 +450,7 @@ extension type CSSStyleRule._(JSObject _) implements CSSGroupingRule, JSObject { /// The read-only **`style`** property is the [CSSStyleDeclaration] interface /// for the declaration block of the [CSSStyleRule]. - external JSObject get style; + external CSSStyleProperties get style; /// The **`styleMap`** read-only property of the /// [CSSStyleRule] interface returns a [StylePropertyMap] object @@ -538,6 +538,57 @@ extension type CSSGroupingRule._(JSObject _) implements CSSRule, JSObject { external CSSRuleList get cssRules; } +/// The **`CSSPageDescriptors`** interface represents a CSS declaration block +/// for an +/// [at-rule](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_syntax/At-rule). +/// +/// The interface exposes style information and various style-related methods +/// and properties for the page. +/// Each multi-word property has versions in camel- and snake-case. +/// This means, for example, that you can access the `margin-top` CSS property +/// using the syntax `style["margin-top"]` or `style.marginTop` (where `style` +/// is a `CSSPageDescriptor`). +/// +/// A `CSSPageDescriptors` object is accessed through the [CSSPageRule.style] +/// property of the `CSSPageRule` interface, which can in turn be found using +/// the [CSSStyleSheet] API. +/// +/// --- +/// +/// API documentation sourced from +/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/CSSPageDescriptors). +extension type CSSPageDescriptors._(JSObject _) + implements CSSStyleDeclaration, JSObject { + external String get margin; + external set margin(String value); + external String get marginTop; + external set marginTop(String value); + external String get marginRight; + external set marginRight(String value); + external String get marginBottom; + external set marginBottom(String value); + external String get marginLeft; + external set marginLeft(String value); + @JS('margin-top') + external String get margin_top; + @JS('margin-top') + external set margin_top(String value); + @JS('margin-right') + external String get margin_right; + @JS('margin-right') + external set margin_right(String value); + @JS('margin-bottom') + external String get margin_bottom; + @JS('margin-bottom') + external set margin_bottom(String value); + @JS('margin-left') + external String get margin_left; + @JS('margin-left') + external set margin_left(String value); + external String get size; + external set size(String value); +} + /// **`CSSPageRule`** represents a single CSS rule. /// /// --- @@ -558,7 +609,7 @@ extension type CSSPageRule._(JSObject _) implements CSSGroupingRule, JSObject { /// [at-rule](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_syntax/At-rule), /// and exposes style information and various style-related methods and /// properties for the page. - external JSObject get style; + external CSSPageDescriptors get style; } /// The **`CSSNamespaceRule`** interface describes an object representing a @@ -686,6 +737,8 @@ extension type CSSStyleDeclaration._(JSObject _) implements JSObject { external set animationPlayState(String value); external String get animationRange; external set animationRange(String value); + external String get animationRangeCenter; + external set animationRangeCenter(String value); external String get animationRangeEnd; external set animationRangeEnd(String value); external String get animationRangeStart; @@ -696,22 +749,6 @@ extension type CSSStyleDeclaration._(JSObject _) implements JSObject { external set animationTimingFunction(String value); external String get animationTrigger; external set animationTrigger(String value); - external String get animationTriggerExitRange; - external set animationTriggerExitRange(String value); - external String get animationTriggerExitRangeEnd; - external set animationTriggerExitRangeEnd(String value); - external String get animationTriggerExitRangeStart; - external set animationTriggerExitRangeStart(String value); - external String get animationTriggerRange; - external set animationTriggerRange(String value); - external String get animationTriggerRangeEnd; - external set animationTriggerRangeEnd(String value); - external String get animationTriggerRangeStart; - external set animationTriggerRangeStart(String value); - external String get animationTriggerTimeline; - external set animationTriggerTimeline(String value); - external String get animationTriggerType; - external set animationTriggerType(String value); external String get appearance; external set appearance(String value); external String get aspectRatio; @@ -786,10 +823,14 @@ extension type CSSStyleDeclaration._(JSObject _) implements JSObject { external set border(String value); external String get borderBlock; external set borderBlock(String value); + external String get borderBlockClip; + external set borderBlockClip(String value); external String get borderBlockColor; external set borderBlockColor(String value); external String get borderBlockEnd; external set borderBlockEnd(String value); + external String get borderBlockEndClip; + external set borderBlockEndClip(String value); external String get borderBlockEndColor; external set borderBlockEndColor(String value); external String get borderBlockEndRadius; @@ -800,6 +841,8 @@ extension type CSSStyleDeclaration._(JSObject _) implements JSObject { external set borderBlockEndWidth(String value); external String get borderBlockStart; external set borderBlockStart(String value); + external String get borderBlockStartClip; + external set borderBlockStartClip(String value); external String get borderBlockStartColor; external set borderBlockStartColor(String value); external String get borderBlockStartRadius; @@ -814,6 +857,8 @@ extension type CSSStyleDeclaration._(JSObject _) implements JSObject { external set borderBlockWidth(String value); external String get borderBottom; external set borderBottom(String value); + external String get borderBottomClip; + external set borderBottomClip(String value); external String get borderBottomColor; external set borderBottomColor(String value); external String get borderBottomLeftRadius; @@ -830,14 +875,6 @@ extension type CSSStyleDeclaration._(JSObject _) implements JSObject { external set borderBoundary(String value); external String get borderClip; external set borderClip(String value); - external String get borderClipBottom; - external set borderClipBottom(String value); - external String get borderClipLeft; - external set borderClipLeft(String value); - external String get borderClipRight; - external set borderClipRight(String value); - external String get borderClipTop; - external set borderClipTop(String value); external String get borderCollapse; external set borderCollapse(String value); external String get borderColor; @@ -860,10 +897,14 @@ extension type CSSStyleDeclaration._(JSObject _) implements JSObject { external set borderImageWidth(String value); external String get borderInline; external set borderInline(String value); + external String get borderInlineClip; + external set borderInlineClip(String value); external String get borderInlineColor; external set borderInlineColor(String value); external String get borderInlineEnd; external set borderInlineEnd(String value); + external String get borderInlineEndClip; + external set borderInlineEndClip(String value); external String get borderInlineEndColor; external set borderInlineEndColor(String value); external String get borderInlineEndRadius; @@ -874,6 +915,8 @@ extension type CSSStyleDeclaration._(JSObject _) implements JSObject { external set borderInlineEndWidth(String value); external String get borderInlineStart; external set borderInlineStart(String value); + external String get borderInlineStartClip; + external set borderInlineStartClip(String value); external String get borderInlineStartColor; external set borderInlineStartColor(String value); external String get borderInlineStartRadius; @@ -888,6 +931,8 @@ extension type CSSStyleDeclaration._(JSObject _) implements JSObject { external set borderInlineWidth(String value); external String get borderLeft; external set borderLeft(String value); + external String get borderLeftClip; + external set borderLeftClip(String value); external String get borderLeftColor; external set borderLeftColor(String value); external String get borderLeftRadius; @@ -902,6 +947,8 @@ extension type CSSStyleDeclaration._(JSObject _) implements JSObject { external set borderRadius(String value); external String get borderRight; external set borderRight(String value); + external String get borderRightClip; + external set borderRightClip(String value); external String get borderRightColor; external set borderRightColor(String value); external String get borderRightRadius; @@ -922,6 +969,8 @@ extension type CSSStyleDeclaration._(JSObject _) implements JSObject { external set borderStyle(String value); external String get borderTop; external set borderTop(String value); + external String get borderTopClip; + external set borderTopClip(String value); external String get borderTopColor; external set borderTopColor(String value); external String get borderTopLeftRadius; @@ -1046,36 +1095,70 @@ extension type CSSStyleDeclaration._(JSObject _) implements JSObject { external set continue_(String value); external String get copyInto; external set copyInto(String value); + external String get corner; + external set corner(String value); + external String get cornerBlockEnd; + external set cornerBlockEnd(String value); external String get cornerBlockEndShape; external set cornerBlockEndShape(String value); + external String get cornerBlockStart; + external set cornerBlockStart(String value); external String get cornerBlockStartShape; external set cornerBlockStartShape(String value); + external String get cornerBottom; + external set cornerBottom(String value); + external String get cornerBottomLeft; + external set cornerBottomLeft(String value); external String get cornerBottomLeftShape; external set cornerBottomLeftShape(String value); + external String get cornerBottomRight; + external set cornerBottomRight(String value); external String get cornerBottomRightShape; external set cornerBottomRightShape(String value); external String get cornerBottomShape; external set cornerBottomShape(String value); + external String get cornerEndEnd; + external set cornerEndEnd(String value); external String get cornerEndEndShape; external set cornerEndEndShape(String value); + external String get cornerEndStart; + external set cornerEndStart(String value); external String get cornerEndStartShape; external set cornerEndStartShape(String value); + external String get cornerInlineEnd; + external set cornerInlineEnd(String value); external String get cornerInlineEndShape; external set cornerInlineEndShape(String value); + external String get cornerInlineStart; + external set cornerInlineStart(String value); external String get cornerInlineStartShape; external set cornerInlineStartShape(String value); + external String get cornerLeft; + external set cornerLeft(String value); external String get cornerLeftShape; external set cornerLeftShape(String value); + external String get cornerRight; + external set cornerRight(String value); external String get cornerRightShape; external set cornerRightShape(String value); external String get cornerShape; external set cornerShape(String value); + external String get cornerStartEnd; + external set cornerStartEnd(String value); external String get cornerStartEndShape; external set cornerStartEndShape(String value); + external String get cornerStartStart; + external set cornerStartStart(String value); external String get cornerStartStartShape; external set cornerStartStartShape(String value); + external String get cornerTop; + external set cornerTop(String value); + external String get cornerTopLeft; + external set cornerTopLeft(String value); external String get cornerTopLeftShape; external set cornerTopLeftShape(String value); + external String get cornerTopRight; + external set cornerTopRight(String value); external String get cornerTopRightShape; external set cornerTopRightShape(String value); external String get cornerTopShape; @@ -1110,6 +1193,12 @@ extension type CSSStyleDeclaration._(JSObject _) implements JSObject { external set dynamicRangeLimit(String value); external String get emptyCells; external set emptyCells(String value); + external String get eventTrigger; + external set eventTrigger(String value); + external String get eventTriggerName; + external set eventTriggerName(String value); + external String get eventTriggerSource; + external set eventTriggerSource(String value); external String get fieldSizing; external set fieldSizing(String value); external String get fill; @@ -1226,20 +1315,6 @@ extension type CSSStyleDeclaration._(JSObject _) implements JSObject { external set forcedColorAdjust(String value); external String get gap; external set gap(String value); - external String get gapRule; - external set gapRule(String value); - external String get gapRuleBreak; - external set gapRuleBreak(String value); - external String get gapRuleColor; - external set gapRuleColor(String value); - external String get gapRuleOutset; - external set gapRuleOutset(String value); - external String get gapRulePaintOrder; - external set gapRulePaintOrder(String value); - external String get gapRuleStyle; - external set gapRuleStyle(String value); - external String get gapRuleWidth; - external set gapRuleWidth(String value); external String get glyphOrientationVertical; external set glyphOrientationVertical(String value); external String get grid; @@ -1328,6 +1403,12 @@ extension type CSSStyleDeclaration._(JSObject _) implements JSObject { external set insetInlineStart(String value); external String get interactivity; external set interactivity(String value); + external String get interestDelay; + external set interestDelay(String value); + external String get interestDelayEnd; + external set interestDelayEnd(String value); + external String get interestDelayStart; + external set interestDelayStart(String value); external String get interpolateSize; external set interpolateSize(String value); external String get isolation; @@ -1340,8 +1421,8 @@ extension type CSSStyleDeclaration._(JSObject _) implements JSObject { external set itemFlow(String value); external String get itemPack; external set itemPack(String value); - external String get itemSlack; - external set itemSlack(String value); + external String get itemTolerance; + external set itemTolerance(String value); external String get itemTrack; external set itemTrack(String value); external String get itemWrap; @@ -1622,6 +1703,12 @@ extension type CSSStyleDeclaration._(JSObject _) implements JSObject { external set placeSelf(String value); external String get pointerEvents; external set pointerEvents(String value); + external String get pointerTimeline; + external set pointerTimeline(String value); + external String get pointerTimelineAxis; + external set pointerTimelineAxis(String value); + external String get pointerTimelineName; + external set pointerTimelineName(String value); external String get position; external set position(String value); external String get positionAnchor; @@ -1682,6 +1769,20 @@ extension type CSSStyleDeclaration._(JSObject _) implements JSObject { external set rubyOverhang(String value); external String get rubyPosition; external set rubyPosition(String value); + external String get rule; + external set rule(String value); + external String get ruleBreak; + external set ruleBreak(String value); + external String get ruleColor; + external set ruleColor(String value); + external String get ruleOutset; + external set ruleOutset(String value); + external String get ruleOverlap; + external set ruleOverlap(String value); + external String get ruleStyle; + external set ruleStyle(String value); + external String get ruleWidth; + external set ruleWidth(String value); external String get rx; external set rx(String value); external String get ry; @@ -1744,6 +1845,8 @@ extension type CSSStyleDeclaration._(JSObject _) implements JSObject { external set scrollSnapStop(String value); external String get scrollSnapType; external set scrollSnapType(String value); + external String get scrollTargetGroup; + external set scrollTargetGroup(String value); external String get scrollTimeline; external set scrollTimeline(String value); external String get scrollTimelineAxis; @@ -1770,6 +1873,8 @@ extension type CSSStyleDeclaration._(JSObject _) implements JSObject { external set shapeRendering(String value); external String get shapeSubtract; external set shapeSubtract(String value); + external String get sliderOrientation; + external set sliderOrientation(String value); external String get spatialNavigationAction; external set spatialNavigationAction(String value); external String get spatialNavigationContain; @@ -1854,6 +1959,8 @@ extension type CSSStyleDeclaration._(JSObject _) implements JSObject { external set textDecoration(String value); external String get textDecorationColor; external set textDecorationColor(String value); + external String get textDecorationInset; + external set textDecorationInset(String value); external String get textDecorationLine; external set textDecorationLine(String value); external String get textDecorationSkip; @@ -1870,8 +1977,6 @@ extension type CSSStyleDeclaration._(JSObject _) implements JSObject { external set textDecorationStyle(String value); external String get textDecorationThickness; external set textDecorationThickness(String value); - external String get textDecorationTrim; - external set textDecorationTrim(String value); external String get textEmphasis; external set textEmphasis(String value); external String get textEmphasisColor; @@ -1916,6 +2021,24 @@ extension type CSSStyleDeclaration._(JSObject _) implements JSObject { external set textWrapStyle(String value); external String get timelineScope; external set timelineScope(String value); + external String get timelineTrigger; + external set timelineTrigger(String value); + external String get timelineTriggerExitRange; + external set timelineTriggerExitRange(String value); + external String get timelineTriggerExitRangeEnd; + external set timelineTriggerExitRangeEnd(String value); + external String get timelineTriggerExitRangeStart; + external set timelineTriggerExitRangeStart(String value); + external String get timelineTriggerName; + external set timelineTriggerName(String value); + external String get timelineTriggerRange; + external set timelineTriggerRange(String value); + external String get timelineTriggerRangeEnd; + external set timelineTriggerRangeEnd(String value); + external String get timelineTriggerRangeStart; + external set timelineTriggerRangeStart(String value); + external String get timelineTriggerSource; + external set timelineTriggerSource(String value); external String get top; external set top(String value); external String get touchAction; @@ -2023,6 +2146,11 @@ extension type CSSStyleDeclaration._(JSObject _) implements JSObject { external String get zoom; external set zoom(String value); } +extension type CSSStyleProperties._(JSObject _) + implements CSSStyleDeclaration, JSObject { + external String get cssFloat; + external set cssFloat(String value); +} @JS() external $CSS get CSS; diff --git a/web/lib/src/dom/digital_credentials.dart b/web/lib/src/dom/digital_credentials.dart index fffab519..d21279f5 100644 --- a/web/lib/src/dom/digital_credentials.dart +++ b/web/lib/src/dom/digital_credentials.dart @@ -15,16 +15,18 @@ library; import 'dart:js_interop'; +import 'credential_management.dart'; + extension type DigitalCredentialRequestOptions._(JSObject _) implements JSObject { external factory DigitalCredentialRequestOptions( - {JSArray requests}); + {required JSArray requests}); - external JSArray get requests; - external set requests(JSArray value); + external JSArray get requests; + external set requests(JSArray value); } -extension type DigitalCredentialRequest._(JSObject _) implements JSObject { - external factory DigitalCredentialRequest({ +extension type DigitalCredentialGetRequest._(JSObject _) implements JSObject { + external factory DigitalCredentialGetRequest({ required String protocol, required JSObject data, }); @@ -34,3 +36,29 @@ extension type DigitalCredentialRequest._(JSObject _) implements JSObject { external JSObject get data; external set data(JSObject value); } +extension type DigitalCredentialCreationOptions._(JSObject _) + implements JSObject { + external factory DigitalCredentialCreationOptions( + {JSArray requests}); + + external JSArray get requests; + external set requests(JSArray value); +} +extension type DigitalCredentialCreateRequest._(JSObject _) + implements JSObject { + external factory DigitalCredentialCreateRequest({ + required String protocol, + required JSObject data, + }); + + external String get protocol; + external set protocol(String value); + external JSObject get data; + external set data(JSObject value); +} +extension type DigitalCredential._(JSObject _) implements Credential, JSObject { + external static bool userAgentAllowsProtocol(String protocol); + external JSObject toJSON(); + external String get protocol; + external JSObject get data; +} diff --git a/web/lib/src/dom/dom.dart b/web/lib/src/dom/dom.dart index dbd3972a..982635af 100644 --- a/web/lib/src/dom/dom.dart +++ b/web/lib/src/dom/dom.dart @@ -1489,7 +1489,7 @@ extension type Document._(JSObject _) implements Node, JSObject { /// original document. The imported node is a clone of the original. external Node importNode( Node node, [ - bool subtree, + JSAny options, ]); /// **`Document.adoptNode()`** transfers a from another [Document] into the @@ -1896,6 +1896,10 @@ extension type Document._(JSObject _) implements Node, JSObject { JSAny node3, JSAny node4, ]); + external void moveBefore( + Node node, + Node? child, + ); /// The [Document] method **`querySelector()`** /// returns the first [Element] within the document that matches the specified @@ -2011,6 +2015,7 @@ extension type Document._(JSObject _) implements Node, JSObject { /// [Document.documentElement], which returns the root element for all /// documents. external SVGSVGElement? get rootElement; + external ViewTransition? get activeViewTransition; /// The **`scrollingElement`** read-only property of the /// [Document] interface returns a reference to the [Element] that @@ -2469,6 +2474,8 @@ extension type Document._(JSObject _) implements Node, JSObject { external set onauxclick(EventHandler value); external EventHandler get onbeforeinput; external set onbeforeinput(EventHandler value); + external EventHandler get onbeforematch; + external set onbeforematch(EventHandler value); external EventHandler get onbeforetoggle; external set onbeforetoggle(EventHandler value); external EventHandler get onblur; @@ -2485,6 +2492,8 @@ extension type Document._(JSObject _) implements Node, JSObject { external set onclick(EventHandler value); external EventHandler get onclose; external set onclose(EventHandler value); + external EventHandler get oncommand; + external set oncommand(EventHandler value); external EventHandler get oncontextlost; external set oncontextlost(EventHandler value); external EventHandler get oncontextmenu; @@ -2627,6 +2636,8 @@ extension type Document._(JSObject _) implements Node, JSObject { external set onpointerdown(EventHandler value); external EventHandler get onpointermove; external set onpointermove(EventHandler value); + external EventHandler get onpointerrawupdate; + external set onpointerrawupdate(EventHandler value); external EventHandler get onpointerup; external set onpointerup(EventHandler value); external EventHandler get onpointercancel; @@ -2664,13 +2675,29 @@ extension type Document._(JSObject _) implements Node, JSObject { /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/XMLDocument). extension type XMLDocument._(JSObject _) implements Document, JSObject {} extension type ElementCreationOptions._(JSObject _) implements JSObject { - external factory ElementCreationOptions({String is_}); + external factory ElementCreationOptions({ + CustomElementRegistry? customElementRegistry, + String is_, + }); + external CustomElementRegistry? get customElementRegistry; + external set customElementRegistry(CustomElementRegistry? value); @JS('is') external String get is_; @JS('is') external set is_(String value); } +extension type ImportNodeOptions._(JSObject _) implements JSObject { + external factory ImportNodeOptions({ + CustomElementRegistry customElementRegistry, + bool selfOnly, + }); + + external CustomElementRegistry get customElementRegistry; + external set customElementRegistry(CustomElementRegistry value); + external bool get selfOnly; + external set selfOnly(bool value); +} /// The **`DOMImplementation`** interface represents an object providing methods /// which are not dependent on any particular document. Such an object is @@ -2687,7 +2714,7 @@ extension type DOMImplementation._(JSObject _) implements JSObject { /// into the document via methods like [Node.insertBefore] or /// [Node.replaceChild]. external DocumentType createDocumentType( - String qualifiedName, + String name, String publicId, String systemId, ); @@ -2853,6 +2880,10 @@ extension type DocumentFragment._(JSObject _) implements Node, JSObject { JSAny node3, JSAny node4, ]); + external void moveBefore( + Node node, + Node? child, + ); /// The **`DocumentFragment.querySelector()`** method returns the /// first element, or `null` if no matches are found, within the @@ -3192,7 +3223,7 @@ extension type Element._(JSObject _) implements Node, JSObject { /// method instead. external void setAttribute( String qualifiedName, - String value, + JSAny value, ); /// `setAttributeNS` adds a new attribute or changes the value of an attribute @@ -3204,7 +3235,7 @@ extension type Element._(JSObject _) implements Node, JSObject { external void setAttributeNS( String? namespace, String qualifiedName, - String value, + JSAny value, ); /// The [Element] method @@ -3432,13 +3463,13 @@ extension type Element._(JSObject _) implements Node, JSObject { /// **`scrollIntoView()`** method scrolls the element's ancestor /// containers such that the element on which `scrollIntoView()` is called is /// visible to the user. - external void scrollIntoView([JSAny arg]); + external JSPromise scrollIntoView([JSAny arg]); /// The **`scroll()`** method of the [Element] /// interface scrolls the element to a particular set of coordinates inside a /// given /// element. - external void scroll([ + external JSPromise scroll([ JSAny optionsOrX, num y, ]); @@ -3446,14 +3477,14 @@ extension type Element._(JSObject _) implements Node, JSObject { /// The **`scrollTo()`** method of the [Element] /// interface scrolls to a particular set of coordinates inside a given /// element. - external void scrollTo([ + external JSPromise scrollTo([ JSAny optionsOrX, num y, ]); /// The **`scrollBy()`** method of the [Element] /// interface scrolls an element by the given amount. - external void scrollBy([ + external JSPromise scrollBy([ JSAny optionsOrX, num y, ]); @@ -3606,6 +3637,10 @@ extension type Element._(JSObject _) implements Node, JSObject { JSAny node3, JSAny node4, ]); + external void moveBefore( + Node node, + Node? child, + ); /// The **`querySelector()`** method of the [Element] /// interface returns the first element that is a descendant of the element on @@ -4044,6 +4079,8 @@ extension type Element._(JSObject _) implements Node, JSObject { external HTMLSlotElement? get assignedSlot; external String? get role; external set role(String? value); + external Element? get ariaActiveDescendantElement; + external set ariaActiveDescendantElement(Element? value); /// The **`ariaAtomic`** property of the [Element] interface reflects the /// value of the @@ -4149,6 +4186,8 @@ extension type Element._(JSObject _) implements Node, JSObject { /// gridcell within a table, grid, or treegrid. external String? get ariaColSpan; external set ariaColSpan(String? value); + external JSArray? get ariaControlsElements; + external set ariaControlsElements(JSArray? value); /// The **`ariaCurrent`** property of the [Element] interface reflects the /// value of the @@ -4157,6 +4196,8 @@ extension type Element._(JSObject _) implements Node, JSObject { /// within a container or set of related elements. external String? get ariaCurrent; external set ariaCurrent(String? value); + external JSArray? get ariaDescribedByElements; + external set ariaDescribedByElements(JSArray? value); /// The **`ariaDescription`** property of the [Element] interface reflects the /// value of the @@ -4165,6 +4206,8 @@ extension type Element._(JSObject _) implements Node, JSObject { /// current element. external String? get ariaDescription; external set ariaDescription(String? value); + external JSArray? get ariaDetailsElements; + external set ariaDetailsElements(JSArray? value); /// The **`ariaDisabled`** property of the [Element] interface reflects the /// value of the @@ -4178,6 +4221,8 @@ extension type Element._(JSObject _) implements Node, JSObject { /// > not require ARIA attributes. external String? get ariaDisabled; external set ariaDisabled(String? value); + external JSArray? get ariaErrorMessageElements; + external set ariaErrorMessageElements(JSArray? value); /// The **`ariaExpanded`** property of the [Element] interface reflects the /// value of the @@ -4186,6 +4231,8 @@ extension type Element._(JSObject _) implements Node, JSObject { /// by this element is expanded or collapsed. external String? get ariaExpanded; external set ariaExpanded(String? value); + external JSArray? get ariaFlowToElements; + external set ariaFlowToElements(JSArray? value); /// The **`ariaHasPopup`** property of the [Element] interface reflects the /// value of the @@ -4218,6 +4265,8 @@ extension type Element._(JSObject _) implements Node, JSObject { /// attribute, which defines a string value that labels the current element. external String? get ariaLabel; external set ariaLabel(String? value); + external JSArray? get ariaLabelledByElements; + external set ariaLabelledByElements(JSArray? value); /// The **`ariaLevel`** property of the [Element] interface reflects the value /// of the `aria-level` attribute, which defines the hierarchical level of an @@ -4280,6 +4329,8 @@ extension type Element._(JSObject _) implements Node, JSObject { /// horizontal, vertical, or unknown/ambiguous. external String? get ariaOrientation; external set ariaOrientation(String? value); + external JSArray? get ariaOwnsElements; + external set ariaOwnsElements(JSArray? value); /// The **`ariaPlaceholder`** property of the [Element] interface reflects the /// value of the `aria-placeholder` attribute, which defines a short hint @@ -4436,6 +4487,7 @@ extension type ShadowRootInit._(JSObject _) implements JSObject { SlotAssignmentMode slotAssignment, bool clonable, bool serializable, + CustomElementRegistry? customElementRegistry, }); external ShadowRootMode get mode; @@ -4448,6 +4500,8 @@ extension type ShadowRootInit._(JSObject _) implements JSObject { external set clonable(bool value); external bool get serializable; external set serializable(bool value); + external CustomElementRegistry? get customElementRegistry; + external set customElementRegistry(CustomElementRegistry? value); } /// The **`NamedNodeMap`** interface represents a collection of [Attr] objects. diff --git a/web/lib/src/dom/event_timing.dart b/web/lib/src/dom/event_timing.dart index 3f189440..0cae4964 100644 --- a/web/lib/src/dom/event_timing.dart +++ b/web/lib/src/dom/event_timing.dart @@ -53,6 +53,11 @@ extension type PerformanceEventTiming._(JSObject _) /// [`target`](https://developer.mozilla.org/en-US/docs/Web/API/Event/target) /// which is the node onto which the event was last dispatched. external Node? get target; + + /// The read-only **`interactionId`** property returns an ID that uniquely + /// identifies a user interaction which triggered a series of associated + /// events. + external int get interactionId; } /// The **`EventCounts`** interface of the diff --git a/web/lib/src/dom/fedcm.dart b/web/lib/src/dom/fedcm.dart index f9dfe1a2..8195296a 100644 --- a/web/lib/src/dom/fedcm.dart +++ b/web/lib/src/dom/fedcm.dart @@ -60,15 +60,12 @@ extension type IdentityProviderRequestOptions._(JSObject _) external factory IdentityProviderRequestOptions({ required String configURL, required String clientId, - String nonce, String loginHint, String domainHint, JSArray fields, JSAny? params, }); - external String get nonce; - external set nonce(String value); external String get loginHint; external set loginHint(String value); external String get domainHint; diff --git a/web/lib/src/dom/fetch.dart b/web/lib/src/dom/fetch.dart index 62c333da..ae60ab61 100644 --- a/web/lib/src/dom/fetch.dart +++ b/web/lib/src/dom/fetch.dart @@ -18,7 +18,7 @@ import 'dart:js_interop'; import 'attribution_reporting_api.dart'; import 'dom.dart'; import 'fileapi.dart'; -import 'private_network_access.dart'; +import 'local_network_access.dart'; import 'referrer_policy.dart'; import 'streams.dart'; import 'trust_token_api.dart'; diff --git a/web/lib/src/dom/hr_time.dart b/web/lib/src/dom/hr_time.dart index 9baed3f4..9db85472 100644 --- a/web/lib/src/dom/hr_time.dart +++ b/web/lib/src/dom/hr_time.dart @@ -214,6 +214,7 @@ extension type Performance._(JSObject _) implements EventTarget, JSObject { /// Not all event types are exposed. You can only get counts for event types /// supported by the [PerformanceEventTiming] interface. external EventCounts get eventCounts; + external int get interactionCount; /// The legacy /// **`Performance.timing`** read-only diff --git a/web/lib/src/dom/html.dart b/web/lib/src/dom/html.dart index 0ce2329e..69024e4d 100644 --- a/web/lib/src/dom/html.dart +++ b/web/lib/src/dom/html.dart @@ -17,7 +17,7 @@ import 'dart:js_interop'; import 'battery_status.dart'; import 'clipboard_apis.dart'; -import 'cookie_store.dart'; +import 'cookiestore.dart'; import 'credential_management.dart'; import 'css_font_loading.dart'; import 'css_typed_om.dart'; @@ -34,6 +34,7 @@ import 'geolocation.dart'; import 'geometry.dart'; import 'hr_time.dart'; import 'indexeddb.dart'; +import 'login_status.dart'; import 'media_capabilities.dart'; import 'media_playback_quality.dart'; import 'media_source.dart'; @@ -48,6 +49,7 @@ import 'scheduling_apis.dart'; import 'screen_wake_lock.dart'; import 'selection_api.dart'; import 'service_workers.dart'; +import 'shared_storage.dart'; import 'speech_api.dart'; import 'storage.dart'; import 'trusted_types.dart'; @@ -56,7 +58,8 @@ import 'vibration.dart'; import 'video_rvfc.dart'; import 'web_locks.dart'; import 'web_share.dart'; -import 'webcryptoapi.dart'; +import 'webcrypto.dart'; +import 'webgpu.dart'; import 'webidl.dart'; import 'webmidi.dart'; import 'xhr.dart'; @@ -71,11 +74,14 @@ typedef EventHandler = EventHandlerNonNull?; typedef OnErrorEventHandler = OnErrorEventHandlerNonNull?; typedef OnBeforeUnloadEventHandler = OnBeforeUnloadEventHandlerNonNull?; typedef TimerHandler = JSAny; +typedef ImageDataArray = JSTypedArray; typedef ImageBitmapSource = JSObject; typedef MessageEventSource = JSObject; typedef BlobCallback = JSFunction; typedef CustomElementConstructor = JSFunction; typedef FunctionStringCallback = JSFunction; +typedef NavigationInterceptHandler = JSFunction; +typedef NavigationPrecommitHandler = JSFunction; typedef EventHandlerNonNull = JSFunction; typedef OnErrorEventHandlerNonNull = JSFunction; typedef OnBeforeUnloadEventHandlerNonNull = JSFunction; @@ -86,7 +92,6 @@ typedef CanPlayTypeResult = String; typedef TextTrackMode = String; typedef TextTrackKind = String; typedef SelectionMode = String; -typedef PredefinedColorSpace = String; typedef CanvasColorType = String; typedef CanvasFillRule = String; typedef ImageSmoothingQuality = String; @@ -100,8 +105,14 @@ typedef CanvasFontStretch = String; typedef CanvasFontVariantCaps = String; typedef CanvasTextRendering = String; typedef OffscreenRenderingContextId = String; +typedef PredefinedColorSpace = String; typedef ScrollRestoration = String; +typedef NavigationHistoryBehavior = String; +typedef NavigationType = String; +typedef NavigationFocusReset = String; +typedef NavigationScrollBehavior = String; typedef DOMParserSupportedType = String; +typedef ImageDataPixelFormat = String; typedef ImageOrientation = String; typedef PremultiplyAlpha = String; typedef ColorSpaceConversion = String; @@ -857,7 +868,7 @@ extension type HTMLElement._(JSObject _) implements Element, JSObject { /// > /// > The `style` property has the same priority in the CSS cascade as an /// > inline style declaration set via the `style` attribute. - external CSSStyleDeclaration get style; + external CSSStyleProperties get style; /// The **`attributeStyleMap`** read-only property of the [HTMLElement] /// interface returns a live [StylePropertyMap] object that contains a list of @@ -884,6 +895,8 @@ extension type HTMLElement._(JSObject _) implements Element, JSObject { external set onauxclick(EventHandler value); external EventHandler get onbeforeinput; external set onbeforeinput(EventHandler value); + external EventHandler get onbeforematch; + external set onbeforematch(EventHandler value); external EventHandler get onbeforetoggle; external set onbeforetoggle(EventHandler value); external EventHandler get onblur; @@ -900,6 +913,8 @@ extension type HTMLElement._(JSObject _) implements Element, JSObject { external set onclick(EventHandler value); external EventHandler get onclose; external set onclose(EventHandler value); + external EventHandler get oncommand; + external set oncommand(EventHandler value); external EventHandler get oncontextlost; external set oncontextlost(EventHandler value); external EventHandler get oncontextmenu; @@ -1042,6 +1057,8 @@ extension type HTMLElement._(JSObject _) implements Element, JSObject { external set onpointerdown(EventHandler value); external EventHandler get onpointermove; external set onpointermove(EventHandler value); + external EventHandler get onpointerrawupdate; + external set onpointerrawupdate(EventHandler value); external EventHandler get onpointerup; external set onpointerup(EventHandler value); external EventHandler get onpointercancel; @@ -2231,6 +2248,28 @@ extension type HTMLAnchorElement._(JSObject _) external String get shape; external set shape(String value); + /// The **`attributionSrc`** property of the [HTMLAnchorElement] interface + /// gets and sets the + /// [`attributionsrc`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attributionsrc) + /// attribute on an `a` element programmatically, reflecting the value of that + /// attribute. `attributionsrc` specifies that you want the browser to send an + /// header. On the server-side this is used to trigger sending an header in + /// the response, to register of a + /// [navigation-based attribution source](https://developer.mozilla.org/en-US/docs/Web/API/Attribution_Reporting_API/Registering_sources#navigation-based_attribution_sources). + /// + /// The browser stores the source data associated with the navigation-based + /// attribution source (as provided in the response header) when it receives + /// the navigation response. + /// + /// See the + /// [Attribution Reporting API](https://developer.mozilla.org/en-US/docs/Web/API/Attribution_Reporting_API) + /// for more details. + /// + /// > **Note:** `` elements cannot be used as attribution triggers, only + /// > sources. + external String get attributionSrc; + external set attributionSrc(String value); + /// The **`HTMLAnchorElement.href`** property is a /// that returns a string containing the whole URL, and allows /// the href to be updated. @@ -2948,6 +2987,39 @@ extension type HTMLImageElement._(JSObject _) implements HTMLElement, JSObject { /// , and . external String get border; external set border(String value); + + /// The + /// **`attributionSrc`** property of the [HTMLImageElement] interface gets and + /// sets the + /// [`attributionsrc`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#attributionsrc) + /// attribute on an `img` element programmatically, reflecting the value of + /// that attribute. `attributionsrc` specifies that you want the browser to + /// send an header along with the image request. + /// + /// On the server-side this is used to trigger sending an or header in the + /// response, to register an image-based + /// [attribution source](https://developer.mozilla.org/en-US/docs/Web/API/Attribution_Reporting_API/Registering_sources#html-based_event_sources) + /// or + /// [attribution trigger](https://developer.mozilla.org/en-US/docs/Web/API/Attribution_Reporting_API/Registering_triggers#html-based_attribution_triggers), + /// respectively. Which response header should be sent back depends on the + /// value of the `Attribution-Reporting-Eligible` header that triggered the + /// registration. + /// + /// The source/trigger is registered once the browser receives the response + /// containing the image file. + /// + /// > [!NOTE] + /// > Bear in mind that users might not necessarily be able to perceive the + /// > image at all — it might be a 1x1 transparent tracking pixel that is only + /// > being used for attribution reporting. + /// + /// See the + /// [Attribution Reporting API](https://developer.mozilla.org/en-US/docs/Web/API/Attribution_Reporting_API) + /// for more details. + external String get attributionSrc; + external set attributionSrc(String value); + external bool get sharedStorageWritable; + external set sharedStorageWritable(bool value); } /// The **`HTMLIFrameElement`** interface provides special properties and @@ -3090,6 +3162,8 @@ extension type HTMLIFrameElement._(JSObject _) external set marginHeight(String value); external String get marginWidth; external set marginWidth(String value); + external bool get sharedStorageWritable; + external set sharedStorageWritable(bool value); } /// The **`HTMLEmbedElement`** interface provides special properties (beyond the @@ -4675,6 +4749,8 @@ extension type HTMLAreaElement._(JSObject _) implements HTMLElement, JSObject { external set referrerPolicy(String value); external bool get noHref; external set noHref(bool value); + external String get attributionSrc; + external set attributionSrc(String value); /// The **`HTMLAreaElement.href`** property is a /// that returns a string containing the whole URL, and allows @@ -6783,6 +6859,27 @@ extension type HTMLButtonElement._(JSObject _) /// error. external void setCustomValidity(String error); + /// The **`command`** property of the [HTMLButtonElement] interface gets and + /// sets the action to be performed on an element being controlled by this + /// button. For this to have an effect, + /// [`commandfor`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#commandfor) + /// must be set. + /// + /// It reflects the + /// [`command`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#command) + /// HTML attribute. + external String get command; + external set command(String value); + + /// The **`commandForElement`** property of the [HTMLButtonElement] interface + /// gets and sets the element to control via a button. + /// + /// It is the JavaScript equivalent of the + /// [`commandfor`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#commandfor) + /// HTML attribute. + external Element? get commandForElement; + external set commandForElement(Element? value); + /// The **`HTMLButtonElement.disabled`** property indicates whether the /// control is disabled, meaning that it does not accept any clicks. external bool get disabled; @@ -8355,6 +8452,17 @@ extension type HTMLDialogElement._(JSObject _) /// `returnValue` of the dialog. external void close([String returnValue]); + /// The **`requestClose()`** method of the [HTMLDialogElement] interface + /// requests to close the `dialog`. + /// An optional string may be passed as an argument, updating the + /// `returnValue` of the dialog. + /// + /// This method differs from the `HTMLDialogElement.close()` method by firing + /// a `cancel` event before firing the `close` event. This allows + /// authors to prevent the dialog from closing. This method exposes the same + /// behavior as the dialog's internal close watcher. + external void requestClose([String returnValue]); + /// The **`open`** property of the /// [HTMLDialogElement] interface is a boolean value reflecting the /// [`open`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dialog#open) @@ -8368,6 +8476,8 @@ extension type HTMLDialogElement._(JSObject _) /// button the user pressed to close it. external String get returnValue; external set returnValue(String value); + external String get closedBy; + external set closedBy(String value); } /// HTML `script` elements expose the **`HTMLScriptElement`** interface, which @@ -8400,6 +8510,13 @@ extension type HTMLScriptElement._(JSObject _) /// which are supported by most modern browsers. external static bool supports(String type); + /// The **`type`** property of the [HTMLScriptElement] interface is a string + /// that reflects the type of the script. + /// + /// It reflects the `type` attribute of the `script` element. + external String get type; + external set type(String value); + /// The **`src`** property of the [HTMLScriptElement] interface is a string /// representing the URL of an external script; this can be used as an /// alternative to embedding a script directly within a document. @@ -8408,13 +8525,6 @@ extension type HTMLScriptElement._(JSObject _) external String get src; external set src(String value); - /// The **`type`** property of the [HTMLScriptElement] interface is a string - /// that reflects the type of the script. - /// - /// It reflects the `type` attribute of the `script` element. - external String get type; - external set type(String value); - /// The **`noModule`** property of the [HTMLScriptElement] interface is a /// boolean value that indicates whether the script should be executed in /// browsers that support @@ -8452,6 +8562,13 @@ extension type HTMLScriptElement._(JSObject _) external bool get defer; external set defer(bool value); + /// The **`blocking`** property of the [HTMLScriptElement] interface is a + /// string indicating that certain operations should be blocked on the + /// fetching of the script. + /// + /// It reflects the `blocking` attribute of the `script` element. + external DOMTokenList get blocking; + /// The **`crossOrigin`** property of the [HTMLScriptElement] interface /// reflects the settings for the script element. For classic scripts from /// other [origins](https://developer.mozilla.org/en-US/docs/Glossary/Origin), @@ -8462,22 +8579,6 @@ extension type HTMLScriptElement._(JSObject _) external String? get crossOrigin; external set crossOrigin(String? value); - /// The **`text`** property of the [HTMLScriptElement] interface is a string - /// that reflects the text content inside the `script` element. It acts the - /// same way as the [Node.textContent] property. - /// - /// It reflects the `text` attribute of the `script` element. - external String get text; - external set text(String value); - - /// The **`integrity`** property of the [HTMLScriptElement] interface is a - /// string that contains inline metadata that a browser can use to verify that - /// a fetched resource has been delivered without unexpected manipulation. - /// - /// It reflects the `integrity` attribute of the `script` element. - external String get integrity; - external set integrity(String value); - /// The **`referrerPolicy`** property of the /// [HTMLScriptElement] interface reflects the HTML /// [`referrerpolicy`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script#referrerpolicy) @@ -8486,12 +8587,13 @@ extension type HTMLScriptElement._(JSObject _) external String get referrerPolicy; external set referrerPolicy(String value); - /// The **`blocking`** property of the [HTMLScriptElement] interface is a - /// string indicating that certain operations should be blocked on the - /// fetching of the script. + /// The **`integrity`** property of the [HTMLScriptElement] interface is a + /// string that contains inline metadata that a browser can use to verify that + /// a fetched resource has been delivered without unexpected manipulation. /// - /// It reflects the `blocking` attribute of the `script` element. - external DOMTokenList get blocking; + /// It reflects the `integrity` attribute of the `script` element. + external String get integrity; + external set integrity(String value); /// The **`fetchPriority`** property of the [HTMLScriptElement] interface /// represents a hint to the browser indicating how it should prioritize @@ -8521,12 +8623,50 @@ extension type HTMLScriptElement._(JSObject _) /// impact of `fetchPriority` on the priority, are entirely browser dependent. external String get fetchPriority; external set fetchPriority(String value); + + /// The **`text`** property of the [HTMLScriptElement] interface is a string + /// that reflects the text content inside the `script` element. It acts the + /// same way as the [Node.textContent] property. + /// + /// It reflects the `text` attribute of the `script` element. + external String get text; + external set text(String value); external String get charset; external set charset(String value); external String get event; external set event(String value); external String get htmlFor; external set htmlFor(String value); + + /// The **`attributionSrc`** property of the [HTMLScriptElement] interface + /// gets and sets the + /// [`attributionsrc`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script#attributionsrc) + /// attribute on an `script` element programmatically, reflecting the value of + /// that attribute. `attributionsrc` specifies that you want the browser to + /// send an header along with the script resource request. + /// + /// On the server-side this is used to trigger sending an or header in the + /// response, to register a JavaScript-based + /// [attribution source](https://developer.mozilla.org/en-US/docs/Web/API/Attribution_Reporting_API/Registering_sources#javascript-based_event_sources) + /// or + /// [attribution trigger](https://developer.mozilla.org/en-US/docs/Web/API/Attribution_Reporting_API/Registering_triggers#javascript-based_attribution_triggers), + /// respectively. Which response header should be sent back depends on the + /// value of the `Attribution-Reporting-Eligible` header that triggered the + /// registration. + /// + /// > [!NOTE] + /// > Alternatively, JavaScript-based attribution sources or triggers can be + /// > registered by sending a [Window.fetch] request containing the + /// > `attributionReporting` option (either set directly on the `fetch()` call + /// > or on a [Request] object passed into the `fetch()` call), or by sending + /// > an [XMLHttpRequest] with [XMLHttpRequest.setAttributionReporting] + /// > invoked on the request object. + /// + /// See the + /// [Attribution Reporting API](https://developer.mozilla.org/en-US/docs/Web/API/Attribution_Reporting_API) + /// for more details. + external String get attributionSrc; + external set attributionSrc(String value); } /// The **`HTMLTemplateElement`** interface enables access to the contents of an @@ -10091,60 +10231,6 @@ extension type TextMetrics._(JSObject _) implements JSObject { /// ideographic baseline of the line box, in CSS pixels. external double get ideographicBaseline; } -extension type ImageDataSettings._(JSObject _) implements JSObject { - external factory ImageDataSettings({PredefinedColorSpace colorSpace}); - - external PredefinedColorSpace get colorSpace; - external set colorSpace(PredefinedColorSpace value); -} - -/// The **`ImageData`** interface represents the underlying pixel data of an -/// area of a `canvas` element. -/// -/// It is created using the [ImageData.ImageData] constructor or creator methods -/// on the [CanvasRenderingContext2D] object associated with a canvas: -/// [CanvasRenderingContext2D.createImageData] and -/// [CanvasRenderingContext2D.getImageData]. It can also be used to set a part -/// of the canvas by using [CanvasRenderingContext2D.putImageData]. -/// -/// --- -/// -/// API documentation sourced from -/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/ImageData). -extension type ImageData._(JSObject _) implements JSObject { - external factory ImageData( - JSAny dataOrSw, - int shOrSw, [ - JSAny settingsOrSh, - ImageDataSettings settings, - ]); - - /// The readonly **`ImageData.width`** property returns the number - /// of pixels per row in the [ImageData] object. - external int get width; - - /// The readonly **`ImageData.height`** property returns the number - /// of rows in the [ImageData] object. - external int get height; - - /// The readonly **`ImageData.data`** property returns a - /// `Uint8ClampedArray` that contains the [ImageData] object's - /// pixel data. Data is stored as a one-dimensional array in the RGBA order, - /// with integer - /// values between `0` and `255` (inclusive). - external JSUint8ClampedArray get data; - - /// The read-only **`ImageData.colorSpace`** property is a string indicating - /// the color space of the image data. - /// - /// The color space can be set during `ImageData` initialization using either - /// the - /// [`ImageData()`](https://developer.mozilla.org/en-US/docs/Web/API/ImageData/ImageData) - /// constructor or the - /// [`createImageData()`](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/createImageData) - /// method. - external PredefinedColorSpace get colorSpace; -} /// The **`Path2D`** interface of the Canvas 2D API is used to declare a path /// that can then be used on a [CanvasRenderingContext2D] object. The @@ -10772,6 +10858,8 @@ extension type ElementInternals._(JSObject _) implements JSObject { /// implicit ARIA role, if any, unless explicitly set. external String? get role; external set role(String? value); + external Element? get ariaActiveDescendantElement; + external set ariaActiveDescendantElement(Element? value); /// The **`ariaAtomic`** property of the [ElementInternals] interface reflects /// the value of the @@ -10908,6 +10996,8 @@ extension type ElementInternals._(JSObject _) implements JSObject { /// > [Accessibility Object Model explainer](https://wicg.github.io/aom/explainer.html#default-semantics-for-custom-elements-via-the-elementinternals-object). external String? get ariaColSpan; external set ariaColSpan(String? value); + external JSArray? get ariaControlsElements; + external set ariaControlsElements(JSArray? value); /// The **`ariaCurrent`** property of the [ElementInternals] interface /// reflects the value of the @@ -10924,6 +11014,8 @@ extension type ElementInternals._(JSObject _) implements JSObject { /// > [Accessibility Object Model explainer](https://wicg.github.io/aom/explainer.html#default-semantics-for-custom-elements-via-the-elementinternals-object). external String? get ariaCurrent; external set ariaCurrent(String? value); + external JSArray? get ariaDescribedByElements; + external set ariaDescribedByElements(JSArray? value); /// The **`ariaDescription`** property of the [ElementInternals] interface /// reflects the value of the @@ -10940,6 +11032,8 @@ extension type ElementInternals._(JSObject _) implements JSObject { /// > [Accessibility Object Model explainer](https://wicg.github.io/aom/explainer.html#default-semantics-for-custom-elements-via-the-elementinternals-object). external String? get ariaDescription; external set ariaDescription(String? value); + external JSArray? get ariaDetailsElements; + external set ariaDetailsElements(JSArray? value); /// The **`ariaDisabled`** property of the [ElementInternals] interface /// reflects the value of the @@ -10956,6 +11050,8 @@ extension type ElementInternals._(JSObject _) implements JSObject { /// > [Accessibility Object Model explainer](https://wicg.github.io/aom/explainer.html#default-semantics-for-custom-elements-via-the-elementinternals-object). external String? get ariaDisabled; external set ariaDisabled(String? value); + external JSArray? get ariaErrorMessageElements; + external set ariaErrorMessageElements(JSArray? value); /// The **`ariaExpanded`** property of the [ElementInternals] interface /// reflects the value of the @@ -10972,6 +11068,8 @@ extension type ElementInternals._(JSObject _) implements JSObject { /// > [Accessibility Object Model explainer](https://wicg.github.io/aom/explainer.html#default-semantics-for-custom-elements-via-the-elementinternals-object). external String? get ariaExpanded; external set ariaExpanded(String? value); + external JSArray? get ariaFlowToElements; + external set ariaFlowToElements(JSArray? value); /// The **`ariaHasPopup`** property of the [ElementInternals] interface /// reflects the value of the @@ -11037,6 +11135,8 @@ extension type ElementInternals._(JSObject _) implements JSObject { /// > [Accessibility Object Model explainer](https://wicg.github.io/aom/explainer.html#default-semantics-for-custom-elements-via-the-elementinternals-object). external String? get ariaLabel; external set ariaLabel(String? value); + external JSArray? get ariaLabelledByElements; + external set ariaLabelledByElements(JSArray? value); /// The **`ariaLevel`** property of the [ElementInternals] interface reflects /// the value of the @@ -11133,6 +11233,8 @@ extension type ElementInternals._(JSObject _) implements JSObject { /// > [Accessibility Object Model explainer](https://wicg.github.io/aom/explainer.html#default-semantics-for-custom-elements-via-the-elementinternals-object). external String? get ariaOrientation; external set ariaOrientation(String? value); + external JSArray? get ariaOwnsElements; + external set ariaOwnsElements(JSArray? value); /// The **`ariaPlaceholder`** property of the [ElementInternals] interface /// reflects the value of the @@ -11505,6 +11607,7 @@ extension type ToggleEvent._(JSObject _) implements Event, JSObject { /// The **`newState`** read-only property of the [ToggleEvent] interface is a /// string representing the state the element is transitioning to. external String get newState; + external Element? get source; } extension type ToggleEventInit._(JSObject _) implements EventInit, JSObject { external factory ToggleEventInit({ @@ -11513,12 +11616,59 @@ extension type ToggleEventInit._(JSObject _) implements EventInit, JSObject { bool composed, String oldState, String newState, + Element? source, }); external String get oldState; external set oldState(String value); external String get newState; external set newState(String value); + external Element? get source; + external set source(Element? value); +} + +/// The **`CommandEvent`** interface represents an event notifying the user when +/// a [HTMLButtonElement] element with valid +/// [HTMLButtonElement.commandForElement] and [HTMLButtonElement.command] +/// attributes is about to invoke an interactive element. +/// +/// This is the event object for the `HTMLElement` [HTMLElement.command_event] +/// event, which represents an action from an Invoker Control when it is invoked +/// (for example when it is clicked or pressed). +/// +/// --- +/// +/// API documentation sourced from +/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/CommandEvent). +extension type CommandEvent._(JSObject _) implements Event, JSObject { + external factory CommandEvent( + String type, [ + CommandEventInit eventInitDict, + ]); + + /// The **`source`** read-only property of the [CommandEvent] interface + /// returns an [EventTarget] representing the control that invoked the given + /// command. + external Element? get source; + + /// The **`command`** read-only property of the [CommandEvent] interface + /// returns a string containing the value of the [HTMLButtonElement.command] + /// property at the time the event was dispatched. + external String get command; +} +extension type CommandEventInit._(JSObject _) implements EventInit, JSObject { + external factory CommandEventInit({ + bool bubbles, + bool cancelable, + bool composed, + Element? source, + String command, + }); + + external Element? get source; + external set source(Element? value); + external String get command; + external set command(String value); } extension type FocusOptions._(JSObject _) implements JSObject { external factory FocusOptions({ @@ -12123,21 +12273,21 @@ extension type Window._(JSObject _) implements EventTarget, JSObject { /// The **`Window.scroll()`** method scrolls the window to a /// particular place in the document. - external void scroll([ + external JSPromise scroll([ JSAny optionsOrX, num y, ]); /// **`Window.scrollTo()`** scrolls to a particular set of /// coordinates in the document. - external void scrollTo([ + external JSPromise scrollTo([ JSAny optionsOrX, num y, ]); /// The **`Window.scrollBy()`** method scrolls the document in the /// window by the given amount. - external void scrollBy([ + external JSPromise scrollBy([ JSAny optionsOrX, num y, ]); @@ -12151,7 +12301,7 @@ extension type Window._(JSObject _) implements EventTarget, JSObject { /// Individual CSS property values are accessed through APIs provided by the /// object, or by /// indexing with CSS property names. - external CSSStyleDeclaration getComputedStyle( + external CSSStyleProperties getComputedStyle( Element elt, [ String? pseudoElt, ]); @@ -12507,6 +12657,12 @@ extension type Window._(JSObject _) implements EventTarget, JSObject { /// that you should be aware of before using them. external History get history; + /// The **`navigation`** read-only property of the [Window] interface returns + /// the current `window`'s associated [Navigation] object. + /// + /// This is the entry point for the [Navigation API]. + external Navigation get navigation; + /// The **`customElements`** read-only property of the [Window] interface /// returns a reference to the [CustomElementRegistry] object, which can be /// used to register new @@ -12639,6 +12795,36 @@ extension type Window._(JSObject _) implements EventTarget, JSObject { /// the application running the script. external Navigator get navigator; + /// The **`originAgentCluster`** read-only property of the [Window] interface + /// returns `true` if this window belongs to an _origin-keyed + /// [agent cluster](https://tc39.es/ecma262/#sec-agent-clusters)_: this means + /// that the operating system has provided dedicated resources (for example an + /// operating system process) to this window's origin that are not shared with + /// windows from other origins. + /// + /// Otherwise this property returns `false`. + /// + /// Windows that are part of an origin-keyed agent cluster are subjects to + /// some additional restrictions, compared with windows that are not. In + /// particular, they cannot: + /// + /// - Set [Document.domain], which is a legacy feature that normally allows + /// same-site cross-origin pages to synchronously access each other's DOM. + /// - Send + /// [`WebAssembly.Module`](https://developer.mozilla.org/en-US/docs/WebAssembly/Reference/JavaScript_interface/Module) + /// objects to other same-site cross-origin pages via [Window.postMessage]. + /// - Send `SharedArrayBuffer` or + /// [`WebAssembly.Memory`](https://developer.mozilla.org/en-US/docs/WebAssembly/Reference/JavaScript_interface/Memory) + /// objects to other same-site cross-origin pages. + /// + /// To request that the browser assign this window to an origin-keyed agent + /// cluster, the server must send the response header. + /// + /// Note that the origin-keyed agent cluster feature is only supported in . If + /// a site is not a secure context, the `window.originAgentCluster` will + /// always return `false`. + external bool get originAgentCluster; + /// Returns the orientation in degrees (in 90-degree increments) of the /// viewport relative to the device's natural orientation. /// @@ -12812,6 +12998,17 @@ extension type Window._(JSObject _) implements EventTarget, JSObject { external EventHandler get ondevicemotion; external set ondevicemotion(EventHandler value); + /// The global read-only **`sharedStorage`** property returns the + /// [WindowSharedStorage] object for the current origin. This is the main + /// entry point for writing data to shared storage using the + /// [Shared Storage API](https://developer.mozilla.org/en-US/docs/Web/API/Shared_Storage_API). + /// + /// > **Note:** `sharedStorage` is not available inside workers. It is + /// > implemented by [Window] and is also available in shared storage worklets + /// > (see [SharedStorageWorkletGlobalScope.sharedStorage], which returns + /// > [WorkletSharedStorage]). + external SharedStorage? get sharedStorage; + /// The `speechSynthesis` read-only property of the Window object returns a /// [SpeechSynthesis] object, which is the entry point into using /// [Web Speech API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Speech_API) @@ -12823,6 +13020,8 @@ extension type Window._(JSObject _) implements EventTarget, JSObject { external set onauxclick(EventHandler value); external EventHandler get onbeforeinput; external set onbeforeinput(EventHandler value); + external EventHandler get onbeforematch; + external set onbeforematch(EventHandler value); external EventHandler get onbeforetoggle; external set onbeforetoggle(EventHandler value); external EventHandler get onblur; @@ -12839,6 +13038,8 @@ extension type Window._(JSObject _) implements EventTarget, JSObject { external set onclick(EventHandler value); external EventHandler get onclose; external set onclose(EventHandler value); + external EventHandler get oncommand; + external set oncommand(EventHandler value); external EventHandler get oncontextlost; external set oncontextlost(EventHandler value); external EventHandler get oncontextmenu; @@ -12981,6 +13182,8 @@ extension type Window._(JSObject _) implements EventTarget, JSObject { external set onpointerdown(EventHandler value); external EventHandler get onpointermove; external set onpointermove(EventHandler value); + external EventHandler get onpointerrawupdate; + external set onpointerrawupdate(EventHandler value); external EventHandler get onpointerup; external set onpointerup(EventHandler value); external EventHandler get onpointercancel; @@ -13098,21 +13301,6 @@ extension type Window._(JSObject _) implements EventTarget, JSObject { /// asynchronously access the capabilities of indexed databases. external IDBFactory get indexedDB; - /// The **`crypto`** read-only property of the [Window] interface returns the - /// [Crypto] object for this window's scope. This object gives web pages - /// access to certain cryptographic related services. - /// - /// Although the property itself is read-only, all of its methods (and the - /// methods of its - /// child object, [SubtleCrypto]) are not read-only, and therefore vulnerable - /// to attack by . - /// - /// Although `crypto` is available on all windows, the returned `Crypto` - /// object only has one usable feature in insecure contexts: the - /// [Crypto.getRandomValues] method. In general, you should use this API only - /// in secure contexts. - external Crypto get crypto; - /// The **`performance`** property of the [Window] interface returns a /// [Performance] object, which can be used to gather performance information /// about code running in the window's scope. @@ -13142,6 +13330,21 @@ extension type Window._(JSObject _) implements EventTarget, JSObject { /// object, providing the entry point for using the [Trusted Types API]. external TrustedTypePolicyFactory get trustedTypes; + /// The **`crypto`** read-only property of the [Window] interface returns the + /// [Crypto] object for this window's scope. This object gives web pages + /// access to certain cryptographic related services. + /// + /// Although the property itself is read-only, all of its methods (and the + /// methods of its + /// child object, [SubtleCrypto]) are not read-only, and therefore vulnerable + /// to attack by . + /// + /// Although `crypto` is available on all windows, the returned `Crypto` + /// object only has one usable feature in insecure contexts: the + /// [Crypto.getRandomValues] method. In general, you should use this API only + /// in secure contexts. + external Crypto get crypto; + /// The read-only **`sessionStorage`** property accesses a session [Storage] /// object for the current . `sessionStorage` is similar to /// [Window.localStorage]; the difference is that while `localStorage` is @@ -13481,6 +13684,591 @@ extension type History._(JSObject _) implements JSObject { external JSAny? get state; } +/// The **`Navigation`** interface of the [Navigation API] allows control over +/// all navigation actions for the current `window` in one central place, +/// including initiating navigations programmatically, examining navigation +/// history entries, and managing navigations as they happen. +/// +/// It is accessed via the [Window.navigation] property. +/// +/// The Navigation API only exposes history entries created in the current +/// browsing context that have the same origin as the current page (e.g. not +/// navigations inside embedded `iframe`s, or cross-origin navigations), +/// providing an accurate list of all previous history entries just for your +/// app. This makes traversing the history a much less fragile proposition than +/// with the older [History API]. +/// +/// --- +/// +/// API documentation sourced from +/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/Navigation). +extension type Navigation._(JSObject _) implements EventTarget, JSObject { + /// The **`entries()`** method of the + /// [Navigation] interface returns an array of [NavigationHistoryEntry] + /// objects representing all existing history entries. + external JSArray entries(); + + /// The **`updateCurrentEntry()`** method of the [Navigation] interface + /// updates the `state` of the [Navigation.currentEntry]; used in cases where + /// the state change will be independent of a navigation or reload. + external void updateCurrentEntry(NavigationUpdateCurrentEntryOptions options); + + /// The **`navigate()`** method of the + /// [Navigation] interface navigates to a specific URL, updating any provided + /// state in the history entries list. + external NavigationResult navigate( + String url, [ + NavigationNavigateOptions options, + ]); + + /// The **`reload()`** method of the + /// [Navigation] interface reloads the current URL, updating any provided + /// state in the history entries list. + external NavigationResult reload([NavigationReloadOptions options]); + + /// The **`traverseTo()`** method of the [Navigation] interface navigates to + /// the [NavigationHistoryEntry] identified by the given + /// [NavigationHistoryEntry.key]. + external NavigationResult traverseTo( + String key, [ + NavigationOptions options, + ]); + + /// The **`back()`** method of the + /// [Navigation] interface navigates backwards by one entry in the navigation + /// history. + external NavigationResult back([NavigationOptions options]); + + /// The **`forward()`** method of the + /// [Navigation] interface navigates forwards by one entry in the navigation + /// history. + external NavigationResult forward([NavigationOptions options]); + + /// The **`currentEntry`** read-only property of the + /// [Navigation] interface returns a [NavigationHistoryEntry] object + /// representing the location the user is currently navigated to right now. + external NavigationHistoryEntry? get currentEntry; + + /// The **`transition`** read-only property of the [Navigation] interface + /// returns a [NavigationTransition] object representing the status of an + /// in-progress navigation, which can be used to track it. + external NavigationTransition? get transition; + + /// The **`activation`** read-only property of the [Navigation] interface + /// returns a [NavigationActivation] object containing information about the + /// most recent cross-document navigation, which "activated" this Document. + /// The property will stay constant during same-document navigations. + external NavigationActivation? get activation; + + /// The **`canGoBack`** read-only property of the + /// [Navigation] interface returns `true` + /// if it is possible to navigate backwards in the navigation history + /// (i.e. the [Navigation.currentEntry] is + /// not the first one in the history entry list), + /// and `false` if it is not. + external bool get canGoBack; + + /// The **`canGoForward`** read-only property of the + /// [Navigation] interface returns `true` if it is possible to navigate + /// forwards in the navigation history + /// (i.e. the [Navigation.currentEntry] is not the last one in the history + /// entry list), + /// and `false` if it is not. + external bool get canGoForward; +} +extension type NavigationUpdateCurrentEntryOptions._(JSObject _) + implements JSObject { + external factory NavigationUpdateCurrentEntryOptions({required JSAny? state}); + + external JSAny? get state; + external set state(JSAny? value); +} +extension type NavigationOptions._(JSObject _) implements JSObject { + external factory NavigationOptions({JSAny? info}); + + external JSAny? get info; + external set info(JSAny? value); +} +extension type NavigationNavigateOptions._(JSObject _) + implements NavigationOptions, JSObject { + external factory NavigationNavigateOptions({ + JSAny? info, + JSAny? state, + NavigationHistoryBehavior history, + }); + + external JSAny? get state; + external set state(JSAny? value); + external NavigationHistoryBehavior get history; + external set history(NavigationHistoryBehavior value); +} +extension type NavigationReloadOptions._(JSObject _) + implements NavigationOptions, JSObject { + external factory NavigationReloadOptions({ + JSAny? info, + JSAny? state, + }); + + external JSAny? get state; + external set state(JSAny? value); +} +extension type NavigationResult._(JSObject _) implements JSObject { + external factory NavigationResult({ + JSPromise committed, + JSPromise finished, + }); + + external JSPromise get committed; + external set committed(JSPromise value); + external JSPromise get finished; + external set finished(JSPromise value); +} + +/// The **`NavigationHistoryEntry`** interface of the [Navigation API] +/// represents a single navigation history entry. +/// +/// These objects are commonly accessed via the [Navigation.currentEntry] +/// property and [Navigation.entries] method. +/// +/// The Navigation API only exposes history entries created in the current +/// browsing context that have the same origin as the current page (e.g. not +/// navigations inside embedded `iframe`s, or cross-origin navigations), +/// providing an accurate list of all previous history entries just for your +/// app. This makes traversing the history a much less fragile proposition than +/// with the older [History API]. +/// +/// --- +/// +/// API documentation sourced from +/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/NavigationHistoryEntry). +extension type NavigationHistoryEntry._(JSObject _) + implements EventTarget, JSObject { + /// The **`getState()`** method of the [NavigationHistoryEntry] interface + /// returns a clone of the developer-supplied state associated with this + /// history entry. + external JSAny? getState(); + + /// The **`url`** read-only property of the [NavigationHistoryEntry] interface + /// returns the absolute URL of this history entry. If the entry corresponds + /// to a different Document than the current one (like `sameDocument` property + /// is `false`), and that Document was fetched with a header set to + /// `no-referrer` or `origin`, the property returns `null`. If current + /// document is not fully active, it returns an empty string. + external String? get url; + + /// The **`key`** read-only property of the [NavigationHistoryEntry] interface + /// returns the `key` of the history entry, or an empty string if current + /// document is not fully active. This is a unique, UA-generated value that + /// represents the history entry's slot in the entries list. It is used to + /// navigate that particular slot via [Navigation.traverseTo]. The `key` will + /// be reused by other entries that replace the entry in the list (that is, if + /// the [NavigateEvent.navigationType] is `replace`). + /// + /// This differs from the [NavigationHistoryEntry.id] of a history entry. The + /// `id` is a unique, UA-generated value that always represents a specific + /// history entry rather than its slot in the entries list. This is useful to + /// correlate it with an external resource such as a storage cache. + external String get key; + + /// The **`id`** read-only property of the [NavigationHistoryEntry] interface + /// returns the `id` of the history entry, or an empty string if current + /// document is not fully active. This is a unique, UA-generated value that + /// always represents a specific history entry, useful to correlate it with an + /// external resource such as a storage cache. + /// + /// This differs from the [NavigationHistoryEntry.key] of a history entry. The + /// `key` is a unique, UA-generated value that represents the history entry's + /// slot in the entries list rather than the entry itself. It is used to + /// navigate that particular slot via [Navigation.traverseTo]. The `key` will + /// be reused by other entries that replace the entry in the list (that is, if + /// the [NavigateEvent.navigationType] is `replace`). + external String get id; + + /// The **`index`** read-only property of the [NavigationHistoryEntry] + /// interface returns the index of the history entry in the history entries + /// list (that is, the list returned by [Navigation.entries]), or `-1` if the + /// entry does not appear in the list or if current document is not fully + /// active. + external int get index; + + /// The **`sameDocument`** read-only property of the [NavigationHistoryEntry] + /// interface returns `true` if this history entry is for the same `document` + /// as the current [Document] value and current document is fully active, or + /// `false` otherwise. + external bool get sameDocument; + external EventHandler get ondispose; + external set ondispose(EventHandler value); +} + +/// The **`NavigationTransition`** interface of the [Navigation API] represents +/// an ongoing navigation, that is, a navigation that hasn't yet reached the +/// [Navigation.navigatesuccess_event] or [Navigation.navigateerror_event] +/// stage. +/// +/// It is accessed via the [Navigation.transition] property. +/// +/// --- +/// +/// API documentation sourced from +/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/NavigationTransition). +extension type NavigationTransition._(JSObject _) implements JSObject { + /// The **`navigationType`** read-only property of the + /// [NavigationTransition] interface returns the type of the ongoing + /// navigation. + external NavigationType get navigationType; + + /// The **`from`** read-only property of the + /// [NavigationTransition] interface returns the [NavigationHistoryEntry] that + /// the transition is coming from. + external NavigationHistoryEntry get from; + external JSPromise get committed; + + /// The **`finished`** read-only property of the + /// [NavigationTransition] interface returns a `Promise` that fulfills at the + /// same time the [Navigation.navigatesuccess_event] event fires, or rejects + /// at the same time the [Navigation.navigateerror_event] event fires. + external JSPromise get finished; +} + +/// The **`NavigationActivation`** interface of the +/// [Navigation API](https://developer.mozilla.org/en-US/docs/Web/API/Navigation_API) +/// represents a recent cross-document navigation. It contains the navigation +/// type and outgoing and inbound document history entries. +/// +/// This object is accessed via the [PageSwapEvent.activation] and +/// [Navigation.activation] properties. Note that, in each case, the +/// `NavigationActivation` represents a different navigation: +/// +/// - `Navigation.activation` represents information about the navigation to the +/// current page. +/// - `PageSwapEvent.activation` represents information about the navigation to +/// the next page. +/// +/// --- +/// +/// API documentation sourced from +/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/NavigationActivation). +extension type NavigationActivation._(JSObject _) implements JSObject { + /// The **`from`** read-only property of the [NavigationActivation] interface + /// contains a [NavigationHistoryEntry] object representing the history entry + /// for the outgoing ("from") document in the navigation. + external NavigationHistoryEntry? get from; + + /// The **`entry`** read-only property of the [NavigationActivation] interface + /// contains a [NavigationHistoryEntry] object representing the history entry + /// for the inbound ("to") document in the navigation. This is equivalent to + /// the [Navigation.currentEntry] property at the moment the inbound document + /// was activated. + /// + /// There are some cases in which either the `from` or `entry` + /// [NavigationHistoryEntry] objects would not be viable targets for the + /// `traverseTo()` method, as they might not be retained in history. For + /// example, the document can be activated using `location.replace()` or its + /// initial entry could be replaced by `history.replaceState()`. However, + /// those entries' `url` properties and `getState()` methods are still + /// accessible. + external NavigationHistoryEntry get entry; + + /// The **`navigationType`** read-only property of the [NavigationActivation] + /// interface contains a string indicating the type of navigation. + external NavigationType get navigationType; +} + +/// The **`NavigateEvent`** interface of the [Navigation API] is the event +/// object for the [Navigation.navigate_event] event, which fires when +/// [any type of navigation](https://github.com/WICG/navigation-api#appendix-types-of-navigations) +/// is initiated (this includes usage of [History API] features like +/// [History.go]). `NavigateEvent` provides access to information about that +/// navigation, and allows developers to intercept and control the navigation +/// handling. +/// +/// --- +/// +/// API documentation sourced from +/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/NavigateEvent). +extension type NavigateEvent._(JSObject _) implements Event, JSObject { + external factory NavigateEvent( + String type, + NavigateEventInit eventInitDict, + ); + + /// The **`intercept()`** method of the + /// [NavigateEvent] interface intercepts this navigation, turning it into a + /// same-document navigation to the [NavigationDestination.url] URL. + external void intercept([NavigationInterceptOptions options]); + + /// The **`scroll()`** method of the + /// [NavigateEvent] interface can be called to manually trigger the + /// browser-driven scrolling behavior that occurs in response to the + /// navigation, if you want it to happen before the navigation handling has + /// completed. + external void scroll(); + + /// The **`navigationType`** read-only property of the + /// [NavigateEvent] interface returns the type of the navigation — `push`, + /// `reload`, `replace`, or `traverse`. + external NavigationType get navigationType; + + /// The **`destination`** read-only property of the + /// [NavigateEvent] interface returns a [NavigationDestination] object + /// representing the destination being navigated to. + external NavigationDestination get destination; + + /// The **`canIntercept`** read-only property of the + /// [NavigateEvent] interface returns `true` if the navigation can be + /// intercepted and have its URL rewritten, or `false` otherwise + /// + /// There are several rules around when a navigation can be intercepted. For + /// example: + /// + /// - You can't intercept cross-origin navigations. + /// - You can intercept `http` or `https` URLs if only the `path`, `query`, + /// and `fragment` portions of the new URL differ from the current URL. + /// - You can intercept `file` URLs if only the `query` and `fragment` + /// portions of the new URL differ. + /// - For other URL types you can intercept the navigation if only the + /// `fragment` portion differs. + /// + /// See the spec for more explanation on + /// [when a Document can have its URL rewritten](https://html.spec.whatwg.org/multipage/nav-history-apis.html#can-have-its-url-rewritten), + /// including a table of examples. + external bool get canIntercept; + + /// The **`userInitiated`** read-only property of the + /// [NavigateEvent] interface returns `true` if the navigation was initiated + /// by the user (e.g. by clicking a link, submitting a form, or pressing the + /// browser's "Back"/"Forward" buttons), or `false` otherwise. + /// + /// > [!NOTE] + /// > The table found at [Appendix: types of + /// > navigations](https://github.com/WICG/navigation-api#appendix-types-of-navigations) + /// > shows which navigation types are user-initiated. + external bool get userInitiated; + + /// The **`hashChange`** read-only property of the + /// [NavigateEvent] interface returns `true` if the navigation is a fragment + /// navigation (i.e. to a fragment identifier in the same document), or + /// `false` otherwise. + external bool get hashChange; + + /// The **`signal`** read-only property of the + /// [NavigateEvent] interface returns an [AbortSignal], which will become + /// aborted if the navigation is cancelled (e.g. by the user pressing the + /// browser's "Stop" button, or another navigation starting and thus + /// cancelling the ongoing one). + external AbortSignal get signal; + + /// The **`formData`** read-only property of the + /// [NavigateEvent] interface returns the [FormData] object representing the + /// submitted data in the case of a + /// [`POST`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST) + /// form submission, or `null` otherwise. + external FormData? get formData; + + /// The **`downloadRequest`** read-only property of the + /// [NavigateEvent] interface returns the filename of the file requested for + /// download, in the case of a download navigation (e.g. an `a` or `area` + /// element with a `download` attribute), or `null` otherwise. + external String? get downloadRequest; + + /// The **`info`** read-only property of the + /// [NavigateEvent] interface returns the `info` data value passed by the + /// initiating navigation operation (e.g. [Navigation.back], or + /// [Navigation.navigate]), or `undefined` if no `info` data was passed. + external JSAny? get info; + + /// The **`hasUAVisualTransition`** read-only property of the [NavigateEvent] + /// interface returns `true` if the user agent performed a visual transition + /// for this navigation before dispatching this event, or `false` otherwise. + /// + /// User agents may provide a built-in visual transition when executing site + /// navigations. If the site author also adds a visual transition, user agent + /// and author transitions may conflict and confuse a visitor. The property + /// lets you detect whether a UA transition was provided so that you can skip + /// author transitions for a better user experience. + external bool get hasUAVisualTransition; + external Element? get sourceElement; +} +extension type NavigateEventInit._(JSObject _) implements EventInit, JSObject { + external factory NavigateEventInit({ + bool bubbles, + bool cancelable, + bool composed, + NavigationType navigationType, + required NavigationDestination destination, + bool canIntercept, + bool userInitiated, + bool hashChange, + required AbortSignal signal, + FormData? formData, + String? downloadRequest, + JSAny? info, + bool hasUAVisualTransition, + Element? sourceElement, + }); + + external NavigationType get navigationType; + external set navigationType(NavigationType value); + external NavigationDestination get destination; + external set destination(NavigationDestination value); + external bool get canIntercept; + external set canIntercept(bool value); + external bool get userInitiated; + external set userInitiated(bool value); + external bool get hashChange; + external set hashChange(bool value); + external AbortSignal get signal; + external set signal(AbortSignal value); + external FormData? get formData; + external set formData(FormData? value); + external String? get downloadRequest; + external set downloadRequest(String? value); + external JSAny? get info; + external set info(JSAny? value); + external bool get hasUAVisualTransition; + external set hasUAVisualTransition(bool value); + external Element? get sourceElement; + external set sourceElement(Element? value); +} +extension type NavigationInterceptOptions._(JSObject _) implements JSObject { + external factory NavigationInterceptOptions({ + NavigationPrecommitHandler precommitHandler, + NavigationInterceptHandler handler, + NavigationFocusReset focusReset, + NavigationScrollBehavior scroll, + }); + + external NavigationPrecommitHandler get precommitHandler; + external set precommitHandler(NavigationPrecommitHandler value); + external NavigationInterceptHandler get handler; + external set handler(NavigationInterceptHandler value); + external NavigationFocusReset get focusReset; + external set focusReset(NavigationFocusReset value); + external NavigationScrollBehavior get scroll; + external set scroll(NavigationScrollBehavior value); +} +extension type NavigationPrecommitController._(JSObject _) implements JSObject { + external void redirect( + String url, [ + NavigationNavigateOptions options, + ]); +} + +/// The **`NavigationDestination`** interface of the [Navigation API] represents +/// the destination being navigated to in the current navigation. +/// +/// It is accessed via the [NavigateEvent.destination] property. +/// +/// --- +/// +/// API documentation sourced from +/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/NavigationDestination). +extension type NavigationDestination._(JSObject _) implements JSObject { + /// The **`getState()`** method of the + /// [NavigationDestination] interface returns a clone of the + /// developer-supplied state associated with the destination + /// [NavigationHistoryEntry], or navigation operation (e.g. + /// [Navigation.navigate]) as appropriate. + external JSAny? getState(); + + /// The **`url`** read-only property of the + /// [NavigationDestination] interface returns the URL being navigated to. + external String get url; + + /// The **`key`** read-only property of the + /// [NavigationDestination] interface returns the [NavigationHistoryEntry.key] + /// value of the destination [NavigationHistoryEntry] if the + /// [NavigateEvent.navigationType] is `traverse`, or an empty string + /// otherwise. + /// + /// The `key` is a unique, UA-generated value that represents the history + /// entry's slot in the history entries list, used to navigate to this place + /// in the history via [Navigation.traverseTo]. It will be reused by other + /// entries that replace the entry in the list (i.e. if the + /// [NavigateEvent.navigationType] is `replace`). + external String get key; + + /// The **`id`** read-only property of the + /// [NavigationDestination] interface returns the [NavigationHistoryEntry.id] + /// value of the destination [NavigationHistoryEntry] if the + /// [NavigateEvent.navigationType] is `traverse`, or an empty string + /// otherwise. + /// + /// The `id` is a unique, UA-generated value that always represents the + /// history entry, useful to correlate a history entry with an external + /// resource such as a storage cache. + external String get id; + + /// The **`index`** read-only property of the + /// [NavigationDestination] interface returns the + /// [NavigationHistoryEntry.index] value of the destination + /// [NavigationHistoryEntry] if the [NavigateEvent.navigationType] is + /// `traverse`, or `-1` otherwise. + external int get index; + + /// The **`sameDocument`** read-only property of the + /// [NavigationDestination] interface returns `true` if the navigation is to + /// the same `document` as the current [Document] value, or `false` otherwise. + /// + /// This is useful for checking whether the navigation will be same-document + /// or cross-document. + external bool get sameDocument; +} + +/// The **`NavigationCurrentEntryChangeEvent`** interface of the +/// [Navigation API] is the event object for the +/// [Navigation.currententrychange_event] event, which fires when the +/// [Navigation.currentEntry] has changed. +/// +/// This event will fire for same-document navigations (e.g. [Navigation.back] +/// or [Navigation.traverseTo]), replacements (i.e. a [Navigation.navigate] call +/// with `history` set to `replace`), or other calls that change the entry's +/// state (e.g. [Navigation.updateCurrentEntry], or the [History API]'s +/// [History.replaceState]). +/// +/// This event fires after the navigation is committed, meaning that the visible +/// URL has changed and the [NavigationHistoryEntry] update has occurred. It is +/// useful for migrating from usage of older API features like the +/// [Window.hashchange_event] or [Window.popstate_event] events. +/// +/// --- +/// +/// API documentation sourced from +/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/NavigationCurrentEntryChangeEvent). +extension type NavigationCurrentEntryChangeEvent._(JSObject _) + implements Event, JSObject { + external factory NavigationCurrentEntryChangeEvent( + String type, + NavigationCurrentEntryChangeEventInit eventInitDict, + ); + + /// The **`navigationType`** read-only property of the + /// [NavigationCurrentEntryChangeEvent] interface returns the type of the + /// navigation that resulted in the change. The property may be `null` if the + /// change occurs due to [Navigation.updateCurrentEntry]. + external NavigationType? get navigationType; + + /// The **`from`** read-only property of the + /// [NavigationCurrentEntryChangeEvent] interface returns the + /// [NavigationHistoryEntry] that was navigated from. + external NavigationHistoryEntry get from; +} +extension type NavigationCurrentEntryChangeEventInit._(JSObject _) + implements EventInit, JSObject { + external factory NavigationCurrentEntryChangeEventInit({ + bool bubbles, + bool cancelable, + bool composed, + NavigationType? navigationType, + required NavigationHistoryEntry from, + }); + + external NavigationType? get navigationType; + external set navigationType(NavigationType? value); + external NavigationHistoryEntry get from; + external set from(NavigationHistoryEntry value); +} + /// **`PopStateEvent`** is an interface for the [Window.popstate_event] event. /// /// A `popstate` event is dispatched to the window every time the active history @@ -13602,7 +14390,7 @@ extension type PageSwapEvent._(JSObject _) implements Event, JSObject { /// contains a [NavigationActivation] object containing the navigation type /// and current and destination document history entries for a same-origin /// navigation. - external JSObject? get activation; + external NavigationActivation? get activation; /// The **`viewTransition`** read-only property of the [PageRevealEvent] /// interface contains a [ViewTransition] object representing the active view @@ -13614,12 +14402,12 @@ extension type PageSwapEventInit._(JSObject _) implements EventInit, JSObject { bool bubbles, bool cancelable, bool composed, - JSObject? activation, + NavigationActivation? activation, ViewTransition? viewTransition, }); - external JSObject? get activation; - external set activation(JSObject? value); + external NavigationActivation? get activation; + external set activation(NavigationActivation? value); external ViewTransition? get viewTransition; external set viewTransition(ViewTransition? value); } @@ -13905,6 +14693,25 @@ extension type DOMParser._(JSObject _) implements JSObject { ); } +/// The `XMLSerializer` interface provides the [XMLSerializer.serializeToString] +/// method to construct an XML string representing a tree. +/// +/// > [!NOTE] +/// > The resulting XML string is not guaranteed to be well-formed XML. +/// +/// --- +/// +/// API documentation sourced from +/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/XMLSerializer). +extension type XMLSerializer._(JSObject _) implements JSObject { + external factory XMLSerializer(); + + /// The [XMLSerializer] method + /// **`serializeToString()`** constructs a string representing the + /// specified tree in form. + external String serializeToString(Node root); +} + /// The **`Navigator`** interface represents the state and the identity of the /// user agent. It allows scripts to query it and to register themselves to /// carry on some activities. @@ -14155,6 +14962,16 @@ extension type Navigator._(JSObject _) implements JSObject { /// current window's user activation state. external UserActivation get userActivation; + /// The **`login`** read-only property of the [Navigator] interface provides + /// access to the browser's [NavigatorLogin] object, which a federated + /// identity provider (IdP) can use to set its login status when a user signs + /// into or out of the IdP. + /// + /// See + /// [Update login status using the Login Status API](https://developer.mozilla.org/en-US/docs/Web/API/FedCM_API/IDP_integration#update_login_status_using_the_login_status_api) + /// for more details of how this is used. + external NavigatorLogin get login; + /// The **`mediaCapabilities`** read-only property of the [Navigator] /// interface references a [MediaCapabilities] object that can expose /// information about the decoding and encoding capabilities for a given media @@ -14536,6 +15353,11 @@ extension type Navigator._(JSObject _) implements JSObject { /// - : The `marionette.enabled` preference or `--marionette` flag is /// passed. external bool get webdriver; + + /// The **`Navigator.gpu`** read-only property returns the [GPU] object for + /// the current browsing context, which is the entry point for the + /// [WebGPU_API]. + external GPU get gpu; } /// The `PluginArray` interface is used to store a list of [Plugin] objects; @@ -14614,6 +15436,65 @@ extension type MimeType._(JSObject _) implements JSObject { external String get suffixes; external Plugin get enabledPlugin; } +extension type ImageDataSettings._(JSObject _) implements JSObject { + external factory ImageDataSettings({ + PredefinedColorSpace colorSpace, + ImageDataPixelFormat pixelFormat, + }); + + external PredefinedColorSpace get colorSpace; + external set colorSpace(PredefinedColorSpace value); + external ImageDataPixelFormat get pixelFormat; + external set pixelFormat(ImageDataPixelFormat value); +} + +/// The **`ImageData`** interface represents the underlying pixel data of an +/// area of a `canvas` element. +/// +/// It is created using the [ImageData.ImageData] constructor or creator methods +/// on the [CanvasRenderingContext2D] object associated with a canvas: +/// [CanvasRenderingContext2D.createImageData] and +/// [CanvasRenderingContext2D.getImageData]. It can also be used to set a part +/// of the canvas by using [CanvasRenderingContext2D.putImageData]. +/// +/// --- +/// +/// API documentation sourced from +/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/ImageData). +extension type ImageData._(JSObject _) implements JSObject { + external factory ImageData( + JSAny dataOrSw, + int shOrSw, [ + JSAny settingsOrSh, + ImageDataSettings settings, + ]); + + /// The readonly **`ImageData.width`** property returns the number + /// of pixels per row in the [ImageData] object. + external int get width; + + /// The readonly **`ImageData.height`** property returns the number + /// of rows in the [ImageData] object. + external int get height; + + /// The readonly **`ImageData.data`** property returns a + /// `Uint8ClampedArray` that contains the [ImageData] object's + /// pixel data. Data is stored as a one-dimensional array in the RGBA order, + /// with integer + /// values between `0` and `255` (inclusive). + external ImageDataArray get data; + + /// The read-only **`ImageData.colorSpace`** property is a string indicating + /// the color space of the image data. + /// + /// The color space can be set during `ImageData` initialization using either + /// the + /// [`ImageData()`](https://developer.mozilla.org/en-US/docs/Web/API/ImageData/ImageData) + /// constructor or the + /// [`createImageData()`](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/createImageData) + /// method. + external PredefinedColorSpace get colorSpace; +} /// The **`ImageBitmap`** interface represents a bitmap image which can be drawn /// to a `canvas` without undue latency. It can be created from a variety of @@ -15300,23 +16181,6 @@ extension type WorkerGlobalScope._(JSObject _) /// asynchronously access the capabilities of indexed databases. external IDBFactory get indexedDB; - /// @AvailableInWorkers("worker") - /// - /// The **`crypto`** read-only property of the [WorkerGlobalScope] interface - /// returns the [Crypto] object for this worker. This object gives workers - /// access to certain cryptographic related services. - /// - /// Although the property itself is read-only, all of its methods (and the - /// methods of its - /// child object, [SubtleCrypto]) are not read-only, and therefore vulnerable - /// to attack by . - /// - /// Although `crypto` is available on all workers, the returned `Crypto` - /// object only has one usable feature in insecure contexts: the - /// [Crypto.getRandomValues] method. In general, you should use this API only - /// in secure contexts. - external Crypto get crypto; - /// @AvailableInWorkers("worker") /// /// The **`performance`** property of the [WorkerGlobalScope] interface @@ -15365,6 +16229,23 @@ extension type WorkerGlobalScope._(JSObject _) /// the global object, providing the entry point for using the /// [Trusted Types API]. external TrustedTypePolicyFactory get trustedTypes; + + /// @AvailableInWorkers("worker") + /// + /// The **`crypto`** read-only property of the [WorkerGlobalScope] interface + /// returns the [Crypto] object for this worker. This object gives workers + /// access to certain cryptographic related services. + /// + /// Although the property itself is read-only, all of its methods (and the + /// methods of its + /// child object, [SubtleCrypto]) are not read-only, and therefore vulnerable + /// to attack by . + /// + /// Although `crypto` is available on all workers, the returned `Crypto` + /// object only has one usable feature in insecure contexts: the + /// [Crypto.getRandomValues] method. In general, you should use this API only + /// in secure contexts. + external Crypto get crypto; } /// @AvailableInWorkers("dedicated") @@ -15568,17 +16449,17 @@ extension type Worker._(JSObject _) implements EventTarget, JSObject { } extension type WorkerOptions._(JSObject _) implements JSObject { external factory WorkerOptions({ + String name, WorkerType type, RequestCredentials credentials, - String name, }); + external String get name; + external set name(String value); external WorkerType get type; external set type(WorkerType value); external RequestCredentials get credentials; external set credentials(RequestCredentials value); - external String get name; - external set name(String value); } /// The **`SharedWorker`** interface represents a specific kind of worker that @@ -15860,6 +16741,13 @@ extension type WorkerNavigator._(JSObject _) implements JSObject { /// object which provides methods for requesting a new [Lock] object and /// querying for an existing `Lock` object. external LockManager get locks; + + /// @AvailableInWorkers("worker") + /// + /// The **`gpu`** read-only property of the [WorkerNavigator] interface + /// returns the [GPU] object for the current worker context, which is the + /// entry point for the [WebGPU_API]. + external GPU get gpu; } /// @AvailableInWorkers("worker") diff --git a/web/lib/src/dom/image_capture.dart b/web/lib/src/dom/image_capture.dart index a2c3a3b6..0cbb2735 100644 --- a/web/lib/src/dom/image_capture.dart +++ b/web/lib/src/dom/image_capture.dart @@ -16,6 +16,7 @@ library; import 'dart:js_interop'; import 'fileapi.dart'; +import 'html.dart'; import 'mediacapture_streams.dart'; typedef ConstrainPoint2D = JSObject; @@ -53,6 +54,12 @@ extension type ImageCapture._(JSObject _) implements JSObject { /// configuration settings. external JSPromise getPhotoSettings(); + /// The **`grabFrame()`** method of the + /// [ImageCapture] interface takes a snapshot of the live video in a + /// [MediaStreamTrack] and returns a `Promise` that resolves with + /// a [ImageBitmap] containing the snapshot. + external JSPromise grabFrame(); + /// The **`track`** read-only property of the /// [ImageCapture] interface returns a reference to the /// [MediaStreamTrack] passed to the diff --git a/web/lib/src/dom/indexeddb.dart b/web/lib/src/dom/indexeddb.dart index 5b75e3fb..35af9649 100644 --- a/web/lib/src/dom/indexeddb.dart +++ b/web/lib/src/dom/indexeddb.dart @@ -512,7 +512,7 @@ extension type IDBObjectStore._(JSObject _) implements JSObject { /// 2. the [IDBObjectStore.count] method with the same key, which /// will return 1 if the row exists and 0 if it doesn't. external IDBRequest getAll([ - JSAny? query, + JSAny? queryOrOptions, int count, ]); @@ -536,7 +536,7 @@ extension type IDBObjectStore._(JSObject _) implements JSObject { /// method provides a cursor if the record exists, and no cursor if it does /// not. external IDBRequest getAllKeys([ - JSAny? query, + JSAny? queryOrOptions, int count, ]); @@ -730,7 +730,7 @@ extension type IDBIndex._(JSObject _) implements JSObject { /// array of all the objects in an object store, though, you should /// use `getAll()`. external IDBRequest getAll([ - JSAny? query, + JSAny? queryOrOptions, int count, ]); @@ -739,7 +739,7 @@ extension type IDBIndex._(JSObject _) implements JSObject { /// the index, /// setting them as the `result` of the request object. external IDBRequest getAllKeys([ - JSAny? query, + JSAny? queryOrOptions, int count, ]); diff --git a/web/lib/src/dom/intersection_observer.dart b/web/lib/src/dom/intersection_observer.dart index 0edee5e4..9cd54d70 100644 --- a/web/lib/src/dom/intersection_observer.dart +++ b/web/lib/src/dom/intersection_observer.dart @@ -135,6 +135,7 @@ extension type IntersectionObserver._(JSObject _) implements JSObject { /// for a more in-depth look at the root margin and how it works with /// the root's bounding box. external String get rootMargin; + external String get scrollMargin; /// The [IntersectionObserver] interface's read-only /// **`thresholds`** property returns the list of intersection diff --git a/web/lib/src/dom/largest_contentful_paint.dart b/web/lib/src/dom/largest_contentful_paint.dart index d2676af0..40ac2825 100644 --- a/web/lib/src/dom/largest_contentful_paint.dart +++ b/web/lib/src/dom/largest_contentful_paint.dart @@ -31,14 +31,14 @@ extension type LargestContentfulPaint._(JSObject _) /// it returns a JSON representation of the [LargestContentfulPaint] object. external JSObject toJSON(); - /// The **`renderTime`** read-only property of the [LargestContentfulPaint] - /// interface represents the time that the element was rendered to the screen. - external double get renderTime; - /// The **`loadTime`** read-only property of the [LargestContentfulPaint] /// interface returns the time that the element was loaded. external double get loadTime; + /// The **`renderTime`** read-only property of the [LargestContentfulPaint] + /// interface represents the time that the element was rendered to the screen. + external double get renderTime; + /// The **`size`** read-only property of the [LargestContentfulPaint] /// interface returns the intrinsic size of the element that is the largest /// contentful paint. @@ -59,4 +59,6 @@ extension type LargestContentfulPaint._(JSObject _) /// interface returns an object representing the [Element] that is the largest /// contentful paint. external Element? get element; + external double get paintTime; + external double? get presentationTime; } diff --git a/web/lib/src/dom/private_network_access.dart b/web/lib/src/dom/local_network_access.dart similarity index 100% rename from web/lib/src/dom/private_network_access.dart rename to web/lib/src/dom/local_network_access.dart diff --git a/web/lib/src/dom/login_status.dart b/web/lib/src/dom/login_status.dart new file mode 100644 index 00000000..77ba9312 --- /dev/null +++ b/web/lib/src/dom/login_status.dart @@ -0,0 +1,54 @@ +// Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. +// +// API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). +// Attributions and copyright licensing by Mozilla Contributors is licensed +// under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. + +// Generated from Web IDL definitions. + +// ignore_for_file: constant_identifier_names, non_constant_identifier_names + +@JS() +library; + +import 'dart:js_interop'; + +typedef LoginStatus = String; + +/// The **`NavigatorLogin`** interface of the [Federated Credential Management +/// (FedCM) API](https://developer.mozilla.org/en-US/docs/Web/API/FedCM_API) +/// defines login functionality for federated identity providers (IdPs). +/// Specifically, it enables a federated identity provider (IdP) to set its +/// login status when a user signs into or out of the IdP. +/// +/// See +/// [Update login status using the Login Status API](https://developer.mozilla.org/en-US/docs/Web/API/FedCM_API/IDP_integration#update_login_status_using_the_login_status_api) +/// for more details of how this is used. +/// +/// `NavigatorLogin` is accessed via the [Navigator.login] property. +/// +/// --- +/// +/// API documentation sourced from +/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/NavigatorLogin). +extension type NavigatorLogin._(JSObject _) implements JSObject { + /// The **`setStatus()`** method of the [NavigatorLogin] interface sets the + /// login status of a federated identity provider (IdP), when called from the + /// IdP's origin. By this, we mean "whether any users are logged into the IdP + /// on the current browser or not". This should be called by the IdP site + /// following a user login or logout. + /// + /// The browser stores this state for each IdP; the + /// [FedCM API](https://developer.mozilla.org/en-US/docs/Web/API/FedCM_API) + /// API then uses it to reduce the number of requests it makes to the IdP + /// (because it does not need to waste time requesting accounts when there are + /// no users logged in to the IdP). It also mitigates + /// [potential timing attacks](https://github.com/w3c-fedid/FedCM/issues/447). + /// + /// See + /// [Update login status using the Login Status API](https://developer.mozilla.org/en-US/docs/Web/API/FedCM_API/IDP_integration#update_login_status_using_the_login_status_api) + /// for more information about FedCM login status. + external JSPromise setStatus(LoginStatus status); +} diff --git a/web/lib/src/dom/mathml_core.dart b/web/lib/src/dom/mathml_core.dart index 774b5ade..abb3d76b 100644 --- a/web/lib/src/dom/mathml_core.dart +++ b/web/lib/src/dom/mathml_core.dart @@ -281,7 +281,7 @@ extension type MathMLElement._(JSObject _) implements Element, JSObject { /// > /// > The `style` property has the same priority in the CSS cascade as an /// > inline style declaration set via the `style` attribute. - external CSSStyleDeclaration get style; + external CSSStyleProperties get style; /// The **`attributeStyleMap`** read-only property of the [MathMLElement] /// interface returns a live [StylePropertyMap] object that contains a list of @@ -308,6 +308,8 @@ extension type MathMLElement._(JSObject _) implements Element, JSObject { external set onauxclick(EventHandler value); external EventHandler get onbeforeinput; external set onbeforeinput(EventHandler value); + external EventHandler get onbeforematch; + external set onbeforematch(EventHandler value); external EventHandler get onbeforetoggle; external set onbeforetoggle(EventHandler value); external EventHandler get onblur; @@ -324,6 +326,8 @@ extension type MathMLElement._(JSObject _) implements Element, JSObject { external set onclick(EventHandler value); external EventHandler get onclose; external set onclose(EventHandler value); + external EventHandler get oncommand; + external set oncommand(EventHandler value); external EventHandler get oncontextlost; external set oncontextlost(EventHandler value); external EventHandler get oncontextmenu; @@ -466,6 +470,8 @@ extension type MathMLElement._(JSObject _) implements Element, JSObject { external set onpointerdown(EventHandler value); external EventHandler get onpointermove; external set onpointermove(EventHandler value); + external EventHandler get onpointerrawupdate; + external set onpointerrawupdate(EventHandler value); external EventHandler get onpointerup; external set onpointerup(EventHandler value); external EventHandler get onpointercancel; diff --git a/web/lib/src/dom/media_capabilities.dart b/web/lib/src/dom/media_capabilities.dart index 0c72c14b..6e6e4501 100644 --- a/web/lib/src/dom/media_capabilities.dart +++ b/web/lib/src/dom/media_capabilities.dart @@ -176,7 +176,7 @@ extension type MediaCapabilitiesDecodingInfo._(JSObject _) required bool smooth, required bool powerEfficient, required MediaKeySystemAccess? keySystemAccess, - MediaDecodingConfiguration configuration, + required MediaDecodingConfiguration configuration, }); external MediaKeySystemAccess? get keySystemAccess; @@ -190,7 +190,7 @@ extension type MediaCapabilitiesEncodingInfo._(JSObject _) required bool supported, required bool smooth, required bool powerEfficient, - MediaEncodingConfiguration configuration, + required MediaEncodingConfiguration configuration, }); external MediaEncodingConfiguration get configuration; diff --git a/web/lib/src/dom/mediacapture_streams.dart b/web/lib/src/dom/mediacapture_streams.dart index 7543571d..98e49a18 100644 --- a/web/lib/src/dom/mediacapture_streams.dart +++ b/web/lib/src/dom/mediacapture_streams.dart @@ -25,6 +25,7 @@ typedef ConstrainULong = JSAny; typedef ConstrainDouble = JSAny; typedef ConstrainBoolean = JSAny; typedef ConstrainDOMString = JSAny; +typedef ConstrainBooleanOrDOMString = JSAny; typedef MediaStreamTrackState = String; typedef MediaDeviceKind = String; @@ -643,7 +644,7 @@ extension type MediaTrackCapabilities._(JSObject _) implements JSObject { JSArray resizeMode, ULongRange sampleRate, ULongRange sampleSize, - JSArray echoCancellation, + JSArray echoCancellation, JSArray autoGainControl, JSArray noiseSuppression, DoubleRange latency, @@ -688,8 +689,8 @@ extension type MediaTrackCapabilities._(JSObject _) implements JSObject { external set sampleRate(ULongRange value); external ULongRange get sampleSize; external set sampleSize(ULongRange value); - external JSArray get echoCancellation; - external set echoCancellation(JSArray value); + external JSArray get echoCancellation; + external set echoCancellation(JSArray value); external JSArray get autoGainControl; external set autoGainControl(JSArray value); external JSArray get noiseSuppression; @@ -767,7 +768,7 @@ extension type MediaTrackConstraints._(JSObject _) ConstrainDOMString resizeMode, ConstrainULong sampleRate, ConstrainULong sampleSize, - ConstrainBoolean echoCancellation, + ConstrainBooleanOrDOMString echoCancellation, ConstrainBoolean autoGainControl, ConstrainBoolean noiseSuppression, ConstrainDouble latency, @@ -813,7 +814,7 @@ extension type MediaTrackConstraintSet._(JSObject _) implements JSObject { ConstrainDOMString resizeMode, ConstrainULong sampleRate, ConstrainULong sampleSize, - ConstrainBoolean echoCancellation, + ConstrainBooleanOrDOMString echoCancellation, ConstrainBoolean autoGainControl, ConstrainBoolean noiseSuppression, ConstrainDouble latency, @@ -861,8 +862,8 @@ extension type MediaTrackConstraintSet._(JSObject _) implements JSObject { external set sampleRate(ConstrainULong value); external ConstrainULong get sampleSize; external set sampleSize(ConstrainULong value); - external ConstrainBoolean get echoCancellation; - external set echoCancellation(ConstrainBoolean value); + external ConstrainBooleanOrDOMString get echoCancellation; + external set echoCancellation(ConstrainBooleanOrDOMString value); external ConstrainBoolean get autoGainControl; external set autoGainControl(ConstrainBoolean value); external ConstrainBoolean get noiseSuppression; @@ -949,7 +950,7 @@ extension type MediaTrackSettings._(JSObject _) implements JSObject { String resizeMode, int sampleRate, int sampleSize, - bool echoCancellation, + JSAny echoCancellation, bool autoGainControl, bool noiseSuppression, num latency, @@ -979,6 +980,7 @@ extension type MediaTrackSettings._(JSObject _) implements JSObject { String cursor, bool restrictOwnAudio, bool suppressLocalAudioPlayback, + num screenPixelRatio, }); /// The [MediaTrackSettings] dictionary's **`width`** @@ -1152,8 +1154,8 @@ extension type MediaTrackSettings._(JSObject _) implements JSObject { /// [WebRTC](https://developer.mozilla.org/en-US/docs/Web/API/WebRTC_API) /// [RTCPeerConnection] /// will never include this property. - external bool get echoCancellation; - external set echoCancellation(bool value); + external JSAny get echoCancellation; + external set echoCancellation(JSAny value); /// The [MediaTrackSettings] dictionary's /// **`autoGainControl`** property is a Boolean value whose value @@ -1384,6 +1386,8 @@ extension type MediaTrackSettings._(JSObject _) implements JSObject { /// clearer, and also in sync with the conference video. external bool get suppressLocalAudioPlayback; external set suppressLocalAudioPlayback(bool value); + external double get screenPixelRatio; + external set screenPixelRatio(num value); } /// The **`MediaStreamTrackEvent`** interface of the @@ -1681,3 +1685,15 @@ extension type ConstrainDOMStringParameters._(JSObject _) implements JSObject { external JSAny get ideal; external set ideal(JSAny value); } +extension type ConstrainBooleanOrDOMStringParameters._(JSObject _) + implements JSObject { + external factory ConstrainBooleanOrDOMStringParameters({ + JSAny exact, + JSAny ideal, + }); + + external JSAny get exact; + external set exact(JSAny value); + external JSAny get ideal; + external set ideal(JSAny value); +} diff --git a/web/lib/src/dom/mediastream_recording.dart b/web/lib/src/dom/mediastream_recording.dart index 46e5ce0c..0c85971d 100644 --- a/web/lib/src/dom/mediastream_recording.dart +++ b/web/lib/src/dom/mediastream_recording.dart @@ -261,8 +261,11 @@ extension type BlobEvent._(JSObject _) implements Event, JSObject { /// to be zero. external double get timecode; } -extension type BlobEventInit._(JSObject _) implements JSObject { +extension type BlobEventInit._(JSObject _) implements EventInit, JSObject { external factory BlobEventInit({ + bool bubbles, + bool cancelable, + bool composed, required Blob data, DOMHighResTimeStamp timecode, }); diff --git a/web/lib/src/dom/notifications.dart b/web/lib/src/dom/notifications.dart index b787f209..92a285ac 100644 --- a/web/lib/src/dom/notifications.dart +++ b/web/lib/src/dom/notifications.dart @@ -176,6 +176,7 @@ extension type NotificationOptions._(JSObject _) implements JSObject { NotificationDirection dir, String lang, String body, + String navigate, String tag, String image, String icon, @@ -195,6 +196,8 @@ extension type NotificationOptions._(JSObject _) implements JSObject { external set lang(String value); external String get body; external set body(String value); + external String get navigate; + external set navigate(String value); external String get tag; external set tag(String value); external String get image; @@ -222,6 +225,7 @@ extension type NotificationAction._(JSObject _) implements JSObject { external factory NotificationAction({ required String action, required String title, + String navigate, String icon, }); @@ -229,6 +233,8 @@ extension type NotificationAction._(JSObject _) implements JSObject { external set action(String value); external String get title; external set title(String value); + external String get navigate; + external set navigate(String value); external String get icon; external set icon(String value); } diff --git a/web/lib/src/dom/paint_timing.dart b/web/lib/src/dom/paint_timing.dart index bd21ba3c..68a87ffd 100644 --- a/web/lib/src/dom/paint_timing.dart +++ b/web/lib/src/dom/paint_timing.dart @@ -44,4 +44,6 @@ import 'performance_timeline.dart'; /// API documentation sourced from /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/PerformancePaintTiming). extension type PerformancePaintTiming._(JSObject _) - implements PerformanceEntry, JSObject {} + implements PerformanceEntry, JSObject { + external JSObject toJSON(); +} diff --git a/web/lib/src/dom/pointerevents.dart b/web/lib/src/dom/pointerevents.dart index 2c6c7fc7..795eaeea 100644 --- a/web/lib/src/dom/pointerevents.dart +++ b/web/lib/src/dom/pointerevents.dart @@ -324,4 +324,18 @@ extension type PointerEvent._(JSObject _) implements MouseEvent, JSObject { /// for more information about pointer, mouse and touch /// interaction). external bool get isPrimary; + + /// The **`persistentDeviceId`** read-only property of the + /// [PointerEvent] interface is a unique identifier for the pointing device + /// generating the `PointerEvent`. This provides a secure, reliable way to + /// identify multiple pointing devices (such as pens) interacting with the + /// screen simultaneously. + /// + /// A `persistentDeviceId` persists for the lifetime of a browsing session. To + /// avoid the risk of fingerprinting/tracking, pointing devices are assigned a + /// new `persistentDeviceId` at the start of each session. + /// + /// Pointer events whose generating device could not be identified are + /// assigned a `persistentDeviceId` value of `0`. + external int get persistentDeviceId; } diff --git a/web/lib/src/dom/push_api.dart b/web/lib/src/dom/push_api.dart index 78ee4dd3..be3bb2f1 100644 --- a/web/lib/src/dom/push_api.dart +++ b/web/lib/src/dom/push_api.dart @@ -17,6 +17,7 @@ import 'dart:js_interop'; import 'fileapi.dart'; import 'hr_time.dart'; +import 'notifications.dart'; import 'service_workers.dart'; typedef PushMessageDataInit = JSAny; @@ -281,14 +282,37 @@ extension type PushEventInit._(JSObject _) bool bubbles, bool cancelable, bool composed, - PushMessageDataInit data, + PushMessageDataInit? data, + Notification? notification, }); - external PushMessageDataInit get data; - external set data(PushMessageDataInit value); + external PushMessageDataInit? get data; + external set data(PushMessageDataInit? value); + external Notification? get notification; + external set notification(Notification? value); } extension type PushSubscriptionChangeEvent._(JSObject _) implements ExtendableEvent, JSObject { + external factory PushSubscriptionChangeEvent( + String type, [ + PushSubscriptionChangeEventInit eventInitDict, + ]); + external PushSubscription? get newSubscription; external PushSubscription? get oldSubscription; } +extension type PushSubscriptionChangeEventInit._(JSObject _) + implements ExtendableEventInit, JSObject { + external factory PushSubscriptionChangeEventInit({ + bool bubbles, + bool cancelable, + bool composed, + PushSubscription newSubscription, + PushSubscription oldSubscription, + }); + + external PushSubscription get newSubscription; + external set newSubscription(PushSubscription value); + external PushSubscription get oldSubscription; + external set oldSubscription(PushSubscription value); +} diff --git a/web/lib/src/dom/reporting.dart b/web/lib/src/dom/reporting.dart index dfe6ac13..91f40163 100644 --- a/web/lib/src/dom/reporting.dart +++ b/web/lib/src/dom/reporting.dart @@ -36,9 +36,7 @@ typedef ReportingObserverCallback = JSFunction; /// API documentation sourced from /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/ReportBody). extension type ReportBody._(JSObject _) implements JSObject { - /// The **`toJSON()`** method of the [ReportBody] interface is a _serializer_, - /// and returns a JSON representation of the `ReportBody` object. - external JSObject toJSON(); + ReportBody() : _ = JSObject(); } /// The `Report` interface of the @@ -60,21 +58,28 @@ extension type ReportBody._(JSObject _) implements JSObject { /// API documentation sourced from /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/Report). extension type Report._(JSObject _) implements JSObject { - external JSObject toJSON(); + external factory Report({ + String type, + String url, + ReportBody? body, + }); /// The **`type`** read-only property of the [Report] /// interface returns the type of report generated, e.g. `deprecation` or /// `intervention`. external String get type; + external set type(String value); /// The **`url`** read-only property of the [Report] /// interface returns the URL of the document that generated the report. external String get url; + external set url(String value); /// The **`body`** read-only property of the [Report] /// interface returns the body of the report, which is a `ReportBody` object /// containing the detailed report information. external ReportBody? get body; + external set body(ReportBody? value); } /// The `ReportingObserver` interface of the diff --git a/web/lib/src/dom/saa_non_cookie_storage.dart b/web/lib/src/dom/saa_non_cookie_storage.dart index 1ea233b3..b9512a8c 100644 --- a/web/lib/src/dom/saa_non_cookie_storage.dart +++ b/web/lib/src/dom/saa_non_cookie_storage.dart @@ -91,9 +91,9 @@ extension type StorageAccessHandle._(JSObject _) implements JSObject { extension type SharedWorkerOptions._(JSObject _) implements WorkerOptions, JSObject { external factory SharedWorkerOptions({ + String name, WorkerType type, RequestCredentials credentials, - String name, SameSiteCookiesType sameSiteCookies, }); diff --git a/web/lib/src/dom/scheduling_apis.dart b/web/lib/src/dom/scheduling_apis.dart index 64ef4afa..5e2ec509 100644 --- a/web/lib/src/dom/scheduling_apis.dart +++ b/web/lib/src/dom/scheduling_apis.dart @@ -85,6 +85,26 @@ extension type Scheduler._(JSObject _) implements JSObject { SchedulerPostTaskCallback callback, [ SchedulerPostTaskOptions options, ]); + + /// The **`yield()`** method of the [Scheduler] interface is used for yielding + /// to the + /// [main thread](https://developer.mozilla.org/en-US/docs/Glossary/Main_thread) + /// during a task and continuing execution later, with the continuation + /// scheduled as a prioritized task (see the + /// [Prioritized Task Scheduling API](https://developer.mozilla.org/en-US/docs/Web/API/Prioritized_Task_Scheduling_API) + /// for more information). This allows long-running work to be broken up so + /// the browser stays responsive. + /// + /// The task can continue when the promise returned by the method is resolved. + /// The priority for when the promise is resolved defaults to + /// [`"user-visible"`](/en-US/docs/Web/API/Prioritized_Task_Scheduling_API#user-visible), + /// but can inherit a different priority if the `yield()` call occurs within a + /// [Scheduler.postTask] callback. + /// + /// In addition, the continuation of work after the `yield()` call can be + /// canceled if it occurs within a `postTask()` callback and the + /// [task is aborted](https://developer.mozilla.org/en-US/docs/Web/API/Scheduler/postTask#aborting_tasks). + external JSPromise yield(); } /// The **`TaskPriorityChangeEvent`** is the interface for the @@ -189,6 +209,12 @@ extension type TaskController._(JSObject _) /// If the task is immutable, the function call is ignored. external void setPriority(TaskPriority priority); } +extension type TaskSignalAnyInit._(JSObject _) implements JSObject { + external factory TaskSignalAnyInit({JSAny priority}); + + external JSAny get priority; + external set priority(JSAny value); +} /// The **`TaskSignal`** interface of the /// [Prioritized Task Scheduling API](https://developer.mozilla.org/en-US/docs/Web/API/Prioritized_Task_Scheduling_API) @@ -218,6 +244,17 @@ extension type TaskController._(JSObject _) /// API documentation sourced from /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/TaskSignal). extension type TaskSignal._(JSObject _) implements AbortSignal, JSObject { + /// The **`TaskSignal.any()`** static method takes an iterable of + /// [AbortSignal] objects and returns a [TaskSignal]. The returned task signal + /// is aborted when any of the abort signals is aborted. + /// + /// When the task signal is aborted, its [AbortSignal.reason] property will be + /// set to the reason of the first signal that is aborted. + external static TaskSignal any( + JSArray signals, [ + TaskSignalAnyInit init, + ]); + /// The read-only **`priority`** property of the [TaskSignal] interface /// indicates the signal /// [priority](https://developer.mozilla.org/en-US/docs/Web/API/Prioritized_Task_Scheduling_API#task_priorities). diff --git a/web/lib/src/dom/screen_capture.dart b/web/lib/src/dom/screen_capture.dart index f5088b33..a3610155 100644 --- a/web/lib/src/dom/screen_capture.dart +++ b/web/lib/src/dom/screen_capture.dart @@ -17,6 +17,7 @@ import 'dart:js_interop'; typedef SelfCapturePreferenceEnum = String; typedef SystemAudioPreferenceEnum = String; +typedef WindowAudioPreferenceEnum = String; typedef SurfaceSwitchingPreferenceEnum = String; typedef MonitorTypeSurfacesEnum = String; extension type DisplayMediaStreamOptions._(JSObject _) implements JSObject { @@ -26,6 +27,7 @@ extension type DisplayMediaStreamOptions._(JSObject _) implements JSObject { JSObject controller, SelfCapturePreferenceEnum selfBrowserSurface, SystemAudioPreferenceEnum systemAudio, + WindowAudioPreferenceEnum windowAudio, SurfaceSwitchingPreferenceEnum surfaceSwitching, MonitorTypeSurfacesEnum monitorTypeSurfaces, }); @@ -40,6 +42,8 @@ extension type DisplayMediaStreamOptions._(JSObject _) implements JSObject { external set selfBrowserSurface(SelfCapturePreferenceEnum value); external SystemAudioPreferenceEnum get systemAudio; external set systemAudio(SystemAudioPreferenceEnum value); + external WindowAudioPreferenceEnum get windowAudio; + external set windowAudio(WindowAudioPreferenceEnum value); external SurfaceSwitchingPreferenceEnum get surfaceSwitching; external set surfaceSwitching(SurfaceSwitchingPreferenceEnum value); external MonitorTypeSurfacesEnum get monitorTypeSurfaces; diff --git a/web/lib/src/dom/scroll_animations.dart b/web/lib/src/dom/scroll_animations.dart new file mode 100644 index 00000000..3908c6db --- /dev/null +++ b/web/lib/src/dom/scroll_animations.dart @@ -0,0 +1,111 @@ +// Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. +// +// API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). +// Attributions and copyright licensing by Mozilla Contributors is licensed +// under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. + +// Generated from Web IDL definitions. + +// ignore_for_file: constant_identifier_names, non_constant_identifier_names + +@JS() +library; + +import 'dart:js_interop'; + +import 'css_typed_om.dart'; +import 'dom.dart'; +import 'web_animations.dart'; + +typedef ScrollAxis = String; +extension type ScrollTimelineOptions._(JSObject _) implements JSObject { + external factory ScrollTimelineOptions({ + Element? source, + ScrollAxis axis, + }); + + external Element? get source; + external set source(Element? value); + external ScrollAxis get axis; + external set axis(ScrollAxis value); +} + +/// The **`ScrollTimeline`** interface of the [Web Animations API] represents a +/// scroll progress timeline (see +/// [CSS scroll-driven animations](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_scroll-driven_animations) +/// for more details). +/// +/// Pass a `ScrollTimeline` instance to the [Animation.Animation] constructor or +/// the [Element.animate] method to specify it as the timeline that will control +/// the progress of the animation. +/// +/// --- +/// +/// API documentation sourced from +/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/ScrollTimeline). +extension type ScrollTimeline._(JSObject _) + implements AnimationTimeline, JSObject { + external factory ScrollTimeline([ScrollTimelineOptions options]); + + /// The **`source`** read-only property of the + /// [ScrollTimeline] interface returns a reference to the scrollable element + /// (_scroller_) whose scroll position is driving the progress of the timeline + /// and therefore the animation. + external Element? get source; + + /// The **`axis`** read-only property of the + /// [ScrollTimeline] interface returns an enumerated value representing the + /// scroll axis that is driving the progress of the timeline. + external ScrollAxis get axis; +} +extension type ViewTimelineOptions._(JSObject _) implements JSObject { + external factory ViewTimelineOptions({ + Element subject, + ScrollAxis axis, + JSAny inset, + }); + + external Element get subject; + external set subject(Element value); + external ScrollAxis get axis; + external set axis(ScrollAxis value); + external JSAny get inset; + external set inset(JSAny value); +} + +/// The **`ViewTimeline`** interface of the [Web Animations API] represents a +/// view progress timeline (see +/// [CSS scroll-driven animations](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_scroll-driven_animations) +/// for more details). +/// +/// Pass a `ViewTimeline` instance to the [Animation.Animation] constructor or +/// the [Element.animate] method to specify it as the timeline that will control +/// the progress of the animation. +/// +/// --- +/// +/// API documentation sourced from +/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/ViewTimeline). +extension type ViewTimeline._(JSObject _) implements ScrollTimeline, JSObject { + external factory ViewTimeline([ViewTimelineOptions options]); + + /// The **`subject`** read-only property of the [ViewTimeline] interface + /// returns a reference to the subject element whose visibility within its + /// nearest ancestor scrollable element (scroller) is driving the progress of + /// the timeline. + external Element get subject; + + /// The **`startOffset`** read-only property of the [ViewTimeline] interface + /// returns a [CSSNumericValue] representing the starting (0% progress) scroll + /// position of the timeline as an offset from the start of the overflowing + /// section of content in the scroller. + external CSSNumericValue get startOffset; + + /// The **`endOffset`** read-only property of the [ViewTimeline] interface + /// returns a [CSSNumericValue] representing the ending (100% progress) scroll + /// position of the timeline as an offset from the start of the overflowing + /// section of content in the scroller. + external CSSNumericValue get endOffset; +} diff --git a/web/lib/src/dom/secure_payment_confirmation.dart b/web/lib/src/dom/secure_payment_confirmation.dart index 16c6779a..fad80bca 100644 --- a/web/lib/src/dom/secure_payment_confirmation.dart +++ b/web/lib/src/dom/secure_payment_confirmation.dart @@ -16,21 +16,28 @@ library; import 'dart:js_interop'; import 'payment_request.dart'; +import 'webauthn.dart'; extension type AuthenticationExtensionsPaymentInputs._(JSObject _) implements JSObject { external factory AuthenticationExtensionsPaymentInputs({ bool isPayment, + JSArray browserBoundPubKeyCredParams, String rpId, String topOrigin, String payeeName, String payeeOrigin, + JSArray paymentEntitiesLogos, PaymentCurrencyAmount total, PaymentCredentialInstrument instrument, }); external bool get isPayment; external set isPayment(bool value); + external JSArray + get browserBoundPubKeyCredParams; + external set browserBoundPubKeyCredParams( + JSArray value); external String get rpId; external set rpId(String value); external String get topOrigin; @@ -39,16 +46,33 @@ extension type AuthenticationExtensionsPaymentInputs._(JSObject _) external set payeeName(String value); external String get payeeOrigin; external set payeeOrigin(String value); + external JSArray get paymentEntitiesLogos; + external set paymentEntitiesLogos(JSArray value); external PaymentCurrencyAmount get total; external set total(PaymentCurrencyAmount value); external PaymentCredentialInstrument get instrument; external set instrument(PaymentCredentialInstrument value); } +extension type AuthenticationExtensionsPaymentOutputs._(JSObject _) + implements JSObject { + external factory AuthenticationExtensionsPaymentOutputs( + {BrowserBoundSignature browserBoundSignature}); + + external BrowserBoundSignature get browserBoundSignature; + external set browserBoundSignature(BrowserBoundSignature value); +} +extension type BrowserBoundSignature._(JSObject _) implements JSObject { + external factory BrowserBoundSignature({required JSArrayBuffer signature}); + + external JSArrayBuffer get signature; + external set signature(JSArrayBuffer value); +} extension type PaymentCredentialInstrument._(JSObject _) implements JSObject { external factory PaymentCredentialInstrument({ required String displayName, required String icon, bool iconMustBeShown, + String details, }); external String get displayName; @@ -57,4 +81,17 @@ extension type PaymentCredentialInstrument._(JSObject _) implements JSObject { external set icon(String value); external bool get iconMustBeShown; external set iconMustBeShown(bool value); + external String get details; + external set details(String value); +} +extension type PaymentEntityLogo._(JSObject _) implements JSObject { + external factory PaymentEntityLogo({ + required String url, + required String label, + }); + + external String get url; + external set url(String value); + external String get label; + external set label(String value); } diff --git a/web/lib/src/dom/selection_api.dart b/web/lib/src/dom/selection_api.dart index 2bb0a2df..af5693ab 100644 --- a/web/lib/src/dom/selection_api.dart +++ b/web/lib/src/dom/selection_api.dart @@ -80,6 +80,37 @@ extension type Selection._(JSObject _) implements JSObject { /// > This method is an alias for the [Selection.removeAllRanges] method. external void empty(); + /// The **`Selection.getComposedRanges()`** method returns an array of + /// [StaticRange] objects representing the current selection ranges, and can + /// return ranges that potentially cross shadow boundaries. + /// + /// As the selection range endpoints may be within a shadow tree, or even + /// different shadow trees, and because these may be closed, the method cannot + /// by default return nodes from within a shadow tree. + /// If the method needs to return a selection that includes nodes inside + /// shadow trees, then the [ShadowRoot] objects for these trees must be passed + /// as arguments to the method. + /// If a corresponding roots are not provided and the start or endpoint of the + /// selection are within a shadow tree, the returned range is re-scoped to + /// include the host of the shadow root rather than some node with in the + /// root. + /// + /// The returned ranges represent the range at the time that + /// `getComposedRanges()` was called. + /// If the DOM or a shadow DOM is mutated, the selected range is likely to be + /// incorrect. + /// Application code might use a [MutationObserver] to monitor for DOM + /// mutations and then call [Selection.setBaseAndExtent] to update the + /// selection. + /// + /// > [!NOTE] + /// > This method should be used instead of [Selection.getRangeAt] when + /// > selecting ranges that can potentially cross shadow root boundaries. + /// > [Selection.getRangeAt] is not aware of shadow roots. + /// > The returned range is not specified, and varies between browsers. + external JSArray getComposedRanges( + [GetComposedRangesOptions options]); + /// The **`Selection.collapse()`** method collapses the current selection to a /// single point. The document is not modified. If the content is focused and /// editable, the caret will blink there. @@ -272,3 +303,9 @@ extension type Selection._(JSObject _) implements JSObject { /// example, using methods like [Range.selectNode]. external String get direction; } +extension type GetComposedRangesOptions._(JSObject _) implements JSObject { + external factory GetComposedRangesOptions({JSArray shadowRoots}); + + external JSArray get shadowRoots; + external set shadowRoots(JSArray value); +} diff --git a/web/lib/src/dom/service_workers.dart b/web/lib/src/dom/service_workers.dart index 013269ca..45bc126f 100644 --- a/web/lib/src/dom/service_workers.dart +++ b/web/lib/src/dom/service_workers.dart @@ -16,7 +16,7 @@ library; import 'dart:js_interop'; import 'background_sync.dart'; -import 'cookie_store.dart'; +import 'cookiestore.dart'; import 'dom.dart'; import 'fetch.dart'; import 'html.dart'; @@ -130,7 +130,7 @@ extension type ServiceWorkerRegistration._(JSObject _) /// the worker /// bypasses any browser caches if the previous fetch occurred over 24 hours /// ago. - external JSPromise update(); + external JSPromise update(); /// The **`unregister()`** method of the /// [ServiceWorkerRegistration] interface unregisters the service worker @@ -223,6 +223,17 @@ extension type ServiceWorkerRegistration._(JSObject _) /// processes. external SyncManager get sync; + /// @AvailableInWorkers("window_and_service") + /// + /// The **`cookies`** read-only property of the [ServiceWorkerRegistration] + /// interface returns a reference to the [CookieStoreManager] interface, which + /// enables a web app to subscribe to and unsubscribe from cookie change + /// events in a + /// [service worker](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API). + /// This is an entry point for the + /// [Cookie Store API](https://developer.mozilla.org/en-US/docs/Web/API/Cookie_Store_API). + external CookieStoreManager get cookies; + /// The **`pushManager`** read-only property of the /// [ServiceWorkerRegistration] interface returns a reference to the /// [PushManager] interface for managing push subscriptions; this includes @@ -498,6 +509,8 @@ extension type ServiceWorkerGlobalScope._(JSObject _) /// interface returns a reference to the [CookieStore] object associated with /// this service worker. external CookieStore get cookieStore; + external EventHandler get oncookiechange; + external set oncookiechange(EventHandler value); external EventHandler get onnotificationclick; external set onnotificationclick(EventHandler value); external EventHandler get onnotificationclose; diff --git a/web/lib/src/dom/shared_storage.dart b/web/lib/src/dom/shared_storage.dart new file mode 100644 index 00000000..640f4dcf --- /dev/null +++ b/web/lib/src/dom/shared_storage.dart @@ -0,0 +1,255 @@ +// Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. +// +// API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). +// Attributions and copyright licensing by Mozilla Contributors is licensed +// under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. + +// Generated from Web IDL definitions. + +// ignore_for_file: constant_identifier_names, non_constant_identifier_names + +@JS() +library; + +import 'dart:js_interop'; + +import 'fetch.dart'; +import 'html.dart'; +import 'turtledove.dart'; + +typedef SharedStorageResponse = JSAny; + +/// The **`SharedStorageWorklet`** interface of the [Shared Storage API] +/// represents the shared storage worklet for the current origin. +/// +/// `SharedStorageWorklet` does not have its own properties or methods. Rather, +/// it inherits the [Worklet.addModule] method from the [Worklet] interface. +/// This method is used for adding a module. +/// +/// Unlike a regular [Worklet]: +/// +/// - If the calling site has not included the Shared Storage API in a +/// [privacy sandbox enrollment process](https://developer.mozilla.org/en-US/docs/Web/Privacy/Guides/Privacy_sandbox/Enrollment), +/// calls to `sharedStorageWorklet.addModule()` will be rejected. +/// - `SharedStorageWorklet` allows only a single module to be added, for +/// privacy reasons. Even with a successful enrollment, repeated calls to +/// `addModule()` on the same shared storage worklet will be rejected. +/// +/// `SharedStorageWorklet` is accessed via [WindowSharedStorage.worklet]. +/// +/// --- +/// +/// API documentation sourced from +/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/SharedStorageWorklet). +extension type SharedStorageWorklet._(JSObject _) implements Worklet, JSObject { + external JSPromise selectURL( + String name, + JSArray urls, [ + SharedStorageRunOperationMethodOptions options, + ]); + external JSPromise run( + String name, [ + SharedStorageRunOperationMethodOptions options, + ]); +} + +/// The **`SharedStorageWorkletGlobalScope`** interface of the +/// [Shared Storage API] represents the global scope of a [SharedStorageWorklet] +/// module. +/// +/// --- +/// +/// API documentation sourced from +/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/SharedStorageWorkletGlobalScope). +extension type SharedStorageWorkletGlobalScope._(JSObject _) + implements WorkletGlobalScope, JSObject { + /// The **`register()`** method of the + /// [SharedStorageWorkletGlobalScope] interface registers an + /// [SharedStorageOperation] defined inside the current worklet module. + external void register( + String name, + JSFunction operationCtor, + ); + external JSPromise> interestGroups(); + + /// The **`context`** read-only property of the + /// [SharedStorageWorkletGlobalScope] interface contains a + /// [WorkletSharedStorage] object instance, which represents the shared + /// storage for a particular origin as exposed to a worklet context. + external SharedStorage get sharedStorage; +} +extension type SharedStorageUrlWithMetadata._(JSObject _) implements JSObject { + external factory SharedStorageUrlWithMetadata({ + required String url, + JSObject reportingMetadata, + }); + + external String get url; + external set url(String value); + external JSObject get reportingMetadata; + external set reportingMetadata(JSObject value); +} +extension type SharedStorageModifierMethod._(JSObject _) implements JSObject {} +extension type SharedStorageSetMethod._(JSObject _) + implements SharedStorageModifierMethod, JSObject { + external factory SharedStorageSetMethod( + String key, + String value, [ + SharedStorageSetMethodOptions options, + ]); +} +extension type SharedStorageAppendMethod._(JSObject _) + implements SharedStorageModifierMethod, JSObject { + external factory SharedStorageAppendMethod( + String key, + String value, [ + SharedStorageModifierMethodOptions options, + ]); +} +extension type SharedStorageDeleteMethod._(JSObject _) + implements SharedStorageModifierMethod, JSObject { + external factory SharedStorageDeleteMethod( + String key, [ + SharedStorageModifierMethodOptions options, + ]); +} +extension type SharedStorageClearMethod._(JSObject _) + implements SharedStorageModifierMethod, JSObject { + external factory SharedStorageClearMethod( + [SharedStorageModifierMethodOptions options]); +} +extension type SharedStorageModifierMethodOptions._(JSObject _) + implements JSObject { + external factory SharedStorageModifierMethodOptions({String withLock}); + + external String get withLock; + external set withLock(String value); +} +extension type SharedStorageSetMethodOptions._(JSObject _) + implements SharedStorageModifierMethodOptions, JSObject { + external factory SharedStorageSetMethodOptions({ + String withLock, + bool ignoreIfPresent, + }); + + external bool get ignoreIfPresent; + external set ignoreIfPresent(bool value); +} + +/// The **`SharedStorage`** interface of the [Shared Storage API] represents the +/// shared storage for a particular origin, defining methods to write data to +/// the shared storage. +/// +/// `SharedStorage` is the base class for: +/// +/// - [WindowSharedStorage], accessed via [Window.sharedStorage]. +/// - [WorkletSharedStorage], accessed via +/// [SharedStorageWorkletGlobalScope.sharedStorage]. +/// +/// --- +/// +/// API documentation sourced from +/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/SharedStorage). +extension type SharedStorage._(JSObject _) implements JSObject { + external JSPromise get(String key); + + /// The **`set()`** method of the [SharedStorage] interface either stores a + /// new key-value pair in the current origin's shared storage or updates an + /// existing one. + external JSPromise set( + String key, + String value, [ + SharedStorageSetMethodOptions options, + ]); + + /// The **`append()`** method of the [SharedStorage] interface appends a + /// string to the value of an existing key-value pair in the current origin's + /// shared storage. + external JSPromise append( + String key, + String value, [ + SharedStorageModifierMethodOptions options, + ]); + + /// The **`delete()`** method of the [SharedStorage] interface deletes an + /// existing key-value pair from the current origin's shared storage. + external JSPromise delete( + String key, [ + SharedStorageModifierMethodOptions options, + ]); + + /// The **`clear()`** method of the [SharedStorage] interface clears the + /// current origin's shared storage, removing all data from it. + external JSPromise clear( + [SharedStorageModifierMethodOptions options]); + external JSPromise batchUpdate( + JSArray methods, [ + SharedStorageModifierMethodOptions options, + ]); + external JSPromise selectURL( + String name, + JSArray urls, [ + SharedStorageRunOperationMethodOptions options, + ]); + external JSPromise run( + String name, [ + SharedStorageRunOperationMethodOptions options, + ]); + external JSPromise createWorklet( + String moduleURL, [ + SharedStorageWorkletOptions options, + ]); + external SharedStorageWorklet get worklet; +} +extension type SharedStoragePrivateAggregationConfig._(JSObject _) + implements JSObject { + external factory SharedStoragePrivateAggregationConfig({ + String aggregationCoordinatorOrigin, + String contextId, + int filteringIdMaxBytes, + int maxContributions, + }); + + external String get aggregationCoordinatorOrigin; + external set aggregationCoordinatorOrigin(String value); + external String get contextId; + external set contextId(String value); + external int get filteringIdMaxBytes; + external set filteringIdMaxBytes(int value); + external int get maxContributions; + external set maxContributions(int value); +} +extension type SharedStorageRunOperationMethodOptions._(JSObject _) + implements JSObject { + external factory SharedStorageRunOperationMethodOptions({ + JSObject data, + bool resolveToConfig, + bool keepAlive, + SharedStoragePrivateAggregationConfig privateAggregationConfig, + String savedQuery, + }); + + external JSObject get data; + external set data(JSObject value); + external bool get resolveToConfig; + external set resolveToConfig(bool value); + external bool get keepAlive; + external set keepAlive(bool value); + external SharedStoragePrivateAggregationConfig get privateAggregationConfig; + external set privateAggregationConfig( + SharedStoragePrivateAggregationConfig value); + external String get savedQuery; + external set savedQuery(String value); +} +extension type SharedStorageWorkletOptions._(JSObject _) + implements WorkletOptions, JSObject { + external factory SharedStorageWorkletOptions({ + RequestCredentials credentials, + String dataOrigin, + }); + + external String get dataOrigin; + external set dataOrigin(String value); +} diff --git a/web/lib/src/dom/speech_api.dart b/web/lib/src/dom/speech_api.dart index 1850fc59..2ee49a68 100644 --- a/web/lib/src/dom/speech_api.dart +++ b/web/lib/src/dom/speech_api.dart @@ -64,6 +64,14 @@ extension type SpeechRecognition._(JSObject _) /// [SpeechRecognitionResult]. external void abort(); + /// The **`grammars`** property of the + /// [SpeechRecognition] interface returns and sets a collection of + /// [SpeechGrammar] objects that represent the grammars that will be + /// understood + /// by the current `SpeechRecognition`. + external SpeechGrammarList get grammars; + external set grammars(SpeechGrammarList value); + /// The **`lang`** property of the [SpeechRecognition] /// interface returns and sets the language of the current /// `SpeechRecognition`. @@ -135,6 +143,11 @@ extension type SpeechRecognition._(JSObject _) /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognitionErrorEvent). extension type SpeechRecognitionErrorEvent._(JSObject _) implements Event, JSObject { + external factory SpeechRecognitionErrorEvent( + String type, + SpeechRecognitionErrorEventInit eventInitDict, + ); + /// The **`error`** read-only property of the /// [SpeechRecognitionErrorEvent] interface returns the type of error raised. external SpeechRecognitionErrorCode get error; @@ -144,6 +157,21 @@ extension type SpeechRecognitionErrorEvent._(JSObject _) /// error in more detail. external String get message; } +extension type SpeechRecognitionErrorEventInit._(JSObject _) + implements EventInit, JSObject { + external factory SpeechRecognitionErrorEventInit({ + bool bubbles, + bool cancelable, + bool composed, + required SpeechRecognitionErrorCode error, + String message, + }); + + external SpeechRecognitionErrorCode get error; + external set error(SpeechRecognitionErrorCode value); + external String get message; + external set message(String value); +} /// The **`SpeechRecognitionAlternative`** interface of the /// [Web Speech API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Speech_API) @@ -246,6 +274,11 @@ extension type SpeechRecognitionResultList._(JSObject _) implements JSObject { /// API documentation sourced from /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognitionEvent). extension type SpeechRecognitionEvent._(JSObject _) implements Event, JSObject { + external factory SpeechRecognitionEvent( + String type, + SpeechRecognitionEventInit eventInitDict, + ); + /// The **`resultIndex`** read-only property of the /// [SpeechRecognitionEvent] interface returns the lowest index value result /// in @@ -273,6 +306,98 @@ extension type SpeechRecognitionEvent._(JSObject _) implements Event, JSObject { /// will not be overwritten or removed. external SpeechRecognitionResultList get results; } +extension type SpeechRecognitionEventInit._(JSObject _) + implements EventInit, JSObject { + external factory SpeechRecognitionEventInit({ + bool bubbles, + bool cancelable, + bool composed, + int resultIndex, + required SpeechRecognitionResultList results, + }); + + external int get resultIndex; + external set resultIndex(int value); + external SpeechRecognitionResultList get results; + external set results(SpeechRecognitionResultList value); +} + +/// The **`SpeechGrammar`** interface of the +/// [Web Speech API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Speech_API) +/// represents a set of words or patterns of words that we want the recognition +/// service to recognize. +/// +/// Grammar is defined using +/// [JSpeech Grammar Format](https://www.w3.org/TR/jsgf/) (**JSGF**.) Other +/// formats may also be supported in the future. +/// +/// --- +/// +/// API documentation sourced from +/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/SpeechGrammar). +extension type SpeechGrammar._(JSObject _) implements JSObject { + /// The **`src`** property of the [SpeechGrammar] interface + /// is used to get or set a string that contains the grammar within the + /// `SpeechGrammar` object. + external String get src; + external set src(String value); + + /// The optional **`weight`** property of the + /// [SpeechGrammar] interface sets and returns the weight of the + /// `SpeechGrammar` object. + external double get weight; + external set weight(num value); +} + +/// The **`SpeechGrammarList`** interface of the +/// [Web Speech API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Speech_API) +/// represents a list of [SpeechGrammar] objects containing words or patterns of +/// words that we want the recognition service to recognize. +/// +/// Grammar is defined using +/// [JSpeech Grammar Format](https://www.w3.org/TR/jsgf/) (**JSGF**.) Other +/// formats may also be supported in the future. +/// +/// --- +/// +/// API documentation sourced from +/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/SpeechGrammarList). +extension type SpeechGrammarList._(JSObject _) implements JSObject { + external factory SpeechGrammarList(); + + /// The **`item`** getter of the [SpeechGrammarList] + /// interface is a standard getter — it allows individual [SpeechGrammar] + /// objects to be retrieved from the `SpeechGrammarList` using array syntax. + external SpeechGrammar item(int index); + + /// The **`addFromURI()`** method of the + /// [SpeechGrammarList] interface takes a grammar present at a specific URI + /// and + /// adds it to the `SpeechGrammarList` as a new [SpeechGrammar] + /// object. + /// + /// Note that some speech recognition services may support built-in grammars + /// that can be + /// specified by URI. + external void addFromURI( + String src, [ + num weight, + ]); + + /// The **`addFromString()`** method of the + /// [SpeechGrammarList] interface takes a grammar present in a specific + /// string within the code base (e.g. stored in a variable) and adds it to + /// the `SpeechGrammarList` as a new [SpeechGrammar] object. + external void addFromString( + String string, [ + num weight, + ]); + + /// The **`length`** read-only property of the + /// [SpeechGrammarList] interface returns the number of + /// [SpeechGrammar] objects contained in the [SpeechGrammarList]. + external int get length; +} /// The **`SpeechSynthesis`** interface of the /// [Web Speech API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Speech_API) diff --git a/web/lib/src/dom/svg.dart b/web/lib/src/dom/svg.dart index 88cd7eef..673b6a5b 100644 --- a/web/lib/src/dom/svg.dart +++ b/web/lib/src/dom/svg.dart @@ -61,6 +61,8 @@ extension type SVGElement._(JSObject _) implements Element, JSObject { external set onauxclick(EventHandler value); external EventHandler get onbeforeinput; external set onbeforeinput(EventHandler value); + external EventHandler get onbeforematch; + external set onbeforematch(EventHandler value); external EventHandler get onbeforetoggle; external set onbeforetoggle(EventHandler value); external EventHandler get onblur; @@ -77,6 +79,8 @@ extension type SVGElement._(JSObject _) implements Element, JSObject { external set onclick(EventHandler value); external EventHandler get onclose; external set onclose(EventHandler value); + external EventHandler get oncommand; + external set oncommand(EventHandler value); external EventHandler get oncontextlost; external set oncontextlost(EventHandler value); external EventHandler get oncontextmenu; @@ -219,6 +223,8 @@ extension type SVGElement._(JSObject _) implements Element, JSObject { external set onpointerdown(EventHandler value); external EventHandler get onpointermove; external set onpointermove(EventHandler value); + external EventHandler get onpointerrawupdate; + external set onpointerrawupdate(EventHandler value); external EventHandler get onpointerup; external set onpointerup(EventHandler value); external EventHandler get onpointercancel; @@ -322,7 +328,7 @@ extension type SVGElement._(JSObject _) implements Element, JSObject { /// > /// > The `style` property has the same priority in the CSS cascade as an /// > inline style declaration set via the `style` attribute. - external CSSStyleDeclaration get style; + external CSSStyleProperties get style; /// The **`attributeStyleMap`** read-only property of the [SVGElement] /// interface returns a live [StylePropertyMap] object that contains a list of @@ -1079,8 +1085,8 @@ extension type SVGAnimatedString._(JSObject _) implements JSObject { /// BaseVal gets or sets the base value of the given attribute before any /// animations are applied. The base value of the given attribute before /// applying any animations. Setter throws DOMException. - external String get baseVal; - external set baseVal(String value); + external JSAny get baseVal; + external set baseVal(JSAny value); /// The `animVal` read-only property of the [SVGAnimatedString] interface /// contains the same value as the [SVGAnimatedString.baseVal] property. If @@ -1351,7 +1357,7 @@ extension type SVGSVGElement._(JSObject _) /// the SVG document fragment (i.e., the search is restricted to a subset of /// the document tree) for an [Element] whose `id` property matches the /// specified string. - external Element getElementById(String elementId); + external Element? getElementById(String elementId); external int suspendRedraw(int maxWaitMilliseconds); external void unsuspendRedraw(int suspendHandleID); external void unsuspendRedrawAll(); @@ -1765,6 +1771,15 @@ extension type SVGStyleElement._(JSObject _) implements SVGElement, JSObject { external String get title; external set title(String value); + /// The **`SVGStyleElement.disabled`** property can be used to get and set + /// whether the stylesheet is disabled (`true`) or not (`false`). + /// + /// Note that there is no corresponding `disabled` attribute on the [SVG + /// `