Skip to content

Commit

Permalink
Rearrange top level definitions
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dmitshur committed Mar 7, 2018
1 parent 7d3a6c4 commit 662b7b8
Showing 1 changed file with 20 additions and 18 deletions.
38 changes: 20 additions & 18 deletions dom.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down Expand Up @@ -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 }
Expand Down

0 comments on commit 662b7b8

Please sign in to comment.