How to use ToString method of html Package

Best K6 code snippet using html.ToString

elements_impl.go

Source:elements_impl.go Github

copy

Full Screen

1// +build js,wasm2package wasm3import (4 "time"5)6// -------------8<---------------------------------------7func NewAudio(src ...string) HTMLAudioElement {8 if jsHTMLAudioElement := jsGlobal.get("HTMLAudioElement"); jsHTMLAudioElement.valid() {9 switch len(src) {10 case 0:11 return wrapHTMLAudioElement(jsHTMLAudioElement.jsNew())12 default:13 return wrapHTMLAudioElement(jsHTMLAudioElement.jsNew(src[0]))14 }15 }16 return nil17}18func NewImage(args ...uint) HTMLImageElement {19 if jsHTMLImageElement := jsGlobal.get("HTMLImageElement"); jsHTMLImageElement.valid() {20 switch len(args) {21 case 0:22 return wrapHTMLImageElement(jsHTMLImageElement.jsNew())23 case 1:24 return wrapHTMLImageElement(jsHTMLImageElement.jsNew(args[0]))25 default:26 return wrapHTMLImageElement(jsHTMLImageElement.jsNew(args[0], args[1]))27 }28 }29 return nil30}31// -------------8<---------------------------------------32type htmlBodyElementImpl struct {33 *eventTargetImpl34 *htmlElementImpl35 *windowEventHandlersImpl36 Value37}38func NewHTMLBodyElement() HTMLBodyElement {39 if el := CurrentDocument().CreateElement("body"); el != nil {40 if body, ok := el.(HTMLBodyElement); ok {41 return body42 }43 }44 return nil45}46func wrapHTMLBodyElement(v Value) HTMLBodyElement {47 if v.valid() {48 hbi := &htmlBodyElementImpl{49 htmlElementImpl: newHTMLElementImpl(v),50 Value: v,51 }52 hbi.eventTargetImpl = hbi.htmlElementImpl.eventTargetImpl53 hbi.windowEventHandlersImpl = newWindowEventHandlersImpl(hbi.eventTargetImpl)54 return hbi55 }56 return nil57}58// -------------8<---------------------------------------59type htmlHeadingElementImpl struct {60 *htmlElementImpl61}62var htmlHeadingTags = map[int]string{63 1: "h1",64 2: "h2",65 3: "h3",66 4: "h4",67 5: "h5",68 6: "h6",69}70func NewHTMLHeadingElement(rank int) HTMLHeadingElement {71 if tag := htmlHeadingTags[rank]; tag != "" {72 if el := CurrentDocument().CreateElement(tag); el != nil {73 if h, ok := el.(HTMLHeadingElement); ok {74 return h75 }76 }77 }78 return nil79}80func wrapHTMLHeadingElement(v Value) HTMLHeadingElement {81 if v.valid() {82 return &htmlHeadingElementImpl{83 htmlElementImpl: newHTMLElementImpl(v),84 }85 }86 return nil87}88// -------------8<---------------------------------------89type htmlParagraphElementImpl struct {90 *htmlElementImpl91}92func NewHTMLParagraphElement() HTMLParagraphElement {93 if el := CurrentDocument().CreateElement("p"); el != nil {94 if p, ok := el.(HTMLParagraphElement); ok {95 return p96 }97 }98 return nil99}100func wrapHTMLParagraphElement(v Value) HTMLParagraphElement {101 if v.valid() {102 return &htmlParagraphElementImpl{103 htmlElementImpl: newHTMLElementImpl(v),104 }105 }106 return nil107}108// -------------8<---------------------------------------109type htmlHRElementImpl struct {110 *htmlElementImpl111}112func NewHTMLHRElement() HTMLHRElement {113 if el := CurrentDocument().CreateElement("hr"); el != nil {114 if hr, ok := el.(HTMLHRElement); ok {115 return hr116 }117 }118 return nil119}120func wrapHTMLHRElement(v Value) HTMLHRElement {121 if v.valid() {122 return &htmlHRElementImpl{123 htmlElementImpl: newHTMLElementImpl(v),124 }125 }126 return nil127}128// -------------8<---------------------------------------129type htmlPreElementImpl struct {130 *htmlElementImpl131}132func NewHTMLPreElement() HTMLPreElement {133 if el := CurrentDocument().CreateElement("pre"); el != nil {134 if pre, ok := el.(HTMLPreElement); ok {135 return pre136 }137 }138 return nil139}140func wrapHTMLPreElement(v Value) HTMLPreElement {141 if v.valid() {142 return &htmlPreElementImpl{143 htmlElementImpl: newHTMLElementImpl(v),144 }145 }146 return nil147}148// -------------8<---------------------------------------149type htmlQuoteElementImpl struct {150 *htmlElementImpl151}152func NewHTMLQuoteElement(block ...bool) HTMLQuoteElement {153 var tag = "q"154 if len(block) > 0 && block[0] == true {155 tag = "blockquote"156 }157 if el := CurrentDocument().CreateElement(tag); el != nil {158 if q, ok := el.(HTMLQuoteElement); ok {159 return q160 }161 }162 return nil163}164func wrapHTMLQuoteElement(v Value) HTMLQuoteElement {165 if v.valid() {166 return &htmlQuoteElementImpl{167 htmlElementImpl: newHTMLElementImpl(v),168 }169 }170 return nil171}172func (p *htmlQuoteElementImpl) Cite() string {173 return p.get("cite").toString()174}175func (p *htmlQuoteElementImpl) SetCite(cite string) {176 p.set("cite", cite)177}178// -------------8<---------------------------------------179type htmlOListElementImpl struct {180 *htmlElementImpl181}182func NewHTMLOListElement() HTMLOListElement {183 if el := CurrentDocument().CreateElement("ol"); el != nil {184 if ol, ok := el.(HTMLOListElement); ok {185 return ol186 }187 }188 return nil189}190func wrapHTMLOListElement(v Value) HTMLOListElement {191 if v.valid() {192 return &htmlOListElementImpl{193 htmlElementImpl: newHTMLElementImpl(v),194 }195 }196 return nil197}198func (p *htmlOListElementImpl) Reversed() bool {199 return p.get("reversed").toBool()200}201func (p *htmlOListElementImpl) SetReversed(r bool) {202 p.set("reversed", r)203}204func (p *htmlOListElementImpl) Start() int {205 return p.get("start").toInt()206}207func (p *htmlOListElementImpl) SetStart(s int) {208 p.set("start", s)209}210func (p *htmlOListElementImpl) Type() string {211 return p.get("type").toString()212}213func (p *htmlOListElementImpl) SetType(t string) {214 p.set("type", t)215}216// -------------8<---------------------------------------217type htmlUListElementImpl struct {218 *htmlElementImpl219}220func NewHTMLUListElement() HTMLUListElement {221 if el := CurrentDocument().CreateElement("ul"); el != nil {222 if ul, ok := el.(HTMLUListElement); ok {223 return ul224 }225 }226 return nil227}228func wrapHTMLUListElement(v Value) HTMLUListElement {229 if v.valid() {230 return &htmlUListElementImpl{231 htmlElementImpl: newHTMLElementImpl(v),232 }233 }234 return nil235}236// -------------8<---------------------------------------237type htmlLIElementImpl struct {238 *htmlElementImpl239}240func NewHTMLLIElement() HTMLLIElement {241 if el := CurrentDocument().CreateElement("li"); el != nil {242 if li, ok := el.(HTMLLIElement); ok {243 return li244 }245 }246 return nil247}248func wrapHTMLLIElement(v Value) HTMLLIElement {249 if v.valid() {250 return &htmlLIElementImpl{251 htmlElementImpl: newHTMLElementImpl(v),252 }253 }254 return nil255}256func (p *htmlLIElementImpl) Value() int {257 return p.get("value").toInt()258}259func (p *htmlLIElementImpl) SetValue(v int) {260 p.set("value", v)261}262// -------------8<---------------------------------------263type htmlDListElementImpl struct {264 *htmlElementImpl265}266func NewHTMLDListElement() HTMLDListElement {267 if el := CurrentDocument().CreateElement("dl"); el != nil {268 if dl, ok := el.(HTMLDListElement); ok {269 return dl270 }271 }272 return nil273}274func wrapHTMLDListElement(v Value) HTMLDListElement {275 if v.valid() {276 return &htmlDListElementImpl{277 htmlElementImpl: newHTMLElementImpl(v),278 }279 }280 return nil281}282// -------------8<---------------------------------------283type htmlDivElementImpl struct {284 *htmlElementImpl285}286func NewHTMLDivElement() HTMLDivElement {287 if el := CurrentDocument().CreateElement("div"); el != nil {288 if div, ok := el.(HTMLDivElement); ok {289 return div290 }291 }292 return nil293}294func wrapHTMLDivElement(v Value) HTMLDivElement {295 if v.valid() {296 return &htmlDivElementImpl{297 htmlElementImpl: newHTMLElementImpl(v),298 }299 }300 return nil301}302// -------------8<---------------------------------------303type htmlAnchorElementImpl struct {304 *htmlElementImpl305 *htmlHyperlinkElementUtilsImpl306 Value307}308func NewHTMLAnchorElement() HTMLAnchorElement {309 if el := CurrentDocument().CreateElement("a"); el != nil {310 if a, ok := el.(HTMLAnchorElement); ok {311 return a312 }313 }314 return nil315}316func wrapHTMLAnchorElement(v Value) HTMLAnchorElement {317 if v.valid() {318 return &htmlAnchorElementImpl{319 htmlElementImpl: newHTMLElementImpl(v),320 htmlHyperlinkElementUtilsImpl: newHTMLHyperlinkElementUtilsImpl(v),321 Value: v,322 }323 }324 return nil325}326func (p *htmlAnchorElementImpl) Target() string {327 return p.get("target").toString()328}329func (p *htmlAnchorElementImpl) SetTarget(t string) {330 p.set("target", t)331}332func (p *htmlAnchorElementImpl) Download() string {333 return p.get("download").toString()334}335func (p *htmlAnchorElementImpl) SetDownload(d string) {336 p.set("download", d)337}338func (p *htmlAnchorElementImpl) Rel() string {339 return p.get("rel").toString()340}341func (p *htmlAnchorElementImpl) SetRel(r string) {342 p.set("rel", r)343}344func (p *htmlAnchorElementImpl) Rev() string {345 return p.get("rev").toString()346}347func (p *htmlAnchorElementImpl) SetRev(r string) {348 p.set("rev", r)349}350func (p *htmlAnchorElementImpl) RelList() DOMTokenList {351 return wrapDOMTokenList(p.get("relList"))352}353func (p *htmlAnchorElementImpl) HrefLang() string {354 return p.get("hreflang").toString()355}356func (p *htmlAnchorElementImpl) SetHrefLang(l string) {357 p.set("hreflang", l)358}359func (p *htmlAnchorElementImpl) Type() string {360 return p.get("type").toString()361}362func (p *htmlAnchorElementImpl) SetType(t string) {363 p.set("type", t)364}365func (p *htmlAnchorElementImpl) Text() string {366 return p.get("text").toString()367}368func (p *htmlAnchorElementImpl) SetText(text string) {369 p.set("text", text)370}371func (p *htmlAnchorElementImpl) ReferrerPolicy() string {372 return p.get("referrerPolicy").toString()373}374func (p *htmlAnchorElementImpl) SetReferrerPolicy(policy string) {375 p.set("referrerPolicy", policy)376}377// -------------8<---------------------------------------378type htmlHyperlinkElementUtilsImpl struct {379 Value380}381func wrapHTMLHyperlinkElementUtils(v Value) HTMLHyperlinkElementUtils {382 if p := newHTMLHyperlinkElementUtilsImpl(v); p != nil {383 return p384 }385 return nil386}387func newHTMLHyperlinkElementUtilsImpl(v Value) *htmlHyperlinkElementUtilsImpl {388 if v.valid() {389 return &htmlHyperlinkElementUtilsImpl{390 Value: v,391 }392 }393 return nil394}395func (p *htmlHyperlinkElementUtilsImpl) Href() string {396 return p.get("href").toString()397}398func (p *htmlHyperlinkElementUtilsImpl) SetHref(href string) {399 p.set("href", href)400}401func (p *htmlHyperlinkElementUtilsImpl) Origin() string {402 return p.get("origin").toString()403}404func (p *htmlHyperlinkElementUtilsImpl) Protocol() string {405 return p.get("protocol").toString()406}407func (p *htmlHyperlinkElementUtilsImpl) SetProtocol(protocol string) {408 p.set("protocol", protocol)409}410func (p *htmlHyperlinkElementUtilsImpl) Username() string {411 return p.get("username").toString()412}413func (p *htmlHyperlinkElementUtilsImpl) SetUsername(username string) {414 p.set("username", username)415}416func (p *htmlHyperlinkElementUtilsImpl) Password() string {417 return p.get("password").toString()418}419func (p *htmlHyperlinkElementUtilsImpl) SetPassword(password string) {420 p.set("password", password)421}422func (p *htmlHyperlinkElementUtilsImpl) Host() string {423 return p.get("host").toString()424}425func (p *htmlHyperlinkElementUtilsImpl) SetHost(host string) {426 p.set("host", host)427}428func (p *htmlHyperlinkElementUtilsImpl) Hostname() string {429 return p.get("hostname").toString()430}431func (p *htmlHyperlinkElementUtilsImpl) SetHostname(hostname string) {432 p.set("hostname", hostname)433}434func (p *htmlHyperlinkElementUtilsImpl) Port() string {435 return p.get("port").toString()436}437func (p *htmlHyperlinkElementUtilsImpl) SetPort(port string) {438 p.set("port", port)439}440func (p *htmlHyperlinkElementUtilsImpl) Pathname() string {441 return p.get("pathname").toString()442}443func (p *htmlHyperlinkElementUtilsImpl) SetPathname(pathname string) {444 p.set("pathname", pathname)445}446func (p *htmlHyperlinkElementUtilsImpl) Search() string {447 return p.get("search").toString()448}449func (p *htmlHyperlinkElementUtilsImpl) SetSearch(search string) {450 p.set("search", search)451}452func (p *htmlHyperlinkElementUtilsImpl) Hash() string {453 return p.get("hash").toString()454}455func (p *htmlHyperlinkElementUtilsImpl) SetHash(hash string) {456 p.set("hash", hash)457}458// -------------8<---------------------------------------459type htmlDataElementImpl struct {460 *htmlElementImpl461}462func NewHTMLDataElement() HTMLDataElement {463 if el := CurrentDocument().CreateElement("data"); el != nil {464 if data, ok := el.(HTMLDataElement); ok {465 return data466 }467 }468 return nil469}470func wrapHTMLDataElement(v Value) HTMLDataElement {471 if v.valid() {472 return &htmlDataElementImpl{473 htmlElementImpl: newHTMLElementImpl(v),474 }475 }476 return nil477}478func (p *htmlDataElementImpl) Value() string {479 return p.get("value").toString()480}481func (p *htmlDataElementImpl) SetValue(value string) {482 p.set("value", value)483}484// -------------8<---------------------------------------485type htmlTimeElementImpl struct {486 *htmlElementImpl487}488func NewHTMLTimeElement() HTMLTimeElement {489 if el := CurrentDocument().CreateElement("time"); el != nil {490 if tim, ok := el.(HTMLTimeElement); ok {491 return tim492 }493 }494 return nil495}496func wrapHTMLTimeElement(v Value) HTMLTimeElement {497 if v.valid() {498 return &htmlTimeElementImpl{499 htmlElementImpl: newHTMLElementImpl(v),500 }501 }502 return nil503}504func (p *htmlTimeElementImpl) DateTime() string {505 return p.get("dateTime").toString()506}507func (p *htmlTimeElementImpl) SetDateTime(dt string) {508 p.set("dateTime", dt)509}510// -------------8<---------------------------------------511type htmlSpanElementImpl struct {512 *htmlElementImpl513}514func NewHTMLSpanElement() HTMLSpanElement {515 if el := CurrentDocument().CreateElement("span"); el != nil {516 if span, ok := el.(HTMLSpanElement); ok {517 return span518 }519 }520 return nil521}522func wrapHTMLSpanElement(v Value) HTMLSpanElement {523 if v.valid() {524 return &htmlSpanElementImpl{525 htmlElementImpl: newHTMLElementImpl(v),526 }527 }528 return nil529}530// -------------8<---------------------------------------531type htmlBRElementImpl struct {532 *htmlElementImpl533}534func NewHTMLBRElement() HTMLBRElement {535 if el := CurrentDocument().CreateElement("br"); el != nil {536 if br, ok := el.(HTMLBRElement); ok {537 return br538 }539 }540 return nil541}542func wrapHTMLBRElement(v Value) HTMLBRElement {543 if v.valid() {544 return &htmlBRElementImpl{545 htmlElementImpl: newHTMLElementImpl(v),546 }547 }548 return nil549}550// -------------8<---------------------------------------551type htmlModElementImpl struct {552 *htmlElementImpl553}554func NewHTMLDelElement() HTMLModElement {555 if el := CurrentDocument().CreateElement("del"); el != nil {556 if d, ok := el.(HTMLModElement); ok {557 return d558 }559 }560 return nil561}562func NewHTMLInsElement() HTMLModElement {563 if el := CurrentDocument().CreateElement("ins"); el != nil {564 if d, ok := el.(HTMLModElement); ok {565 return d566 }567 }568 return nil569}570func wrapHTMLModElement(v Value) HTMLModElement {571 if v.valid() {572 return &htmlModElementImpl{573 htmlElementImpl: newHTMLElementImpl(v),574 }575 }576 return nil577}578func (p *htmlModElementImpl) Cite() string {579 return p.get("cite").toString()580}581func (p *htmlModElementImpl) SetCite(cite string) {582 p.set("cite", cite)583}584func (p *htmlModElementImpl) DateTime() string {585 return p.get("dateTime").toString()586}587func (p *htmlModElementImpl) SetDateTime(dt string) {588 p.set("dateTime", dt)589}590// -------------8<---------------------------------------591type htmlPictureElementImpl struct {592 *htmlElementImpl593}594func NewHTMLPictureElement() HTMLPictureElement {595 if el := CurrentDocument().CreateElement("picture"); el != nil {596 if picture, ok := el.(HTMLPictureElement); ok {597 return picture598 }599 }600 return nil601}602func wrapHTMLPictureElement(v Value) HTMLPictureElement {603 if v.valid() {604 return &htmlPictureElementImpl{605 htmlElementImpl: newHTMLElementImpl(v),606 }607 }608 return nil609}610// -------------8<---------------------------------------611type htmlSourceElementImpl struct {612 *htmlElementImpl613}614func NewHTMLSourceElement() HTMLSourceElement {615 if el := CurrentDocument().CreateElement("source"); el != nil {616 if source, ok := el.(HTMLSourceElement); ok {617 return source618 }619 }620 return nil621}622func wrapHTMLSourceElement(v Value) HTMLSourceElement {623 if v.valid() {624 return &htmlSourceElementImpl{625 htmlElementImpl: newHTMLElementImpl(v),626 }627 }628 return nil629}630func (p *htmlSourceElementImpl) Src() string {631 return p.get("src").toString()632}633func (p *htmlSourceElementImpl) SetSrc(src string) {634 p.set("src", src)635}636func (p *htmlSourceElementImpl) Type() string {637 return p.get("type").toString()638}639func (p *htmlSourceElementImpl) SetType(t string) {640 p.set("type", t)641}642func (p *htmlSourceElementImpl) SrcSet() string {643 return p.get("srcset").toString()644}645func (p *htmlSourceElementImpl) SetSrcSet(srcset string) {646 p.set("srcset", srcset)647}648func (p *htmlSourceElementImpl) Sizes() string {649 return p.get("sizes").toString()650}651func (p *htmlSourceElementImpl) SetSizes(sizes string) {652 p.set("sizes", sizes)653}654func (p *htmlSourceElementImpl) Media() string {655 return p.get("media").toString()656}657func (p *htmlSourceElementImpl) SetMedia(media string) {658 p.set("media", media)659}660// -------------8<---------------------------------------661type htmlImageElementImpl struct {662 *htmlElementImpl663}664func NewHTMLImageElement() HTMLImageElement {665 if el := CurrentDocument().CreateElement("img"); el != nil {666 if img, ok := el.(HTMLImageElement); ok {667 return img668 }669 }670 return nil671}672func wrapHTMLImageElement(v Value) HTMLImageElement {673 if v.valid() {674 return &htmlImageElementImpl{675 htmlElementImpl: newHTMLElementImpl(v),676 }677 }678 return nil679}680func (p *htmlImageElementImpl) Alt() string {681 return p.get("alt").toString()682}683func (p *htmlImageElementImpl) SetAlt(alt string) {684 p.set("alt", alt)685}686func (p *htmlImageElementImpl) Src() string {687 return p.get("src").toString()688}689func (p *htmlImageElementImpl) SetSrc(src string) {690 p.set("src", src)691}692func (p *htmlImageElementImpl) SrcSet() string {693 return p.get("srcset").toString()694}695func (p *htmlImageElementImpl) SetSrcSet(srcset string) {696 p.set("srcset", srcset)697}698func (p *htmlImageElementImpl) Sizes() string {699 return p.get("sizes").toString()700}701func (p *htmlImageElementImpl) SetSizes(sizes string) {702 p.set("sizes", sizes)703}704func (p *htmlImageElementImpl) CrossOrigin() string {705 return p.get("crossOrigin").toString()706}707func (p *htmlImageElementImpl) SetCrossOrigin(co string) {708 p.set("crossOrigin", co)709}710func (p *htmlImageElementImpl) UseMap() string {711 return p.get("useMap").toString()712}713func (p *htmlImageElementImpl) SetUseMap(um string) {714 p.set("useMap", um)715}716func (p *htmlImageElementImpl) LongDesc() string {717 return p.get("longDesc").toString()718}719func (p *htmlImageElementImpl) SetLongDesc(ld string) {720 p.set("longDesc", ld)721}722func (p *htmlImageElementImpl) IsMap() bool {723 return p.get("isMap").toBool()724}725func (p *htmlImageElementImpl) SetIsMap(b bool) {726 p.set("isMap", b)727}728func (p *htmlImageElementImpl) Width() uint {729 return p.get("width").toUint()730}731func (p *htmlImageElementImpl) SetWidth(w uint) {732 p.set("width", w)733}734func (p *htmlImageElementImpl) Height() uint {735 return p.get("height").toUint()736}737func (p *htmlImageElementImpl) SetHeight(h uint) {738 p.set("height", h)739}740func (p *htmlImageElementImpl) NaturalWidth() uint {741 return p.get("naturalWidth").toUint()742}743func (p *htmlImageElementImpl) NaturalHeight() uint {744 return p.get("naturalHeight").toUint()745}746func (p *htmlImageElementImpl) Complete() bool {747 return p.get("complete").toBool()748}749func (p *htmlImageElementImpl) CurrentSrc() string {750 return p.get("currentSrc").toString()751}752func (p *htmlImageElementImpl) ReferrerPolicy() string {753 return p.get("referrerPolicy").toString()754}755func (p *htmlImageElementImpl) SetReferrerPolicy(policy string) {756 p.set("referrerPolicy", policy)757}758func (p *htmlImageElementImpl) X() int {759 return p.get("x").toInt()760}761func (p *htmlImageElementImpl) Y() int {762 return p.get("y").toInt()763}764// -------------8<---------------------------------------765type htmlIFrameElementImpl struct {766 *htmlElementImpl767}768func NewHTMLIFrameElement() HTMLIFrameElement {769 if el := CurrentDocument().CreateElement("iframe"); el != nil {770 if iframe, ok := el.(HTMLIFrameElement); ok {771 return iframe772 }773 }774 return nil775}776func wrapHTMLIFrameElement(v Value) HTMLIFrameElement {777 if v.valid() {778 return &htmlIFrameElementImpl{779 htmlElementImpl: newHTMLElementImpl(v),780 }781 }782 return nil783}784func (p *htmlIFrameElementImpl) Src() string {785 return p.get("src").toString()786}787func (p *htmlIFrameElementImpl) SetSrc(src string) {788 p.set("src", src)789}790func (p *htmlIFrameElementImpl) SrcDoc() string {791 return p.get("srcdoc").toString()792}793func (p *htmlIFrameElementImpl) SetSrcDoc(srcDoc string) {794 p.set("srcdoc", srcDoc)795}796func (p *htmlIFrameElementImpl) Name() string {797 return p.get("name").toString()798}799func (p *htmlIFrameElementImpl) SetName(name string) {800 p.set("name", name)801}802func (p *htmlIFrameElementImpl) Sandbox() DOMTokenList {803 return wrapDOMTokenList(p.get("sandbox"))804}805func (p *htmlIFrameElementImpl) AllowFullScreen() bool {806 return p.get("allowFullscreen").toBool()807}808func (p *htmlIFrameElementImpl) SetAllowFullScreen(b bool) {809 p.set("allowFullscreen", b)810}811func (p *htmlIFrameElementImpl) AllowPaymentRequest() bool {812 return p.get("allowPaymentRequest").toBool()813}814func (p *htmlIFrameElementImpl) SetAllowPaymentRequest(b bool) {815 p.set("allowPaymentRequest", b)816}817func (p *htmlIFrameElementImpl) Width() string {818 return p.get("width").toString()819}820func (p *htmlIFrameElementImpl) SetWidth(w string) {821 p.set("width", w)822}823func (p *htmlIFrameElementImpl) Height() string {824 return p.get("height").toString()825}826func (p *htmlIFrameElementImpl) SetHeight(h string) {827 p.set("height", h)828}829func (p *htmlIFrameElementImpl) ReferrerPolicy() string {830 return p.get("referrerPolicy").toString()831}832func (p *htmlIFrameElementImpl) SetReferrerPolicy(policy string) {833 p.set("referrerPolicy", policy)834}835func (p *htmlIFrameElementImpl) ContentDocument() Document {836 return wrapDocument(p.get("contentDocument"))837}838func (p *htmlIFrameElementImpl) ContentWindow() WindowProxy {839 return wrapWindowProxy(p.get("contentWindow"))840}841// -------------8<---------------------------------------842type htmlEmbedElementImpl struct {843 *htmlElementImpl844}845func NewHTMLEmbedElement() HTMLEmbedElement {846 if el := CurrentDocument().CreateElement("embed"); el != nil {847 if embed, ok := el.(HTMLEmbedElement); ok {848 return embed849 }850 }851 return nil852}853func wrapHTMLEmbedElement(v Value) HTMLEmbedElement {854 if v.valid() {855 return &htmlEmbedElementImpl{856 htmlElementImpl: newHTMLElementImpl(v),857 }858 }859 return nil860}861func (p *htmlEmbedElementImpl) Src() string {862 return p.get("src").toString()863}864func (p *htmlEmbedElementImpl) SetSrc(src string) {865 p.set("src", src)866}867func (p *htmlEmbedElementImpl) Type() string {868 return p.get("type").toString()869}870func (p *htmlEmbedElementImpl) SetType(t string) {871 p.set("type", t)872}873func (p *htmlEmbedElementImpl) Width() string {874 return p.get("width").toString()875}876func (p *htmlEmbedElementImpl) SetWidth(w string) {877 p.set("width", w)878}879func (p *htmlEmbedElementImpl) Height() string {880 return p.get("height").toString()881}882func (p *htmlEmbedElementImpl) SetHeight(h string) {883 p.set("height", h)884}885// -------------8<---------------------------------------886type htmlObjectElementImpl struct {887 *htmlElementImpl888}889func NewHTMLObjectElement() HTMLObjectElement {890 if el := CurrentDocument().CreateElement("object"); el != nil {891 if obj, ok := el.(HTMLObjectElement); ok {892 return obj893 }894 }895 return nil896}897func wrapHTMLObjectElement(v Value) HTMLObjectElement {898 if v.valid() {899 return &htmlObjectElementImpl{900 htmlElementImpl: newHTMLElementImpl(v),901 }902 }903 return nil904}905func (p *htmlObjectElementImpl) Data() string {906 return p.get("data").toString()907}908func (p *htmlObjectElementImpl) SetData(d string) {909 p.set("data", d)910}911func (p *htmlObjectElementImpl) Type() string {912 return p.get("type").toString()913}914func (p *htmlObjectElementImpl) SetType(t string) {915 p.set("type", t)916}917func (p *htmlObjectElementImpl) TypeMustMatch() bool {918 return p.get("typeMustMatch").toBool()919}920func (p *htmlObjectElementImpl) SetTypeMustMatch(b bool) {921 p.set("typeMustMatch", b)922}923func (p *htmlObjectElementImpl) Name() string {924 return p.get("name").toString()925}926func (p *htmlObjectElementImpl) SetName(name string) {927 p.set("name", name)928}929func (p *htmlObjectElementImpl) Form() HTMLFormElement {930 return wrapHTMLFormElement(p.get("form"))931}932func (p *htmlObjectElementImpl) Width() string {933 return p.get("width").toString()934}935func (p *htmlObjectElementImpl) SetWidth(w string) {936 p.set("width", w)937}938func (p *htmlObjectElementImpl) Height() string {939 return p.get("height").toString()940}941func (p *htmlObjectElementImpl) SetHeight(h string) {942 p.set("height", h)943}944func (p *htmlObjectElementImpl) ContentDocument() Document {945 return wrapDocument(p.get("contentDocument"))946}947func (p *htmlObjectElementImpl) ContentWindow() WindowProxy {948 return wrapWindowProxy(p.get("contentWindow"))949}950func (p *htmlObjectElementImpl) WillValidate() bool {951 return p.get("willValidate").toBool()952}953func (p *htmlObjectElementImpl) Validity() ValidityState {954 return wrapValidityState(p.get("validity"))955}956func (p *htmlObjectElementImpl) ValidationMessage() string {957 return p.get("validationMessage").toString()958}959func (p *htmlObjectElementImpl) CheckValidity() bool {960 return p.call("checkValidity").toBool()961}962func (p *htmlObjectElementImpl) ReportValidity() bool {963 return p.call("reportValidity").toBool()964}965func (p *htmlObjectElementImpl) SetCustomValidity(e string) {966 p.call("setCustomValidity", e)967}968// -------------8<---------------------------------------969type validityStateImpl struct {970 *htmlElementImpl971}972func wrapValidityState(v Value) ValidityState {973 if v.valid() {974 return &validityStateImpl{975 htmlElementImpl: newHTMLElementImpl(v),976 }977 }978 return nil979}980func (p *validityStateImpl) ValueMissing() bool {981 return p.get("valueMissing").toBool()982}983func (p *validityStateImpl) TypeMismatch() bool {984 return p.get("typeMismatch").toBool()985}986func (p *validityStateImpl) PatternMismatch() bool {987 return p.get("patternMismatch").toBool()988}989func (p *validityStateImpl) TooLong() bool {990 return p.get("tooLong").toBool()991}992func (p *validityStateImpl) TooShort() bool {993 return p.get("tooShort").toBool()994}995func (p *validityStateImpl) RangeUnderflow() bool {996 return p.get("rangeUnderflow").toBool()997}998func (p *validityStateImpl) RangeOverflow() bool {999 return p.get("rangeOverflow").toBool()1000}1001func (p *validityStateImpl) StepMismatch() bool {1002 return p.get("stepMismatch").toBool()1003}1004func (p *validityStateImpl) BadInput() bool {1005 return p.get("badInput").toBool()1006}1007func (p *validityStateImpl) CustomError() bool {1008 return p.get("customError").toBool()1009}1010func (p *validityStateImpl) Valid() bool {1011 return p.get("valid").toBool()1012}1013// -------------8<---------------------------------------1014type htmlParamElementImpl struct {1015 *htmlElementImpl1016}1017func NewHTMLParamElement(name string, value string) HTMLParamElement {1018 if el := CurrentDocument().CreateElement("param"); el != nil {1019 if param, ok := el.(HTMLParamElement); ok {1020 param.SetName(name)1021 param.SetValue(value)1022 return param1023 }1024 }1025 return nil1026}1027func wrapHTMLParamElement(v Value) HTMLParamElement {1028 if v.valid() {1029 return &htmlParamElementImpl{1030 htmlElementImpl: newHTMLElementImpl(v),1031 }1032 }1033 return nil1034}1035func (p *htmlParamElementImpl) Name() string {1036 return p.get("name").toString()1037}1038func (p *htmlParamElementImpl) SetName(name string) {1039 p.set("name", name)1040}1041func (p *htmlParamElementImpl) Value() string {1042 return p.get("value").toString()1043}1044func (p *htmlParamElementImpl) SetValue(value string) {1045 p.set("value", value)1046}1047// -------------8<---------------------------------------1048type htmlVideoElementImpl struct {1049 *htmlMediaElementImpl1050}1051func NewHTMLVideoElement() HTMLVideoElement {1052 if el := CurrentDocument().CreateElement("video"); el != nil {1053 if video, ok := el.(HTMLVideoElement); ok {1054 return video1055 }1056 }1057 return nil1058}1059func wrapHTMLVideoElement(v Value) HTMLVideoElement {1060 if v.valid() {1061 return &htmlVideoElementImpl{1062 htmlMediaElementImpl: newHTMLMediaElementImpl(v),1063 }1064 }1065 return nil1066}1067func (p *htmlVideoElementImpl) Width() uint {1068 return p.get("width").toUint()1069}1070func (p *htmlVideoElementImpl) SetWidth(w uint) {1071 p.set("width", w)1072}1073func (p *htmlVideoElementImpl) Height() uint {1074 return p.get("height").toUint()1075}1076func (p *htmlVideoElementImpl) SetHeight(h uint) {1077 p.set("height", h)1078}1079func (p *htmlVideoElementImpl) VideoWidth() uint {1080 return p.get("videoWidth").toUint()1081}1082func (p *htmlVideoElementImpl) VideoHeight() uint {1083 return p.get("videoHeight").toUint()1084}1085func (p *htmlVideoElementImpl) Poster() string {1086 return p.get("poster").toString()1087}1088func (p *htmlVideoElementImpl) SetPoster(poster string) {1089 p.set("poster", poster)1090}1091// -------------8<---------------------------------------1092type htmlAudioElementImpl struct {1093 *htmlMediaElementImpl1094}1095func NewHTMLAudioElement() HTMLAudioElement {1096 if el := CurrentDocument().CreateElement("audio"); el != nil {1097 if audio, ok := el.(HTMLAudioElement); ok {1098 return audio1099 }1100 }1101 return nil1102}1103func wrapHTMLAudioElement(v Value) HTMLAudioElement {1104 if v.valid() {1105 return &htmlAudioElementImpl{1106 htmlMediaElementImpl: newHTMLMediaElementImpl(v),1107 }1108 }1109 return nil1110}1111// -------------8<---------------------------------------1112type htmlTrackElementImpl struct {1113 *htmlElementImpl1114}1115func NewHTMLTrackElement() HTMLTrackElement {1116 if el := CurrentDocument().CreateElement("track"); el != nil {1117 if track, ok := el.(HTMLTrackElement); ok {1118 return track1119 }1120 }1121 return nil1122}1123func wrapHTMLTrackElement(v Value) HTMLTrackElement {1124 if v.valid() {1125 return &htmlTrackElementImpl{1126 htmlElementImpl: newHTMLElementImpl(v),1127 }1128 }1129 return nil1130}1131func (p *htmlTrackElementImpl) Kind() string {1132 return p.get("kind").toString()1133}1134func (p *htmlTrackElementImpl) SetKind(k string) {1135 p.set("kind", k)1136}1137func (p *htmlTrackElementImpl) Src() string {1138 return p.get("src").toString()1139}1140func (p *htmlTrackElementImpl) SetSrc(src string) {1141 p.set("src", src)1142}1143func (p *htmlTrackElementImpl) SrcLang() string {1144 return p.get("srclang").toString()1145}1146func (p *htmlTrackElementImpl) SetSrcLang(sl string) {1147 p.set("srclang", sl)1148}1149func (p *htmlTrackElementImpl) Label() string {1150 return p.get("label").toString()1151}1152func (p *htmlTrackElementImpl) SetLabel(lbl string) {1153 p.set("label", lbl)1154}1155func (p *htmlTrackElementImpl) Default() bool {1156 return p.get("default").toBool()1157}1158func (p *htmlTrackElementImpl) SetDefault(b bool) {1159 p.set("default", b)1160}1161func (p *htmlTrackElementImpl) ReadyState() HTMLTrackElementReadyState {1162 return HTMLTrackElementReadyState(p.get("readyState").toUint16())1163}1164func (p *htmlTrackElementImpl) Track() TextTrack {1165 return wrapTextTrack(p.get("track"))1166}1167// -------------8<---------------------------------------1168type textTrackImpl struct {1169 *eventTargetImpl1170}1171func wrapTextTrack(v Value) TextTrack {1172 if v.valid() {1173 return &textTrackImpl{1174 eventTargetImpl: newEventTargetImpl(v),1175 }1176 }1177 return nil1178}1179func (p *textTrackImpl) Kind() TextTrackKind {1180 return TextTrackKind(p.get("kind").toString())1181}1182func (p *textTrackImpl) Label() string {1183 return p.get("label").toString()1184}1185func (p *textTrackImpl) Language() string {1186 return p.get("language").toString()1187}1188func (p *textTrackImpl) Id() string {1189 return p.get("id").toString()1190}1191func (p *textTrackImpl) InBandMetadataTrackDispatchType() string {1192 return p.get("inBandMetadataTrackDispatchType").toString()1193}1194func (p *textTrackImpl) Mode() TextTrackMode {1195 return TextTrackMode(p.get("mode").toString())1196}1197func (p *textTrackImpl) SetMode(mode TextTrackMode) {1198 p.set("mode", string(mode))1199}1200func (p *textTrackImpl) Cues() TextTrackCueList {1201 return wrapTextTrackCueList(p.get("cues"))1202}1203func (p *textTrackImpl) ActiveCues() TextTrackCueList {1204 return wrapTextTrackCueList(p.get("activeCues"))1205}1206func (p *textTrackImpl) AddCue(cue TextTrackCue) {1207 p.call("addCue", JSValueOf(cue))1208}1209func (p *textTrackImpl) RemoveCue(cue TextTrackCue) {1210 p.call("removeCue", JSValueOf(cue))1211}1212func (p *textTrackImpl) OnCueChange(fn func(Event)) EventHandler {1213 return p.On("cuechange", fn)1214}1215// -------------8<---------------------------------------1216type textTrackCueListImpl struct {1217 Value1218}1219func wrapTextTrackCueList(v Value) TextTrackCueList {1220 if v.valid() {1221 return &textTrackCueListImpl{1222 Value: v,1223 }1224 }1225 return nil1226}1227func (p *textTrackCueListImpl) Length() uint {1228 return p.get("length").toUint()1229}1230func (p *textTrackCueListImpl) Item(index uint) TextTrackCue {1231 return wrapTextTrackCue(p.call("item", index))1232}1233func (p *textTrackCueListImpl) CueById(id string) TextTrackCue {1234 return wrapTextTrackCue(p.call("getCueById", id))1235}1236// -------------8<---------------------------------------1237type textTrackCueImpl struct {1238 *eventTargetImpl1239}1240func wrapTextTrackCue(v Value) TextTrackCue {1241 if v.valid() {1242 return &textTrackCueImpl{1243 eventTargetImpl: newEventTargetImpl(v),1244 }1245 }1246 return nil1247}1248func (p *textTrackCueImpl) Track() TextTrack {1249 return wrapTextTrack(p.get("track"))1250}1251func (p *textTrackCueImpl) Id() string {1252 return p.get("id").toString()1253}1254func (p *textTrackCueImpl) SetId(id string) {1255 p.set("id", id)1256}1257func (p *textTrackCueImpl) StartTime() float64 {1258 return p.get("startTime").toFloat64()1259}1260func (p *textTrackCueImpl) SetStartTime(st float64) {1261 p.set("startTime", st)1262}1263func (p *textTrackCueImpl) EndTime() float64 {1264 return p.get("endTime").toFloat64()1265}1266func (p *textTrackCueImpl) SetEndTime(et float64) {1267 p.set("endTime", et)1268}1269func (p *textTrackCueImpl) PauseOnExit() bool {1270 return p.get("pauseOnExit").toBool()1271}1272func (p *textTrackCueImpl) SetPauseOnExit(poe bool) {1273 p.set("pauseOnExit", poe)1274}1275func (p *textTrackCueImpl) OnEnter(fn func(Event)) EventHandler {1276 return p.On("enter", fn)1277}1278func (p *textTrackCueImpl) OnExit(fn func(Event)) EventHandler {1279 return p.On("exit", fn)1280}1281// -------------8<---------------------------------------1282type htmlMapElementImpl struct {1283 *htmlElementImpl1284}1285func NewHTMLMapElement() HTMLMapElement {1286 if el := CurrentDocument().CreateElement("map"); el != nil {1287 if m, ok := el.(HTMLMapElement); ok {1288 return m1289 }1290 }1291 return nil1292}1293func wrapHTMLMapElement(v Value) HTMLMapElement {1294 if v.valid() {1295 return &htmlMapElementImpl{1296 htmlElementImpl: newHTMLElementImpl(v),1297 }1298 }1299 return nil1300}1301func (p *htmlMapElementImpl) Name() string {1302 return p.get("name").toString()1303}1304func (p *htmlMapElementImpl) SetName(name string) {1305 p.set("name", name)1306}1307func (p *htmlMapElementImpl) Areas() []HTMLAreaElement {1308 if c := wrapHTMLCollection(p.get("areas")); c != nil && c.Length() > 0 {1309 var ret []HTMLAreaElement1310 for i := uint(0); i < c.Length(); i++ {1311 if el, ok := c.Item(i).(HTMLAreaElement); ok {1312 ret = append(ret, el)1313 }1314 }1315 return ret1316 }1317 return nil1318}1319// <img> and <object> Elements1320func (p *htmlMapElementImpl) Images() []HTMLElement {1321 return htmlCollectionToHTMLElementSlice(p.get("images"))1322}1323// -------------8<---------------------------------------1324type htmlAreaElementImpl struct {1325 *htmlElementImpl1326 *htmlHyperlinkElementUtilsImpl1327 Value1328}1329func NewHTMLAreaElement() HTMLAreaElement {1330 if el := CurrentDocument().CreateElement("area"); el != nil {1331 if area, ok := el.(HTMLAreaElement); ok {1332 return area1333 }1334 }1335 return nil1336}1337func wrapHTMLAreaElement(v Value) HTMLAreaElement {1338 if v.valid() {1339 return &htmlAreaElementImpl{1340 htmlElementImpl: newHTMLElementImpl(v),1341 htmlHyperlinkElementUtilsImpl: newHTMLHyperlinkElementUtilsImpl(v),1342 Value: v,1343 }1344 }1345 return nil1346}1347func (p *htmlAreaElementImpl) Alt() string {1348 return p.get("alt").toString()1349}1350func (p *htmlAreaElementImpl) SetAlt(alt string) {1351 p.set("alt", alt)1352}1353func (p *htmlAreaElementImpl) Coords() string {1354 return p.get("coords").toString()1355}1356func (p *htmlAreaElementImpl) SetCoords(coords string) {1357 p.set("coords", coords)1358}1359func (p *htmlAreaElementImpl) Shape() string {1360 return p.get("shape").toString()1361}1362func (p *htmlAreaElementImpl) SetShape(shape string) {1363 p.set("shape", shape)1364}1365func (p *htmlAreaElementImpl) Target() string {1366 return p.get("target").toString()1367}1368func (p *htmlAreaElementImpl) SetTarget(target string) {1369 p.set("target", target)1370}1371func (p *htmlAreaElementImpl) Download() string {1372 return p.get("download").toString()1373}1374func (p *htmlAreaElementImpl) SetDownload(download string) {1375 p.set("download", download)1376}1377func (p *htmlAreaElementImpl) Rel() string {1378 return p.get("rel").toString()1379}1380func (p *htmlAreaElementImpl) SetRel(rel string) {1381 p.set("rel", rel)1382}1383func (p *htmlAreaElementImpl) RelList() DOMTokenList {1384 return wrapDOMTokenList(p.get("relList"))1385}1386func (p *htmlAreaElementImpl) HrefLang() string {1387 return p.get("hreflang").toString()1388}1389func (p *htmlAreaElementImpl) SetHrefLang(hl string) {1390 p.set("hreflang", hl)1391}1392func (p *htmlAreaElementImpl) Type() string {1393 return p.get("type").toString()1394}1395func (p *htmlAreaElementImpl) SetType(typ string) {1396 p.set("type", typ)1397}1398func (p *htmlAreaElementImpl) ReferrerPolicy() string {1399 return p.get("referrerPolicy").toString()1400}1401func (p *htmlAreaElementImpl) SetReferrerPolicy(policy string) {1402 p.set("referrerPolicy", policy)1403}1404// -------------8<---------------------------------------1405type htmlMediaElementImpl struct {1406 *htmlElementImpl1407}1408func wrapHTMLMediaElement(v Value) HTMLMediaElement {1409 if p := newHTMLMediaElementImpl(v); p != nil {1410 return p1411 }1412 return nil1413}1414func newHTMLMediaElementImpl(v Value) *htmlMediaElementImpl {1415 if v.valid() {1416 return &htmlMediaElementImpl{1417 htmlElementImpl: newHTMLElementImpl(v),1418 }1419 }1420 return nil1421}1422func (p *htmlMediaElementImpl) Error() MediaError {1423 return wrapMediaError(p.get("error"))1424}1425func (p *htmlMediaElementImpl) Src() string {1426 return p.get("src").toString()1427}1428func (p *htmlMediaElementImpl) SetSrc(src string) {1429 p.set("src", src)1430}1431func (p *htmlMediaElementImpl) SrcObject() MediaProvider {1432 return wrapMediaProvider(p.get("srcObject"))1433}1434func (p *htmlMediaElementImpl) SetSrcObject(provider MediaProvider) {1435 p.set("srcObject", JSValueOf(provider))1436}1437func (p *htmlMediaElementImpl) CurrentSrc() string {1438 return p.get("currentSrc").toString()1439}1440func (p *htmlMediaElementImpl) CrossOrigin() string {1441 return p.get("crossOrigin").toString()1442}1443func (p *htmlMediaElementImpl) SetCrossOrigin(co string) {1444 p.set("crossOrigin", co)1445}1446func (p *htmlMediaElementImpl) NetworkState() MediaNetworkState {1447 return MediaNetworkState(p.get("networkState").toUint16())1448}1449func (p *htmlMediaElementImpl) Preload() string {1450 return p.get("preload").toString()1451}1452func (p *htmlMediaElementImpl) SetPreload(preload string) {1453 p.set("preload", preload)1454}1455func (p *htmlMediaElementImpl) Buffered() TimeRanges {1456 return wrapTimeRanges(p.get("buffered"))1457}1458func (p *htmlMediaElementImpl) Load() {1459 p.call("load")1460}1461func (p *htmlMediaElementImpl) CanPlayType(typ string) CanPlayTypeResult {1462 return CanPlayTypeResult(p.call("canPlayType", typ).toString())1463}1464func (p *htmlMediaElementImpl) ReadyState() MediaReadyState {1465 return MediaReadyState(p.get("readyState").toUint16())1466}1467func (p *htmlMediaElementImpl) Seeking() bool {1468 return p.get("seeking").toBool()1469}1470func (p *htmlMediaElementImpl) CurrentTime() float64 {1471 return p.get("currentTime").toFloat64()1472}1473func (p *htmlMediaElementImpl) SetCurrentTime(ct float64) {1474 p.set("currentTime", ct)1475}1476func (p *htmlMediaElementImpl) FastSeek(fs float64) {1477 p.call("fastSeek", fs)1478}1479func (p *htmlMediaElementImpl) Duration() float64 {1480 return p.get("duration").toFloat64()1481}1482func (p *htmlMediaElementImpl) StartDate() time.Time {1483 return jsDateToTime(p.call("getStartDate"))1484}1485func (p *htmlMediaElementImpl) Paused() bool {1486 return p.get("paused").toBool()1487}1488func (p *htmlMediaElementImpl) DefaultPlaybackRate() float64 {1489 return p.get("defaultPlaybackRate").toFloat64()1490}1491func (p *htmlMediaElementImpl) SetDefaultPlaybackRate(rate float64) {1492 p.set("defaultPlaybackRate", rate)1493}1494func (p *htmlMediaElementImpl) PlaybackRate() float64 {1495 return p.get("playbackRate").toFloat64()1496}1497func (p *htmlMediaElementImpl) SetPlaybackRate(rate float64) {1498 p.set("playbackRate", rate)1499}1500func (p *htmlMediaElementImpl) Played() TimeRanges {1501 return wrapTimeRanges(p.get("played"))1502}1503func (p *htmlMediaElementImpl) Seekable() TimeRanges {1504 return wrapTimeRanges(p.get("seekable"))1505}1506func (p *htmlMediaElementImpl) Ended() bool {1507 return p.get("ended").toBool()1508}1509func (p *htmlMediaElementImpl) AutoPlay() bool {1510 return p.get("autoplay").toBool()1511}1512func (p *htmlMediaElementImpl) SetAutoPlay(b bool) {1513 p.set("autoplay", b)1514}1515func (p *htmlMediaElementImpl) Loop() bool {1516 return p.get("loop").toBool()1517}1518func (p *htmlMediaElementImpl) SetLoop(b bool) {1519 p.set("loop", b)1520}1521func (p *htmlMediaElementImpl) Play() {1522 p.call("play")1523}1524func (p *htmlMediaElementImpl) Pause() {1525 p.call("pause")1526}1527func (p *htmlMediaElementImpl) Controls() bool {1528 return p.get("controls").toBool()1529}1530func (p *htmlMediaElementImpl) SetControls(b bool) {1531 p.set("controls", b)1532}1533func (p *htmlMediaElementImpl) Volume() bool {1534 return p.get("volume").toBool()1535}1536func (p *htmlMediaElementImpl) SetVolume(b bool) {1537 p.set("volume", b)1538}1539func (p *htmlMediaElementImpl) Muted() bool {1540 return p.get("muted").toBool()1541}1542func (p *htmlMediaElementImpl) SetMuted(b bool) {1543 p.set("muted", b)1544}1545func (p *htmlMediaElementImpl) DefaultMuted() bool {1546 return p.get("defaultMuted").toBool()1547}1548func (p *htmlMediaElementImpl) SetDefaultMuted(b bool) {1549 p.set("defaultMuted", b)1550}1551func (p *htmlMediaElementImpl) AudioTracks() AudioTrackList {1552 return wrapAudioTrackList(p.get("audioTracks"))1553}1554func (p *htmlMediaElementImpl) VideoTracks() VideoTrackList {1555 return wrapVideoTrackList(p.get("videoTracks"))1556}1557func (p *htmlMediaElementImpl) TextTracks() TextTrackList {1558 return wrapTextTrackList(p.get("textTracks"))1559}1560func (p *htmlMediaElementImpl) AddTextTrack(kind TextTrackKind, args ...string) TextTrack {1561 switch len(args) {1562 case 0:1563 return wrapTextTrack(p.call("addTextTrack", string(kind)))1564 case 1:1565 return wrapTextTrack(p.call("addTextTrack", string(kind), args[0]))1566 default:1567 return wrapTextTrack(p.call("addTextTrack", string(kind), args[0], args[1]))1568 }1569}1570// -------------8<---------------------------------------1571type audioTrackListImpl struct {1572 *eventTargetImpl1573}1574func wrapAudioTrackList(v Value) AudioTrackList {1575 if v.valid() {1576 return &audioTrackListImpl{1577 eventTargetImpl: newEventTargetImpl(v),1578 }1579 }1580 return nil1581}1582func (p *audioTrackListImpl) Length() uint {1583 return p.get("length").toUint()1584}1585func (p *audioTrackListImpl) Item(index uint) AudioTrack {1586 return wrapAudioTrack(p.call("item", index))1587}1588func (p *audioTrackListImpl) TrackById(id string) AudioTrack {1589 return wrapAudioTrack(p.call("getTrackById", id))1590}1591func (p *audioTrackListImpl) OnChange(fn func(Event)) EventHandler {1592 return p.On("change", fn)1593}1594func (p *audioTrackListImpl) OnAddTrack(fn func(Event)) EventHandler {1595 return p.On("addtrack", fn)1596}1597func (p *audioTrackListImpl) OnRemoveTrack(fn func(Event)) EventHandler {1598 return p.On("removetrack", fn)1599}1600// -------------8<---------------------------------------1601type audioTrackImpl struct {1602 Value1603}1604func wrapAudioTrack(v Value) AudioTrack {1605 if v.valid() {1606 return &audioTrackImpl{1607 Value: v,1608 }1609 }1610 return nil1611}1612func (p *audioTrackImpl) Id() string {1613 return p.get("id").toString()1614}1615func (p *audioTrackImpl) Kind() string {1616 return p.get("kind").toString()1617}1618func (p *audioTrackImpl) Label() string {1619 return p.get("label").toString()1620}1621func (p *audioTrackImpl) Language() string {1622 return p.get("language").toString()1623}1624func (p *audioTrackImpl) Enabled() bool {1625 return p.get("enabled").toBool()1626}1627func (p *audioTrackImpl) SetEnabled(b bool) {1628 p.set("enabled", b)1629}1630// -------------8<---------------------------------------1631type videoTrackListImpl struct {1632 *eventTargetImpl1633}1634func wrapVideoTrackList(v Value) VideoTrackList {1635 if v.valid() {1636 return &videoTrackListImpl{1637 eventTargetImpl: newEventTargetImpl(v),1638 }1639 }1640 return nil1641}1642func (p *videoTrackListImpl) Length() uint {1643 return p.get("length").toUint()1644}1645func (p *videoTrackListImpl) Item(index uint) VideoTrack {1646 return wrapVideoTrack(p.call("item", index))1647}1648func (p *videoTrackListImpl) TrackById(id string) VideoTrack {1649 return wrapVideoTrack(p.call("getTrackById", id))1650}1651func (p *videoTrackListImpl) SelectedIndex() int {1652 return p.get("selectedIndex").toInt()1653}1654func (p *videoTrackListImpl) OnChange(fn func(Event)) EventHandler {1655 return p.On("change", fn)1656}1657func (p *videoTrackListImpl) OnAddTrack(fn func(Event)) EventHandler {1658 return p.On("addtrack", fn)1659}1660func (p *videoTrackListImpl) OnRemoveTrack(fn func(Event)) EventHandler {1661 return p.On("removetrack", fn)1662}1663// -------------8<---------------------------------------1664type videoTrackImpl struct {1665 Value1666}1667func wrapVideoTrack(v Value) VideoTrack {1668 if v.valid() {1669 return &videoTrackImpl{1670 Value: v,1671 }1672 }1673 return nil1674}1675func (p *videoTrackImpl) Id() string {1676 return p.get("id").toString()1677}1678func (p *videoTrackImpl) Kind() string {1679 return p.get("kind").toString()1680}1681func (p *videoTrackImpl) Label() string {1682 return p.get("label").toString()1683}1684func (p *videoTrackImpl) Language() string {1685 return p.get("language").toString()1686}1687func (p *videoTrackImpl) Selected() bool {1688 return p.get("selected").toBool()1689}1690func (p *videoTrackImpl) SetSelected(b bool) {1691 p.set("selected", b)1692}1693// -------------8<---------------------------------------1694type textTrackListImpl struct {1695 *eventTargetImpl1696}1697func wrapTextTrackList(v Value) TextTrackList {1698 if v.valid() {1699 return &textTrackListImpl{1700 eventTargetImpl: newEventTargetImpl(v),1701 }1702 }1703 return nil1704}1705func (p *textTrackListImpl) Length() uint {1706 return p.get("length").toUint()1707}1708func (p *textTrackListImpl) Item(index uint) TextTrack {1709 return wrapTextTrack(p.call("item", index))1710}1711func (p *textTrackListImpl) TrackById(id string) TextTrack {1712 return wrapTextTrack(p.call("getTrackById", id))1713}1714func (p *textTrackListImpl) OnChange(fn func(Event)) EventHandler {1715 return p.On("change", fn)1716}1717func (p *textTrackListImpl) OnAddTrack(fn func(Event)) EventHandler {1718 return p.On("addtrack", fn)1719}1720func (p *textTrackListImpl) OnRemoveTrack(fn func(Event)) EventHandler {1721 return p.On("removetrack", fn)1722}1723// -------------8<---------------------------------------1724type timeRangesImpl struct {1725 Value1726}1727func wrapTimeRanges(v Value) TimeRanges {1728 if v.valid() {1729 return &timeRangesImpl{1730 Value: v,1731 }1732 }1733 return nil1734}1735func (p *timeRangesImpl) Length() uint {1736 return p.get("length").toUint()1737}1738func (p *timeRangesImpl) Start(index uint) float64 {1739 return p.call("start", index).toFloat64()1740}1741func (p *timeRangesImpl) End(index uint) float64 {1742 return p.call("end", index).toFloat64()1743}1744// -------------8<---------------------------------------1745type mediaErrorImpl struct {1746 Value1747}1748func wrapMediaError(v Value) MediaError {1749 if v.valid() {1750 return &mediaErrorImpl{1751 Value: v,1752 }1753 }1754 return nil1755}1756func (p *mediaErrorImpl) Code() MediaErrorCode {1757 return MediaErrorCode(p.get("code").toUint16())1758}1759// -------------8<---------------------------------------1760type mediaProviderImpl struct {1761 Value1762}1763func wrapMediaProvider(v Value) MediaProvider {1764 if v.valid() {1765 return &mediaProviderImpl{1766 Value: v,1767 }1768 }1769 return nil1770}1771// -------------8<---------------------------------------1772type sourceBufferImpl struct {1773 *eventTargetImpl1774}1775func wrapSourceBuffer(v Value) SourceBuffer {1776 if v.valid() {1777 return &sourceBufferImpl{1778 eventTargetImpl: newEventTargetImpl(v),1779 }1780 }1781 return nil1782}1783func (p *sourceBufferImpl) Mode() AppendMode {1784 return AppendMode(p.get("mode").toString())1785}1786func (p *sourceBufferImpl) SetMode(mode AppendMode) {1787 p.set("mode", string(mode))1788}1789func (p *sourceBufferImpl) Updating() bool {1790 return p.get("updating").toBool()1791}1792func (p *sourceBufferImpl) Buffered() TimeRanges {1793 return wrapTimeRanges(p.get("buffered"))1794}1795func (p *sourceBufferImpl) TimestampOffset() float64 {1796 return p.get("timestampOffset").toFloat64()1797}1798func (p *sourceBufferImpl) SetTimestampOffset(t float64) {1799 p.set("timestampOffset", t)1800}1801func (p *sourceBufferImpl) AudioTracks() AudioTrackList {1802 return wrapAudioTrackList(p.get("audioTracks"))1803}1804func (p *sourceBufferImpl) VideoTracks() VideoTrackList {1805 return wrapVideoTrackList(p.get("videoTracks"))1806}1807func (p *sourceBufferImpl) TextTracks() TextTrackList {1808 return wrapTextTrackList(p.get("textTracks"))1809}1810func (p *sourceBufferImpl) AppendWindowStart() float64 {1811 return p.get("appendWindowStart").toFloat64()1812}1813func (p *sourceBufferImpl) SetAppendWindowStart(ws float64) {1814 p.set("appendWindowStart", ws)1815}1816func (p *sourceBufferImpl) AppendWindowEnd() float64 {1817 return p.get("appendWindowEnd").toFloat64()1818}1819func (p *sourceBufferImpl) SetAppendWindowEnd(we float64) {1820 p.set("appendWindowEnd", we)1821}1822func (p *sourceBufferImpl) OnUpdatestart(fn func(Event)) EventHandler {1823 return p.On("updatestart", fn)1824}1825func (p *sourceBufferImpl) OnUpdate(fn func(Event)) EventHandler {1826 return p.On("update", fn)1827}1828func (p *sourceBufferImpl) OnUpdateend(fn func(Event)) EventHandler {1829 return p.On("updateend", fn)1830}1831func (p *sourceBufferImpl) OnError(fn func(Event)) EventHandler {1832 return p.On("error", fn)1833}1834func (p *sourceBufferImpl) OnAbort(fn func(Event)) EventHandler {1835 return p.On("abort", fn)1836}1837func (p *sourceBufferImpl) AppendBuffer(buffer BufferSource) {1838 p.call("appendBuffer", JSValueOf(buffer))1839}1840func (p *sourceBufferImpl) Abort() {1841 p.call("abort")1842}1843func (p *sourceBufferImpl) Remove(start float64, end float64) {1844 p.call("remove", start, end)1845}1846// -------------8<---------------------------------------1847type mediaSourceImpl struct {1848 *eventTargetImpl1849}1850func wrapMediaSource(v Value) MediaSource {1851 if v.valid() {1852 return &mediaSourceImpl{1853 eventTargetImpl: newEventTargetImpl(v),1854 }1855 }1856 return nil1857}1858func (p *mediaSourceImpl) SourceBuffers() SourceBufferList {1859 return wrapSourceBufferList(p.get("sourceBuffers"))1860}1861func (p *mediaSourceImpl) ActiveSourceBuffers() SourceBufferList {1862 return wrapSourceBufferList(p.get("activeSourceBuffers"))1863}1864func (p *mediaSourceImpl) ReadyState() ReadyState {1865 return ReadyState(p.get("readyState").toString())1866}1867func (p *mediaSourceImpl) Duration() float64 {1868 return p.get("duration").toFloat64()1869}1870func (p *mediaSourceImpl) SetDuration(d float64) {1871 p.set("duration", d)1872}1873func (p *mediaSourceImpl) OnSourceOpen(fn func(Event)) EventHandler {1874 return p.On("sourceopen", fn)1875}1876func (p *mediaSourceImpl) OnSourceEnded(fn func(Event)) EventHandler {1877 return p.On("sourceended", fn)1878}1879func (p *mediaSourceImpl) OnSourceClose(fn func(Event)) EventHandler {1880 return p.On("sourceclose", fn)1881}1882func (p *mediaSourceImpl) AddSourceBuffer(typ string) SourceBuffer {1883 return wrapSourceBuffer(p.call("addSourceBuffer", typ))1884}1885func (p *mediaSourceImpl) RemoveSourceBuffer(sb SourceBuffer) {1886 p.call("removeSourceBuffer", JSValueOf(sb))1887}1888func (p *mediaSourceImpl) EndOfStream(err ...EndOfStreamError) {1889 switch len(err) {1890 case 0:1891 p.call("endOfStream")1892 default:1893 p.call("endOfStream", string(err[0]))1894 }1895}1896func (p *mediaSourceImpl) SetLiveSeekableRange(start float64, end float64) {1897 p.call("setLiveSeekableRange", start, end)1898}1899func (p *mediaSourceImpl) ClearLiveSeekableRange() {1900 p.call("clearLiveSeekableRange")1901}1902func (p *mediaSourceImpl) IsTypeSupported(string) bool { // static1903 return p.call("isTypeSupported").toBool()1904}1905// -------------8<---------------------------------------1906type sourceBufferListImpl struct {1907 *eventTargetImpl1908}1909func wrapSourceBufferList(v Value) SourceBufferList {1910 if v.valid() {1911 return &sourceBufferListImpl{1912 eventTargetImpl: newEventTargetImpl(v),1913 }1914 }1915 return nil1916}1917func (p *sourceBufferListImpl) Length() uint {1918 return p.get("length").toUint()1919}1920func (p *sourceBufferListImpl) OnAddSourceBuffer(fn func(Event)) EventHandler {1921 return p.On("addsourcebuffer", fn)1922}1923func (p *sourceBufferListImpl) OnRemoveSourceBuffer(fn func(Event)) EventHandler {1924 return p.On("removesourcebuffer", fn)1925}1926func (p *sourceBufferListImpl) Item(index uint) SourceBuffer { // getter1927 return wrapSourceBuffer(p.call("SourceBuffer", index))1928}1929// -------------8<---------------------------------------...

