From 662b7b8f3412aba33480fc334a39340f90aafdb2 Mon Sep 17 00:00:00 2001 From: Dmitri Shuralyov Date: Wed, 7 Mar 2018 12:59:44 -0500 Subject: [PATCH] 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. --- dom.go | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/dom.go b/dom.go index 8040c3e..f84d139 100644 --- a/dom.go +++ b/dom.go @@ -1852,22 +1852,19 @@ func (e *HTMLAreaElement) Rel() *TokenList { type HTMLAudioElement struct{ *HTMLMediaElement } type HTMLBRElement struct{ *BasicHTMLElement } + type HTMLBaseElement struct{ *BasicHTMLElement } -type HTMLBodyElement struct{ *BasicHTMLElement } -type ValidityState struct { - *js.Object - CustomError bool `js:"customError"` - PatternMismatch bool `js:"patternMismatch"` - RangeOverflow bool `js:"rangeOverflow"` - RangeUnderflow bool `js:"rangeUnderflow"` - StepMismatch bool `js:"stepMismatch"` - TooLong bool `js:"tooLong"` - TypeMismatch bool `js:"typeMismatch"` - Valid bool `js:"valid"` - ValueMissing bool `js:"valueMissing"` +func (e *HTMLBaseElement) Href() string { + return e.Get("href").String() +} + +func (e *HTMLBaseElement) Target() string { + return e.Get("target").String() } +type HTMLBodyElement struct{ *BasicHTMLElement } + type HTMLButtonElement struct { *BasicHTMLElement AutoFocus bool `js:"autofocus"` @@ -3029,12 +3026,17 @@ type HTMLUnknownElement struct{ *BasicHTMLElement } type HTMLVideoElement struct{ *HTMLMediaElement } -func (e *HTMLBaseElement) Href() string { - return e.Get("href").String() -} - -func (e *HTMLBaseElement) Target() string { - return e.Get("target").String() +type ValidityState struct { + *js.Object + CustomError bool `js:"customError"` + PatternMismatch bool `js:"patternMismatch"` + RangeOverflow bool `js:"rangeOverflow"` + RangeUnderflow bool `js:"rangeUnderflow"` + StepMismatch bool `js:"stepMismatch"` + TooLong bool `js:"tooLong"` + TypeMismatch bool `js:"typeMismatch"` + Valid bool `js:"valid"` + ValueMissing bool `js:"valueMissing"` } type CSSStyleDeclaration struct{ *js.Object }