Skip to content

Add generated element constructors #185

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Feb 29, 2024
Merged
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
- Include MDN API documentation as class and member dartdoc comments. Docs
sourced from the [MDN Web Docs][] project; attributions and copyright
licensing by Mozilla Contributors is licensed under [CC-BY-SA 2.5][].
- Add a constructor for each Element tag onto their respective Element
interfaces.
- Remove `external` Element constructors that would result in a runtime error.
- Deprecate `createAudioElement` in favor of the `HTMLAudioElement` constructor.

[MDN Web Docs]: https://developer.mozilla.org/en-US/docs/Web
[CC-BY-SA 2.5]: https://creativecommons.org/licenses/by-sa/2.5/
Expand Down
15 changes: 15 additions & 0 deletions lib/src/dom/css_masking.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,34 @@ library;

import 'dart:js_interop';

import 'dom.dart';
import 'svg.dart';

/// The **`SVGClipPathElement`** interface provides access to the properties of
/// elements, as well as methods to manipulate them.
extension type SVGClipPathElement._(JSObject _)
implements SVGElement, JSObject {
/// Creates an [SVGClipPathElement] using the tag 'clipPath'.
SVGClipPathElement()
: _ = document.createElementNS(
'http://www.w3.org/2000/svg',
'clipPath',
);

external SVGAnimatedEnumeration get clipPathUnits;
external SVGAnimatedTransformList get transform;
}

/// The **`SVGMaskElement`** interface provides access to the properties of
/// elements, as well as methods to manipulate them.
extension type SVGMaskElement._(JSObject _) implements SVGElement, JSObject {
/// Creates an [SVGMaskElement] using the tag 'mask'.
SVGMaskElement()
: _ = document.createElementNS(
'http://www.w3.org/2000/svg',
'mask',
);

external SVGAnimatedEnumeration get maskUnits;
external SVGAnimatedEnumeration get maskContentUnits;
external SVGAnimatedLength get x;
Expand Down
Loading