Full Screen

Full Screen

form_impl.go

Source:form_impl.go Github

copy

Full Screen

1// +build js,wasm2package wasm3import (4 "time"5)6// -------------8<---------------------------------------7type htmlFormElementImpl struct {8 *htmlElementImpl9}10func NewHTMLFormElement() HTMLFormElement {11 if el := CurrentDocument().CreateElement("form"); el != nil {12 if form, ok := el.(HTMLFormElement); ok {13 return form14 }15 }16 return nil17}18func wrapHTMLFormElement(v Value) HTMLFormElement {19 if v.valid() {20 return &htmlFormElementImpl{21 htmlElementImpl: newHTMLElementImpl(v),22 }23 }24 return nil25}26func (p *htmlFormElementImpl) AcceptCharset() string {27 return p.get("acceptCharset").toString()28}29func (p *htmlFormElementImpl) SetAcceptCharset(ch string) {30 p.set("acceptCharset", ch)31}32func (p *htmlFormElementImpl) Action() string {33 return p.get("action").toString()34}35func (p *htmlFormElementImpl) SetAction(a string) {36 p.set("action", a)37}38func (p *htmlFormElementImpl) Autocomplete() string {39 return p.get("autocomplete").toString()40}41func (p *htmlFormElementImpl) SetAutocomplete(ac string) {42 p.set("autocomplete", ac)43}44func (p *htmlFormElementImpl) Enctype() string {45 return p.get("enctype").toString()46}47func (p *htmlFormElementImpl) SetEnctype(et string) {48 p.set("enctype", et)49}50func (p *htmlFormElementImpl) Encoding() string {51 return p.get("encoding").toString()52}53func (p *htmlFormElementImpl) SetEncoding(enc string) {54 p.set("encoding", enc)55}56func (p *htmlFormElementImpl) Method() string {57 return p.get("method").toString()58}59func (p *htmlFormElementImpl) SetMethod(m string) {60 p.set("method", m)61}62func (p *htmlFormElementImpl) Name() string {63 return p.get("name").toString()64}65func (p *htmlFormElementImpl) SetName(name string) {66 p.set("name", name)67}68func (p *htmlFormElementImpl) NoValidate() bool {69 return p.get("noValidate").toBool()70}71func (p *htmlFormElementImpl) SetNoValidate(b bool) {72 p.set("noValidate", b)73}74func (p *htmlFormElementImpl) Target() string {75 return p.get("target").toString()76}77func (p *htmlFormElementImpl) SetTarget(t string) {78 p.set("target", t)79}80func (p *htmlFormElementImpl) Elements() HTMLFormControlsCollection {81 return wrapHTMLFormControlsCollection(p.get("elements"))82}83func (p *htmlFormElementImpl) Submit() {84 p.call("submit")85}86func (p *htmlFormElementImpl) Reset() {87 p.call("reset")88}89func (p *htmlFormElementImpl) CheckValidity() bool {90 return p.call("checkValidity").toBool()91}92func (p *htmlFormElementImpl) ReportValidity() bool {93 return p.call("reportValidity").toBool()94}95// -------------8<---------------------------------------96type htmlFormControlsCollectionImpl struct {97 *htmlCollectionImpl98}99func wrapHTMLFormControlsCollection(v Value) HTMLFormControlsCollection {100 if v.valid() {101 return &htmlFormControlsCollectionImpl{102 htmlCollectionImpl: newHTMLCollectionImpl(v),103 }104 }105 return nil106}107//NOTE overriden namedbyItem108func (p *htmlFormControlsCollectionImpl) ItemByName(item string) HTMLFormControl {109 return wrapHTMLFormControl(p.call("namedItem", item))110}111// -------------8<---------------------------------------112type htmlFormControlImpl struct {113 Value114}115func wrapHTMLFormControl(v Value) HTMLFormControl {116 if v.valid() {117 return &htmlFormControlImpl{118 Value: v,119 }120 }121 return nil122}123// -------------8<---------------------------------------124type radioNodeListImpl struct {125 *nodeListImpl126}127func wrapRadioNodeList(v Value) RadioNodeList {128 if v.valid() {129 return &radioNodeListImpl{130 nodeListImpl: newNodeListImpl(v),131 }132 }133 return nil134}135func (p *radioNodeListImpl) Value() string {136 return p.get("value").toString()137}138func (p *radioNodeListImpl) SetValue(value string) {139 p.set("value", value)140}141// -------------8<---------------------------------------142type htmlLabelElementImpl struct {143 *htmlElementImpl144}145func NewHTMLLabelElement() HTMLLabelElement {146 if el := CurrentDocument().CreateElement("label"); el != nil {147 if label, ok := el.(HTMLLabelElement); ok {148 return label149 }150 }151 return nil152}153func wrapHTMLLabelElement(v Value) HTMLLabelElement {154 if v.valid() {155 return &htmlLabelElementImpl{156 htmlElementImpl: newHTMLElementImpl(v),157 }158 }159 return nil160}161func (p *htmlLabelElementImpl) Form() HTMLFormElement {162 return wrapHTMLFormElement(p.get("form"))163}164func (p *htmlLabelElementImpl) HtmlFor() string {165 return p.get("htmlFor").toString()166}167func (p *htmlLabelElementImpl) SetHtmlFor(hf string) {168 p.set("htmlFor", hf)169}170func (p *htmlLabelElementImpl) Control() HTMLElement {171 return wrapHTMLElement(p.get("control"))172}173// -------------8<---------------------------------------174type htmlInputElementImpl struct {175 *htmlElementImpl176}177var htmlInputElementTypeMap = map[string]string{178 "button": "button",179 "checkbox": "checkbox",180 "color": "color",181 "date": "date",182 "datetime-local": "datetime-local",183 "email": "email",184 "file": "file",185 "hidden": "hidden",186 "image": "image",187 "month": "month",188 "number": "number",189 "password": "password",190 "radio": "radio",191 "range": "range",192 "reset": "reset",193 "search": "search",194 "submit": "submit",195 "tel": "tel",196 "text": "text",197 "time": "time",198 "url": "url",199 "week": "week",200}201func NewHTMLInputElement(typ ...string) HTMLInputElement {202 if el := CurrentDocument().CreateElement("input"); el != nil {203 if input, ok := el.(HTMLInputElement); ok {204 if len(typ) > 0 {205 if t := htmlInputElementTypeMap[typ[0]]; t != "" {206 input.SetType(t)207 }208 }209 return input210 }211 }212 return nil213}214func wrapHTMLInputElement(v Value) HTMLInputElement {215 if v.valid() {216 return &htmlInputElementImpl{217 htmlElementImpl: newHTMLElementImpl(v),218 }219 }220 return nil221}222func (p *htmlInputElementImpl) Accept() string {223 return p.get("accept").toString()224}225func (p *htmlInputElementImpl) SetAccept(a string) {226 p.set("accept", a)227}228func (p *htmlInputElementImpl) Alt() string {229 return p.get("alt").toString()230}231func (p *htmlInputElementImpl) SetAlt(a string) {232 p.set("alt", a)233}234func (p *htmlInputElementImpl) Autocomplete() string {235 return p.get("autocomplete").toString()236}237func (p *htmlInputElementImpl) SetAutocomplete(ac string) {238 p.set("autocomplete", ac)239}240func (p *htmlInputElementImpl) Autofocus() bool {241 return p.get("autofocus").toBool()242}243func (p *htmlInputElementImpl) SetAutofocus(af bool) {244 p.set("autofocus", af)245}246func (p *htmlInputElementImpl) DefaultChecked() bool {247 return p.get("defaultChecked").toBool()248}249func (p *htmlInputElementImpl) SetDefaultChecked(dc bool) {250 p.set("defaultChecked", dc)251}252func (p *htmlInputElementImpl) Checked() bool {253 return p.get("checked").toBool()254}255func (p *htmlInputElementImpl) SetChecked(c bool) {256 p.set("checked", c)257}258func (p *htmlInputElementImpl) DirName() string {259 return p.get("dirName").toString()260}261func (p *htmlInputElementImpl) SetDirName(dn string) {262 p.set("dirName", dn)263}264func (p *htmlInputElementImpl) Disabled() bool {265 return p.get("disabled").toBool()266}267func (p *htmlInputElementImpl) SetDisabled(d bool) {268 p.set("disabled", d)269}270func (p *htmlInputElementImpl) Form() HTMLFormElement {271 return wrapHTMLFormElement(p.get("form"))272}273func (p *htmlInputElementImpl) Files() []File {274 return fileListToSlice(p.get("files"))275}276func (p *htmlInputElementImpl) FormAction() string {277 return p.get("formAction").toString()278}279func (p *htmlInputElementImpl) SetFormAction(fa string) {280 p.set("formAction", fa)281}282func (p *htmlInputElementImpl) FormEnctype() string {283 return p.get("formEnctype").toString()284}285func (p *htmlInputElementImpl) SetFormEnctype(fe string) {286 p.set("formEnctype", fe)287}288func (p *htmlInputElementImpl) FormMethod() string {289 return p.get("formMethod").toString()290}291func (p *htmlInputElementImpl) SetFormMethod(fm string) {292 p.set("formMethod", fm)293}294func (p *htmlInputElementImpl) FormNoValidate() bool {295 return p.get("formNoValidate").toBool()296}297func (p *htmlInputElementImpl) SetFormNoValidate(b bool) {298 p.set("formNoValidate", b)299}300func (p *htmlInputElementImpl) FormTarget() string {301 return p.get("formTarget").toString()302}303func (p *htmlInputElementImpl) SetFormTarget(ft string) {304 p.set("formTarget", ft)305}306func (p *htmlInputElementImpl) Height() uint {307 return p.get("height").toUint()308}309func (p *htmlInputElementImpl) SetHeight(h uint) {310 p.set("height", h)311}312func (p *htmlInputElementImpl) Indeterminate() bool {313 return p.get("indeterminate").toBool()314}315func (p *htmlInputElementImpl) SetIndeterminate(b bool) {316 p.set("indeterminate", b)317}318func (p *htmlInputElementImpl) List() HTMLElement {319 return wrapHTMLElement(p.get("list"))320}321func (p *htmlInputElementImpl) Max() string {322 return p.get("max").toString()323}324func (p *htmlInputElementImpl) SetMax(m string) {325 p.set("max", m)326}327func (p *htmlInputElementImpl) MaxLength() int {328 return p.get("maxLength").toInt()329}330func (p *htmlInputElementImpl) SetMaxLength(m int) {331 p.set("maxLength", m)332}333func (p *htmlInputElementImpl) Min() string {334 return p.get("min").toString()335}336func (p *htmlInputElementImpl) SetMin(m string) {337 p.set("min", m)338}339func (p *htmlInputElementImpl) MinLength() int {340 return p.get("minLength").toInt()341}342func (p *htmlInputElementImpl) SetMinLength(m int) {343 p.set("minLength", m)344}345func (p *htmlInputElementImpl) Multiple() bool {346 return p.get("multiple").toBool()347}348func (p *htmlInputElementImpl) SetMultiple(b bool) {349 p.set("multiple", b)350}351func (p *htmlInputElementImpl) Name() string {352 return p.get("name").toString()353}354func (p *htmlInputElementImpl) SetName(name string) {355 p.set("name", name)356}357func (p *htmlInputElementImpl) Pattern() string {358 return p.get("pattern").toString()359}360func (p *htmlInputElementImpl) SetPattern(pattern string) {361 p.set("pattern", pattern)362}363func (p *htmlInputElementImpl) Placeholder() string {364 return p.get("placeholder").toString()365}366func (p *htmlInputElementImpl) SetPlaceholder(ph string) {367 p.set("placeholder", ph)368}369func (p *htmlInputElementImpl) ReadOnly() bool {370 return p.get("readOnly").toBool()371}372func (p *htmlInputElementImpl) SetReadOnly(b bool) {373 p.set("readOnly", b)374}375func (p *htmlInputElementImpl) Required() bool {376 return p.get("_required").toBool()377}378func (p *htmlInputElementImpl) SetRequired(b bool) {379 p.set("_required", b)380}381func (p *htmlInputElementImpl) Size() uint {382 return p.get("size").toUint()383}384func (p *htmlInputElementImpl) SetSize(s uint) {385 p.set("size", s)386}387func (p *htmlInputElementImpl) Src() string {388 return p.get("src").toString()389}390func (p *htmlInputElementImpl) SetSrc(src string) {391 p.set("src", src)392}393func (p *htmlInputElementImpl) Step() string {394 return p.get("step").toString()395}396func (p *htmlInputElementImpl) SetStep(s string) {397 p.set("step", s)398}399func (p *htmlInputElementImpl) Type() string {400 return p.get("type").toString()401}402func (p *htmlInputElementImpl) SetType(t string) {403 p.set("type", t)404}405func (p *htmlInputElementImpl) DefaultValue() string {406 return p.get("defaultValue").toString()407}408func (p *htmlInputElementImpl) SetDefaultValue(dv string) {409 p.set("defaultValue", dv)410}411func (p *htmlInputElementImpl) Value() string {412 return p.get("value").toString()413}414func (p *htmlInputElementImpl) SetValue(value string) {415 p.set("value", value)416}417func (p *htmlInputElementImpl) ValueAsDate() time.Time {418 //TODO: test it419 return jsDateToTime(p.get("valueAsDate"))420}421func (p *htmlInputElementImpl) SetValueAsDate(t time.Time) {422 // TODO: test it423 d := jsDate.jsNew()424 d.call("setTime", t.Unix())425 p.set("valueAsDate", d)426}427func (p *htmlInputElementImpl) ValueAsNumber() float64 {428 return p.get("valueAsNumber").toFloat64()429}430func (p *htmlInputElementImpl) SetValueAsNumber(n float64) {431 p.set("valueAsNumber", n)432}433func (p *htmlInputElementImpl) Width() uint {434 return p.get("width").toUint()435}436func (p *htmlInputElementImpl) SetWidth(w uint) {437 p.set("width", w)438}439func (p *htmlInputElementImpl) StepUp(n ...int) {440 switch len(n) {441 case 0:442 p.call("stepUp")443 default:444 p.call("stepUp", n[0])445 }446}447func (p *htmlInputElementImpl) StepDown(n ...int) {448 switch len(n) {449 case 0:450 p.call("stepDown")451 default:452 p.call("stepDown", n[0])453 }454}455func (p *htmlInputElementImpl) WillValidate() bool {456 return p.get("willValidate").toBool()457}458func (p *htmlInputElementImpl) Validity() ValidityState {459 return wrapValidityState(p.get("validity"))460}461func (p *htmlInputElementImpl) ValidationMessage() string {462 return p.get("validationMessage").toString()463}464func (p *htmlInputElementImpl) CheckValidity() bool {465 return p.call("checkValidity").toBool()466}467func (p *htmlInputElementImpl) ReportValidity() bool {468 return p.call("reportValidity").toBool()469}470func (p *htmlInputElementImpl) SetCustomValidity(cv string) {471 p.call("setCustomValidity", cv)472}473func (p *htmlInputElementImpl) Labels() []Node {474 return nodeListToSlice(p.get("labels"))475}476func (p *htmlInputElementImpl) Select() {477 p.call("select")478}479func (p *htmlInputElementImpl) SelectionStart() uint {480 return p.get("selectionStart").toUint()481}482func (p *htmlInputElementImpl) SetSelectionStart(se uint) {483 p.set("selectionStart", se)484}485func (p *htmlInputElementImpl) SelectionEnd() uint {486 return p.get("selectionEnd").toUint()487}488func (p *htmlInputElementImpl) SetSelectionEnd(se uint) {489 p.set("selectionEnd", se)490}491func (p *htmlInputElementImpl) SelectionDirection() string {492 return p.get("selectionDirection").toString()493}494func (p *htmlInputElementImpl) SetSelectionDirection(sd string) {495 p.set("selectionDirection", sd)496}497func (p *htmlInputElementImpl) SetRangeText(r string, args ...interface{}) {498 switch len(args) {499 case 0:500 p.call("setRangeText", r)501 case 2:502 if start, ok := args[0].(uint); ok {503 if end, ok := args[1].(uint); ok {504 p.call("setRangeText", r, start, end)505 }506 }507 case 3:508 if start, ok := args[0].(uint); ok {509 if end, ok := args[1].(uint); ok {510 if selectionMode, ok := args[2].(SelectionMode); ok {511 p.call("setRangeText", r, start, end, string(selectionMode))512 }513 }514 }515 }516}517func (p *htmlInputElementImpl) SetSelectionRange(start uint, end uint, direction ...string) {518 switch len(direction) {519 case 0:520 p.call("setSelectionRange", start, end)521 default:522 p.call("setSelectionRange", start, end, direction[0])523 }524}525// -------------8<---------------------------------------526type htmlButtonElementImpl struct {527 *htmlElementImpl528}529func NewHTMLButtonElement() HTMLButtonElement {530 if el := CurrentDocument().CreateElement("button"); el != nil {531 if button, ok := el.(HTMLButtonElement); ok {532 return button533 }534 }535 return nil536}537func wrapHTMLButtonElement(v Value) HTMLButtonElement {538 if v.valid() {539 return &htmlButtonElementImpl{540 htmlElementImpl: newHTMLElementImpl(v),541 }542 }543 return nil544}545func (p *htmlButtonElementImpl) Autofocus() bool {546 return p.get("autofocus").toBool()547}548func (p *htmlButtonElementImpl) SetAutofocus(b bool) {549 p.set("autofocus", b)550}551func (p *htmlButtonElementImpl) Disabled() bool {552 return p.get("disabled").toBool()553}554func (p *htmlButtonElementImpl) SetDisabled(b bool) {555 p.set("disabled", b)556}557func (p *htmlButtonElementImpl) Form() HTMLFormElement {558 return wrapHTMLFormElement(p.get("form"))559}560func (p *htmlButtonElementImpl) FormAction() string {561 return p.get("formAction").toString()562}563func (p *htmlButtonElementImpl) SetFormAction(fa string) {564 p.set("formAction", fa)565}566func (p *htmlButtonElementImpl) FormEnctype() string {567 return p.get("formEnctype").toString()568}569func (p *htmlButtonElementImpl) SetFormEnctype(fe string) {570 p.set("formEnctype", fe)571}572func (p *htmlButtonElementImpl) FormMethod() string {573 return p.get("formMethod").toString()574}575func (p *htmlButtonElementImpl) SetFormMethod(fm string) {576 p.set("formMethod", fm)577}578func (p *htmlButtonElementImpl) FormNoValidate() bool {579 return p.get("formNoValidate").toBool()580}581func (p *htmlButtonElementImpl) SetFormNoValidate(b bool) {582 p.set("formNoValidate", b)583}584func (p *htmlButtonElementImpl) FormTarget() string {585 return p.get("formTarget").toString()586}587func (p *htmlButtonElementImpl) SetFormTarget(ft string) {588 p.set("formTarget", ft)589}590func (p *htmlButtonElementImpl) Name() string {591 return p.get("name").toString()592}593func (p *htmlButtonElementImpl) SetName(name string) {594 p.set("name", name)595}596func (p *htmlButtonElementImpl) Type() string {597 return p.get("type").toString()598}599func (p *htmlButtonElementImpl) SetType(t string) {600 p.set("type", t)601}602func (p *htmlButtonElementImpl) Value() string {603 return p.get("value").toString()604}605func (p *htmlButtonElementImpl) SetValue(v string) {606 p.set("value", v)607}608func (p *htmlButtonElementImpl) WillValidate() bool {609 return p.get("willValidate").toBool()610}611func (p *htmlButtonElementImpl) Validity() ValidityState {612 return wrapValidityState(p.get("validity"))613}614func (p *htmlButtonElementImpl) ValidationMessage() string {615 return p.get("validationMessage").toString()616}617func (p *htmlButtonElementImpl) CheckValidity() bool {618 return p.call("checkValidity").toBool()619}620func (p *htmlButtonElementImpl) ReportValidity() bool {621 return p.call("reportValidity").toBool()622}623func (p *htmlButtonElementImpl) SetCustomValidity(e string) {624 p.call("setCustomValidity", e)625}626func (p *htmlButtonElementImpl) Labels() []Node {627 return nodeListToSlice(p.get("labels"))628}629// -------------8<---------------------------------------630type htmlSelectElementImpl struct {631 *htmlElementImpl632}633func NewHTMLSelectElement() HTMLSelectElement {634 if el := CurrentDocument().CreateElement("select"); el != nil {635 if sel, ok := el.(HTMLSelectElement); ok {636 return sel637 }638 }639 return nil640}641func wrapHTMLSelectElement(v Value) HTMLSelectElement {642 if v.valid() {643 return &htmlSelectElementImpl{644 htmlElementImpl: newHTMLElementImpl(v),645 }646 }647 return nil648}649func (p *htmlSelectElementImpl) Autocomplete() string {650 return p.get("autocomplete").toString()651}652func (p *htmlSelectElementImpl) SetAutocomplete(ac string) {653 p.set("autocomplete", ac)654}655func (p *htmlSelectElementImpl) Autofocus() bool {656 return p.get("autofocus").toBool()657}658func (p *htmlSelectElementImpl) SetAutofocus(af bool) {659 p.set("autofocus", af)660}661func (p *htmlSelectElementImpl) Disabled() bool {662 return p.get("disabled").toBool()663}664func (p *htmlSelectElementImpl) SetDisabled(b bool) {665 p.set("disabled", b)666}667func (p *htmlSelectElementImpl) Form() HTMLFormElement {668 return wrapHTMLFormElement(p.get("form"))669}670func (p *htmlSelectElementImpl) Multiple() bool {671 return p.get("multiple").toBool()672}673func (p *htmlSelectElementImpl) SetMultiple(m bool) {674 p.set("multiple", m)675}676func (p *htmlSelectElementImpl) Name() string {677 return p.get("name").toString()678}679func (p *htmlSelectElementImpl) SetName(name string) {680 p.set("name", name)681}682func (p *htmlSelectElementImpl) Required() bool {683 return p.get("_required").toBool()684}685func (p *htmlSelectElementImpl) SetRequired(b bool) {686 p.set("_required", b)687}688func (p *htmlSelectElementImpl) Size() uint {689 return p.get("size").toUint()690}691func (p *htmlSelectElementImpl) SetSize(s uint) {692 p.set("size", s)693}694func (p *htmlSelectElementImpl) Type() string {695 return p.get("type").toString()696}697func (p *htmlSelectElementImpl) Options() HTMLOptionsCollection {698 return wrapHTMLOptionsCollection(p.get("options"))699}700func (p *htmlSelectElementImpl) Length() uint {701 return p.get("length").toUint()702}703func (p *htmlSelectElementImpl) SetLength(l uint) {704 p.set("length", l)705}706func (p *htmlSelectElementImpl) Item(index uint) Element {707 return wrapAsElement(p.call("item", index))708}709func (p *htmlSelectElementImpl) NamedItem(name string) HTMLOptionElement {710 return wrapHTMLOptionElement(p.call("namedItem", name))711}712func (p *htmlSelectElementImpl) Add(element HTMLElement, before ...interface{}) {713 switch len(before) {714 case 0:715 p.call("add", JSValueOf(element))716 default:717 switch x := before[0].(type) {718 case HTMLElement:719 p.call("add", JSValueOf(element), JSValueOf(x))720 case int:721 p.call("add", JSValueOf(element), x)722 }723 }724}725func (p *htmlSelectElementImpl) RemoveByIndex(index int) {726 p.call("remove", index)727}728func (p *htmlSelectElementImpl) Set(index uint, option HTMLOptionElement) {729 // TODO730 // which method ??731 // setter void (unsigned long index, HTMLOptionElement? option);732}733func (p *htmlSelectElementImpl) SelectedOptions() []HTMLOptionElement {734 return htmlCollectionToHTMLOptionElementSlice(p.get("selectedOptions"))735}736func (p *htmlSelectElementImpl) SelectedIndex() int {737 return p.get("selectedIndex").toInt()738}739func (p *htmlSelectElementImpl) SetSelectedIndex(index int) {740 p.set("selectedIndex", index)741}742func (p *htmlSelectElementImpl) Value() string {743 return p.get("value").toString()744}745func (p *htmlSelectElementImpl) SetValue(v string) {746 p.set("value", v)747}748func (p *htmlSelectElementImpl) WillValidate() bool {749 return p.get("willValidate").toBool()750}751func (p *htmlSelectElementImpl) Validity() ValidityState {752 return wrapValidityState(p.get("validity"))753}754func (p *htmlSelectElementImpl) ValidationMessage() string {755 return p.get("validationMessage").toString()756}757func (p *htmlSelectElementImpl) CheckValidity() bool {758 return p.call("checkValidity").toBool()759}760func (p *htmlSelectElementImpl) ReportValidity() bool {761 return p.call("reportValidity").toBool()762}763func (p *htmlSelectElementImpl) SetCustomValidity(e string) {764 p.call("setCustomValidity", e)765}766func (p *htmlSelectElementImpl) Labels() []Node {767 return nodeListToSlice(p.get("labels"))768}769// -------------8<---------------------------------------770type htmlOptionsCollectionImpl struct {771 *htmlCollectionImpl772}773func wrapHTMLOptionsCollection(v Value) HTMLOptionsCollection {774 if v.valid() {775 return &htmlOptionsCollectionImpl{776 htmlCollectionImpl: newHTMLCollectionImpl(v),777 }778 }779 return nil780}781func (p *htmlOptionsCollectionImpl) Length() uint {782 return p.get("length").toUint()783}784/* TODO setter785func (p *htmlOptionsCollectionImpl) Set(index uint,option HTMLOptionElement) {786 p.call("")787}788*/789func (p *htmlOptionsCollectionImpl) Add(element HTMLElement, before ...interface{}) {790 switch len(before) {791 case 0:792 p.call("add", JSValueOf(element))793 default:794 switch x := before[0].(type) {795 case HTMLElement:796 p.call("add", JSValueOf(element), JSValueOf(x))797 case int:798 p.call("add", JSValueOf(element), x)799 }800 }801}802func (p *htmlOptionsCollectionImpl) Remove(index int) {803 p.call("remove", index)804}805func (p *htmlOptionsCollectionImpl) SelectedIndex() int {806 return p.get("selectedIndex").toInt()807}808func (p *htmlOptionsCollectionImpl) SetSelectedIndex(i int) {809 p.set("selectedIndex", i)810}811// -------------8<---------------------------------------812type htmlDataListElementImpl struct {813 *htmlElementImpl814}815func NewHTMLDataListElement() HTMLDataListElement {816 if el := CurrentDocument().CreateElement("datalist"); el != nil {817 if datalist, ok := el.(HTMLDataListElement); ok {818 return datalist819 }820 }821 return nil822}823func wrapHTMLDataListElement(v Value) HTMLDataListElement {824 if v.valid() {825 return &htmlDataListElementImpl{826 htmlElementImpl: newHTMLElementImpl(v),827 }828 }829 return nil830}831func (p *htmlDataListElementImpl) Options() []HTMLOptionElement {832 return htmlCollectionToHTMLOptionElementSlice(p.get("options"))833}834// -------------8<---------------------------------------835type htmlOptGroupElementImpl struct {836 *htmlElementImpl837}838func NewHTMLOptGroupElement() HTMLOptGroupElement {839 if el := CurrentDocument().CreateElement("optgroup"); el != nil {840 if optgroup, ok := el.(HTMLOptGroupElement); ok {841 return optgroup842 }843 }844 return nil845}846func wrapHTMLOptGroupElement(v Value) HTMLOptGroupElement {847 if v.valid() {848 return &htmlOptGroupElementImpl{849 htmlElementImpl: newHTMLElementImpl(v),850 }851 }852 return nil853}854func (p *htmlOptGroupElementImpl) Disabled() bool {855 return p.get("disabled").toBool()856}857func (p *htmlOptGroupElementImpl) SetDisabled(b bool) {858 p.set("disabled", b)859}860func (p *htmlOptGroupElementImpl) Label() string {861 return p.get("label").toString()862}863func (p *htmlOptGroupElementImpl) SetLabel(lbl string) {864 p.set("label", lbl)865}866// -------------8<---------------------------------------867type htmlOptionElementImpl struct {868 *htmlElementImpl869}870/*871func NewHTMLOptionElement() HTMLOptionElement {872 if el := CurrentDocument().CreateElement("option"); el != nil {873 if option, ok := el.(HTMLOptionElement); ok {874 return option875 }876 }877 return nil878}879*/880//Named Constructor881func NewOption(args ...interface{}) HTMLOptionElement {882 if jsOpt := jsGlobal.get("Option"); jsOpt.valid() {883 switch len(args) {884 case 1:885 if text, ok := args[0].(string); ok {886 return wrapHTMLOptionElement(jsOpt.jsNew(text))887 }888 case 2:889 if text, ok := args[0].(string); ok {890 if value, ok := args[1].(string); ok {891 return wrapHTMLOptionElement(jsOpt.jsNew(text, value))892 }893 }894 case 3:895 if text, ok := args[0].(string); ok {896 if value, ok := args[1].(string); ok {897 if defaultSelected, ok := args[2].(bool); ok {898 return wrapHTMLOptionElement(jsOpt.jsNew(text, value, defaultSelected))899 }900 }901 }902 case 4:903 if text, ok := args[0].(string); ok {904 if value, ok := args[1].(string); ok {905 if defaultSelected, ok := args[2].(bool); ok {906 if selected, ok := args[3].(bool); ok {907 return wrapHTMLOptionElement(jsOpt.jsNew(text, value, defaultSelected, selected))908 }909 }910 }911 }912 }913 return wrapHTMLOptionElement(jsOpt.jsNew())914 }915 return nil916}917func wrapHTMLOptionElement(v Value) HTMLOptionElement {918 if v.valid() {919 return &htmlOptionElementImpl{920 htmlElementImpl: newHTMLElementImpl(v),921 }922 }923 return nil924}925func (p *htmlOptionElementImpl) Disabled() bool {926 return p.get("disabled").toBool()927}928func (p *htmlOptionElementImpl) SetDisabled(b bool) {929 p.set("disabled", b)930}931func (p *htmlOptionElementImpl) Form() HTMLFormElement {932 return wrapHTMLFormElement(p.get("form"))933}934func (p *htmlOptionElementImpl) Label() string {935 return p.get("label").toString()936}937func (p *htmlOptionElementImpl) SetLabel(lbl string) {938 p.set("label", lbl)939}940func (p *htmlOptionElementImpl) DefaultSelected() bool {941 return p.get("defaultSelected").toBool()942}943func (p *htmlOptionElementImpl) SetDefaultSelected(b bool) {944 p.set("defaultSelected", b)945}946func (p *htmlOptionElementImpl) Selected() bool {947 return p.get("selected").toBool()948}949func (p *htmlOptionElementImpl) SetSelected(b bool) {950 p.set("selected", b)951}952func (p *htmlOptionElementImpl) Value() string {953 return p.get("value").toString()954}955func (p *htmlOptionElementImpl) SetValue(v string) {956 p.set("value", v)957}958func (p *htmlOptionElementImpl) Text() string {959 return p.get("text").toString()960}961func (p *htmlOptionElementImpl) SetText(t string) {962 p.set("text", t)963}964func (p *htmlOptionElementImpl) Index() int {965 return p.get("index").toInt()966}967// -------------8<---------------------------------------968type htmlTextAreaElementImpl struct {969 *htmlElementImpl970}971func NewHTMLTextAreaElement() HTMLTextAreaElement {972 if el := CurrentDocument().CreateElement("textarea"); el != nil {973 if textarea, ok := el.(HTMLTextAreaElement); ok {974 return textarea975 }976 }977 return nil978}979func wrapHTMLTextAreaElement(v Value) HTMLTextAreaElement {980 if v.valid() {981 return &htmlTextAreaElementImpl{982 htmlElementImpl: newHTMLElementImpl(v),983 }984 }985 return nil986}987func (p *htmlTextAreaElementImpl) Autocomplete() string {988 return p.get("autocomplete").toString()989}990func (p *htmlTextAreaElementImpl) SetAutocomplete(ac string) {991 p.set("autocomplete", ac)992}993func (p *htmlTextAreaElementImpl) Autofocus() bool {994 return p.get("autofocus").toBool()995}996func (p *htmlTextAreaElementImpl) SetAutofocus(b bool) {997 p.set("autofocus", b)998}999func (p *htmlTextAreaElementImpl) Cols() uint {1000 return p.get("cols").toUint()1001}1002func (p *htmlTextAreaElementImpl) SetCols(c uint) {1003 p.set("cols", c)1004}1005func (p *htmlTextAreaElementImpl) DirName() string {1006 return p.get("dirName").toString()1007}1008func (p *htmlTextAreaElementImpl) SetDirName(dn string) {1009 p.set("dirName", dn)1010}1011func (p *htmlTextAreaElementImpl) Disabled() bool {1012 return p.get("disabled").toBool()1013}1014func (p *htmlTextAreaElementImpl) SetDisabled(b bool) {1015 p.set("disabled", b)1016}1017func (p *htmlTextAreaElementImpl) Form() HTMLFormElement {1018 return wrapHTMLFormElement(p.get("form"))1019}1020func (p *htmlTextAreaElementImpl) MaxLength() int {1021 return p.get("maxLength").toInt()1022}1023func (p *htmlTextAreaElementImpl) SetMaxLength(m int) {1024 p.set("maxLength", m)1025}1026func (p *htmlTextAreaElementImpl) MinLength() int {1027 return p.get("minLength").toInt()1028}1029func (p *htmlTextAreaElementImpl) SetMinLength(m int) {1030 p.set("minLength", m)1031}1032func (p *htmlTextAreaElementImpl) Name() string {1033 return p.get("name").toString()1034}1035func (p *htmlTextAreaElementImpl) SetName(name string) {1036 p.set("name", name)1037}1038func (p *htmlTextAreaElementImpl) Placeholder() string {1039 return p.get("placeholder").toString()1040}1041func (p *htmlTextAreaElementImpl) SetPlaceholder(h string) {1042 p.set("placeholder", h)1043}1044func (p *htmlTextAreaElementImpl) ReadOnly() bool {1045 return p.get("readOnly").toBool()1046}1047func (p *htmlTextAreaElementImpl) SetReadOnly(b bool) {1048 p.set("readOnly", b)1049}1050func (p *htmlTextAreaElementImpl) Required() bool {1051 return p.get("_required").toBool()1052}1053func (p *htmlTextAreaElementImpl) SetRequired(b bool) {1054 p.set("_required", b)1055}1056func (p *htmlTextAreaElementImpl) Rows() uint {1057 return p.get("rows").toUint()1058}1059func (p *htmlTextAreaElementImpl) SetRows(r uint) {1060 p.set("rows", r)1061}1062func (p *htmlTextAreaElementImpl) Wrap() string {1063 return p.get("wrap").toString()1064}1065func (p *htmlTextAreaElementImpl) SetWrap(w string) {1066 p.set("wrap", w)1067}1068func (p *htmlTextAreaElementImpl) Type() string {1069 return p.get("type").toString()1070}1071func (p *htmlTextAreaElementImpl) DefaultValue() string {1072 return p.get("defaultValue").toString()1073}1074func (p *htmlTextAreaElementImpl) SetDefaultValue(dv string) {1075 p.set("defaultValue", dv)1076}1077func (p *htmlTextAreaElementImpl) Value() string {1078 return p.get("value").toString()1079}1080func (p *htmlTextAreaElementImpl) SetValue(v string) {1081 p.set("value", v)1082}1083func (p *htmlTextAreaElementImpl) TextLength() uint {1084 return p.get("textLength").toUint()1085}1086func (p *htmlTextAreaElementImpl) WillValidate() bool {1087 return p.get("willValidate").toBool()1088}1089func (p *htmlTextAreaElementImpl) Validity() ValidityState {1090 return wrapValidityState(p.get("validity"))1091}1092func (p *htmlTextAreaElementImpl) ValidationMessage() string {1093 return p.get("validationMessage").toString()1094}1095func (p *htmlTextAreaElementImpl) CheckValidity() bool {1096 return p.call("checkValidity").toBool()1097}1098func (p *htmlTextAreaElementImpl) ReportValidity() bool {1099 return p.call("reportValidity").toBool()1100}1101func (p *htmlTextAreaElementImpl) SetCustomValidity(e string) {1102 p.call("setCustomValidity", e)1103}1104func (p *htmlTextAreaElementImpl) Labels() []Node {1105 return nodeListToSlice(p.get("labels"))1106}1107func (p *htmlTextAreaElementImpl) Select() {1108 p.call("select")1109}1110func (p *htmlTextAreaElementImpl) SelectionStart() uint {1111 return p.get("selectionStart").toUint()1112}1113func (p *htmlTextAreaElementImpl) SetSelectionStart(ss uint) {1114 p.set("selectionStart", ss)1115}1116func (p *htmlTextAreaElementImpl) SelectionEnd() uint {1117 return p.get("selectionEnd").toUint()1118}1119func (p *htmlTextAreaElementImpl) SetSelectionEnd(se uint) {1120 p.set("selectionEnd", se)1121}1122func (p *htmlTextAreaElementImpl) SelectionDirection() string {1123 return p.get("selectionDirection").toString()1124}1125func (p *htmlTextAreaElementImpl) SetSelectionDirection(sd string) {1126 p.set("selectionDirection", sd)1127}1128func (p *htmlTextAreaElementImpl) SetRangeText(r string, args ...interface{}) {1129 switch len(args) {1130 case 0:1131 p.call("setRangeText", r)1132 case 2:1133 if start, ok := args[0].(uint); ok {1134 if end, ok := args[1].(uint); ok {1135 p.call("setRangeText", r, start, end)1136 }1137 }1138 case 3:1139 if start, ok := args[0].(uint); ok {1140 if end, ok := args[1].(uint); ok {1141 if selectionMode, ok := args[2].(SelectionMode); ok {1142 p.call("setRangeText", r, start, end, string(selectionMode))1143 }1144 }1145 }1146 }1147}1148func (p *htmlTextAreaElementImpl) SetSelectionRange(start uint, end uint, direction ...string) {1149 switch len(direction) {1150 case 0:1151 p.call("setSelectionRange", start, end)1152 default:1153 p.call("setSelectionRange", start, end, direction[0])1154 }1155}1156// -------------8<---------------------------------------1157type htmlOutputElementImpl struct {1158 *htmlElementImpl1159}1160func NewHTMLOutputElement() HTMLOutputElement {1161 if el := CurrentDocument().CreateElement("output"); el != nil {1162 if output, ok := el.(HTMLOutputElement); ok {1163 return output1164 }1165 }1166 return nil1167}1168func wrapHTMLOutputElement(v Value) HTMLOutputElement {1169 if v.valid() {1170 return &htmlOutputElementImpl{1171 htmlElementImpl: newHTMLElementImpl(v),1172 }1173 }1174 return nil1175}1176func (p *htmlOutputElementImpl) HtmlFor() DOMTokenList {1177 return wrapDOMTokenList(p.get("htmlFor"))1178}1179func (p *htmlOutputElementImpl) Form() HTMLFormElement {1180 return wrapHTMLFormElement(p.get("form"))1181}1182func (p *htmlOutputElementImpl) Name() string {1183 return p.get("name").toString()1184}1185func (p *htmlOutputElementImpl) SetName(name string) {1186 p.set("name", name)1187}1188func (p *htmlOutputElementImpl) Type() string {1189 return p.get("type").toString()1190}1191func (p *htmlOutputElementImpl) DefaultValue() string {1192 return p.get("defaultValue").toString()1193}1194func (p *htmlOutputElementImpl) SetDefaultValue(dv string) {1195 p.set("defaultValue", dv)1196}1197func (p *htmlOutputElementImpl) Value() string {1198 return p.get("value").toString()1199}1200func (p *htmlOutputElementImpl) SetValue(v string) {1201 p.set("value", v)1202}1203func (p *htmlOutputElementImpl) WillValidate() bool {1204 return p.get("willValidate").toBool()1205}1206func (p *htmlOutputElementImpl) Validity() ValidityState {1207 return wrapValidityState(p.get("validity"))1208}1209func (p *htmlOutputElementImpl) ValidationMessage() string {1210 return p.get("validationMessage").toString()1211}1212func (p *htmlOutputElementImpl) CheckValidity() bool {1213 return p.call("checkValidity").toBool()1214}1215func (p *htmlOutputElementImpl) ReportValidity() bool {1216 return p.call("reportValidity").toBool()1217}1218func (p *htmlOutputElementImpl) SetCustomValidity(e string) {1219 p.call("setCustomValidity", e)1220}1221func (p *htmlOutputElementImpl) Labels() []Node {1222 return nodeListToSlice(p.get("labels"))1223}1224// -------------8<---------------------------------------1225type htmlProgressElementImpl struct {1226 *htmlElementImpl1227}1228func NewHTMLProgressElement() HTMLProgressElement {1229 if el := CurrentDocument().CreateElement("progress"); el != nil {1230 if progress, ok := el.(HTMLProgressElement); ok {1231 return progress1232 }1233 }1234 return nil1235}1236func wrapHTMLProgressElement(v Value) HTMLProgressElement {1237 if v.valid() {1238 return &htmlProgressElementImpl{1239 htmlElementImpl: newHTMLElementImpl(v),1240 }1241 }1242 return nil1243}1244func (p *htmlProgressElementImpl) Value() float64 {1245 return p.get("value").toFloat64()1246}1247func (p *htmlProgressElementImpl) SetValue(v float64) {1248 p.set("value", v)1249}1250func (p *htmlProgressElementImpl) Max() float64 {1251 return p.get("max").toFloat64()1252}1253func (p *htmlProgressElementImpl) SetMax(m float64) {1254 p.set("max", m)1255}1256func (p *htmlProgressElementImpl) Position() float64 {1257 return p.get("position").toFloat64()1258}1259func (p *htmlProgressElementImpl) Labels() []Node {1260 return nodeListToSlice(p.get("labels"))1261}1262// -------------8<---------------------------------------1263type htmlMeterElementImpl struct {1264 *htmlElementImpl1265}1266func NewHTMLMeterElement() HTMLMeterElement {1267 if el := CurrentDocument().CreateElement("meter"); el != nil {1268 if meter, ok := el.(HTMLMeterElement); ok {1269 return meter1270 }1271 }1272 return nil1273}1274func wrapHTMLMeterElement(v Value) HTMLMeterElement {1275 if v.valid() {1276 return &htmlMeterElementImpl{1277 htmlElementImpl: newHTMLElementImpl(v),1278 }1279 }1280 return nil1281}1282func (p *htmlMeterElementImpl) Value() float64 {1283 return p.get("value").toFloat64()1284}1285func (p *htmlMeterElementImpl) SetValue(v float64) {1286 p.set("value", v)1287}1288func (p *htmlMeterElementImpl) Min() float64 {1289 return p.get("min").toFloat64()1290}1291func (p *htmlMeterElementImpl) SetMin(m float64) {1292 p.set("min", m)1293}1294func (p *htmlMeterElementImpl) Max() float64 {1295 return p.get("max").toFloat64()1296}1297func (p *htmlMeterElementImpl) SetMax(m float64) {1298 p.set("max", m)1299}1300func (p *htmlMeterElementImpl) Low() float64 {1301 return p.get("low").toFloat64()1302}1303func (p *htmlMeterElementImpl) SetLow(v float64) {1304 p.set("low", v)1305}1306func (p *htmlMeterElementImpl) High() float64 {1307 return p.get("high").toFloat64()1308}1309func (p *htmlMeterElementImpl) SetHigh(v float64) {1310 p.set("high", v)1311}1312func (p *htmlMeterElementImpl) Optimum() float64 {1313 return p.get("optimum").toFloat64()1314}1315func (p *htmlMeterElementImpl) SetOptimum(v float64) {1316 p.set("optimum", v)1317}1318func (p *htmlMeterElementImpl) Labels() []Node {1319 return nodeListToSlice(p.get("labels"))1320}1321// -------------8<---------------------------------------1322type htmlFieldSetElementImpl struct {1323 *htmlElementImpl1324}1325func NewHTMLFieldSetElement() HTMLFieldSetElement {1326 if el := CurrentDocument().CreateElement("fieldset"); el != nil {1327 if fieldset, ok := el.(HTMLFieldSetElement); ok {1328 return fieldset1329 }1330 }1331 return nil1332}1333func wrapHTMLFieldSetElement(v Value) HTMLFieldSetElement {1334 if v.valid() {1335 return &htmlFieldSetElementImpl{1336 htmlElementImpl: newHTMLElementImpl(v),1337 }1338 }1339 return nil1340}1341func (p *htmlFieldSetElementImpl) Disabled() bool {1342 return p.get("disabled").toBool()1343}1344func (p *htmlFieldSetElementImpl) SetDisabled(b bool) {1345 p.set("disabled", b)1346}1347func (p *htmlFieldSetElementImpl) Form() HTMLFormElement {1348 return wrapHTMLFormElement(p.get("form"))1349}1350func (p *htmlFieldSetElementImpl) Name() string {1351 return p.get("name").toString()1352}1353func (p *htmlFieldSetElementImpl) SetName(name string) {1354 p.set("name", name)1355}1356func (p *htmlFieldSetElementImpl) Type() string {1357 return p.get("type").toString()1358}1359func (p *htmlFieldSetElementImpl) Elements() []HTMLElement {1360 return htmlCollectionToHTMLElementSlice(p.get("elements"))1361}1362func (p *htmlFieldSetElementImpl) WillValidate() bool {1363 return p.get("willValidate").toBool()1364}1365func (p *htmlFieldSetElementImpl) Validity() ValidityState {1366 return wrapValidityState(p.get("validity"))1367}1368func (p *htmlFieldSetElementImpl) ValidationMessage() string {1369 return p.get("validationMessage").toString()1370}1371func (p *htmlFieldSetElementImpl) CheckValidity() bool {1372 return p.call("checkValidity").toBool()1373}1374func (p *htmlFieldSetElementImpl) ReportValidity() bool {1375 return p.call("reportValidity").toBool()1376}1377func (p *htmlFieldSetElementImpl) SetCustomValidity(e string) {1378 p.call("setCustomValidity", e)1379}1380// -------------8<---------------------------------------1381type htmlLegendElementImpl struct {1382 *htmlElementImpl1383}1384func NewHTMLLegendElement() HTMLLegendElement {1385 if el := CurrentDocument().CreateElement("legend"); el != nil {1386 if legend, ok := el.(HTMLLegendElement); ok {1387 return legend1388 }1389 }1390 return nil1391}1392func wrapHTMLLegendElement(v Value) HTMLLegendElement {1393 if v.valid() {1394 return &htmlLegendElementImpl{1395 htmlElementImpl: newHTMLElementImpl(v),1396 }1397 }1398 return nil1399}1400func (p *htmlLegendElementImpl) Form() HTMLFormElement {1401 return wrapHTMLFormElement(p.get("form"))1402}1403// -------------8<---------------------------------------...

