Skip to content

Commit 6f70ffa

Browse files
sigmundchCommit Queue
authored andcommitted
[dart:html] Disallow extending html elements.
This change removes the `.created` constructor in the html class hierarchy. These classes now only offer public factory constructors. As a result, developers will no longer be able to extend these classes in their libraries. This is a breaking change, however we don't expect there to be as much use of this feature (extending html element classes). In particular, the ability to extend html elements was intended for web components. Dart only ever supported the 0.5 spec of web components, which is old and long deprecated. Previously, in Dart 3.0, we removed APIs used to register custom elements from `dart:html`, so the ability to extend html elements has not been useful since then. For more details see #53264 CoreLibraryReviewExempt: ddc/dart2js-specific library. Change-Id: I43d8c9ae99dc83545e70e1f3b9dfc9f1b274a5c7 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321741 Reviewed-by: Lasse Nielsen <[email protected]> Reviewed-by: Srujan Gaddam <[email protected]> Reviewed-by: Stephen Adams <[email protected]> Commit-Queue: Srujan Gaddam <[email protected]>
1 parent 4b7fef5 commit 6f70ffa

File tree

10 files changed

+89
-1018
lines changed

10 files changed

+89
-1018
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,17 @@
88

99
- Added `Iterable.withIterator` constructor.
1010

11+
#### `dart:html`
12+
13+
- **Breaking change**: Native classes in `dart:html`, like `HtmlElement`, can no
14+
longer be extended. Long ago, to support custom elements, element classes
15+
exposed a `.created` constructor that adhered to the v0.5 spec of web
16+
components. On this release, those constructors has been removed and with that
17+
change, the classes can no longer be extended. In a future change, they may be
18+
marked as interface classes as well. This is a follow up from an earlier
19+
breaking change in 3.0.0 that removed the `registerElement` APIs. See
20+
[#53264](https://github.com/dart-lang/sdk/issues/53264) for details.
21+
1122
### Tools
1223

1324
#### Analyzer

pkg/compiler/test/inlining/data/native.dart

Lines changed: 0 additions & 73 deletions
This file was deleted.

0 commit comments

Comments
 (0)