diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9ed8ed72..8968778b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -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/
diff --git a/lib/src/dom/css_masking.dart b/lib/src/dom/css_masking.dart
index e64944be..82826801 100644
--- a/lib/src/dom/css_masking.dart
+++ b/lib/src/dom/css_masking.dart
@@ -13,12 +13,20 @@ 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;
}
@@ -26,6 +34,13 @@ extension type SVGClipPathElement._(JSObject _)
/// 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;
diff --git a/lib/src/dom/filter_effects.dart b/lib/src/dom/filter_effects.dart
index c39a94b0..dac019c4 100644
--- a/lib/src/dom/filter_effects.dart
+++ b/lib/src/dom/filter_effects.dart
@@ -13,11 +13,19 @@ library;
import 'dart:js_interop';
+import 'dom.dart';
import 'svg.dart';
/// The **`SVGFilterElement`** interface provides access to the properties of
/// elements, as well as methods to manipulate them.
extension type SVGFilterElement._(JSObject _) implements SVGElement, JSObject {
+ /// Creates an [SVGFilterElement] using the tag 'filter'.
+ SVGFilterElement()
+ : _ = document.createElementNS(
+ 'http://www.w3.org/2000/svg',
+ 'filter',
+ );
+
external SVGAnimatedEnumeration get filterUnits;
external SVGAnimatedEnumeration get primitiveUnits;
external SVGAnimatedLength get x;
@@ -29,6 +37,13 @@ extension type SVGFilterElement._(JSObject _) implements SVGElement, JSObject {
/// The **`SVGFEBlendElement`** interface corresponds to the element.
extension type SVGFEBlendElement._(JSObject _) implements SVGElement, JSObject {
+ /// Creates an [SVGFEBlendElement] using the tag 'feBlend'.
+ SVGFEBlendElement()
+ : _ = document.createElementNS(
+ 'http://www.w3.org/2000/svg',
+ 'feBlend',
+ );
+
external static int get SVG_FEBLEND_MODE_UNKNOWN;
external static int get SVG_FEBLEND_MODE_NORMAL;
external static int get SVG_FEBLEND_MODE_MULTIPLY;
@@ -59,6 +74,13 @@ extension type SVGFEBlendElement._(JSObject _) implements SVGElement, JSObject {
/// The **`SVGFEColorMatrixElement`** interface corresponds to the element.
extension type SVGFEColorMatrixElement._(JSObject _)
implements SVGElement, JSObject {
+ /// Creates an [SVGFEColorMatrixElement] using the tag 'feColorMatrix'.
+ SVGFEColorMatrixElement()
+ : _ = document.createElementNS(
+ 'http://www.w3.org/2000/svg',
+ 'feColorMatrix',
+ );
+
external static int get SVG_FECOLORMATRIX_TYPE_UNKNOWN;
external static int get SVG_FECOLORMATRIX_TYPE_MATRIX;
external static int get SVG_FECOLORMATRIX_TYPE_SATURATE;
@@ -78,6 +100,14 @@ extension type SVGFEColorMatrixElement._(JSObject _)
/// element.
extension type SVGFEComponentTransferElement._(JSObject _)
implements SVGElement, JSObject {
+ /// Creates an [SVGFEComponentTransferElement] using the tag
+ /// 'feComponentTransfer'.
+ SVGFEComponentTransferElement()
+ : _ = document.createElementNS(
+ 'http://www.w3.org/2000/svg',
+ 'feComponentTransfer',
+ );
+
external SVGAnimatedString get in1;
external SVGAnimatedLength get x;
external SVGAnimatedLength get y;
@@ -107,23 +137,58 @@ extension type SVGComponentTransferFunctionElement._(JSObject _)
/// The **`SVGFEFuncRElement`** interface corresponds to the element.
extension type SVGFEFuncRElement._(JSObject _)
- implements SVGComponentTransferFunctionElement, JSObject {}
+ implements SVGComponentTransferFunctionElement, JSObject {
+ /// Creates an [SVGFEFuncRElement] using the tag 'feFuncR'.
+ SVGFEFuncRElement()
+ : _ = document.createElementNS(
+ 'http://www.w3.org/2000/svg',
+ 'feFuncR',
+ );
+}
/// The **`SVGFEFuncGElement`** interface corresponds to the element.
extension type SVGFEFuncGElement._(JSObject _)
- implements SVGComponentTransferFunctionElement, JSObject {}
+ implements SVGComponentTransferFunctionElement, JSObject {
+ /// Creates an [SVGFEFuncGElement] using the tag 'feFuncG'.
+ SVGFEFuncGElement()
+ : _ = document.createElementNS(
+ 'http://www.w3.org/2000/svg',
+ 'feFuncG',
+ );
+}
/// The **`SVGFEFuncBElement`** interface corresponds to the element.
extension type SVGFEFuncBElement._(JSObject _)
- implements SVGComponentTransferFunctionElement, JSObject {}
+ implements SVGComponentTransferFunctionElement, JSObject {
+ /// Creates an [SVGFEFuncBElement] using the tag 'feFuncB'.
+ SVGFEFuncBElement()
+ : _ = document.createElementNS(
+ 'http://www.w3.org/2000/svg',
+ 'feFuncB',
+ );
+}
/// The **`SVGFEFuncAElement`** interface corresponds to the element.
extension type SVGFEFuncAElement._(JSObject _)
- implements SVGComponentTransferFunctionElement, JSObject {}
+ implements SVGComponentTransferFunctionElement, JSObject {
+ /// Creates an [SVGFEFuncAElement] using the tag 'feFuncA'.
+ SVGFEFuncAElement()
+ : _ = document.createElementNS(
+ 'http://www.w3.org/2000/svg',
+ 'feFuncA',
+ );
+}
/// The **`SVGFECompositeElement`** interface corresponds to the element.
extension type SVGFECompositeElement._(JSObject _)
implements SVGElement, JSObject {
+ /// Creates an [SVGFECompositeElement] using the tag 'feComposite'.
+ SVGFECompositeElement()
+ : _ = document.createElementNS(
+ 'http://www.w3.org/2000/svg',
+ 'feComposite',
+ );
+
external static int get SVG_FECOMPOSITE_OPERATOR_UNKNOWN;
external static int get SVG_FECOMPOSITE_OPERATOR_OVER;
external static int get SVG_FECOMPOSITE_OPERATOR_IN;
@@ -148,6 +213,13 @@ extension type SVGFECompositeElement._(JSObject _)
/// The **`SVGFEConvolveMatrixElement`** interface corresponds to the element.
extension type SVGFEConvolveMatrixElement._(JSObject _)
implements SVGElement, JSObject {
+ /// Creates an [SVGFEConvolveMatrixElement] using the tag 'feConvolveMatrix'.
+ SVGFEConvolveMatrixElement()
+ : _ = document.createElementNS(
+ 'http://www.w3.org/2000/svg',
+ 'feConvolveMatrix',
+ );
+
external static int get SVG_EDGEMODE_UNKNOWN;
external static int get SVG_EDGEMODE_DUPLICATE;
external static int get SVG_EDGEMODE_WRAP;
@@ -174,6 +246,14 @@ extension type SVGFEConvolveMatrixElement._(JSObject _)
/// The **`SVGFEDiffuseLightingElement`** interface corresponds to the element.
extension type SVGFEDiffuseLightingElement._(JSObject _)
implements SVGElement, JSObject {
+ /// Creates an [SVGFEDiffuseLightingElement] using the tag
+ /// 'feDiffuseLighting'.
+ SVGFEDiffuseLightingElement()
+ : _ = document.createElementNS(
+ 'http://www.w3.org/2000/svg',
+ 'feDiffuseLighting',
+ );
+
external SVGAnimatedString get in1;
external SVGAnimatedNumber get surfaceScale;
external SVGAnimatedNumber get diffuseConstant;
@@ -189,6 +269,13 @@ extension type SVGFEDiffuseLightingElement._(JSObject _)
/// The **`SVGFEDistantLightElement`** interface corresponds to the element.
extension type SVGFEDistantLightElement._(JSObject _)
implements SVGElement, JSObject {
+ /// Creates an [SVGFEDistantLightElement] using the tag 'feDistantLight'.
+ SVGFEDistantLightElement()
+ : _ = document.createElementNS(
+ 'http://www.w3.org/2000/svg',
+ 'feDistantLight',
+ );
+
external SVGAnimatedNumber get azimuth;
external SVGAnimatedNumber get elevation;
}
@@ -196,6 +283,13 @@ extension type SVGFEDistantLightElement._(JSObject _)
/// The **`SVGFEPointLightElement`** interface corresponds to the element.
extension type SVGFEPointLightElement._(JSObject _)
implements SVGElement, JSObject {
+ /// Creates an [SVGFEPointLightElement] using the tag 'fePointLight'.
+ SVGFEPointLightElement()
+ : _ = document.createElementNS(
+ 'http://www.w3.org/2000/svg',
+ 'fePointLight',
+ );
+
external SVGAnimatedNumber get x;
external SVGAnimatedNumber get y;
external SVGAnimatedNumber get z;
@@ -204,6 +298,13 @@ extension type SVGFEPointLightElement._(JSObject _)
/// The **`SVGFESpotLightElement`** interface corresponds to the element.
extension type SVGFESpotLightElement._(JSObject _)
implements SVGElement, JSObject {
+ /// Creates an [SVGFESpotLightElement] using the tag 'feSpotLight'.
+ SVGFESpotLightElement()
+ : _ = document.createElementNS(
+ 'http://www.w3.org/2000/svg',
+ 'feSpotLight',
+ );
+
external SVGAnimatedNumber get x;
external SVGAnimatedNumber get y;
external SVGAnimatedNumber get z;
@@ -217,6 +318,14 @@ extension type SVGFESpotLightElement._(JSObject _)
/// The **`SVGFEDisplacementMapElement`** interface corresponds to the element.
extension type SVGFEDisplacementMapElement._(JSObject _)
implements SVGElement, JSObject {
+ /// Creates an [SVGFEDisplacementMapElement] using the tag
+ /// 'feDisplacementMap'.
+ SVGFEDisplacementMapElement()
+ : _ = document.createElementNS(
+ 'http://www.w3.org/2000/svg',
+ 'feDisplacementMap',
+ );
+
external static int get SVG_CHANNEL_UNKNOWN;
external static int get SVG_CHANNEL_R;
external static int get SVG_CHANNEL_G;
@@ -237,6 +346,13 @@ extension type SVGFEDisplacementMapElement._(JSObject _)
/// The **`SVGFEDropShadowElement`** interface corresponds to the element.
extension type SVGFEDropShadowElement._(JSObject _)
implements SVGElement, JSObject {
+ /// Creates an [SVGFEDropShadowElement] using the tag 'feDropShadow'.
+ SVGFEDropShadowElement()
+ : _ = document.createElementNS(
+ 'http://www.w3.org/2000/svg',
+ 'feDropShadow',
+ );
+
external void setStdDeviation(
num stdDeviationX,
num stdDeviationY,
@@ -255,6 +371,13 @@ extension type SVGFEDropShadowElement._(JSObject _)
/// The **`SVGFEFloodElement`** interface corresponds to the element.
extension type SVGFEFloodElement._(JSObject _) implements SVGElement, JSObject {
+ /// Creates an [SVGFEFloodElement] using the tag 'feFlood'.
+ SVGFEFloodElement()
+ : _ = document.createElementNS(
+ 'http://www.w3.org/2000/svg',
+ 'feFlood',
+ );
+
external SVGAnimatedLength get x;
external SVGAnimatedLength get y;
external SVGAnimatedLength get width;
@@ -265,6 +388,13 @@ extension type SVGFEFloodElement._(JSObject _) implements SVGElement, JSObject {
/// The **`SVGFEGaussianBlurElement`** interface corresponds to the element.
extension type SVGFEGaussianBlurElement._(JSObject _)
implements SVGElement, JSObject {
+ /// Creates an [SVGFEGaussianBlurElement] using the tag 'feGaussianBlur'.
+ SVGFEGaussianBlurElement()
+ : _ = document.createElementNS(
+ 'http://www.w3.org/2000/svg',
+ 'feGaussianBlur',
+ );
+
external static int get SVG_EDGEMODE_UNKNOWN;
external static int get SVG_EDGEMODE_DUPLICATE;
external static int get SVG_EDGEMODE_WRAP;
@@ -286,6 +416,13 @@ extension type SVGFEGaussianBlurElement._(JSObject _)
/// The **`SVGFEImageElement`** interface corresponds to the element.
extension type SVGFEImageElement._(JSObject _) implements SVGElement, JSObject {
+ /// Creates an [SVGFEImageElement] using the tag 'feImage'.
+ SVGFEImageElement()
+ : _ = document.createElementNS(
+ 'http://www.w3.org/2000/svg',
+ 'feImage',
+ );
+
external SVGAnimatedPreserveAspectRatio get preserveAspectRatio;
external SVGAnimatedString get crossOrigin;
external SVGAnimatedLength get x;
@@ -298,6 +435,13 @@ extension type SVGFEImageElement._(JSObject _) implements SVGElement, JSObject {
/// The **`SVGFEMergeElement`** interface corresponds to the element.
extension type SVGFEMergeElement._(JSObject _) implements SVGElement, JSObject {
+ /// Creates an [SVGFEMergeElement] using the tag 'feMerge'.
+ SVGFEMergeElement()
+ : _ = document.createElementNS(
+ 'http://www.w3.org/2000/svg',
+ 'feMerge',
+ );
+
external SVGAnimatedLength get x;
external SVGAnimatedLength get y;
external SVGAnimatedLength get width;
@@ -308,12 +452,26 @@ extension type SVGFEMergeElement._(JSObject _) implements SVGElement, JSObject {
/// The **`SVGFEMergeNodeElement`** interface corresponds to the element.
extension type SVGFEMergeNodeElement._(JSObject _)
implements SVGElement, JSObject {
+ /// Creates an [SVGFEMergeNodeElement] using the tag 'feMergeNode'.
+ SVGFEMergeNodeElement()
+ : _ = document.createElementNS(
+ 'http://www.w3.org/2000/svg',
+ 'feMergeNode',
+ );
+
external SVGAnimatedString get in1;
}
/// The **`SVGFEMorphologyElement`** interface corresponds to the element.
extension type SVGFEMorphologyElement._(JSObject _)
implements SVGElement, JSObject {
+ /// Creates an [SVGFEMorphologyElement] using the tag 'feMorphology'.
+ SVGFEMorphologyElement()
+ : _ = document.createElementNS(
+ 'http://www.w3.org/2000/svg',
+ 'feMorphology',
+ );
+
external static int get SVG_MORPHOLOGY_OPERATOR_UNKNOWN;
external static int get SVG_MORPHOLOGY_OPERATOR_ERODE;
external static int get SVG_MORPHOLOGY_OPERATOR_DILATE;
@@ -331,6 +489,13 @@ extension type SVGFEMorphologyElement._(JSObject _)
/// The **`SVGFEOffsetElement`** interface corresponds to the element.
extension type SVGFEOffsetElement._(JSObject _)
implements SVGElement, JSObject {
+ /// Creates an [SVGFEOffsetElement] using the tag 'feOffset'.
+ SVGFEOffsetElement()
+ : _ = document.createElementNS(
+ 'http://www.w3.org/2000/svg',
+ 'feOffset',
+ );
+
external SVGAnimatedString get in1;
external SVGAnimatedNumber get dx;
external SVGAnimatedNumber get dy;
@@ -345,6 +510,14 @@ extension type SVGFEOffsetElement._(JSObject _)
/// element.
extension type SVGFESpecularLightingElement._(JSObject _)
implements SVGElement, JSObject {
+ /// Creates an [SVGFESpecularLightingElement] using the tag
+ /// 'feSpecularLighting'.
+ SVGFESpecularLightingElement()
+ : _ = document.createElementNS(
+ 'http://www.w3.org/2000/svg',
+ 'feSpecularLighting',
+ );
+
external SVGAnimatedString get in1;
external SVGAnimatedNumber get surfaceScale;
external SVGAnimatedNumber get specularConstant;
@@ -360,6 +533,13 @@ extension type SVGFESpecularLightingElement._(JSObject _)
/// The **`SVGFETileElement`** interface corresponds to the element.
extension type SVGFETileElement._(JSObject _) implements SVGElement, JSObject {
+ /// Creates an [SVGFETileElement] using the tag 'feTile'.
+ SVGFETileElement()
+ : _ = document.createElementNS(
+ 'http://www.w3.org/2000/svg',
+ 'feTile',
+ );
+
external SVGAnimatedString get in1;
external SVGAnimatedLength get x;
external SVGAnimatedLength get y;
@@ -371,6 +551,13 @@ extension type SVGFETileElement._(JSObject _) implements SVGElement, JSObject {
/// The **`SVGFETurbulenceElement`** interface corresponds to the element.
extension type SVGFETurbulenceElement._(JSObject _)
implements SVGElement, JSObject {
+ /// Creates an [SVGFETurbulenceElement] using the tag 'feTurbulence'.
+ SVGFETurbulenceElement()
+ : _ = document.createElementNS(
+ 'http://www.w3.org/2000/svg',
+ 'feTurbulence',
+ );
+
external static int get SVG_TURBULENCE_TYPE_UNKNOWN;
external static int get SVG_TURBULENCE_TYPE_FRACTALNOISE;
external static int get SVG_TURBULENCE_TYPE_TURBULENCE;
diff --git a/lib/src/dom/html.dart b/lib/src/dom/html.dart
index 98a56997..71d36a71 100644
--- a/lib/src/dom/html.dart
+++ b/lib/src/dom/html.dart
@@ -199,7 +199,161 @@ extension type DOMStringList._(JSObject _) implements JSObject {
/// elements directly implement this interface, while others implement it via an
/// interface that inherits it.
extension type HTMLElement._(JSObject _) implements Element, JSObject {
- external factory HTMLElement();
+ /// Creates an [HTMLElement] using the tag 'article'.
+ HTMLElement.article() : _ = document.createElement('article');
+
+ /// Creates an [HTMLElement] using the tag 'section'.
+ HTMLElement.section() : _ = document.createElement('section');
+
+ /// Creates an [HTMLElement] using the tag 'nav'.
+ HTMLElement.nav() : _ = document.createElement('nav');
+
+ /// Creates an [HTMLElement] using the tag 'aside'.
+ HTMLElement.aside() : _ = document.createElement('aside');
+
+ /// Creates an [HTMLElement] using the tag 'hgroup'.
+ HTMLElement.hgroup() : _ = document.createElement('hgroup');
+
+ /// Creates an [HTMLElement] using the tag 'header'.
+ HTMLElement.header() : _ = document.createElement('header');
+
+ /// Creates an [HTMLElement] using the tag 'footer'.
+ HTMLElement.footer() : _ = document.createElement('footer');
+
+ /// Creates an [HTMLElement] using the tag 'address'.
+ HTMLElement.address() : _ = document.createElement('address');
+
+ /// Creates an [HTMLElement] using the tag 'dt'.
+ HTMLElement.dt() : _ = document.createElement('dt');
+
+ /// Creates an [HTMLElement] using the tag 'dd'.
+ HTMLElement.dd() : _ = document.createElement('dd');
+
+ /// Creates an [HTMLElement] using the tag 'figure'.
+ HTMLElement.figure() : _ = document.createElement('figure');
+
+ /// Creates an [HTMLElement] using the tag 'figcaption'.
+ HTMLElement.figcaption() : _ = document.createElement('figcaption');
+
+ /// Creates an [HTMLElement] using the tag 'main'.
+ HTMLElement.main() : _ = document.createElement('main');
+
+ /// Creates an [HTMLElement] using the tag 'search'.
+ HTMLElement.search() : _ = document.createElement('search');
+
+ /// Creates an [HTMLElement] using the tag 'em'.
+ HTMLElement.em() : _ = document.createElement('em');
+
+ /// Creates an [HTMLElement] using the tag 'strong'.
+ HTMLElement.strong() : _ = document.createElement('strong');
+
+ /// Creates an [HTMLElement] using the tag 'small'.
+ HTMLElement.small() : _ = document.createElement('small');
+
+ /// Creates an [HTMLElement] using the tag 's'.
+ HTMLElement.s() : _ = document.createElement('s');
+
+ /// Creates an [HTMLElement] using the tag 'cite'.
+ HTMLElement.cite() : _ = document.createElement('cite');
+
+ /// Creates an [HTMLElement] using the tag 'dfn'.
+ HTMLElement.dfn() : _ = document.createElement('dfn');
+
+ /// Creates an [HTMLElement] using the tag 'abbr'.
+ HTMLElement.abbr() : _ = document.createElement('abbr');
+
+ /// Creates an [HTMLElement] using the tag 'ruby'.
+ HTMLElement.ruby() : _ = document.createElement('ruby');
+
+ /// Creates an [HTMLElement] using the tag 'rt'.
+ HTMLElement.rt() : _ = document.createElement('rt');
+
+ /// Creates an [HTMLElement] using the tag 'rp'.
+ HTMLElement.rp() : _ = document.createElement('rp');
+
+ /// Creates an [HTMLElement] using the tag 'code'.
+ HTMLElement.code() : _ = document.createElement('code');
+
+ /// Creates an [HTMLElement] using the tag 'var'.
+ HTMLElement.var_() : _ = document.createElement('var');
+
+ /// Creates an [HTMLElement] using the tag 'samp'.
+ HTMLElement.samp() : _ = document.createElement('samp');
+
+ /// Creates an [HTMLElement] using the tag 'kbd'.
+ HTMLElement.kbd() : _ = document.createElement('kbd');
+
+ /// Creates an [HTMLElement] using the tag 'sub'.
+ HTMLElement.sub() : _ = document.createElement('sub');
+
+ /// Creates an [HTMLElement] using the tag 'sup'.
+ HTMLElement.sup() : _ = document.createElement('sup');
+
+ /// Creates an [HTMLElement] using the tag 'i'.
+ HTMLElement.i() : _ = document.createElement('i');
+
+ /// Creates an [HTMLElement] using the tag 'b'.
+ HTMLElement.b() : _ = document.createElement('b');
+
+ /// Creates an [HTMLElement] using the tag 'u'.
+ HTMLElement.u() : _ = document.createElement('u');
+
+ /// Creates an [HTMLElement] using the tag 'mark'.
+ HTMLElement.mark() : _ = document.createElement('mark');
+
+ /// Creates an [HTMLElement] using the tag 'bdi'.
+ HTMLElement.bdi() : _ = document.createElement('bdi');
+
+ /// Creates an [HTMLElement] using the tag 'bdo'.
+ HTMLElement.bdo() : _ = document.createElement('bdo');
+
+ /// Creates an [HTMLElement] using the tag 'wbr'.
+ HTMLElement.wbr() : _ = document.createElement('wbr');
+
+ /// Creates an [HTMLElement] using the tag 'summary'.
+ HTMLElement.summary() : _ = document.createElement('summary');
+
+ /// Creates an [HTMLElement] using the tag 'noscript'.
+ HTMLElement.noscript() : _ = document.createElement('noscript');
+
+ /// Creates an [HTMLElement] using the tag 'acronym'.
+ HTMLElement.acronym() : _ = document.createElement('acronym');
+
+ /// Creates an [HTMLElement] using the tag 'noframes'.
+ HTMLElement.noframes() : _ = document.createElement('noframes');
+
+ /// Creates an [HTMLElement] using the tag 'menuitem'.
+ HTMLElement.menuitem() : _ = document.createElement('menuitem');
+
+ /// Creates an [HTMLElement] using the tag 'noembed'.
+ HTMLElement.noembed() : _ = document.createElement('noembed');
+
+ /// Creates an [HTMLElement] using the tag 'plaintext'.
+ HTMLElement.plaintext() : _ = document.createElement('plaintext');
+
+ /// Creates an [HTMLElement] using the tag 'rb'.
+ HTMLElement.rb() : _ = document.createElement('rb');
+
+ /// Creates an [HTMLElement] using the tag 'rtc'.
+ HTMLElement.rtc() : _ = document.createElement('rtc');
+
+ /// Creates an [HTMLElement] using the tag 'strike'.
+ HTMLElement.strike() : _ = document.createElement('strike');
+
+ /// Creates an [HTMLElement] using the tag 'basefont'.
+ HTMLElement.basefont() : _ = document.createElement('basefont');
+
+ /// Creates an [HTMLElement] using the tag 'big'.
+ HTMLElement.big() : _ = document.createElement('big');
+
+ /// Creates an [HTMLElement] using the tag 'center'.
+ HTMLElement.center() : _ = document.createElement('center');
+
+ /// Creates an [HTMLElement] using the tag 'nobr'.
+ HTMLElement.nobr() : _ = document.createElement('nobr');
+
+ /// Creates an [HTMLElement] using the tag 'tt'.
+ HTMLElement.tt() : _ = document.createElement('tt');
/// The **`HTMLElement.click()`** method simulates a mouse click on
/// an element.
@@ -534,7 +688,31 @@ extension type HTMLElement._(JSObject _) implements Element, JSObject {
/// and derives from the [HTMLElement] interface, but without implementing any
/// additional properties or methods.
extension type HTMLUnknownElement._(JSObject _)
- implements HTMLElement, JSObject {}
+ implements HTMLElement, JSObject {
+ /// Creates an [HTMLUnknownElement] using the tag 'applet'.
+ HTMLUnknownElement.applet() : _ = document.createElement('applet');
+
+ /// Creates an [HTMLUnknownElement] using the tag 'bgsound'.
+ HTMLUnknownElement.bgsound() : _ = document.createElement('bgsound');
+
+ /// Creates an [HTMLUnknownElement] using the tag 'isindex'.
+ HTMLUnknownElement.isindex() : _ = document.createElement('isindex');
+
+ /// Creates an [HTMLUnknownElement] using the tag 'keygen'.
+ HTMLUnknownElement.keygen() : _ = document.createElement('keygen');
+
+ /// Creates an [HTMLUnknownElement] using the tag 'nextid'.
+ HTMLUnknownElement.nextid() : _ = document.createElement('nextid');
+
+ /// Creates an [HTMLUnknownElement] using the tag 'blink'.
+ HTMLUnknownElement.blink() : _ = document.createElement('blink');
+
+ /// Creates an [HTMLUnknownElement] using the tag 'multicol'.
+ HTMLUnknownElement.multicol() : _ = document.createElement('multicol');
+
+ /// Creates an [HTMLUnknownElement] using the tag 'spacer'.
+ HTMLUnknownElement.spacer() : _ = document.createElement('spacer');
+}
/// The **`DOMStringMap`** interface is used for the [HTMLElement.dataset]
/// attribute, to represent data for custom attributes added to elements.
@@ -547,7 +725,8 @@ extension type DOMStringMap._(JSObject _) implements JSObject {}
/// You can retrieve the `HTMLHtmlElement` object for a given document by
/// reading the value of the [document.documentElement] property.
extension type HTMLHtmlElement._(JSObject _) implements HTMLElement, JSObject {
- external factory HTMLHtmlElement();
+ /// Creates an [HTMLHtmlElement] using the tag 'html'.
+ HTMLHtmlElement() : _ = document.createElement('html');
external set version(String value);
external String get version;
@@ -557,14 +736,16 @@ extension type HTMLHtmlElement._(JSObject _) implements HTMLElement, JSObject {
/// metadata, for a document. This object inherits all of the properties and
/// methods described in the [HTMLElement] interface.
extension type HTMLHeadElement._(JSObject _) implements HTMLElement, JSObject {
- external factory HTMLHeadElement();
+ /// Creates an [HTMLHeadElement] using the tag 'head'.
+ HTMLHeadElement() : _ = document.createElement('head');
}
/// The **`HTMLTitleElement`** interface is implemented by a document's `title`.
/// This element inherits all of the properties and methods of the [HTMLElement]
/// interface.
extension type HTMLTitleElement._(JSObject _) implements HTMLElement, JSObject {
- external factory HTMLTitleElement();
+ /// Creates an [HTMLTitleElement] using the tag 'title'.
+ HTMLTitleElement() : _ = document.createElement('title');
external set text(String value);
external String get text;
@@ -574,7 +755,8 @@ extension type HTMLTitleElement._(JSObject _) implements HTMLElement, JSObject {
/// This object inherits all of the properties and methods as described in the
/// [HTMLElement] interface.
extension type HTMLBaseElement._(JSObject _) implements HTMLElement, JSObject {
- external factory HTMLBaseElement();
+ /// Creates an [HTMLBaseElement] using the tag 'base'.
+ HTMLBaseElement() : _ = document.createElement('base');
external set href(String value);
external String get href;
@@ -591,7 +773,8 @@ extension type HTMLBaseElement._(JSObject _) implements HTMLElement, JSObject {
/// This object inherits all of the properties and methods of the [HTMLElement]
/// interface.
extension type HTMLLinkElement._(JSObject _) implements HTMLElement, JSObject {
- external factory HTMLLinkElement();
+ /// Creates an [HTMLLinkElement] using the tag 'link'.
+ HTMLLinkElement() : _ = document.createElement('link');
external set href(String value);
external String get href;
@@ -637,7 +820,8 @@ extension type HTMLLinkElement._(JSObject _) implements HTMLElement, JSObject {
/// This interface inherits all of the properties and methods described in the
/// [HTMLElement] interface.
extension type HTMLMetaElement._(JSObject _) implements HTMLElement, JSObject {
- external factory HTMLMetaElement();
+ /// Creates an [HTMLMetaElement] using the tag 'meta'.
+ HTMLMetaElement() : _ = document.createElement('meta');
external set name(String value);
external String get name;
@@ -660,7 +844,8 @@ extension type HTMLMetaElement._(JSObject _) implements HTMLElement, JSObject {
/// for an overview of the objects used to manipulate specified CSS properties
/// using the DOM.
extension type HTMLStyleElement._(JSObject _) implements HTMLElement, JSObject {
- external factory HTMLStyleElement();
+ /// Creates an [HTMLStyleElement] using the tag 'style'.
+ HTMLStyleElement() : _ = document.createElement('style');
external set disabled(bool value);
external bool get disabled;
@@ -676,7 +861,8 @@ extension type HTMLStyleElement._(JSObject _) implements HTMLElement, JSObject {
/// those inherited from the regular [HTMLElement] interface) for manipulating
/// `body` elements.
extension type HTMLBodyElement._(JSObject _) implements HTMLElement, JSObject {
- external factory HTMLBodyElement();
+ /// Creates an [HTMLBodyElement] using the tag 'body'.
+ HTMLBodyElement() : _ = document.createElement('body');
external set text(String value);
external String get text;
@@ -736,7 +922,23 @@ extension type HTMLBodyElement._(JSObject _) implements HTMLElement, JSObject {
/// and properties from the [HTMLElement] interface.
extension type HTMLHeadingElement._(JSObject _)
implements HTMLElement, JSObject {
- external factory HTMLHeadingElement();
+ /// Creates an [HTMLHeadingElement] using the tag 'h1'.
+ HTMLHeadingElement.h1() : _ = document.createElement('h1');
+
+ /// Creates an [HTMLHeadingElement] using the tag 'h2'.
+ HTMLHeadingElement.h2() : _ = document.createElement('h2');
+
+ /// Creates an [HTMLHeadingElement] using the tag 'h3'.
+ HTMLHeadingElement.h3() : _ = document.createElement('h3');
+
+ /// Creates an [HTMLHeadingElement] using the tag 'h4'.
+ HTMLHeadingElement.h4() : _ = document.createElement('h4');
+
+ /// Creates an [HTMLHeadingElement] using the tag 'h5'.
+ HTMLHeadingElement.h5() : _ = document.createElement('h5');
+
+ /// Creates an [HTMLHeadingElement] using the tag 'h6'.
+ HTMLHeadingElement.h6() : _ = document.createElement('h6');
external set align(String value);
external String get align;
@@ -747,7 +949,8 @@ extension type HTMLHeadingElement._(JSObject _)
/// manipulating `p` elements.
extension type HTMLParagraphElement._(JSObject _)
implements HTMLElement, JSObject {
- external factory HTMLParagraphElement();
+ /// Creates an [HTMLParagraphElement] using the tag 'p'.
+ HTMLParagraphElement() : _ = document.createElement('p');
external set align(String value);
external String get align;
@@ -757,7 +960,8 @@ extension type HTMLParagraphElement._(JSObject _)
/// of the [HTMLElement] interface it also has available to it by inheritance)
/// for manipulating `hr` elements.
extension type HTMLHRElement._(JSObject _) implements HTMLElement, JSObject {
- external factory HTMLHRElement();
+ /// Creates an [HTMLHRElement] using the tag 'hr'.
+ HTMLHRElement() : _ = document.createElement('hr');
external set align(String value);
external String get align;
@@ -775,7 +979,14 @@ extension type HTMLHRElement._(JSObject _) implements HTMLElement, JSObject {
/// (beyond those of the [HTMLElement] interface it also has available to it by
/// inheritance) for manipulating a block of preformatted text (`pre`).
extension type HTMLPreElement._(JSObject _) implements HTMLElement, JSObject {
- external factory HTMLPreElement();
+ /// Creates an [HTMLPreElement] using the tag 'pre'.
+ HTMLPreElement.pre() : _ = document.createElement('pre');
+
+ /// Creates an [HTMLPreElement] using the tag 'listing'.
+ HTMLPreElement.listing() : _ = document.createElement('listing');
+
+ /// Creates an [HTMLPreElement] using the tag 'xmp'.
+ HTMLPreElement.xmp() : _ = document.createElement('xmp');
external set width(int value);
external int get width;
@@ -786,7 +997,11 @@ extension type HTMLPreElement._(JSObject _) implements HTMLElement, JSObject {
/// inheritance) for manipulating quoting elements, like `blockquote` and `q`,
/// but not the `cite` element.
extension type HTMLQuoteElement._(JSObject _) implements HTMLElement, JSObject {
- external factory HTMLQuoteElement();
+ /// Creates an [HTMLQuoteElement] using the tag 'blockquote'.
+ HTMLQuoteElement.blockquote() : _ = document.createElement('blockquote');
+
+ /// Creates an [HTMLQuoteElement] using the tag 'q'.
+ HTMLQuoteElement.q() : _ = document.createElement('q');
external set cite(String value);
external String get cite;
@@ -796,7 +1011,8 @@ extension type HTMLQuoteElement._(JSObject _) implements HTMLElement, JSObject {
/// those defined on the regular [HTMLElement] interface it also has available
/// to it by inheritance) for manipulating ordered list elements.
extension type HTMLOListElement._(JSObject _) implements HTMLElement, JSObject {
- external factory HTMLOListElement();
+ /// Creates an [HTMLOListElement] using the tag 'ol'.
+ HTMLOListElement() : _ = document.createElement('ol');
external set reversed(bool value);
external bool get reversed;
@@ -812,7 +1028,8 @@ extension type HTMLOListElement._(JSObject _) implements HTMLElement, JSObject {
/// those defined on the regular [HTMLElement] interface it also has available
/// to it by inheritance) for manipulating unordered list (`ul`) elements.
extension type HTMLUListElement._(JSObject _) implements HTMLElement, JSObject {
- external factory HTMLUListElement();
+ /// Creates an [HTMLUListElement] using the tag 'ul'.
+ HTMLUListElement() : _ = document.createElement('ul');
external set compact(bool value);
external bool get compact;
@@ -825,7 +1042,8 @@ extension type HTMLUListElement._(JSObject _) implements HTMLElement, JSObject {
/// element.
/// `