Full Screen

Full Screen

document_metadata_impl.go

Source:document_metadata_impl.go Github

copy

Full Screen

1// +build js,wasm2package wasm3// -------------8<---------------------------------------4type htmlHtmlElementImpl struct {5 *htmlElementImpl6}7func NewHTMLHtmlElement() HTMLHtmlElement {8 if el := CurrentDocument().CreateElement("html"); el != nil {9 if html, ok := el.(HTMLHtmlElement); ok {10 return html11 }12 }13 return nil14}15func wrapHTMLHtmlElement(v Value) HTMLHtmlElement {16 if v.valid() {17 return &htmlHtmlElementImpl{18 htmlElementImpl: newHTMLElementImpl(v),19 }20 }21 return nil22}23// -------------8<---------------------------------------24type htmlHeadElementImpl struct {25 *htmlElementImpl26}27func NewHTMLHeadElement() HTMLHeadElement {28 if el := CurrentDocument().CreateElement("head"); el != nil {29 if head, ok := el.(HTMLHeadElement); ok {30 return head31 }32 }33 return nil34}35func wrapHTMLHeadElement(v Value) HTMLHeadElement {36 if v.valid() {37 return &htmlHeadElementImpl{38 htmlElementImpl: newHTMLElementImpl(v),39 }40 }41 return nil42}43// -------------8<---------------------------------------44type htmlTitleElementImpl struct {45 *htmlElementImpl46}47func NewHTMLTitleElement() HTMLTitleElement {48 if el := CurrentDocument().CreateElement("title"); el != nil {49 if title, ok := el.(HTMLTitleElement); ok {50 return title51 }52 }53 return nil54}55func wrapHTMLTitleElement(v Value) HTMLTitleElement {56 if v.valid() {57 return &htmlTitleElementImpl{58 htmlElementImpl: newHTMLElementImpl(v),59 }60 }61 return nil62}63func (p *htmlTitleElementImpl) Text() string {64 return p.get("text").toString()65}66func (p *htmlTitleElementImpl) SetText(text string) {67 p.set("text", text)68}69// -------------8<---------------------------------------70type htmlBaseElementImpl struct {71 *htmlElementImpl72}73func NewHTMLBaseElement() HTMLBaseElement {74 if el := CurrentDocument().CreateElement("base"); el != nil {75 if base, ok := el.(HTMLBaseElement); ok {76 return base77 }78 }79 return nil80}81func wrapHTMLBaseElement(v Value) HTMLBaseElement {82 if v.valid() {83 return &htmlBaseElementImpl{84 htmlElementImpl: newHTMLElementImpl(v),85 }86 }87 return nil88}89func (p *htmlBaseElementImpl) Href() string {90 return p.get("href").toString()91}92func (p *htmlBaseElementImpl) SetHref(href string) {93 p.set("href", href)94}95func (p *htmlBaseElementImpl) Target() string {96 return p.get("target").toString()97}98func (p *htmlBaseElementImpl) SetTarget(target string) {99 p.set("target", target)100}101// -------------8<---------------------------------------102type htmlLinkElementImpl struct {103 *linkStyleImpl104 *htmlElementImpl105 Value106}107func NewHTMLLinkElement() HTMLLinkElement {108 if el := CurrentDocument().CreateElement("link"); el != nil {109 if link, ok := el.(HTMLLinkElement); ok {110 return link111 }112 }113 return nil114}115func wrapHTMLLinkElement(v Value) HTMLLinkElement {116 if v.valid() {117 return &htmlLinkElementImpl{118 linkStyleImpl: newLinkStyleImpl(v),119 htmlElementImpl: newHTMLElementImpl(v),120 Value: v,121 }122 }123 return nil124}125func (p *htmlLinkElementImpl) Href() string {126 return p.get("href").toString()127}128func (p *htmlLinkElementImpl) SetHref(href string) {129 p.set("href", href)130}131func (p *htmlLinkElementImpl) CrossOrigin() string {132 return p.get("crossOrigin").toString()133}134func (p *htmlLinkElementImpl) SetCrossOrigin(crossOrigin string) {135 p.set("crossOrigin", crossOrigin)136}137func (p *htmlLinkElementImpl) Rel() string {138 return p.get("rel").toString()139}140func (p *htmlLinkElementImpl) SetRel(rel string) {141 p.set("rel", rel)142}143func (p *htmlLinkElementImpl) Rev() string {144 return p.get("rev").toString()145}146func (p *htmlLinkElementImpl) SetRev(rev string) {147 p.set("rev", rev)148}149func (p *htmlLinkElementImpl) RelList() DOMTokenList {150 return wrapDOMTokenList(p.get("relList"))151}152func (p *htmlLinkElementImpl) Media() string {153 return p.get("media").toString()154}155func (p *htmlLinkElementImpl) SetMedia(media string) {156 p.set("media", media)157}158func (p *htmlLinkElementImpl) Nonce() string {159 return p.get("nonce").toString()160}161func (p *htmlLinkElementImpl) SetNonce(nonce string) {162 p.set("nonce", nonce)163}164func (p *htmlLinkElementImpl) HrefLang() string {165 return p.get("hreflang").toString()166}167func (p *htmlLinkElementImpl) SetHrefLang(hreflang string) {168 p.set("hreflang", hreflang)169}170func (p *htmlLinkElementImpl) Type() string {171 return p.get("type").toString()172}173func (p *htmlLinkElementImpl) SetType(typ string) {174 p.set("type", typ)175}176func (p *htmlLinkElementImpl) Sizes() DOMTokenList {177 return wrapDOMTokenList(p.get("sizes"))178}179func (p *htmlLinkElementImpl) ReferrerPolicy() string {180 return p.get("referrerPolicy").toString()181}182func (p *htmlLinkElementImpl) SetReferrerPolicy(referrerPolicy string) {183 p.set("referrerPolicy", referrerPolicy)184}185// -------------8<---------------------------------------186type htmlMetaElementImpl struct {187 *htmlElementImpl188}189func NewHTMLMetaElement() HTMLMetaElement {190 if el := CurrentDocument().CreateElement("meta"); el != nil {191 if meta, ok := el.(HTMLMetaElement); ok {192 return meta193 }194 }195 return nil196}197func wrapHTMLMetaElement(v Value) HTMLMetaElement {198 if v.valid() {199 return &htmlMetaElementImpl{200 htmlElementImpl: newHTMLElementImpl(v),201 }202 }203 return nil204}205func (p *htmlMetaElementImpl) Name() string {206 return p.get("name").toString()207}208func (p *htmlMetaElementImpl) SetName(name string) {209 p.set("name", name)210}211func (p *htmlMetaElementImpl) HTTPEquiv() string {212 return p.get("httpEquiv").toString()213}214func (p *htmlMetaElementImpl) SetHTTPEquiv(httpEquiv string) {215 p.set("httpEquiv", httpEquiv)216}217func (p *htmlMetaElementImpl) Content() string {218 return p.get("content").toString()219}220func (p *htmlMetaElementImpl) SetContent(content string) {221 p.set("content", content)222}223// -------------8<---------------------------------------224type htmlStyleElementImpl struct {225 *htmlElementImpl226 *linkStyleImpl227 Value228}229func NewHTMLStyleElement() HTMLStyleElement {230 if el := CurrentDocument().CreateElement("style"); el != nil {231 if style, ok := el.(HTMLStyleElement); ok {232 return style233 }234 }235 return nil236}237func wrapHTMLStyleElement(v Value) HTMLStyleElement {238 if v.valid() {239 return &htmlStyleElementImpl{240 htmlElementImpl: newHTMLElementImpl(v),241 linkStyleImpl: newLinkStyleImpl(v),242 Value: v,243 }244 }245 return nil246}247func (p *htmlStyleElementImpl) Media() string {248 return p.get("media").toString()249}250func (p *htmlStyleElementImpl) SetMedia(media string) {251 p.set("media", media)252}253func (p *htmlStyleElementImpl) Nonce() string {254 return p.get("nonce").toString()255}256func (p *htmlStyleElementImpl) SetNonce(nonce string) {257 p.set("nonce", nonce)258}259func (p *htmlStyleElementImpl) Type() string {260 return p.get("type").toString()261}262func (p *htmlStyleElementImpl) SetType(typ string) {263 p.set("type", typ)264}265// -------------8<---------------------------------------...

