diff --git a/lib/src/dom.dart b/lib/src/dom.dart index 80d20cf5..f4cbf40c 100644 --- a/lib/src/dom.dart +++ b/lib/src/dom.dart @@ -5,6 +5,7 @@ export 'dom/accelerometer.dart'; export 'dom/angle_instanced_arrays.dart'; export 'dom/attribution_reporting_api.dart'; +export 'dom/background_sync.dart'; export 'dom/battery_status.dart'; export 'dom/clipboard_apis.dart'; export 'dom/compression.dart'; @@ -15,8 +16,10 @@ export 'dom/csp.dart'; export 'dom/css_animations.dart'; export 'dom/css_animations_2.dart'; export 'dom/css_cascade.dart'; +export 'dom/css_cascade_6.dart'; export 'dom/css_conditional.dart'; -export 'dom/css_contain_3.dart'; +export 'dom/css_conditional_5.dart'; +export 'dom/css_contain.dart'; export 'dom/css_counter_styles.dart'; export 'dom/css_font_loading.dart'; export 'dom/css_fonts.dart'; @@ -27,8 +30,11 @@ export 'dom/css_properties_values_api.dart'; 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_identities.dart'; export 'dom/dom.dart'; export 'dom/dom_parsing.dart'; export 'dom/encoding.dart'; @@ -73,10 +79,12 @@ export 'dom/media_playback_quality.dart'; export 'dom/media_source.dart'; export 'dom/mediacapture_fromelement.dart'; export 'dom/mediacapture_streams.dart'; +export 'dom/mediacapture_transform.dart'; export 'dom/mediasession.dart'; export 'dom/mediastream_recording.dart'; export 'dom/mst_content_hint.dart'; export 'dom/navigation_timing.dart'; +export 'dom/netinfo.dart'; export 'dom/notifications.dart'; export 'dom/oes_draw_buffers_indexed.dart'; export 'dom/oes_element_index_uint.dart'; @@ -96,6 +104,7 @@ export 'dom/performance_timeline.dart'; 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'; @@ -104,6 +113,8 @@ export 'dom/reporting.dart'; export 'dom/requestidlecallback.dart'; export 'dom/resize_observer.dart'; export 'dom/resource_timing.dart'; +export 'dom/saa_non_cookie_storage.dart'; +export 'dom/sanitizer_api.dart'; export 'dom/scheduling_apis.dart'; export 'dom/screen_capture.dart'; export 'dom/screen_orientation.dart'; diff --git a/lib/src/dom/background_sync.dart b/lib/src/dom/background_sync.dart new file mode 100644 index 00000000..eb9f2b88 --- /dev/null +++ b/lib/src/dom/background_sync.dart @@ -0,0 +1,89 @@ +// Copyright (c) 2024, 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. + +@JS() +library; + +import 'dart:js_interop'; + +import 'service_workers.dart'; + +/// The **`SyncManager`** interface of the [Background Synchronization API] +/// provides an interface for registering and listing sync registrations. +/// +/// --- +/// +/// API documentation sourced from +/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/SyncManager). +extension type SyncManager._(JSObject _) implements JSObject { + /// The **`register()`** method of the [SyncManager] interface registers a + /// synchronization event, triggering a [ServiceWorkerGlobalScope.sync_event] + /// event inside the associated service worker as soon as network connectivity + /// is available. + external JSPromise register(String tag); + + /// The **`getTags()`** method of the + /// [SyncManager] interface returns a list of developer-defined identifiers + /// for + /// `SyncManager` registrations. + external JSPromise> getTags(); +} + +/// @AvailableInWorkers("service") +/// +/// The **`SyncEvent`** interface of the [Background Synchronization API] +/// represents a sync action that is dispatched on the +/// [ServiceWorkerGlobalScope] of a ServiceWorker. +/// +/// This interface inherits from the [ExtendableEvent] interface. +/// +/// --- +/// +/// API documentation sourced from +/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/SyncEvent). +extension type SyncEvent._(JSObject _) implements ExtendableEvent, JSObject { + external factory SyncEvent( + String type, + SyncEventInit init, + ); + + /// @AvailableInWorkers("service") + /// + /// The **`tag`** read-only property of the + /// [SyncEvent] interface returns the developer-defined identifier for + /// this `SyncEvent`. This is the value passed in the `tag` parameter + /// of the [SyncEvent.SyncEvent] constructor. + external String get tag; + + /// @AvailableInWorkers("service") + /// + /// The **`lastChance`** read-only property of the + /// [SyncEvent] interface returns `true` if the user agent will not + /// make further synchronization attempts after the current attempt. This is + /// the value + /// passed in the `lastChance` parameter of the + /// [SyncEvent.SyncEvent] constructor. + external bool get lastChance; +} +extension type SyncEventInit._(JSObject _) + implements ExtendableEventInit, JSObject { + external factory SyncEventInit({ + bool bubbles, + bool cancelable, + bool composed, + required String tag, + bool lastChance, + }); + + external String get tag; + external set tag(String value); + external bool get lastChance; + external set lastChance(bool value); +} diff --git a/lib/src/dom/clipboard_apis.dart b/lib/src/dom/clipboard_apis.dart index 2f3e20c4..2ad520a0 100644 --- a/lib/src/dom/clipboard_apis.dart +++ b/lib/src/dom/clipboard_apis.dart @@ -83,6 +83,8 @@ extension type ClipboardItem._(JSObject _) implements JSObject { ClipboardItemOptions options, ]); + external static bool supports(String type); + /// The **`getType()`** method of the [ClipboardItem] interface returns a /// `Promise` that resolves with a [Blob] of the requested or an error if the /// MIME type is not found. diff --git a/lib/src/dom/credential_management.dart b/lib/src/dom/credential_management.dart index 0156b43f..884db23c 100644 --- a/lib/src/dom/credential_management.dart +++ b/lib/src/dom/credential_management.dart @@ -13,6 +13,7 @@ library; import 'dart:js_interop'; +import 'digital_identities.dart'; import 'dom.dart'; import 'fedcm.dart'; import 'web_otp.dart'; @@ -147,6 +148,7 @@ extension type CredentialRequestOptions._(JSObject _) implements JSObject { IdentityCredentialRequestOptions identity, bool password, FederatedCredentialRequestOptions federated, + DigitalCredentialRequestOptions digital, OTPCredentialRequestOptions otp, PublicKeyCredentialRequestOptions publicKey, }); @@ -161,6 +163,8 @@ extension type CredentialRequestOptions._(JSObject _) implements JSObject { external set password(bool value); external FederatedCredentialRequestOptions get federated; external set federated(FederatedCredentialRequestOptions value); + external DigitalCredentialRequestOptions get digital; + external set digital(DigitalCredentialRequestOptions value); external OTPCredentialRequestOptions get otp; external set otp(OTPCredentialRequestOptions value); external PublicKeyCredentialRequestOptions get publicKey; @@ -168,12 +172,15 @@ extension type CredentialRequestOptions._(JSObject _) implements JSObject { } extension type CredentialCreationOptions._(JSObject _) implements JSObject { external factory CredentialCreationOptions({ + CredentialMediationRequirement mediation, AbortSignal signal, PasswordCredentialInit password, FederatedCredentialInit federated, PublicKeyCredentialCreationOptions publicKey, }); + external CredentialMediationRequirement get mediation; + external set mediation(CredentialMediationRequirement value); external AbortSignal get signal; external set signal(AbortSignal value); external PasswordCredentialInit get password; diff --git a/lib/src/dom/csp.dart b/lib/src/dom/csp.dart index b7a6240a..18fa3064 100644 --- a/lib/src/dom/csp.dart +++ b/lib/src/dom/csp.dart @@ -138,16 +138,16 @@ extension type SecurityPolicyViolationEventInit._(JSObject _) bool bubbles, bool cancelable, bool composed, - required String documentURI, + String documentURI, String referrer, String blockedURI, - required String violatedDirective, - required String effectiveDirective, - required String originalPolicy, + String violatedDirective, + String effectiveDirective, + String originalPolicy, String sourceFile, String sample, - required SecurityPolicyViolationEventDisposition disposition, - required int statusCode, + SecurityPolicyViolationEventDisposition disposition, + int statusCode, int lineNumber, int columnNumber, }); diff --git a/lib/src/dom/css_animations.dart b/lib/src/dom/css_animations.dart index 620cb4ae..7186f2c5 100644 --- a/lib/src/dom/css_animations.dart +++ b/lib/src/dom/css_animations.dart @@ -91,7 +91,7 @@ extension type CSSKeyframeRule._(JSObject _) implements CSSRule, JSObject { /// [CSSStyleDeclaration] interface for the /// [declaration block](https://www.w3.org/TR/1998/REC-CSS2-19980512/syndata.html#block) /// of the [CSSKeyframeRule]. - external CSSStyleDeclaration get style; + external JSObject get style; } /// The **`CSSKeyframesRule`** interface describes an object representing a diff --git a/lib/src/dom/css_cascade_6.dart b/lib/src/dom/css_cascade_6.dart new file mode 100644 index 00000000..82493ded --- /dev/null +++ b/lib/src/dom/css_cascade_6.dart @@ -0,0 +1,34 @@ +// Copyright (c) 2024, 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. + +@JS() +library; + +import 'dart:js_interop'; + +import 'cssom.dart'; + +/// The **`CSSScopeRule`** interface of the +/// [CSS Object Model](https://developer.mozilla.org/en-US/docs/Web/API/CSS_Object_Model) +/// represents a CSS at-rule. +/// +/// --- +/// +/// API documentation sourced from +/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/CSSScopeRule). +extension type CSSScopeRule._(JSObject _) implements CSSGroupingRule, JSObject { + /// The **`start`** property of the [CSSScopeRule] interface returns a string + /// containing the value of the `@scope` at-rule's scope root. + external String? get start; + + /// The **`end`** property of the [CSSScopeRule] interface returns a string + /// containing the value of the `@scope` at-rule's scope limit. + external String? get end; +} diff --git a/lib/src/dom/css_contain_3.dart b/lib/src/dom/css_conditional_5.dart similarity index 100% rename from lib/src/dom/css_contain_3.dart rename to lib/src/dom/css_conditional_5.dart diff --git a/lib/src/dom/css_contain.dart b/lib/src/dom/css_contain.dart new file mode 100644 index 00000000..cc67070c --- /dev/null +++ b/lib/src/dom/css_contain.dart @@ -0,0 +1,65 @@ +// Copyright (c) 2024, 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. + +@JS() +library; + +import 'dart:js_interop'; + +import 'dom.dart'; + +/// The **`ContentVisibilityAutoStateChangeEvent`** interface is the event +/// object for the [element.contentvisibilityautostatechange_event] event, which +/// fires on any element with set on it when it starts or stops being +/// [relevant to the user](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_containment#relevant_to_the_user) +/// and +/// [skipping its contents](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_containment#skips_its_contents). +/// +/// While the element is not relevant (between the start and end events), the +/// user agent skips an element's rendering, including layout and painting. +/// This can significantly improve page rendering speed. +/// The [element.contentvisibilityautostatechange_event] event provides a way +/// for an app's code to also start or stop rendering processes (e.g. drawing on +/// a `canvas`) when they are not needed, thereby conserving processing power. +/// +/// Note that even when hidden from view, element contents will remain +/// semantically relevant (e.g. to assistive technology users), so this signal +/// should not be used to skip significant semantic DOM updates. +/// +/// --- +/// +/// API documentation sourced from +/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/ContentVisibilityAutoStateChangeEvent). +extension type ContentVisibilityAutoStateChangeEvent._(JSObject _) + implements Event, JSObject { + external factory ContentVisibilityAutoStateChangeEvent( + String type, [ + ContentVisibilityAutoStateChangeEventInit eventInitDict, + ]); + + /// The `skipped` read-only property of the + /// [ContentVisibilityAutoStateChangeEvent] interface returns `true` if the + /// user agent [skips the element's + /// contents](/en-US/docs/Web/CSS/CSS_containment#skips_its_contents), or + /// `false` otherwise. + external bool get skipped; +} +extension type ContentVisibilityAutoStateChangeEventInit._(JSObject _) + implements EventInit, JSObject { + external factory ContentVisibilityAutoStateChangeEventInit({ + bool bubbles, + bool cancelable, + bool composed, + bool skipped, + }); + + external bool get skipped; + external set skipped(bool value); +} diff --git a/lib/src/dom/css_fonts.dart b/lib/src/dom/css_fonts.dart index 0482332d..e4b8636e 100644 --- a/lib/src/dom/css_fonts.dart +++ b/lib/src/dom/css_fonts.dart @@ -27,7 +27,7 @@ extension type CSSFontFaceRule._(JSObject _) implements CSSRule, JSObject { /// returns the style information from the /// [at-rule](https://developer.mozilla.org/en-US/docs/Web/CSS/At-rule). This /// will be in the form of a [CSSStyleDeclaration] object. - external CSSStyleDeclaration get style; + external JSObject get style; } /// The **`CSSFontFeatureValuesRule`** interface represents an diff --git a/lib/src/dom/css_transitions_2.dart b/lib/src/dom/css_transitions_2.dart index b419132c..43abb4d2 100644 --- a/lib/src/dom/css_transitions_2.dart +++ b/lib/src/dom/css_transitions_2.dart @@ -13,8 +13,20 @@ library; import 'dart:js_interop'; +import 'cssom.dart'; import 'web_animations.dart'; +/// The **`CSSStartingStyleRule`** interface of the +/// [CSS Object Model](https://developer.mozilla.org/en-US/docs/Web/API/CSS_Object_Model) +/// represents a CSS at-rule. +/// +/// --- +/// +/// API documentation sourced from +/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/CSSStartingStyleRule). +extension type CSSStartingStyleRule._(JSObject _) + implements CSSGroupingRule, JSObject {} + /// The **`CSSTransition`** interface of the [Web Animations API] represents an /// [Animation] object used for a /// [CSS Transition](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_transitions). diff --git a/lib/src/dom/css_view_transitions.dart b/lib/src/dom/css_view_transitions.dart new file mode 100644 index 00000000..19ffa14d --- /dev/null +++ b/lib/src/dom/css_view_transitions.dart @@ -0,0 +1,73 @@ +// Copyright (c) 2024, 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. + +@JS() +library; + +import 'dart:js_interop'; + +typedef UpdateCallback = JSFunction; + +/// The **`ViewTransition`** interface of the [View Transitions API] represents +/// a view transition, and provides functionality to react to the transition +/// reaching different states (e.g. ready to run the animation, or animation +/// finished) or skip the transition altogether. +/// +/// This object type is returned by the [Document.startViewTransition] method. +/// When `startViewTransition()` is invoked, a sequence of steps is followed as +/// explained in +/// [The view transition process](https://developer.mozilla.org/en-US/docs/Web/API/View_Transitions_API#the_view_transition_process). +/// This also explains when the different promises fulfill. +/// +/// --- +/// +/// API documentation sourced from +/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/ViewTransition). +extension type ViewTransition._(JSObject _) implements JSObject { + /// The **`skipTransition()`** method of the + /// [ViewTransition] interface skips the animation part of the view + /// transition, but doesn't skip running the [Document.startViewTransition] + /// callback that updates the DOM. + external void skipTransition(); + + /// The **`updateCallbackDone`** read-only property of the + /// [ViewTransition] interface is a `Promise` that fulfills when the promise + /// returned by the [Document.startViewTransition]'s callback fulfills, or + /// rejects when it rejects. + /// + /// `updateCallbackDone` is useful when you don't care about the + /// success/failure of the transition animation, and just want to know if and + /// when the DOM is updated. + external JSPromise get updateCallbackDone; + + /// The **`ready`** read-only property of the + /// [ViewTransition] interface is a `Promise` that fulfills once the + /// pseudo-element tree is created and the transition animation is about to + /// start. + /// + /// `ready` will reject if the transition cannot begin. This can be due to + /// misconfiguration, for example duplicate s, or if the callback passed to + /// [Document.startViewTransition] throws or returns a promise that rejects. + external JSPromise get ready; + + /// The **`finished`** read-only property of the + /// [ViewTransition] interface is a `Promise` that fulfills once the + /// transition animation is finished, and the new page view is visible and + /// interactive to the user. + /// + /// `finished` only rejects if the callback passed to + /// [Document.startViewTransition]throws or returns a promise that rejects, + /// which indicates that the new state of the page wasn't created. + /// + /// If a transition animation fails to start, or is skipped during the + /// animation using [ViewTransition.skipTransition], the end state is still + /// reached therefore `finished` still fulfills. + external JSPromise get finished; +} diff --git a/lib/src/dom/css_view_transitions_2.dart b/lib/src/dom/css_view_transitions_2.dart new file mode 100644 index 00000000..ea8511b5 --- /dev/null +++ b/lib/src/dom/css_view_transitions_2.dart @@ -0,0 +1,28 @@ +// Copyright (c) 2024, 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. + +@JS() +library; + +import 'dart:js_interop'; + +import 'css_view_transitions.dart'; + +extension type StartViewTransitionOptions._(JSObject _) implements JSObject { + external factory StartViewTransitionOptions({ + UpdateCallback? update, + JSArray? types, + }); + + external UpdateCallback? get update; + external set update(UpdateCallback? value); + external JSArray? get types; + external set types(JSArray? value); +} diff --git a/lib/src/dom/cssom.dart b/lib/src/dom/cssom.dart index d68c3e5d..98cf3037 100644 --- a/lib/src/dom/cssom.dart +++ b/lib/src/dom/cssom.dart @@ -435,7 +435,7 @@ extension type CSSStyleRule._(JSObject _) implements CSSGroupingRule, JSObject { /// for the /// [declaration block](https://www.w3.org/TR/1998/REC-CSS2-19980512/syndata.html#block) /// of the [CSSStyleRule]. - external CSSStyleDeclaration get style; + external JSObject get style; } /// The **`CSSImportRule`** interface represents an @@ -534,7 +534,7 @@ extension type CSSPageRule._(JSObject _) implements CSSGroupingRule, JSObject { /// [CSS declaration block](https://developer.mozilla.org/en-US/docs/Web/API/CSS_Object_Model/CSS_Declaration_Block), /// and exposes style information and various style-related methods and /// properties. - external CSSStyleDeclaration get style; + external JSObject get style; } /// The **`CSSNamespaceRule`** interface describes an object representing a @@ -626,16 +626,6 @@ extension type CSSStyleDeclaration._(JSObject _) implements JSObject { /// block, e.g. a [CSSStyleRule] representing the style for a CSS /// selector. external CSSRule? get parentRule; - - /// The **`cssFloat`** property of the [CSSStyleDeclaration] interface returns - /// the result of invoking [CSSStyleDeclaration.getPropertyValue] with `float` - /// as an argument. - /// - /// When setting, it invokes [CSSStyleDeclaration.setProperty] with `float` as - /// the first argument, and the given value as the second argument. The given - /// value must be a valid value for the `float` property. - external String get cssFloat; - external set cssFloat(String value); external String get accentColor; external set accentColor(String value); external String get alignContent; @@ -648,10 +638,10 @@ extension type CSSStyleDeclaration._(JSObject _) implements JSObject { external set alignmentBaseline(String value); external String get all; external set all(String value); - external String get anchorDefault; - external set anchorDefault(String value); external String get anchorName; external set anchorName(String value); + external String get anchorScope; + external set anchorScope(String value); external String get animation; external set animation(String value); external String get animationComposition; @@ -924,6 +914,8 @@ extension type CSSStyleDeclaration._(JSObject _) implements JSObject { external set captionSide(String value); external String get caret; external set caret(String value); + external String get caretAnimation; + external set caretAnimation(String value); external String get caretColor; external set caretColor(String value); external String get caretShape; @@ -1024,6 +1016,8 @@ extension type CSSStyleDeclaration._(JSObject _) implements JSObject { external set display(String value); external String get dominantBaseline; external set dominantBaseline(String value); + external String get dynamicRangeLimit; + external set dynamicRangeLimit(String value); external String get emptyCells; external set emptyCells(String value); external String get fieldSizing; @@ -1238,8 +1232,6 @@ extension type CSSStyleDeclaration._(JSObject _) implements JSObject { external set justifyItems(String value); external String get justifySelf; external set justifySelf(String value); - external String get layoutOrder; - external set layoutOrder(String value); external String get left; external set left(String value); external String get letterSpacing; @@ -1512,22 +1504,24 @@ extension type CSSStyleDeclaration._(JSObject _) implements JSObject { external set pointerEvents(String value); external String get position; external set position(String value); - external String get positionFallbackBounds; - external set positionFallbackBounds(String value); - external String get positionTryFinal; - external set positionTryFinal(String value); + external String get positionAnchor; + external set positionAnchor(String value); + external String get positionTry; + external set positionTry(String value); external String get positionTryOptions; external set positionTryOptions(String value); external String get positionTryOrder; external set positionTryOrder(String value); + external String get positionVisibility; + external set positionVisibility(String value); external String get printColorAdjust; external set printColorAdjust(String value); external String get quotes; external set quotes(String value); external String get r; external set r(String value); - external String get readingOrder; - external set readingOrder(String value); + external String get readingFlow; + external set readingFlow(String value); external String get regionFragment; external set regionFragment(String value); external String get resize; @@ -1842,6 +1836,8 @@ extension type CSSStyleDeclaration._(JSObject _) implements JSObject { external set viewTimelineInset(String value); external String get viewTimelineName; external set viewTimelineName(String value); + external String get viewTransitionClass; + external set viewTransitionClass(String value); external String get viewTransitionName; external set viewTransitionName(String value); external String get visibility; diff --git a/lib/src/dom/cssom_view.dart b/lib/src/dom/cssom_view.dart index 5d9ad5a8..56faaabd 100644 --- a/lib/src/dom/cssom_view.dart +++ b/lib/src/dom/cssom_view.dart @@ -191,6 +191,13 @@ extension type Screen._(JSObject _) implements JSObject { /// [Screen] interface returns the current orientation of the screen. external ScreenOrientation get orientation; } +extension type CaretPositionFromPointOptions._(JSObject _) implements JSObject { + external factory CaretPositionFromPointOptions( + {JSArray shadowRoots}); + + external JSArray get shadowRoots; + external set shadowRoots(JSArray value); +} extension type ScrollIntoViewOptions._(JSObject _) implements ScrollOptions, JSObject { external factory ScrollIntoViewOptions({ diff --git a/lib/src/dom/digital_identities.dart b/lib/src/dom/digital_identities.dart new file mode 100644 index 00000000..bcc6f856 --- /dev/null +++ b/lib/src/dom/digital_identities.dart @@ -0,0 +1,34 @@ +// Copyright (c) 2024, 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. + +@JS() +library; + +import 'dart:js_interop'; + +extension type DigitalCredentialRequestOptions._(JSObject _) + implements JSObject { + external factory DigitalCredentialRequestOptions( + {JSArray providers}); + + external JSArray get providers; + external set providers(JSArray value); +} +extension type IdentityRequestProvider._(JSObject _) implements JSObject { + external factory IdentityRequestProvider({ + required String protocol, + required JSObject request, + }); + + external String get protocol; + external set protocol(String value); + external JSObject get request; + external set request(JSObject value); +} diff --git a/lib/src/dom/dom.dart b/lib/src/dom/dom.dart index a7fdef5a..082543f8 100644 --- a/lib/src/dom/dom.dart +++ b/lib/src/dom/dom.dart @@ -15,11 +15,13 @@ import 'dart:js_interop'; import 'css_font_loading.dart'; import 'css_typed_om.dart'; +import 'css_view_transitions.dart'; import 'cssom.dart'; import 'cssom_view.dart'; import 'fullscreen.dart'; import 'geometry.dart'; import 'html.dart'; +import 'pointerlock.dart'; import 'selection_api.dart'; import 'svg.dart'; import 'web_animations.dart'; @@ -1245,6 +1247,17 @@ external Document get document; extension type Document._(JSObject _) implements Node, JSObject { external factory Document(); + external static Document parseHTMLUnsafe(JSAny html); + + /// The **`startViewTransition()`** method of the [Document] interface starts + /// a new view transition and returns a [ViewTransition] object to represent + /// it. + /// + /// When `startViewTransition()` is invoked, a sequence of steps is followed + /// as explained in + /// [The view transition process](https://developer.mozilla.org/en-US/docs/Web/API/View_Transitions_API#the_view_transition_process). + external ViewTransition startViewTransition([JSObject callbackOptions]); + /// The **`elementFromPoint()`** /// method, available on the [Document] object, returns the topmost [Element] /// at the specified coordinates @@ -1295,8 +1308,9 @@ extension type Document._(JSObject _) implements Node, JSObject { /// caret's character offset within that node. external JSObject? caretPositionFromPoint( num x, - num y, - ); + num y, [ + CaretPositionFromPointOptions options, + ]); /// The **`getElementsByTagName`** method of /// [Document] interface returns an @@ -1522,7 +1536,7 @@ extension type Document._(JSObject _) implements Node, JSObject { /// > calling `document.write()` on a closed (loaded) document automatically /// > calls `document.open()`, /// > [which will clear the document](https://developer.mozilla.org/en-US/docs/Web/API/Document/open#notes). - external void write(String text); + external void write(JSAny text); /// > **Warning:** Use of the `document.writeln()` method is strongly /// > discouraged. @@ -1549,7 +1563,7 @@ extension type Document._(JSObject _) implements Node, JSObject { /// > any existing code that is still using it. /// /// Writes a string of text followed by a newline character to a document. - external void writeln(String text); + external void writeln(JSAny text); /// The **`hasFocus()`** method of the [Document] interface returns a boolean /// value indicating whether the document or any element inside the document @@ -1628,6 +1642,19 @@ extension type Document._(JSObject _) implements Node, JSObject { /// [Document.pointerlockerror_event] events. external void exitPointerLock(); + /// The **`hasUnpartitionedCookieAccess()`** method of the [Document] + /// interface returns a `Promise` that resolves with a boolean value + /// indicating whether the document has access to + /// [third-party](https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies#third-party_cookies), + /// [unpartitioned](https://developer.mozilla.org/en-US/docs/Web/API/Storage_Access_API#unpartitioned_versus_partitioned_cookies) + /// cookies. + /// + /// This method is part of the + /// [Storage Access API](https://developer.mozilla.org/en-US/docs/Web/API/Storage_Access_API). + /// + /// This method is a new name for [Document.hasStorageAccess]. + external JSPromise hasUnpartitionedCookieAccess(); + /// The **`getSelection()`** method of /// the [Document] interface returns a [Selection] /// object representing the range of text selected by the user, or the current @@ -2693,6 +2720,22 @@ extension type DocumentFragment._(JSObject _) implements Node, JSObject { /// API documentation sourced from /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/ShadowRoot). extension type ShadowRoot._(JSObject _) implements DocumentFragment, JSObject { + external void setHTMLUnsafe(JSAny html); + + /// The **`getHTML()`** method of the [ShadowRoot] interface is used to + /// serialize a shadow root's DOM to an HTML string. + /// + /// The method provides an options argument that enables the serialization of + /// child nodes that are shadow roots. + /// The options can be used to include nested shadow roots that have been set + /// as [ShadowRoot.serializable], and/or a specified array of [ShadowRoot] + /// objects, which may be either open or closed. + /// + /// Without arguments, child nodes that are shadow roots are not serialized, + /// and this method behaves in the same way as reading the value of + /// [Element.innerHTML]. + external String getHTML([GetHTMLOptions options]); + /// The **`getAnimations()`** method of the [ShadowRoot] interface /// returns an array of all [Animation] objects currently in effect whose /// target elements are descendants of the shadow tree. This array includes @@ -2768,6 +2811,24 @@ extension type ShadowRoot._(JSObject _) implements DocumentFragment, JSObject { /// attach a shadow root. external bool get clonable; + /// The **`serializable`** read-only property of the [ShadowRoot] interface + /// returns `true` if the shadow root is serializable. + /// + /// If set, the shadow root may be serialized by calling the [Element.getHTML] + /// or [ShadowRoot.getHTML] methods with the `options.serializableShadowRoots` + /// parameter set `true`. + /// + /// The serializable property of a shadow root is specified when the shadow + /// root is created, either declaratively by adding the + /// [`shadowrootserializable`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/template#shadowrootserializable) + /// attribute on a `