Skip to content

Commit b90b63d

Browse files
authored
Update APIs and docs (#345)
1 parent 5caa92e commit b90b63d

File tree

104 files changed

+13666
-4627
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+13666
-4627
lines changed

third_party/mdn/mdn.json

Lines changed: 2613 additions & 1650 deletions
Large diffs are not rendered by default.

web/lib/src/dom.dart

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@ export 'dom/css_contain.dart';
2323
export 'dom/css_counter_styles.dart';
2424
export 'dom/css_font_loading.dart';
2525
export 'dom/css_fonts.dart';
26+
export 'dom/css_fonts_5.dart';
2627
export 'dom/css_highlight_api.dart';
2728
export 'dom/css_masking.dart';
29+
export 'dom/css_nesting.dart';
2830
export 'dom/css_paint_api.dart';
2931
export 'dom/css_properties_values_api.dart';
3032
export 'dom/css_transitions.dart';
@@ -34,7 +36,7 @@ export 'dom/css_view_transitions.dart';
3436
export 'dom/css_view_transitions_2.dart';
3537
export 'dom/cssom.dart';
3638
export 'dom/cssom_view.dart';
37-
export 'dom/digital_identities.dart';
39+
export 'dom/digital_credentials.dart';
3840
export 'dom/dom.dart';
3941
export 'dom/dom_parsing.dart';
4042
export 'dom/encoding.dart';
@@ -114,11 +116,11 @@ export 'dom/requestidlecallback.dart';
114116
export 'dom/resize_observer.dart';
115117
export 'dom/resource_timing.dart';
116118
export 'dom/saa_non_cookie_storage.dart';
117-
export 'dom/sanitizer_api.dart';
118119
export 'dom/scheduling_apis.dart';
119120
export 'dom/screen_capture.dart';
120121
export 'dom/screen_orientation.dart';
121122
export 'dom/screen_wake_lock.dart';
123+
export 'dom/scroll_to_text_fragment.dart';
122124
export 'dom/secure_payment_confirmation.dart';
123125
export 'dom/selection_api.dart';
124126
export 'dom/server_timing.dart';
@@ -146,9 +148,12 @@ export 'dom/web_share.dart';
146148
export 'dom/webaudio.dart';
147149
export 'dom/webauthn.dart';
148150
export 'dom/webcodecs.dart';
151+
export 'dom/webcodecs_aac_codec_registration.dart';
149152
export 'dom/webcodecs_av1_codec_registration.dart';
150153
export 'dom/webcodecs_avc_codec_registration.dart';
154+
export 'dom/webcodecs_flac_codec_registration.dart';
151155
export 'dom/webcodecs_hevc_codec_registration.dart';
156+
export 'dom/webcodecs_opus_codec_registration.dart';
152157
export 'dom/webcodecs_vp9_codec_registration.dart';
153158
export 'dom/webcryptoapi.dart';
154159
export 'dom/webgl1.dart';

web/lib/src/dom/angle_instanced_arrays.dart

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,11 @@ import 'webgl1.dart';
2828
/// in the
2929
/// [WebGL tutorial](https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Tutorial).
3030
///
31-
/// > **Note:** This extension is only available to [WebGLRenderingContext]
32-
/// > contexts. In [WebGL2RenderingContext], the functionality of this extension
33-
/// > is available on the WebGL2 context by default and the constants and
34-
/// > methods are available without the "`ANGLE`" suffix.
31+
/// > [!NOTE]
32+
/// > This extension is only available to [WebGLRenderingContext] contexts. In
33+
/// > [WebGL2RenderingContext], the functionality of this extension is available
34+
/// > on the WebGL2 context by default and the constants and methods are
35+
/// > available without the `ANGLE_` suffix.
3536
/// >
3637
/// > Despite the name "ANGLE", this extension works on any device if the
3738
/// > hardware supports it and not just on Windows when using the ANGLE library.
@@ -51,8 +52,9 @@ extension type ANGLE_instanced_arrays._(JSObject _) implements JSObject {
5152
/// [WebGLRenderingContext.drawArrays] method. In addition, it can execute
5253
/// multiple instances of the range of elements.
5354
///
54-
/// > **Note:** When using [WebGL2RenderingContext], this method is available
55-
/// > as [WebGL2RenderingContext.drawArraysInstanced] by default.
55+
/// > [!NOTE]
56+
/// > When using [WebGL2RenderingContext], this method is available as
57+
/// > [WebGL2RenderingContext.drawArraysInstanced] by default.
5658
external void drawArraysInstancedANGLE(
5759
GLenum mode,
5860
GLint first,
@@ -67,8 +69,9 @@ extension type ANGLE_instanced_arrays._(JSObject _) implements JSObject {
6769
/// [WebGLRenderingContext.drawElements] method. In addition, it can execute
6870
/// multiple instances of a set of elements.
6971
///
70-
/// > **Note:** When using [WebGL2RenderingContext], this method is available
71-
/// > as [WebGL2RenderingContext.drawElementsInstanced] by default.
72+
/// > [!NOTE]
73+
/// > When using [WebGL2RenderingContext], this method is available as
74+
/// > [WebGL2RenderingContext.drawElementsInstanced] by default.
7275
external void drawElementsInstancedANGLE(
7376
GLenum mode,
7477
GLsizei count,
@@ -84,8 +87,9 @@ extension type ANGLE_instanced_arrays._(JSObject _) implements JSObject {
8487
/// [ANGLE_instanced_arrays.drawArraysInstancedANGLE] and
8588
/// [ANGLE_instanced_arrays.drawElementsInstancedANGLE].
8689
///
87-
/// > **Note:** When using [WebGL2RenderingContext], this method is available
88-
/// > as [WebGL2RenderingContext.vertexAttribDivisor] by default.
90+
/// > [!NOTE]
91+
/// > When using [WebGL2RenderingContext], this method is available as
92+
/// > [WebGL2RenderingContext.vertexAttribDivisor] by default.
8993
external void vertexAttribDivisorANGLE(
9094
GLuint index,
9195
GLuint divisor,

web/lib/src/dom/battery_status.dart

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ extension type BatteryManager._(JSObject _) implements EventTarget, JSObject {
4949
/// When its value changes, the [BatteryManager.chargingtimechange_event]
5050
/// event is fired.
5151
///
52-
/// > **Note:** Even if the time returned is precise to the second,
52+
/// > [!NOTE]
53+
/// > Even if the time returned is precise to the second,
5354
/// > browsers round them to a higher interval
5455
/// > (typically to the closest 15 minutes) for privacy reasons.
5556
external double get chargingTime;
@@ -62,8 +63,9 @@ extension type BatteryManager._(JSObject _) implements EventTarget, JSObject {
6263
/// When its value changes, the [BatteryManager.dischargingtimechange_event]
6364
/// event is fired.
6465
///
65-
/// > **Note:** Even if the time returned is precise to the second, browsers
66-
/// > round them to a higher
66+
/// > [!NOTE]
67+
/// > Even if the time returned is precise to the second, browsers round them
68+
/// > to a higher
6769
/// > interval (typically to the closest 15 minutes) for privacy reasons.
6870
external double get dischargingTime;
6971

web/lib/src/dom/clipboard_apis.dart

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,16 @@ extension type ClipboardEvent._(JSObject _) implements Event, JSObject {
6666
/// The **`ClipboardItem`** interface of the
6767
/// [Clipboard API](https://developer.mozilla.org/en-US/docs/Web/API/Clipboard_API)
6868
/// represents a single item format, used when reading or writing clipboard data
69-
/// using [clipboard.read] and [clipboard.write] respectively.
69+
/// using [Clipboard.read] and [Clipboard.write] respectively.
7070
///
71-
/// The benefit of having the **`ClipboardItem`** interface to represent data,
72-
/// is that it enables developers to cope with the varying scope of file types
73-
/// and data.
71+
/// The **`ClipboardItem`** interface enables developers to use a single type to
72+
/// represent a range of different data formats.
7473
///
75-
/// > **Note:** To work with text see the [Clipboard.readText] and
76-
/// > [Clipboard.writeText] methods of the [Clipboard] interface.
74+
/// > [!NOTE]
75+
/// > The `read()` and `write()` methods can be used to work with text strings
76+
/// > and arbitrary data items represented by [Blob] instances. However, if you
77+
/// > are solely working with text, it is more convenient to use the
78+
/// > [Clipboard.readText] and [Clipboard.writeText] methods.
7779
///
7880
/// ---
7981
///
@@ -93,7 +95,7 @@ extension type ClipboardItem._(JSObject _) implements JSObject {
9395
/// [Clipboard API](https://developer.mozilla.org/en-US/docs/Web/API/Clipboard_API)
9496
/// mandates support for plain text, HTML and PNG files.
9597
/// The `supports()` method will always return `true` for these MIME types, so
96-
/// testing them is unnecessary .
98+
/// testing them is unnecessary.
9799
external static bool supports(String type);
98100

99101
/// The **`getType()`** method of the [ClipboardItem] interface returns a
@@ -109,7 +111,7 @@ extension type ClipboardItem._(JSObject _) implements JSObject {
109111
external PresentationStyle get presentationStyle;
110112

111113
/// The read-only **`types`** property of the [ClipboardItem] interface
112-
/// returns an `Array` of available within the [ClipboardItem]
114+
/// returns an `Array` of available within the [ClipboardItem].
113115
external JSArray<JSString> get types;
114116
}
115117
extension type ClipboardItemOptions._(JSObject _) implements JSObject {
@@ -147,29 +149,28 @@ extension type Clipboard._(JSObject _) implements EventTarget, JSObject {
147149
///
148150
/// The method can in theory return arbitrary data (unlike
149151
/// [Clipboard.readText], which can only return text).
150-
/// Browsers commonly support reading text, HTML, and PNG image data — see
151-
/// [browser compatibility](#browser_compatibility) for more information.
152+
/// Browsers commonly support reading text, HTML, and PNG image data.
152153
external JSPromise<ClipboardItems> read(
153154
[ClipboardUnsanitizedFormats formats]);
154155

155156
/// The **`readText()`** method of the [Clipboard] interface returns a
156-
/// `Promise` which fulfils with a copy of the textual contents of the system
157+
/// `Promise` which fulfills with a copy of the textual contents of the system
157158
/// clipboard.
158159
///
159-
/// > **Note:** To read non-text contents from the clipboard, use the
160-
/// > [Clipboard.read] method instead.
160+
/// > [!NOTE]
161+
/// > To read non-text contents from the clipboard, use the [Clipboard.read]
162+
/// > method instead.
161163
/// > You can write text to the clipboard using [Clipboard.writeText].
162164
external JSPromise<JSString> readText();
163165

164166
/// The **`write()`** method of the [Clipboard] interface writes arbitrary
165-
/// data to the clipboard, such as images, fulfilling the returned `Promise`
166-
/// on completion.
167+
/// [ClipboardItem] data such as images and text to the clipboard, fulfilling
168+
/// the returned `Promise` on completion.
167169
/// This can be used to implement cut and copy functionality.
168170
///
169171
/// The method can in theory write arbitrary data (unlike
170172
/// [Clipboard.writeText], which can only write text).
171-
/// Browsers commonly support writing text, HTML, and PNG image data — see
172-
/// [browser compatibility](#browser_compatibility) for more information.
173+
/// Browsers commonly support writing text, HTML, and PNG image data.
173174
external JSPromise<JSAny?> write(ClipboardItems data);
174175

175176
/// The **`writeText()`** method of the [Clipboard] interface writes the

web/lib/src/dom/console.dart

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,12 @@ external $Console get console;
2828
/// documentation, try the methods in your browser's developer tools, although
2929
/// even here, there are some differences between browsers.
3030
///
31-
/// The `console` object can be accessed from any global object. [Window] on
32-
/// browsing scopes and [WorkerGlobalScope] as specific variants in workers via
33-
/// the property console. It's exposed as [Window.console], and can be
34-
/// referenced as `console`. For example:
31+
/// The `console` object is available in any global scope. For example:
3532
///
3633
/// ```js
3734
/// console.log("Failed to open the specified link");
3835
/// ```
3936
///
40-
/// This page documents the [Methods](#methods) available on the `console`
41-
/// object and gives a few [Usage](#usage) examples.
42-
///
4337
/// ---
4438
///
4539
/// API documentation sourced from

web/lib/src/dom/cookie_store.dart

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -199,20 +199,12 @@ extension type CookieStoreManager._(JSObject _) implements JSObject {
199199

200200
/// The **`CookieChangeEvent`** interface of the [Cookie Store API] is the event
201201
/// type of the [CookieStore.change_event] event fired at a [CookieStore] when
202-
/// any cookie changes occur. A cookie change consists of a cookie and a type
203-
/// (either "changed" or "deleted").
202+
/// any cookies are created or deleted.
204203
///
205-
/// Cookie changes that will cause the `CookieChangeEvent` to be dispatched are:
206-
///
207-
/// - A cookie is newly created and not immediately removed. In this case `type`
208-
/// is "changed".
209-
/// - A cookie is newly created and immediately removed. In this case `type` is
210-
/// "deleted".
211-
/// - A cookie is removed. In this case `type` is "deleted".
212-
///
213-
/// > **Note:** A cookie that is replaced due to the insertion of another cookie
214-
/// > with the same name, domain, and path, is ignored and does not trigger a
215-
/// > change event.
204+
/// > [!NOTE]
205+
/// > A cookie that is replaced due to the insertion of another cookie with the
206+
/// > same name, domain, and path, is ignored and does not trigger a change
207+
/// > event.
216208
///
217209
/// ---
218210
///
@@ -226,11 +218,17 @@ extension type CookieChangeEvent._(JSObject _) implements Event, JSObject {
226218

227219
/// The **`changed`** read-only property of the [CookieChangeEvent] interface
228220
/// returns an array of the cookies that have been changed.
221+
///
222+
/// Note that this will exclude cookies which were created with an expiry date
223+
/// in the past, as these cookies are immediately deleted.
229224
external JSArray<CookieListItem> get changed;
230225

231226
/// The **`deleted`** read-only property of the [CookieChangeEvent] interface
232227
/// returns an array of the cookies that have been deleted by the given
233228
/// `CookieChangeEvent` instance.
229+
///
230+
/// Note that this will include cookies which were created with an expiry date
231+
/// in the past, as these cookies are immediately deleted.
234232
external JSArray<CookieListItem> get deleted;
235233
}
236234
extension type CookieChangeEventInit._(JSObject _)
@@ -266,9 +264,10 @@ extension type CookieChangeEventInit._(JSObject _)
266264
/// "deleted"
267265
/// - A cookie is removed. In this case `type` is "deleted".
268266
///
269-
/// > **Note:** A cookie that is replaced due to the insertion of another cookie
270-
/// > with the same name, domain, and path, is ignored and does not trigger a
271-
/// > change event.
267+
/// > [!NOTE]
268+
/// > A cookie that is replaced due to the insertion of another cookie with the
269+
/// > same name, domain, and path, is ignored and does not trigger a change
270+
/// > event.
272271
///
273272
/// ---
274273
///

0 commit comments

Comments
 (0)