Skip to content

Commit 662b7b8

Browse files
committed
Rearrange top level definitions
Improve consistency. The HTMLBaseElement methods should follow the HTMLBaseElement type definition, rather than be elsewhere. Move ValidityState down, after all HTML elements. Its previous location in the middle was too arbitrary. Many HTML elements use ValidityState.
1 parent 7d3a6c4 commit 662b7b8

File tree

1 file changed

+20
-18
lines changed

1 file changed

+20
-18
lines changed

dom.go

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1852,22 +1852,19 @@ func (e *HTMLAreaElement) Rel() *TokenList {
18521852
type HTMLAudioElement struct{ *HTMLMediaElement }
18531853

18541854
type HTMLBRElement struct{ *BasicHTMLElement }
1855+
18551856
type HTMLBaseElement struct{ *BasicHTMLElement }
1856-
type HTMLBodyElement struct{ *BasicHTMLElement }
18571857

1858-
type ValidityState struct {
1859-
*js.Object
1860-
CustomError bool `js:"customError"`
1861-
PatternMismatch bool `js:"patternMismatch"`
1862-
RangeOverflow bool `js:"rangeOverflow"`
1863-
RangeUnderflow bool `js:"rangeUnderflow"`
1864-
StepMismatch bool `js:"stepMismatch"`
1865-
TooLong bool `js:"tooLong"`
1866-
TypeMismatch bool `js:"typeMismatch"`
1867-
Valid bool `js:"valid"`
1868-
ValueMissing bool `js:"valueMissing"`
1858+
func (e *HTMLBaseElement) Href() string {
1859+
return e.Get("href").String()
1860+
}
1861+
1862+
func (e *HTMLBaseElement) Target() string {
1863+
return e.Get("target").String()
18691864
}
18701865

1866+
type HTMLBodyElement struct{ *BasicHTMLElement }
1867+
18711868
type HTMLButtonElement struct {
18721869
*BasicHTMLElement
18731870
AutoFocus bool `js:"autofocus"`
@@ -3029,12 +3026,17 @@ type HTMLUnknownElement struct{ *BasicHTMLElement }
30293026

30303027
type HTMLVideoElement struct{ *HTMLMediaElement }
30313028

3032-
func (e *HTMLBaseElement) Href() string {
3033-
return e.Get("href").String()
3034-
}
3035-
3036-
func (e *HTMLBaseElement) Target() string {
3037-
return e.Get("target").String()
3029+
type ValidityState struct {
3030+
*js.Object
3031+
CustomError bool `js:"customError"`
3032+
PatternMismatch bool `js:"patternMismatch"`
3033+
RangeOverflow bool `js:"rangeOverflow"`
3034+
RangeUnderflow bool `js:"rangeUnderflow"`
3035+
StepMismatch bool `js:"stepMismatch"`
3036+
TooLong bool `js:"tooLong"`
3037+
TypeMismatch bool `js:"typeMismatch"`
3038+
Valid bool `js:"valid"`
3039+
ValueMissing bool `js:"valueMissing"`
30383040
}
30393041

30403042
type CSSStyleDeclaration struct{ *js.Object }

0 commit comments

Comments
 (0)