Full Screen

Full Screen

ToString

Using AI Code Generation

copy

Full Screen

1import (2func main() {3 doc, err := html.Parse(os.Stdin)4 if err != nil {5 fmt.Fprintf(os.Stderr, "findlinks1: %v\n", err)6 os.Exit(1)7 }8 for _, link := range visit(nil, doc) {9 fmt.Println(link)10 }11}12func visit(links []string, n *html.Node) []string {13 if n.Type == html.ElementNode && n.Data == "a" {14 for _, a := range n.Attr {15 if a.Key == "href" {16 links = append(links, a.Val)17 }18 }19 }20 for c := n.FirstChild; c != nil; c = c.NextSibling {21 links = visit(links, c)22 }23}24import (25func main() {26 doc, err := html.Parse(os.Stdin)27 if err != nil {28 fmt.Fprintf(os.Stderr, "findlinks1: %v\n", err)29 os.Exit(1)30 }31 outline(nil, doc)32}33func outline(stack []string, n *html.Node) {34 if n.Type == html.ElementNode {35 fmt.Println(stack)36 }37 for c := n.FirstChild; c != nil; c = c.NextSibling {38 outline(stack, c)39 }40}41import (42func main() {43 doc, err := html.Parse(os.Stdin)44 if err != nil {45 fmt.Fprintf(os.Stderr, "findlinks1: %v\n", err)46 os.Exit(1)47 }48 outline(nil, doc)49}50func outline(stack []string, n *html.Node) {51 if n.Type == html.ElementNode {52 fmt.Println(stack)53 }54 for c := n.FirstChild; c != nil; c = c.NextSibling {55 outline(stack, c)56 }57}

Full Screen

Full Screen

ToString

Using AI Code Generation

copy

Full Screen

1import (2func main() {3 doc, err := html.Parse(strings.NewReader(`<html><body><h1>Hello</h1></body></html>`))4 if err != nil {5 fmt.Println("Error in parsing html")6 }7 fmt.Println(doc)8}9&{1 0xc0000b6000

Full Screen

Full Screen

ToString

Using AI Code Generation

copy

Full Screen

1import (2func main() {3 fmt.Println(html.EscapeString("Hello, world!"))4}5import (6func main() {7 fmt.Println(html.UnescapeString("Hello, world!"))8}9import (10func main() {11 fmt.Println(html.QueryEscape("Hello, world!"))12}13import (14func main() {15 fmt.Println(html.QueryUnescape("Hello, world!"))16}17import (18func main() {19 fmt.Println(html.EscapeString("Hello, world!"))20}21import (22func main() {23 fmt.Println(html.UnescapeString("Hello, world!"))24}25import (26func main() {27 fmt.Println(html.QueryEscape("Hello, world!"))28}29import (30func main() {31 fmt.Println(html.QueryUnescape("Hello, world!"))32}33import (34func main() {35 fmt.Println(html.EscapeString("Hello, world!"))36}37import (38func main() {39 fmt.Println(html.UnescapeString("Hello, world!"))40}41import (42func main() {

Full Screen

Full Screen

ToString

Using AI Code Generation

copy

Full Screen

1import (2func main() {3 r := strings.NewReader(`<html>4 n, err := html.Parse(r)5 if err != nil {6 panic(err)7 }8 fmt.Println(n.FirstChild.FirstChild.Data)9 fmt.Println(n.FirstChild.FirstChild.FirstChild.Data)10 fmt.Println(n.FirstChild.FirstChild.FirstChild.NextSibling.Data)11 fmt.Println(n.FirstChild.FirstChild.FirstChild.NextSibling.NextSibling.Data)12 fmt.Println(n.FirstChild.FirstChild.FirstChild.NextSibling.NextSibling.FirstChild.Data)13 fmt.Println(n.FirstChild.FirstChild.FirstChild.NextSibling.NextSibling.FirstChild.NextSibling.Data)14 fmt.Println(n.FirstChild.FirstChild.FirstChild.NextSibling.NextSibling.FirstChild.NextSibling.NextSibling.Data)15 fmt.Println(n.FirstChild.FirstChild.FirstChild.NextSibling.NextSibling.FirstChild.NextSibling.NextSibling.FirstChild.Data)16 fmt.Println(n.FirstChild.FirstChild.FirstChild.NextSibling.NextSibling.FirstChild.NextSibling.NextSibling.FirstChild.NextSibling.Data)17 fmt.Println(n.FirstChild.FirstChild.FirstChild.NextSibling.NextSibling.FirstChild.NextSibling.NextSibling.FirstChild.NextSibling.NextSibling.Data)18 fmt.Println(n.FirstChild.FirstChild.FirstChild.NextSibling.NextSibling.FirstChild.NextSibling.NextSibling.FirstChild.NextSibling.NextSibling.FirstChild.Data)19 fmt.Println(n.FirstChild.FirstChild.FirstChild.NextSibling.NextSibling.FirstChild.NextSibling.NextSibling.FirstChild.NextSibling.NextSibling.FirstChild.NextSibling.Data)20 fmt.Println(n.FirstChild.FirstChild.FirstChild.NextSibling.NextSibling.FirstChild.NextSibling.NextSibling.FirstChild.NextSibling.NextSibling.FirstChild.NextSibling.NextSibling.Data)21 fmt.Println(n.FirstChild.FirstChild.FirstChild.NextSibling.NextSibling.FirstChild.NextSibling.NextSibling.FirstChild.NextSibling.NextSibling.FirstChild.NextSibling.NextSibling.FirstChild.Data)22 fmt.Println(n.FirstChild.FirstChild.FirstChild.NextSibling.NextSibling.FirstChild.NextSibling.NextSibling.FirstChild.NextSibling.NextSibling.FirstChild.NextSibling.NextSibling.FirstChild.NextSibling.Data)23 fmt.Println(n.FirstChild.FirstChild.FirstChild.NextSibling.NextSibling.FirstChild.NextSibling.NextSibling.FirstChild.NextSibling.NextSibling.FirstChild.NextSibling.NextSibling.FirstChild.NextSibling.NextSibling.Data)24 fmt.Println(n.FirstChild.FirstChild.FirstChild.NextSibling.NextSibling.FirstChild.NextSibling.NextSibling.FirstChild.NextSibling.NextSibling.First

Full Screen

Full Screen

ToString

Using AI Code Generation

copy

Full Screen

1import (2func main() {3 fmt.Println(html.EscapeString("Hello, world!"))4}5import (6func main() {7 fmt.Println(html.UnescapeString("Hello, world!"))8}9import (10func main() {11 fmt.Println(template.HTMLEscapeString("Hello, world!"))12}13import (14func main() {15 fmt.Println(template.HTMLEscapeString("Hello, world!"))16}17import (18func main() {19 fmt.Println(template.HTMLEscapeString("Hello, world!"))20}21import (22func main() {23 fmt.Println(template.HTMLEscapeString("Hello, world!"))24}25import (26func main() {27 fmt.Println(template.HTMLEscapeString("Hello, world!"))28}29import (30func main() {31 fmt.Println(template.HTMLEscapeString("Hello, world!"))32}33import (

Full Screen

Full Screen

ToString

Using AI Code Generation

copy

Full Screen

1import (2func main() {3 html := utils.NewHtml()4 str := html.ToString()5 fmt.Println(str)6}7import (8func main() {9 html := utils.NewHtml()10 str := html.ToJson()11 fmt.Println(str)12}13import (14func main() {15 html := utils.NewHtml()16 str := html.ToXml()17 fmt.Println(str)18}19import (20func main() {21 html := utils.NewHtml()22 html.AddTitle("Title")23 str := html.ToString()24 fmt.Println(str)25}26import (27func main() {28 html := utils.NewHtml()29 html.AddHead("<script src='jquery.js'></script>")30 str := html.ToString()31 fmt.Println(str)32}33import (

Full Screen

Full Screen

ToString

Using AI Code Generation

copy

Full Screen

1import "fmt"2type html struct {3}4func (h html) ToString() string {5 return fmt.Sprintf("<%s>", h.name)6}7func main() {8 h := html{"html"}9 fmt.Println(h.ToString())10}11import "fmt"12type html struct {13}14func (h html) ToString() string {15 return fmt.Sprintf("<%s>", h.name)16}17func main() {18 h := html{"html"}19 fmt.Println(h.ToString())20}21import "fmt"22type html struct {23}24func (h html) ToString() string {25 return fmt.Sprintf("<%s>", h.name)26}27func main() {28 h := html{"html"}29 fmt.Println(h.ToString())30}31import "fmt"32type html struct {33}34func (h html) ToString() string {35 return fmt.Sprintf("<%s>", h.name)36}37func main() {38 h := html{"html"}39 fmt.Println(h.ToString())40}41import "fmt"42type html struct {43}44func (h html) ToString() string {45 return fmt.Sprintf("<%s>", h.name)46}47func main() {48 h := html{"html"}49 fmt.Println(h.ToString())50}51import "fmt"52type html struct {53}54func (h html) ToString() string {55 return fmt.Sprintf("<%s>", h.name)56}57func main() {58 h := html{"html"}59 fmt.Println(h.ToString())60}

Full Screen

Full Screen

ToString

Using AI Code Generation

copy

Full Screen

1import (2func main() {3 var a = HTML.HTML("<h1>Hello World</h1>")4 fmt.Println(a.ToString())5}6import (7func main() {8 var a = HTML.HTML("<h1>Hello World</h1>")9 fmt.Println(a.ToString())10}11import (12func main() {13 var a = HTML.HTML("<h1>Hello World</h1>")14 fmt.Println(a.ToString())15}16import (17func main() {18 var a = HTML.HTML("<h1>Hello World</h1>")19 fmt.Println(a.ToString())20}21import (22func main() {23 var a = HTML.HTML("<h1>Hello World</h1>")24 fmt.Println(a.ToString())25}26import (27func main() {28 var a = HTML.HTML("<h1>Hello World</h1>")29 fmt.Println(a.ToString())30}31import (32func main() {33 var a = HTML.HTML("<h1>Hello World</h1>")34 fmt.Println(a.ToString())35}36import (37func main() {38 var a = HTML.HTML("<h1>Hello World</h1>")39 fmt.Println(a.ToString())40}41import (42func main() {43 var a = HTML.HTML("<h1>Hello World</h1>")44 fmt.Println(a.ToString())45}46import (47func main() {48 var a = HTML.HTML("<h1>Hello World</h1>")49 fmt.Println(a.ToString

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run K6 automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Most used method in

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful