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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions web/lib/src/dom.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ 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_animations.dart';
Expand All @@ -33,12 +33,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';
Expand Down Expand Up @@ -75,6 +73,7 @@ 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/mathml_core.dart';
export 'dom/media_capabilities.dart';
export 'dom/media_playback_quality.dart';
Expand Down Expand Up @@ -107,7 +106,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';
Expand All @@ -130,6 +128,7 @@ 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';
Expand All @@ -155,7 +154,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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,30 +128,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")
Expand Down
3 changes: 3 additions & 0 deletions web/lib/src/dom/credential_management.dart
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ extension type CredentialCreationOptions._(JSObject _) implements JSObject {
AbortSignal signal,
PasswordCredentialInit password,
FederatedCredentialInit federated,
DigitalCredentialCreationOptions digital,
PublicKeyCredentialCreationOptions publicKey,
});

Expand All @@ -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);
}
Expand Down
200 changes: 0 additions & 200 deletions web/lib/src/dom/csp.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down
19 changes: 18 additions & 1 deletion web/lib/src/dom/css_view_transitions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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<JSString> get types;
}
extension type StartViewTransitionOptions._(JSObject _) implements JSObject {
external factory StartViewTransitionOptions({
ViewTransitionUpdateCallback? update,
JSArray<JSString>? types,
});

external ViewTransitionUpdateCallback? get update;
external set update(ViewTransitionUpdateCallback? value);
external JSArray<JSString>? get types;
external set types(JSArray<JSString>? value);
}

/// The **`ViewTransition`** interface of the [View Transition API] represents
/// an active view transition, and provides functionality to react to the
Expand Down Expand Up @@ -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 {}
37 changes: 0 additions & 37 deletions web/lib/src/dom/css_view_transitions_2.dart

This file was deleted.

Loading
Loading