Skip to content

Commit 464ddb3

Browse files
committed
Fix accessors in various DOM elements
1 parent 25f9527 commit 464ddb3

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

lib/src/html/dom/element_subclasses.dart

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ class AnchorElement extends HtmlElement
6767
_setAttribute('download', value);
6868
}
6969

70-
String? get hreflang => _getAttribute('hreflang');
70+
String get hreflang => _getAttribute('hreflang') ?? '';
7171

72-
set hreflang(String? value) {
72+
set hreflang(String value) {
7373
_setAttribute('hreflang', value);
7474
}
7575

@@ -79,15 +79,15 @@ class AnchorElement extends HtmlElement
7979
_setAttribute('rel', value);
8080
}
8181

82-
String? get target => _getAttribute('target');
82+
String get target => _getAttribute('target') ?? '';
8383

84-
set target(String? value) {
84+
set target(String value) {
8585
_setAttribute('target', value);
8686
}
8787

88-
String? get type => _getAttribute('type');
88+
String get type => _getAttribute('type') ?? '';
8989

90-
set type(String? value) {
90+
set type(String value) {
9191
_setAttribute('type', value);
9292
}
9393

@@ -3332,6 +3332,18 @@ class VideoElement extends MediaElement implements CanvasImageSource {
33323332

33333333
VideoElement._(Document ownerDocument) : super._(ownerDocument, 'VIDEO');
33343334

3335+
String get currentSrc => _getAttribute('currentsrc') ?? '';
3336+
3337+
set currentSrc(String value) {
3338+
_setAttribute('currentsrc', value);
3339+
}
3340+
3341+
num get currentTime => _getAttributeNum('currenttime', defaultValue: 0.0) ?? 0.0;
3342+
3343+
set currentTime(num value) {
3344+
_setAttributeNum('currenttime', value);
3345+
}
3346+
33353347
num get duration => 0;
33363348

33373349
bool get ended => false;

0 commit comments

Comments
 (0)