From 50c6cb17f10a6f92f2e429ff7533d95283e0a203 Mon Sep 17 00:00:00 2001 From: Kenneth Shaw Date: Sat, 22 Feb 2025 07:19:54 +0700 Subject: [PATCH] Change easyjson -> jsonv2 --- accessibility/accessibility.go | 44 +- accessibility/easyjson.go | 2260 ---- accessibility/types.go | 171 +- animation/animation.go | 6 +- animation/easyjson.go | 1880 --- animation/types.go | 87 +- audits/audits.go | 18 +- audits/easyjson.go | 4084 ------ audits/types.go | 782 +- autofill/autofill.go | 6 +- autofill/easyjson.go | 1080 -- autofill/types.go | 31 +- backgroundservice/easyjson.go | 687 - backgroundservice/types.go | 31 +- bluetoothemulation/easyjson.go | 737 -- bluetoothemulation/types.go | 46 +- browser/browser.go | 62 +- browser/easyjson.go | 2494 ---- browser/types.go | 193 +- cachestorage/cachestorage.go | 22 +- cachestorage/easyjson.go | 1218 -- cachestorage/types.go | 41 +- cast/cast.go | 2 +- cast/easyjson.go | 665 - cast/types.go | 2 +- cdp/easyjson.go | 1390 -- cdp/types.go | 556 +- cdproto.go | 785 +- css/css.go | 116 +- css/easyjson.go | 10798 ---------------- css/events.go | 2 +- css/types.go | 329 +- debugger/debugger.go | 122 +- debugger/easyjson.go | 5496 -------- debugger/events.go | 52 +- debugger/types.go | 314 +- deviceaccess/easyjson.go | 466 - deviceorientation/easyjson.go | 158 - dom/dom.go | 186 +- dom/easyjson.go | 8173 ------------ dom/types.go | 160 +- domdebugger/domdebugger.go | 16 +- domdebugger/easyjson.go | 876 -- domdebugger/types.go | 78 +- domsnapshot/domsnapshot.go | 14 +- domsnapshot/easyjson.go | 3247 ----- domsnapshot/types.go | 156 +- domstorage/domstorage.go | 2 +- domstorage/easyjson.go | 1044 -- domstorage/types.go | 6 +- easyjson.go | 287 - emulation/easyjson.go | 3837 ------ emulation/emulation.go | 72 +- emulation/types.go | 301 +- eventbreakpoints/easyjson.go | 210 - extensions/easyjson.go | 660 - extensions/extensions.go | 22 +- extensions/types.go | 36 +- fedcm/easyjson.go | 836 -- fedcm/events.go | 2 +- fedcm/fedcm.go | 4 +- fedcm/types.go | 121 +- fetch/easyjson.go | 1697 --- fetch/events.go | 20 +- fetch/fetch.go | 44 +- fetch/types.go | 105 +- filesystem/easyjson.go | 541 - filesystem/filesystem.go | 2 +- filesystem/types.go | 6 +- go.mod | 4 +- go.sum | 6 +- har/easyjson.go | 2121 ---- har/types.go | 178 +- headlessexperimental/easyjson.go | 300 - headlessexperimental/headlessexperimental.go | 12 +- headlessexperimental/types.go | 42 +- heapprofiler/easyjson.go | 1880 --- heapprofiler/events.go | 2 +- heapprofiler/heapprofiler.go | 30 +- indexeddb/easyjson.go | 2201 ---- indexeddb/indexeddb.go | 78 +- indexeddb/types.go | 82 +- input/easyjson.go | 1912 --- input/input.go | 142 +- input/types.go | 291 +- inspector/easyjson.go | 321 - inspector/types.go | 36 +- io/easyjson.go | 390 - io/io.go | 14 +- layertree/easyjson.go | 1981 --- layertree/events.go | 2 +- layertree/layertree.go | 34 +- layertree/types.go | 71 +- log/easyjson.go | 716 -- log/types.go | 128 +- media/easyjson.go | 1177 -- media/types.go | 34 +- memory/easyjson.go | 1560 --- memory/memory.go | 18 +- memory/types.go | 36 +- network/easyjson.go | 11128 ---------------- network/events.go | 126 +- network/network.go | 102 +- network/types.go | 1226 +- overlay/easyjson.go | 4977 -------- overlay/overlay.go | 70 +- overlay/types.go | 240 +- page/easyjson.go | 11178 ----------------- page/events.go | 30 +- page/page.go | 162 +- page/types.go | 710 +- performance/easyjson.go | 503 - performance/performance.go | 4 +- performance/types.go | 36 +- performancetimeline/easyjson.go | 705 -- performancetimeline/types.go | 24 +- preload/easyjson.go | 1200 -- preload/events.go | 6 +- preload/types.go | 184 +- profiler/easyjson.go | 2074 --- profiler/events.go | 6 +- profiler/profiler.go | 16 +- profiler/types.go | 22 +- pwa/easyjson.go | 1063 -- pwa/pwa.go | 16 +- pwa/types.go | 36 +- runtime/easyjson.go | 5418 -------- runtime/events.go | 20 +- runtime/runtime.go | 150 +- runtime/types.go | 304 +- security/easyjson.go | 901 -- security/types.go | 174 +- serviceworker/easyjson.go | 1544 --- serviceworker/types.go | 68 +- storage/easyjson.go | 8167 ------------ storage/events.go | 14 +- storage/storage.go | 48 +- storage/types.go | 364 +- systeminfo/easyjson.go | 1420 --- systeminfo/systeminfo.go | 12 +- systeminfo/types.go | 79 +- target/easyjson.go | 2865 ----- target/target.go | 72 +- target/types.go | 51 +- tethering/easyjson.go | 224 - tracing/easyjson.go | 1202 -- tracing/events.go | 18 +- tracing/tracing.go | 24 +- tracing/types.go | 189 +- webaudio/easyjson.go | 1828 --- webaudio/events.go | 12 +- webaudio/types.go | 141 +- webaudio/webaudio.go | 2 +- webauthn/easyjson.go | 1837 --- webauthn/types.go | 130 +- webauthn/webauthn.go | 18 +- 156 files changed, 3829 insertions(+), 135104 deletions(-) delete mode 100644 accessibility/easyjson.go delete mode 100644 animation/easyjson.go delete mode 100644 audits/easyjson.go delete mode 100644 autofill/easyjson.go delete mode 100644 backgroundservice/easyjson.go delete mode 100644 bluetoothemulation/easyjson.go delete mode 100644 browser/easyjson.go delete mode 100644 cachestorage/easyjson.go delete mode 100644 cast/easyjson.go delete mode 100644 cdp/easyjson.go delete mode 100644 css/easyjson.go delete mode 100644 debugger/easyjson.go delete mode 100644 deviceaccess/easyjson.go delete mode 100644 deviceorientation/easyjson.go delete mode 100644 dom/easyjson.go delete mode 100644 domdebugger/easyjson.go delete mode 100644 domsnapshot/easyjson.go delete mode 100644 domstorage/easyjson.go delete mode 100644 easyjson.go delete mode 100644 emulation/easyjson.go delete mode 100644 eventbreakpoints/easyjson.go delete mode 100644 extensions/easyjson.go delete mode 100644 fedcm/easyjson.go delete mode 100644 fetch/easyjson.go delete mode 100644 filesystem/easyjson.go delete mode 100644 har/easyjson.go delete mode 100644 headlessexperimental/easyjson.go delete mode 100644 heapprofiler/easyjson.go delete mode 100644 indexeddb/easyjson.go delete mode 100644 input/easyjson.go delete mode 100644 inspector/easyjson.go delete mode 100644 io/easyjson.go delete mode 100644 layertree/easyjson.go delete mode 100644 log/easyjson.go delete mode 100644 media/easyjson.go delete mode 100644 memory/easyjson.go delete mode 100644 network/easyjson.go delete mode 100644 overlay/easyjson.go delete mode 100644 page/easyjson.go delete mode 100644 performance/easyjson.go delete mode 100644 performancetimeline/easyjson.go delete mode 100644 preload/easyjson.go delete mode 100644 profiler/easyjson.go delete mode 100644 pwa/easyjson.go delete mode 100644 runtime/easyjson.go delete mode 100644 security/easyjson.go delete mode 100644 serviceworker/easyjson.go delete mode 100644 storage/easyjson.go delete mode 100644 systeminfo/easyjson.go delete mode 100644 target/easyjson.go delete mode 100644 tethering/easyjson.go delete mode 100644 tracing/easyjson.go delete mode 100644 webaudio/easyjson.go delete mode 100644 webauthn/easyjson.go diff --git a/accessibility/accessibility.go b/accessibility/accessibility.go index c5ebdfee..7acbe84c 100644 --- a/accessibility/accessibility.go +++ b/accessibility/accessibility.go @@ -50,10 +50,10 @@ func (p *EnableParams) Do(ctx context.Context) (err error) { // GetPartialAXTreeParams fetches the accessibility node and partial // accessibility tree for this DOM node, if it exists. type GetPartialAXTreeParams struct { - NodeID cdp.NodeID `json:"nodeId,omitempty"` // Identifier of the node to get the partial accessibility tree for. - BackendNodeID cdp.BackendNodeID `json:"backendNodeId,omitempty"` // Identifier of the backend node to get the partial accessibility tree for. - ObjectID runtime.RemoteObjectID `json:"objectId,omitempty"` // JavaScript object id of the node wrapper to get the partial accessibility tree for. - FetchRelatives bool `json:"fetchRelatives,omitempty"` // Whether to fetch this node's ancestors, siblings and children. Defaults to true. + NodeID cdp.NodeID `json:"nodeId,omitempty,omitzero"` // Identifier of the node to get the partial accessibility tree for. + BackendNodeID cdp.BackendNodeID `json:"backendNodeId,omitempty,omitzero"` // Identifier of the backend node to get the partial accessibility tree for. + ObjectID runtime.RemoteObjectID `json:"objectId,omitempty,omitzero"` // JavaScript object id of the node wrapper to get the partial accessibility tree for. + FetchRelatives bool `json:"fetchRelatives,omitempty,omitzero"` // Whether to fetch this node's ancestors, siblings and children. Defaults to true. } // GetPartialAXTree fetches the accessibility node and partial accessibility @@ -96,7 +96,7 @@ func (p GetPartialAXTreeParams) WithFetchRelatives(fetchRelatives bool) *GetPart // GetPartialAXTreeReturns return values. type GetPartialAXTreeReturns struct { - Nodes []*Node `json:"nodes,omitempty"` // The Accessibility.AXNode for this DOM node, if it exists, plus its ancestors, siblings and children, if requested. + Nodes []*Node `json:"nodes,omitempty,omitzero"` // The Accessibility.AXNode for this DOM node, if it exists, plus its ancestors, siblings and children, if requested. } // Do executes Accessibility.getPartialAXTree against the provided context. @@ -118,8 +118,8 @@ func (p *GetPartialAXTreeParams) Do(ctx context.Context) (nodes []*Node, err err // GetFullAXTreeParams fetches the entire accessibility tree for the root // Document. type GetFullAXTreeParams struct { - Depth int64 `json:"depth,omitempty"` // The maximum depth at which descendants of the root node should be retrieved. If omitted, the full tree is returned. - FrameID cdp.FrameID `json:"frameId,omitempty"` // The frame for whose document the AX tree should be retrieved. If omitted, the root frame is used. + Depth int64 `json:"depth,omitempty,omitzero"` // The maximum depth at which descendants of the root node should be retrieved. If omitted, the full tree is returned. + FrameID cdp.FrameID `json:"frameId,omitempty,omitzero"` // The frame for whose document the AX tree should be retrieved. If omitted, the root frame is used. } // GetFullAXTree fetches the entire accessibility tree for the root Document. @@ -147,7 +147,7 @@ func (p GetFullAXTreeParams) WithFrameID(frameID cdp.FrameID) *GetFullAXTreePara // GetFullAXTreeReturns return values. type GetFullAXTreeReturns struct { - Nodes []*Node `json:"nodes,omitempty"` + Nodes []*Node `json:"nodes,omitempty,omitzero"` } // Do executes Accessibility.getFullAXTree against the provided context. @@ -169,7 +169,7 @@ func (p *GetFullAXTreeParams) Do(ctx context.Context) (nodes []*Node, err error) // GetRootAXNodeParams fetches the root node. Requires enable() to have been // called previously. type GetRootAXNodeParams struct { - FrameID cdp.FrameID `json:"frameId,omitempty"` // The frame in whose document the node resides. If omitted, the root frame is used. + FrameID cdp.FrameID `json:"frameId,omitempty,omitzero"` // The frame in whose document the node resides. If omitted, the root frame is used. } // GetRootAXNode fetches the root node. Requires enable() to have been called @@ -191,7 +191,7 @@ func (p GetRootAXNodeParams) WithFrameID(frameID cdp.FrameID) *GetRootAXNodePara // GetRootAXNodeReturns return values. type GetRootAXNodeReturns struct { - Node *Node `json:"node,omitempty"` + Node *Node `json:"node,omitempty,omitzero"` } // Do executes Accessibility.getRootAXNode against the provided context. @@ -213,9 +213,9 @@ func (p *GetRootAXNodeParams) Do(ctx context.Context) (node *Node, err error) { // GetAXNodeAndAncestorsParams fetches a node and all ancestors up to and // including the root. Requires enable() to have been called previously. type GetAXNodeAndAncestorsParams struct { - NodeID cdp.NodeID `json:"nodeId,omitempty"` // Identifier of the node to get. - BackendNodeID cdp.BackendNodeID `json:"backendNodeId,omitempty"` // Identifier of the backend node to get. - ObjectID runtime.RemoteObjectID `json:"objectId,omitempty"` // JavaScript object id of the node wrapper to get. + NodeID cdp.NodeID `json:"nodeId,omitempty,omitzero"` // Identifier of the node to get. + BackendNodeID cdp.BackendNodeID `json:"backendNodeId,omitempty,omitzero"` // Identifier of the backend node to get. + ObjectID runtime.RemoteObjectID `json:"objectId,omitempty,omitzero"` // JavaScript object id of the node wrapper to get. } // GetAXNodeAndAncestors fetches a node and all ancestors up to and including @@ -248,7 +248,7 @@ func (p GetAXNodeAndAncestorsParams) WithObjectID(objectID runtime.RemoteObjectI // GetAXNodeAndAncestorsReturns return values. type GetAXNodeAndAncestorsReturns struct { - Nodes []*Node `json:"nodes,omitempty"` + Nodes []*Node `json:"nodes,omitempty,omitzero"` } // Do executes Accessibility.getAXNodeAndAncestors against the provided context. @@ -271,7 +271,7 @@ func (p *GetAXNodeAndAncestorsParams) Do(ctx context.Context) (nodes []*Node, er // Requires enable() to have been called previously. type GetChildAXNodesParams struct { ID NodeID `json:"id"` - FrameID cdp.FrameID `json:"frameId,omitempty"` // The frame in whose document the node resides. If omitted, the root frame is used. + FrameID cdp.FrameID `json:"frameId,omitempty,omitzero"` // The frame in whose document the node resides. If omitted, the root frame is used. } // GetChildAXNodes fetches a particular accessibility node by AXNodeId. @@ -297,7 +297,7 @@ func (p GetChildAXNodesParams) WithFrameID(frameID cdp.FrameID) *GetChildAXNodes // GetChildAXNodesReturns return values. type GetChildAXNodesReturns struct { - Nodes []*Node `json:"nodes,omitempty"` + Nodes []*Node `json:"nodes,omitempty,omitzero"` } // Do executes Accessibility.getChildAXNodes against the provided context. @@ -324,11 +324,11 @@ func (p *GetChildAXNodesParams) Do(ctx context.Context) (nodes []*Node, err erro // accessibleName or role is specified, it returns all the accessibility nodes // in the subtree. type QueryAXTreeParams struct { - NodeID cdp.NodeID `json:"nodeId,omitempty"` // Identifier of the node for the root to query. - BackendNodeID cdp.BackendNodeID `json:"backendNodeId,omitempty"` // Identifier of the backend node for the root to query. - ObjectID runtime.RemoteObjectID `json:"objectId,omitempty"` // JavaScript object id of the node wrapper for the root to query. - AccessibleName string `json:"accessibleName,omitempty"` // Find nodes with this computed name. - Role string `json:"role,omitempty"` // Find nodes with this computed role. + NodeID cdp.NodeID `json:"nodeId,omitempty,omitzero"` // Identifier of the node for the root to query. + BackendNodeID cdp.BackendNodeID `json:"backendNodeId,omitempty,omitzero"` // Identifier of the backend node for the root to query. + ObjectID runtime.RemoteObjectID `json:"objectId,omitempty,omitzero"` // JavaScript object id of the node wrapper for the root to query. + AccessibleName string `json:"accessibleName,omitempty,omitzero"` // Find nodes with this computed name. + Role string `json:"role,omitempty,omitzero"` // Find nodes with this computed role. } // QueryAXTree query a DOM node's accessibility subtree for accessible name @@ -379,7 +379,7 @@ func (p QueryAXTreeParams) WithRole(role string) *QueryAXTreeParams { // QueryAXTreeReturns return values. type QueryAXTreeReturns struct { - Nodes []*Node `json:"nodes,omitempty"` // A list of Accessibility.AXNode matching the specified attributes, including nodes that are ignored for accessibility. + Nodes []*Node `json:"nodes,omitempty,omitzero"` // A list of Accessibility.AXNode matching the specified attributes, including nodes that are ignored for accessibility. } // Do executes Accessibility.queryAXTree against the provided context. diff --git a/accessibility/easyjson.go b/accessibility/easyjson.go deleted file mode 100644 index 5764bd14..00000000 --- a/accessibility/easyjson.go +++ /dev/null @@ -1,2260 +0,0 @@ -// Code generated by easyjson for marshaling/unmarshaling. DO NOT EDIT. - -package accessibility - -import ( - json "encoding/json" - runtime "github.com/chromedp/cdproto/runtime" - easyjson "github.com/mailru/easyjson" - jlexer "github.com/mailru/easyjson/jlexer" - jwriter "github.com/mailru/easyjson/jwriter" -) - -// suppress unused package warning -var ( - _ *json.RawMessage - _ *jlexer.Lexer - _ *jwriter.Writer - _ easyjson.Marshaler -) - -func easyjsonC5a4559bDecodeGithubComChromedpCdprotoAccessibility(in *jlexer.Lexer, out *ValueSource) { - isTopLevel := in.IsStart() - if in.IsNull() { - if isTopLevel { - in.Consumed() - } - in.Skip() - return - } - in.Delim('{') - for !in.IsDelim('}') { - key := in.UnsafeFieldName(false) - in.WantColon() - if in.IsNull() { - in.Skip() - in.WantComma() - continue - } - switch key { - case "type": - (out.Type).UnmarshalEasyJSON(in) - case "value": - if in.IsNull() { - in.Skip() - out.Value = nil - } else { - if out.Value == nil { - out.Value = new(Value) - } - (*out.Value).UnmarshalEasyJSON(in) - } - case "attribute": - out.Attribute = string(in.String()) - case "attributeValue": - if in.IsNull() { - in.Skip() - out.AttributeValue = nil - } else { - if out.AttributeValue == nil { - out.AttributeValue = new(Value) - } - (*out.AttributeValue).UnmarshalEasyJSON(in) - } - case "superseded": - out.Superseded = bool(in.Bool()) - case "nativeSource": - (out.NativeSource).UnmarshalEasyJSON(in) - case "nativeSourceValue": - if in.IsNull() { - in.Skip() - out.NativeSourceValue = nil - } else { - if out.NativeSourceValue == nil { - out.NativeSourceValue = new(Value) - } - (*out.NativeSourceValue).UnmarshalEasyJSON(in) - } - case "invalid": - out.Invalid = bool(in.Bool()) - case "invalidReason": - out.InvalidReason = string(in.String()) - default: - in.SkipRecursive() - } - in.WantComma() - } - in.Delim('}') - if isTopLevel { - in.Consumed() - } -} -func easyjsonC5a4559bEncodeGithubComChromedpCdprotoAccessibility(out *jwriter.Writer, in ValueSource) { - out.RawByte('{') - first := true - _ = first - { - const prefix string = ",\"type\":" - out.RawString(prefix[1:]) - (in.Type).MarshalEasyJSON(out) - } - if in.Value != nil { - const prefix string = ",\"value\":" - out.RawString(prefix) - (*in.Value).MarshalEasyJSON(out) - } - if in.Attribute != "" { - const prefix string = ",\"attribute\":" - out.RawString(prefix) - out.String(string(in.Attribute)) - } - if in.AttributeValue != nil { - const prefix string = ",\"attributeValue\":" - out.RawString(prefix) - (*in.AttributeValue).MarshalEasyJSON(out) - } - if in.Superseded { - const prefix string = ",\"superseded\":" - out.RawString(prefix) - out.Bool(bool(in.Superseded)) - } - if in.NativeSource != "" { - const prefix string = ",\"nativeSource\":" - out.RawString(prefix) - (in.NativeSource).MarshalEasyJSON(out) - } - if in.NativeSourceValue != nil { - const prefix string = ",\"nativeSourceValue\":" - out.RawString(prefix) - (*in.NativeSourceValue).MarshalEasyJSON(out) - } - if in.Invalid { - const prefix string = ",\"invalid\":" - out.RawString(prefix) - out.Bool(bool(in.Invalid)) - } - if in.InvalidReason != "" { - const prefix string = ",\"invalidReason\":" - out.RawString(prefix) - out.String(string(in.InvalidReason)) - } - out.RawByte('}') -} - -// MarshalJSON supports json.Marshaler interface -func (v ValueSource) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - easyjsonC5a4559bEncodeGithubComChromedpCdprotoAccessibility(&w, v) - return w.Buffer.BuildBytes(), w.Error -} - -// MarshalEasyJSON supports easyjson.Marshaler interface -func (v ValueSource) MarshalEasyJSON(w *jwriter.Writer) { - easyjsonC5a4559bEncodeGithubComChromedpCdprotoAccessibility(w, v) -} - -// UnmarshalJSON supports json.Unmarshaler interface -func (v *ValueSource) UnmarshalJSON(data []byte) error { - r := jlexer.Lexer{Data: data} - easyjsonC5a4559bDecodeGithubComChromedpCdprotoAccessibility(&r, v) - return r.Error() -} - -// UnmarshalEasyJSON supports easyjson.Unmarshaler interface -func (v *ValueSource) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjsonC5a4559bDecodeGithubComChromedpCdprotoAccessibility(l, v) -} -func easyjsonC5a4559bDecodeGithubComChromedpCdprotoAccessibility1(in *jlexer.Lexer, out *Value) { - isTopLevel := in.IsStart() - if in.IsNull() { - if isTopLevel { - in.Consumed() - } - in.Skip() - return - } - in.Delim('{') - for !in.IsDelim('}') { - key := in.UnsafeFieldName(false) - in.WantColon() - if in.IsNull() { - in.Skip() - in.WantComma() - continue - } - switch key { - case "type": - (out.Type).UnmarshalEasyJSON(in) - case "value": - (out.Value).UnmarshalEasyJSON(in) - case "relatedNodes": - if in.IsNull() { - in.Skip() - out.RelatedNodes = nil - } else { - in.Delim('[') - if out.RelatedNodes == nil { - if !in.IsDelim(']') { - out.RelatedNodes = make([]*RelatedNode, 0, 8) - } else { - out.RelatedNodes = []*RelatedNode{} - } - } else { - out.RelatedNodes = (out.RelatedNodes)[:0] - } - for !in.IsDelim(']') { - var v1 *RelatedNode - if in.IsNull() { - in.Skip() - v1 = nil - } else { - if v1 == nil { - v1 = new(RelatedNode) - } - (*v1).UnmarshalEasyJSON(in) - } - out.RelatedNodes = append(out.RelatedNodes, v1) - in.WantComma() - } - in.Delim(']') - } - case "sources": - if in.IsNull() { - in.Skip() - out.Sources = nil - } else { - in.Delim('[') - if out.Sources == nil { - if !in.IsDelim(']') { - out.Sources = make([]*ValueSource, 0, 8) - } else { - out.Sources = []*ValueSource{} - } - } else { - out.Sources = (out.Sources)[:0] - } - for !in.IsDelim(']') { - var v2 *ValueSource - if in.IsNull() { - in.Skip() - v2 = nil - } else { - if v2 == nil { - v2 = new(ValueSource) - } - (*v2).UnmarshalEasyJSON(in) - } - out.Sources = append(out.Sources, v2) - in.WantComma() - } - in.Delim(']') - } - default: - in.SkipRecursive() - } - in.WantComma() - } - in.Delim('}') - if isTopLevel { - in.Consumed() - } -} -func easyjsonC5a4559bEncodeGithubComChromedpCdprotoAccessibility1(out *jwriter.Writer, in Value) { - out.RawByte('{') - first := true - _ = first - { - const prefix string = ",\"type\":" - out.RawString(prefix[1:]) - (in.Type).MarshalEasyJSON(out) - } - if (in.Value).IsDefined() { - const prefix string = ",\"value\":" - out.RawString(prefix) - (in.Value).MarshalEasyJSON(out) - } - if len(in.RelatedNodes) != 0 { - const prefix string = ",\"relatedNodes\":" - out.RawString(prefix) - { - out.RawByte('[') - for v3, v4 := range in.RelatedNodes { - if v3 > 0 { - out.RawByte(',') - } - if v4 == nil { - out.RawString("null") - } else { - (*v4).MarshalEasyJSON(out) - } - } - out.RawByte(']') - } - } - if len(in.Sources) != 0 { - const prefix string = ",\"sources\":" - out.RawString(prefix) - { - out.RawByte('[') - for v5, v6 := range in.Sources { - if v5 > 0 { - out.RawByte(',') - } - if v6 == nil { - out.RawString("null") - } else { - (*v6).MarshalEasyJSON(out) - } - } - out.RawByte(']') - } - } - out.RawByte('}') -} - -// MarshalJSON supports json.Marshaler interface -func (v Value) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - easyjsonC5a4559bEncodeGithubComChromedpCdprotoAccessibility1(&w, v) - return w.Buffer.BuildBytes(), w.Error -} - -// MarshalEasyJSON supports easyjson.Marshaler interface -func (v Value) MarshalEasyJSON(w *jwriter.Writer) { - easyjsonC5a4559bEncodeGithubComChromedpCdprotoAccessibility1(w, v) -} - -// UnmarshalJSON supports json.Unmarshaler interface -func (v *Value) UnmarshalJSON(data []byte) error { - r := jlexer.Lexer{Data: data} - easyjsonC5a4559bDecodeGithubComChromedpCdprotoAccessibility1(&r, v) - return r.Error() -} - -// UnmarshalEasyJSON supports easyjson.Unmarshaler interface -func (v *Value) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjsonC5a4559bDecodeGithubComChromedpCdprotoAccessibility1(l, v) -} -func easyjsonC5a4559bDecodeGithubComChromedpCdprotoAccessibility2(in *jlexer.Lexer, out *RelatedNode) { - isTopLevel := in.IsStart() - if in.IsNull() { - if isTopLevel { - in.Consumed() - } - in.Skip() - return - } - in.Delim('{') - for !in.IsDelim('}') { - key := in.UnsafeFieldName(false) - in.WantColon() - if in.IsNull() { - in.Skip() - in.WantComma() - continue - } - switch key { - case "backendDOMNodeId": - (out.BackendDOMNodeID).UnmarshalEasyJSON(in) - case "idref": - out.Idref = string(in.String()) - case "text": - out.Text = string(in.String()) - default: - in.SkipRecursive() - } - in.WantComma() - } - in.Delim('}') - if isTopLevel { - in.Consumed() - } -} -func easyjsonC5a4559bEncodeGithubComChromedpCdprotoAccessibility2(out *jwriter.Writer, in RelatedNode) { - out.RawByte('{') - first := true - _ = first - { - const prefix string = ",\"backendDOMNodeId\":" - out.RawString(prefix[1:]) - out.Int64(int64(in.BackendDOMNodeID)) - } - if in.Idref != "" { - const prefix string = ",\"idref\":" - out.RawString(prefix) - out.String(string(in.Idref)) - } - if in.Text != "" { - const prefix string = ",\"text\":" - out.RawString(prefix) - out.String(string(in.Text)) - } - out.RawByte('}') -} - -// MarshalJSON supports json.Marshaler interface -func (v RelatedNode) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - easyjsonC5a4559bEncodeGithubComChromedpCdprotoAccessibility2(&w, v) - return w.Buffer.BuildBytes(), w.Error -} - -// MarshalEasyJSON supports easyjson.Marshaler interface -func (v RelatedNode) MarshalEasyJSON(w *jwriter.Writer) { - easyjsonC5a4559bEncodeGithubComChromedpCdprotoAccessibility2(w, v) -} - -// UnmarshalJSON supports json.Unmarshaler interface -func (v *RelatedNode) UnmarshalJSON(data []byte) error { - r := jlexer.Lexer{Data: data} - easyjsonC5a4559bDecodeGithubComChromedpCdprotoAccessibility2(&r, v) - return r.Error() -} - -// UnmarshalEasyJSON supports easyjson.Unmarshaler interface -func (v *RelatedNode) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjsonC5a4559bDecodeGithubComChromedpCdprotoAccessibility2(l, v) -} -func easyjsonC5a4559bDecodeGithubComChromedpCdprotoAccessibility3(in *jlexer.Lexer, out *QueryAXTreeReturns) { - isTopLevel := in.IsStart() - if in.IsNull() { - if isTopLevel { - in.Consumed() - } - in.Skip() - return - } - in.Delim('{') - for !in.IsDelim('}') { - key := in.UnsafeFieldName(false) - in.WantColon() - if in.IsNull() { - in.Skip() - in.WantComma() - continue - } - switch key { - case "nodes": - if in.IsNull() { - in.Skip() - out.Nodes = nil - } else { - in.Delim('[') - if out.Nodes == nil { - if !in.IsDelim(']') { - out.Nodes = make([]*Node, 0, 8) - } else { - out.Nodes = []*Node{} - } - } else { - out.Nodes = (out.Nodes)[:0] - } - for !in.IsDelim(']') { - var v7 *Node - if in.IsNull() { - in.Skip() - v7 = nil - } else { - if v7 == nil { - v7 = new(Node) - } - (*v7).UnmarshalEasyJSON(in) - } - out.Nodes = append(out.Nodes, v7) - in.WantComma() - } - in.Delim(']') - } - default: - in.SkipRecursive() - } - in.WantComma() - } - in.Delim('}') - if isTopLevel { - in.Consumed() - } -} -func easyjsonC5a4559bEncodeGithubComChromedpCdprotoAccessibility3(out *jwriter.Writer, in QueryAXTreeReturns) { - out.RawByte('{') - first := true - _ = first - if len(in.Nodes) != 0 { - const prefix string = ",\"nodes\":" - first = false - out.RawString(prefix[1:]) - { - out.RawByte('[') - for v8, v9 := range in.Nodes { - if v8 > 0 { - out.RawByte(',') - } - if v9 == nil { - out.RawString("null") - } else { - (*v9).MarshalEasyJSON(out) - } - } - out.RawByte(']') - } - } - out.RawByte('}') -} - -// MarshalJSON supports json.Marshaler interface -func (v QueryAXTreeReturns) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - easyjsonC5a4559bEncodeGithubComChromedpCdprotoAccessibility3(&w, v) - return w.Buffer.BuildBytes(), w.Error -} - -// MarshalEasyJSON supports easyjson.Marshaler interface -func (v QueryAXTreeReturns) MarshalEasyJSON(w *jwriter.Writer) { - easyjsonC5a4559bEncodeGithubComChromedpCdprotoAccessibility3(w, v) -} - -// UnmarshalJSON supports json.Unmarshaler interface -func (v *QueryAXTreeReturns) UnmarshalJSON(data []byte) error { - r := jlexer.Lexer{Data: data} - easyjsonC5a4559bDecodeGithubComChromedpCdprotoAccessibility3(&r, v) - return r.Error() -} - -// UnmarshalEasyJSON supports easyjson.Unmarshaler interface -func (v *QueryAXTreeReturns) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjsonC5a4559bDecodeGithubComChromedpCdprotoAccessibility3(l, v) -} -func easyjsonC5a4559bDecodeGithubComChromedpCdprotoAccessibility4(in *jlexer.Lexer, out *QueryAXTreeParams) { - isTopLevel := in.IsStart() - if in.IsNull() { - if isTopLevel { - in.Consumed() - } - in.Skip() - return - } - in.Delim('{') - for !in.IsDelim('}') { - key := in.UnsafeFieldName(false) - in.WantColon() - if in.IsNull() { - in.Skip() - in.WantComma() - continue - } - switch key { - case "nodeId": - (out.NodeID).UnmarshalEasyJSON(in) - case "backendNodeId": - (out.BackendNodeID).UnmarshalEasyJSON(in) - case "objectId": - out.ObjectID = runtime.RemoteObjectID(in.String()) - case "accessibleName": - out.AccessibleName = string(in.String()) - case "role": - out.Role = string(in.String()) - default: - in.SkipRecursive() - } - in.WantComma() - } - in.Delim('}') - if isTopLevel { - in.Consumed() - } -} -func easyjsonC5a4559bEncodeGithubComChromedpCdprotoAccessibility4(out *jwriter.Writer, in QueryAXTreeParams) { - out.RawByte('{') - first := true - _ = first - if in.NodeID != 0 { - const prefix string = ",\"nodeId\":" - first = false - out.RawString(prefix[1:]) - out.Int64(int64(in.NodeID)) - } - if in.BackendNodeID != 0 { - const prefix string = ",\"backendNodeId\":" - if first { - first = false - out.RawString(prefix[1:]) - } else { - out.RawString(prefix) - } - out.Int64(int64(in.BackendNodeID)) - } - if in.ObjectID != "" { - const prefix string = ",\"objectId\":" - if first { - first = false - out.RawString(prefix[1:]) - } else { - out.RawString(prefix) - } - out.String(string(in.ObjectID)) - } - if in.AccessibleName != "" { - const prefix string = ",\"accessibleName\":" - if first { - first = false - out.RawString(prefix[1:]) - } else { - out.RawString(prefix) - } - out.String(string(in.AccessibleName)) - } - if in.Role != "" { - const prefix string = ",\"role\":" - if first { - first = false - out.RawString(prefix[1:]) - } else { - out.RawString(prefix) - } - out.String(string(in.Role)) - } - out.RawByte('}') -} - -// MarshalJSON supports json.Marshaler interface -func (v QueryAXTreeParams) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - easyjsonC5a4559bEncodeGithubComChromedpCdprotoAccessibility4(&w, v) - return w.Buffer.BuildBytes(), w.Error -} - -// MarshalEasyJSON supports easyjson.Marshaler interface -func (v QueryAXTreeParams) MarshalEasyJSON(w *jwriter.Writer) { - easyjsonC5a4559bEncodeGithubComChromedpCdprotoAccessibility4(w, v) -} - -// UnmarshalJSON supports json.Unmarshaler interface -func (v *QueryAXTreeParams) UnmarshalJSON(data []byte) error { - r := jlexer.Lexer{Data: data} - easyjsonC5a4559bDecodeGithubComChromedpCdprotoAccessibility4(&r, v) - return r.Error() -} - -// UnmarshalEasyJSON supports easyjson.Unmarshaler interface -func (v *QueryAXTreeParams) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjsonC5a4559bDecodeGithubComChromedpCdprotoAccessibility4(l, v) -} -func easyjsonC5a4559bDecodeGithubComChromedpCdprotoAccessibility5(in *jlexer.Lexer, out *Property) { - isTopLevel := in.IsStart() - if in.IsNull() { - if isTopLevel { - in.Consumed() - } - in.Skip() - return - } - in.Delim('{') - for !in.IsDelim('}') { - key := in.UnsafeFieldName(false) - in.WantColon() - if in.IsNull() { - in.Skip() - in.WantComma() - continue - } - switch key { - case "name": - (out.Name).UnmarshalEasyJSON(in) - case "value": - if in.IsNull() { - in.Skip() - out.Value = nil - } else { - if out.Value == nil { - out.Value = new(Value) - } - (*out.Value).UnmarshalEasyJSON(in) - } - default: - in.SkipRecursive() - } - in.WantComma() - } - in.Delim('}') - if isTopLevel { - in.Consumed() - } -} -func easyjsonC5a4559bEncodeGithubComChromedpCdprotoAccessibility5(out *jwriter.Writer, in Property) { - out.RawByte('{') - first := true - _ = first - { - const prefix string = ",\"name\":" - out.RawString(prefix[1:]) - (in.Name).MarshalEasyJSON(out) - } - { - const prefix string = ",\"value\":" - out.RawString(prefix) - if in.Value == nil { - out.RawString("null") - } else { - (*in.Value).MarshalEasyJSON(out) - } - } - out.RawByte('}') -} - -// MarshalJSON supports json.Marshaler interface -func (v Property) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - easyjsonC5a4559bEncodeGithubComChromedpCdprotoAccessibility5(&w, v) - return w.Buffer.BuildBytes(), w.Error -} - -// MarshalEasyJSON supports easyjson.Marshaler interface -func (v Property) MarshalEasyJSON(w *jwriter.Writer) { - easyjsonC5a4559bEncodeGithubComChromedpCdprotoAccessibility5(w, v) -} - -// UnmarshalJSON supports json.Unmarshaler interface -func (v *Property) UnmarshalJSON(data []byte) error { - r := jlexer.Lexer{Data: data} - easyjsonC5a4559bDecodeGithubComChromedpCdprotoAccessibility5(&r, v) - return r.Error() -} - -// UnmarshalEasyJSON supports easyjson.Unmarshaler interface -func (v *Property) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjsonC5a4559bDecodeGithubComChromedpCdprotoAccessibility5(l, v) -} -func easyjsonC5a4559bDecodeGithubComChromedpCdprotoAccessibility6(in *jlexer.Lexer, out *Node) { - isTopLevel := in.IsStart() - if in.IsNull() { - if isTopLevel { - in.Consumed() - } - in.Skip() - return - } - in.Delim('{') - for !in.IsDelim('}') { - key := in.UnsafeFieldName(false) - in.WantColon() - if in.IsNull() { - in.Skip() - in.WantComma() - continue - } - switch key { - case "nodeId": - out.NodeID = NodeID(in.String()) - case "ignored": - out.Ignored = bool(in.Bool()) - case "ignoredReasons": - if in.IsNull() { - in.Skip() - out.IgnoredReasons = nil - } else { - in.Delim('[') - if out.IgnoredReasons == nil { - if !in.IsDelim(']') { - out.IgnoredReasons = make([]*Property, 0, 8) - } else { - out.IgnoredReasons = []*Property{} - } - } else { - out.IgnoredReasons = (out.IgnoredReasons)[:0] - } - for !in.IsDelim(']') { - var v10 *Property - if in.IsNull() { - in.Skip() - v10 = nil - } else { - if v10 == nil { - v10 = new(Property) - } - (*v10).UnmarshalEasyJSON(in) - } - out.IgnoredReasons = append(out.IgnoredReasons, v10) - in.WantComma() - } - in.Delim(']') - } - case "role": - if in.IsNull() { - in.Skip() - out.Role = nil - } else { - if out.Role == nil { - out.Role = new(Value) - } - (*out.Role).UnmarshalEasyJSON(in) - } - case "chromeRole": - if in.IsNull() { - in.Skip() - out.ChromeRole = nil - } else { - if out.ChromeRole == nil { - out.ChromeRole = new(Value) - } - (*out.ChromeRole).UnmarshalEasyJSON(in) - } - case "name": - if in.IsNull() { - in.Skip() - out.Name = nil - } else { - if out.Name == nil { - out.Name = new(Value) - } - (*out.Name).UnmarshalEasyJSON(in) - } - case "description": - if in.IsNull() { - in.Skip() - out.Description = nil - } else { - if out.Description == nil { - out.Description = new(Value) - } - (*out.Description).UnmarshalEasyJSON(in) - } - case "value": - if in.IsNull() { - in.Skip() - out.Value = nil - } else { - if out.Value == nil { - out.Value = new(Value) - } - (*out.Value).UnmarshalEasyJSON(in) - } - case "properties": - if in.IsNull() { - in.Skip() - out.Properties = nil - } else { - in.Delim('[') - if out.Properties == nil { - if !in.IsDelim(']') { - out.Properties = make([]*Property, 0, 8) - } else { - out.Properties = []*Property{} - } - } else { - out.Properties = (out.Properties)[:0] - } - for !in.IsDelim(']') { - var v11 *Property - if in.IsNull() { - in.Skip() - v11 = nil - } else { - if v11 == nil { - v11 = new(Property) - } - (*v11).UnmarshalEasyJSON(in) - } - out.Properties = append(out.Properties, v11) - in.WantComma() - } - in.Delim(']') - } - case "parentId": - out.ParentID = NodeID(in.String()) - case "childIds": - if in.IsNull() { - in.Skip() - out.ChildIDs = nil - } else { - in.Delim('[') - if out.ChildIDs == nil { - if !in.IsDelim(']') { - out.ChildIDs = make([]NodeID, 0, 4) - } else { - out.ChildIDs = []NodeID{} - } - } else { - out.ChildIDs = (out.ChildIDs)[:0] - } - for !in.IsDelim(']') { - var v12 NodeID - v12 = NodeID(in.String()) - out.ChildIDs = append(out.ChildIDs, v12) - in.WantComma() - } - in.Delim(']') - } - case "backendDOMNodeId": - (out.BackendDOMNodeID).UnmarshalEasyJSON(in) - case "frameId": - (out.FrameID).UnmarshalEasyJSON(in) - default: - in.SkipRecursive() - } - in.WantComma() - } - in.Delim('}') - if isTopLevel { - in.Consumed() - } -} -func easyjsonC5a4559bEncodeGithubComChromedpCdprotoAccessibility6(out *jwriter.Writer, in Node) { - out.RawByte('{') - first := true - _ = first - { - const prefix string = ",\"nodeId\":" - out.RawString(prefix[1:]) - out.String(string(in.NodeID)) - } - { - const prefix string = ",\"ignored\":" - out.RawString(prefix) - out.Bool(bool(in.Ignored)) - } - if len(in.IgnoredReasons) != 0 { - const prefix string = ",\"ignoredReasons\":" - out.RawString(prefix) - { - out.RawByte('[') - for v13, v14 := range in.IgnoredReasons { - if v13 > 0 { - out.RawByte(',') - } - if v14 == nil { - out.RawString("null") - } else { - (*v14).MarshalEasyJSON(out) - } - } - out.RawByte(']') - } - } - if in.Role != nil { - const prefix string = ",\"role\":" - out.RawString(prefix) - (*in.Role).MarshalEasyJSON(out) - } - if in.ChromeRole != nil { - const prefix string = ",\"chromeRole\":" - out.RawString(prefix) - (*in.ChromeRole).MarshalEasyJSON(out) - } - if in.Name != nil { - const prefix string = ",\"name\":" - out.RawString(prefix) - (*in.Name).MarshalEasyJSON(out) - } - if in.Description != nil { - const prefix string = ",\"description\":" - out.RawString(prefix) - (*in.Description).MarshalEasyJSON(out) - } - if in.Value != nil { - const prefix string = ",\"value\":" - out.RawString(prefix) - (*in.Value).MarshalEasyJSON(out) - } - if len(in.Properties) != 0 { - const prefix string = ",\"properties\":" - out.RawString(prefix) - { - out.RawByte('[') - for v15, v16 := range in.Properties { - if v15 > 0 { - out.RawByte(',') - } - if v16 == nil { - out.RawString("null") - } else { - (*v16).MarshalEasyJSON(out) - } - } - out.RawByte(']') - } - } - if in.ParentID != "" { - const prefix string = ",\"parentId\":" - out.RawString(prefix) - out.String(string(in.ParentID)) - } - if len(in.ChildIDs) != 0 { - const prefix string = ",\"childIds\":" - out.RawString(prefix) - { - out.RawByte('[') - for v17, v18 := range in.ChildIDs { - if v17 > 0 { - out.RawByte(',') - } - out.String(string(v18)) - } - out.RawByte(']') - } - } - if in.BackendDOMNodeID != 0 { - const prefix string = ",\"backendDOMNodeId\":" - out.RawString(prefix) - out.Int64(int64(in.BackendDOMNodeID)) - } - if in.FrameID != "" { - const prefix string = ",\"frameId\":" - out.RawString(prefix) - out.String(string(in.FrameID)) - } - out.RawByte('}') -} - -// MarshalJSON supports json.Marshaler interface -func (v Node) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - easyjsonC5a4559bEncodeGithubComChromedpCdprotoAccessibility6(&w, v) - return w.Buffer.BuildBytes(), w.Error -} - -// MarshalEasyJSON supports easyjson.Marshaler interface -func (v Node) MarshalEasyJSON(w *jwriter.Writer) { - easyjsonC5a4559bEncodeGithubComChromedpCdprotoAccessibility6(w, v) -} - -// UnmarshalJSON supports json.Unmarshaler interface -func (v *Node) UnmarshalJSON(data []byte) error { - r := jlexer.Lexer{Data: data} - easyjsonC5a4559bDecodeGithubComChromedpCdprotoAccessibility6(&r, v) - return r.Error() -} - -// UnmarshalEasyJSON supports easyjson.Unmarshaler interface -func (v *Node) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjsonC5a4559bDecodeGithubComChromedpCdprotoAccessibility6(l, v) -} -func easyjsonC5a4559bDecodeGithubComChromedpCdprotoAccessibility7(in *jlexer.Lexer, out *GetRootAXNodeReturns) { - isTopLevel := in.IsStart() - if in.IsNull() { - if isTopLevel { - in.Consumed() - } - in.Skip() - return - } - in.Delim('{') - for !in.IsDelim('}') { - key := in.UnsafeFieldName(false) - in.WantColon() - if in.IsNull() { - in.Skip() - in.WantComma() - continue - } - switch key { - case "node": - if in.IsNull() { - in.Skip() - out.Node = nil - } else { - if out.Node == nil { - out.Node = new(Node) - } - (*out.Node).UnmarshalEasyJSON(in) - } - default: - in.SkipRecursive() - } - in.WantComma() - } - in.Delim('}') - if isTopLevel { - in.Consumed() - } -} -func easyjsonC5a4559bEncodeGithubComChromedpCdprotoAccessibility7(out *jwriter.Writer, in GetRootAXNodeReturns) { - out.RawByte('{') - first := true - _ = first - if in.Node != nil { - const prefix string = ",\"node\":" - first = false - out.RawString(prefix[1:]) - (*in.Node).MarshalEasyJSON(out) - } - out.RawByte('}') -} - -// MarshalJSON supports json.Marshaler interface -func (v GetRootAXNodeReturns) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - easyjsonC5a4559bEncodeGithubComChromedpCdprotoAccessibility7(&w, v) - return w.Buffer.BuildBytes(), w.Error -} - -// MarshalEasyJSON supports easyjson.Marshaler interface -func (v GetRootAXNodeReturns) MarshalEasyJSON(w *jwriter.Writer) { - easyjsonC5a4559bEncodeGithubComChromedpCdprotoAccessibility7(w, v) -} - -// UnmarshalJSON supports json.Unmarshaler interface -func (v *GetRootAXNodeReturns) UnmarshalJSON(data []byte) error { - r := jlexer.Lexer{Data: data} - easyjsonC5a4559bDecodeGithubComChromedpCdprotoAccessibility7(&r, v) - return r.Error() -} - -// UnmarshalEasyJSON supports easyjson.Unmarshaler interface -func (v *GetRootAXNodeReturns) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjsonC5a4559bDecodeGithubComChromedpCdprotoAccessibility7(l, v) -} -func easyjsonC5a4559bDecodeGithubComChromedpCdprotoAccessibility8(in *jlexer.Lexer, out *GetRootAXNodeParams) { - isTopLevel := in.IsStart() - if in.IsNull() { - if isTopLevel { - in.Consumed() - } - in.Skip() - return - } - in.Delim('{') - for !in.IsDelim('}') { - key := in.UnsafeFieldName(false) - in.WantColon() - if in.IsNull() { - in.Skip() - in.WantComma() - continue - } - switch key { - case "frameId": - (out.FrameID).UnmarshalEasyJSON(in) - default: - in.SkipRecursive() - } - in.WantComma() - } - in.Delim('}') - if isTopLevel { - in.Consumed() - } -} -func easyjsonC5a4559bEncodeGithubComChromedpCdprotoAccessibility8(out *jwriter.Writer, in GetRootAXNodeParams) { - out.RawByte('{') - first := true - _ = first - if in.FrameID != "" { - const prefix string = ",\"frameId\":" - first = false - out.RawString(prefix[1:]) - out.String(string(in.FrameID)) - } - out.RawByte('}') -} - -// MarshalJSON supports json.Marshaler interface -func (v GetRootAXNodeParams) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - easyjsonC5a4559bEncodeGithubComChromedpCdprotoAccessibility8(&w, v) - return w.Buffer.BuildBytes(), w.Error -} - -// MarshalEasyJSON supports easyjson.Marshaler interface -func (v GetRootAXNodeParams) MarshalEasyJSON(w *jwriter.Writer) { - easyjsonC5a4559bEncodeGithubComChromedpCdprotoAccessibility8(w, v) -} - -// UnmarshalJSON supports json.Unmarshaler interface -func (v *GetRootAXNodeParams) UnmarshalJSON(data []byte) error { - r := jlexer.Lexer{Data: data} - easyjsonC5a4559bDecodeGithubComChromedpCdprotoAccessibility8(&r, v) - return r.Error() -} - -// UnmarshalEasyJSON supports easyjson.Unmarshaler interface -func (v *GetRootAXNodeParams) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjsonC5a4559bDecodeGithubComChromedpCdprotoAccessibility8(l, v) -} -func easyjsonC5a4559bDecodeGithubComChromedpCdprotoAccessibility9(in *jlexer.Lexer, out *GetPartialAXTreeReturns) { - isTopLevel := in.IsStart() - if in.IsNull() { - if isTopLevel { - in.Consumed() - } - in.Skip() - return - } - in.Delim('{') - for !in.IsDelim('}') { - key := in.UnsafeFieldName(false) - in.WantColon() - if in.IsNull() { - in.Skip() - in.WantComma() - continue - } - switch key { - case "nodes": - if in.IsNull() { - in.Skip() - out.Nodes = nil - } else { - in.Delim('[') - if out.Nodes == nil { - if !in.IsDelim(']') { - out.Nodes = make([]*Node, 0, 8) - } else { - out.Nodes = []*Node{} - } - } else { - out.Nodes = (out.Nodes)[:0] - } - for !in.IsDelim(']') { - var v19 *Node - if in.IsNull() { - in.Skip() - v19 = nil - } else { - if v19 == nil { - v19 = new(Node) - } - (*v19).UnmarshalEasyJSON(in) - } - out.Nodes = append(out.Nodes, v19) - in.WantComma() - } - in.Delim(']') - } - default: - in.SkipRecursive() - } - in.WantComma() - } - in.Delim('}') - if isTopLevel { - in.Consumed() - } -} -func easyjsonC5a4559bEncodeGithubComChromedpCdprotoAccessibility9(out *jwriter.Writer, in GetPartialAXTreeReturns) { - out.RawByte('{') - first := true - _ = first - if len(in.Nodes) != 0 { - const prefix string = ",\"nodes\":" - first = false - out.RawString(prefix[1:]) - { - out.RawByte('[') - for v20, v21 := range in.Nodes { - if v20 > 0 { - out.RawByte(',') - } - if v21 == nil { - out.RawString("null") - } else { - (*v21).MarshalEasyJSON(out) - } - } - out.RawByte(']') - } - } - out.RawByte('}') -} - -// MarshalJSON supports json.Marshaler interface -func (v GetPartialAXTreeReturns) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - easyjsonC5a4559bEncodeGithubComChromedpCdprotoAccessibility9(&w, v) - return w.Buffer.BuildBytes(), w.Error -} - -// MarshalEasyJSON supports easyjson.Marshaler interface -func (v GetPartialAXTreeReturns) MarshalEasyJSON(w *jwriter.Writer) { - easyjsonC5a4559bEncodeGithubComChromedpCdprotoAccessibility9(w, v) -} - -// UnmarshalJSON supports json.Unmarshaler interface -func (v *GetPartialAXTreeReturns) UnmarshalJSON(data []byte) error { - r := jlexer.Lexer{Data: data} - easyjsonC5a4559bDecodeGithubComChromedpCdprotoAccessibility9(&r, v) - return r.Error() -} - -// UnmarshalEasyJSON supports easyjson.Unmarshaler interface -func (v *GetPartialAXTreeReturns) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjsonC5a4559bDecodeGithubComChromedpCdprotoAccessibility9(l, v) -} -func easyjsonC5a4559bDecodeGithubComChromedpCdprotoAccessibility10(in *jlexer.Lexer, out *GetPartialAXTreeParams) { - isTopLevel := in.IsStart() - if in.IsNull() { - if isTopLevel { - in.Consumed() - } - in.Skip() - return - } - in.Delim('{') - for !in.IsDelim('}') { - key := in.UnsafeFieldName(false) - in.WantColon() - if in.IsNull() { - in.Skip() - in.WantComma() - continue - } - switch key { - case "nodeId": - (out.NodeID).UnmarshalEasyJSON(in) - case "backendNodeId": - (out.BackendNodeID).UnmarshalEasyJSON(in) - case "objectId": - out.ObjectID = runtime.RemoteObjectID(in.String()) - case "fetchRelatives": - out.FetchRelatives = bool(in.Bool()) - default: - in.SkipRecursive() - } - in.WantComma() - } - in.Delim('}') - if isTopLevel { - in.Consumed() - } -} -func easyjsonC5a4559bEncodeGithubComChromedpCdprotoAccessibility10(out *jwriter.Writer, in GetPartialAXTreeParams) { - out.RawByte('{') - first := true - _ = first - if in.NodeID != 0 { - const prefix string = ",\"nodeId\":" - first = false - out.RawString(prefix[1:]) - out.Int64(int64(in.NodeID)) - } - if in.BackendNodeID != 0 { - const prefix string = ",\"backendNodeId\":" - if first { - first = false - out.RawString(prefix[1:]) - } else { - out.RawString(prefix) - } - out.Int64(int64(in.BackendNodeID)) - } - if in.ObjectID != "" { - const prefix string = ",\"objectId\":" - if first { - first = false - out.RawString(prefix[1:]) - } else { - out.RawString(prefix) - } - out.String(string(in.ObjectID)) - } - if in.FetchRelatives { - const prefix string = ",\"fetchRelatives\":" - if first { - first = false - out.RawString(prefix[1:]) - } else { - out.RawString(prefix) - } - out.Bool(bool(in.FetchRelatives)) - } - out.RawByte('}') -} - -// MarshalJSON supports json.Marshaler interface -func (v GetPartialAXTreeParams) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - easyjsonC5a4559bEncodeGithubComChromedpCdprotoAccessibility10(&w, v) - return w.Buffer.BuildBytes(), w.Error -} - -// MarshalEasyJSON supports easyjson.Marshaler interface -func (v GetPartialAXTreeParams) MarshalEasyJSON(w *jwriter.Writer) { - easyjsonC5a4559bEncodeGithubComChromedpCdprotoAccessibility10(w, v) -} - -// UnmarshalJSON supports json.Unmarshaler interface -func (v *GetPartialAXTreeParams) UnmarshalJSON(data []byte) error { - r := jlexer.Lexer{Data: data} - easyjsonC5a4559bDecodeGithubComChromedpCdprotoAccessibility10(&r, v) - return r.Error() -} - -// UnmarshalEasyJSON supports easyjson.Unmarshaler interface -func (v *GetPartialAXTreeParams) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjsonC5a4559bDecodeGithubComChromedpCdprotoAccessibility10(l, v) -} -func easyjsonC5a4559bDecodeGithubComChromedpCdprotoAccessibility11(in *jlexer.Lexer, out *GetFullAXTreeReturns) { - isTopLevel := in.IsStart() - if in.IsNull() { - if isTopLevel { - in.Consumed() - } - in.Skip() - return - } - in.Delim('{') - for !in.IsDelim('}') { - key := in.UnsafeFieldName(false) - in.WantColon() - if in.IsNull() { - in.Skip() - in.WantComma() - continue - } - switch key { - case "nodes": - if in.IsNull() { - in.Skip() - out.Nodes = nil - } else { - in.Delim('[') - if out.Nodes == nil { - if !in.IsDelim(']') { - out.Nodes = make([]*Node, 0, 8) - } else { - out.Nodes = []*Node{} - } - } else { - out.Nodes = (out.Nodes)[:0] - } - for !in.IsDelim(']') { - var v22 *Node - if in.IsNull() { - in.Skip() - v22 = nil - } else { - if v22 == nil { - v22 = new(Node) - } - (*v22).UnmarshalEasyJSON(in) - } - out.Nodes = append(out.Nodes, v22) - in.WantComma() - } - in.Delim(']') - } - default: - in.SkipRecursive() - } - in.WantComma() - } - in.Delim('}') - if isTopLevel { - in.Consumed() - } -} -func easyjsonC5a4559bEncodeGithubComChromedpCdprotoAccessibility11(out *jwriter.Writer, in GetFullAXTreeReturns) { - out.RawByte('{') - first := true - _ = first - if len(in.Nodes) != 0 { - const prefix string = ",\"nodes\":" - first = false - out.RawString(prefix[1:]) - { - out.RawByte('[') - for v23, v24 := range in.Nodes { - if v23 > 0 { - out.RawByte(',') - } - if v24 == nil { - out.RawString("null") - } else { - (*v24).MarshalEasyJSON(out) - } - } - out.RawByte(']') - } - } - out.RawByte('}') -} - -// MarshalJSON supports json.Marshaler interface -func (v GetFullAXTreeReturns) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - easyjsonC5a4559bEncodeGithubComChromedpCdprotoAccessibility11(&w, v) - return w.Buffer.BuildBytes(), w.Error -} - -// MarshalEasyJSON supports easyjson.Marshaler interface -func (v GetFullAXTreeReturns) MarshalEasyJSON(w *jwriter.Writer) { - easyjsonC5a4559bEncodeGithubComChromedpCdprotoAccessibility11(w, v) -} - -// UnmarshalJSON supports json.Unmarshaler interface -func (v *GetFullAXTreeReturns) UnmarshalJSON(data []byte) error { - r := jlexer.Lexer{Data: data} - easyjsonC5a4559bDecodeGithubComChromedpCdprotoAccessibility11(&r, v) - return r.Error() -} - -// UnmarshalEasyJSON supports easyjson.Unmarshaler interface -func (v *GetFullAXTreeReturns) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjsonC5a4559bDecodeGithubComChromedpCdprotoAccessibility11(l, v) -} -func easyjsonC5a4559bDecodeGithubComChromedpCdprotoAccessibility12(in *jlexer.Lexer, out *GetFullAXTreeParams) { - isTopLevel := in.IsStart() - if in.IsNull() { - if isTopLevel { - in.Consumed() - } - in.Skip() - return - } - in.Delim('{') - for !in.IsDelim('}') { - key := in.UnsafeFieldName(false) - in.WantColon() - if in.IsNull() { - in.Skip() - in.WantComma() - continue - } - switch key { - case "depth": - out.Depth = int64(in.Int64()) - case "frameId": - (out.FrameID).UnmarshalEasyJSON(in) - default: - in.SkipRecursive() - } - in.WantComma() - } - in.Delim('}') - if isTopLevel { - in.Consumed() - } -} -func easyjsonC5a4559bEncodeGithubComChromedpCdprotoAccessibility12(out *jwriter.Writer, in GetFullAXTreeParams) { - out.RawByte('{') - first := true - _ = first - if in.Depth != 0 { - const prefix string = ",\"depth\":" - first = false - out.RawString(prefix[1:]) - out.Int64(int64(in.Depth)) - } - if in.FrameID != "" { - const prefix string = ",\"frameId\":" - if first { - first = false - out.RawString(prefix[1:]) - } else { - out.RawString(prefix) - } - out.String(string(in.FrameID)) - } - out.RawByte('}') -} - -// MarshalJSON supports json.Marshaler interface -func (v GetFullAXTreeParams) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - easyjsonC5a4559bEncodeGithubComChromedpCdprotoAccessibility12(&w, v) - return w.Buffer.BuildBytes(), w.Error -} - -// MarshalEasyJSON supports easyjson.Marshaler interface -func (v GetFullAXTreeParams) MarshalEasyJSON(w *jwriter.Writer) { - easyjsonC5a4559bEncodeGithubComChromedpCdprotoAccessibility12(w, v) -} - -// UnmarshalJSON supports json.Unmarshaler interface -func (v *GetFullAXTreeParams) UnmarshalJSON(data []byte) error { - r := jlexer.Lexer{Data: data} - easyjsonC5a4559bDecodeGithubComChromedpCdprotoAccessibility12(&r, v) - return r.Error() -} - -// UnmarshalEasyJSON supports easyjson.Unmarshaler interface -func (v *GetFullAXTreeParams) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjsonC5a4559bDecodeGithubComChromedpCdprotoAccessibility12(l, v) -} -func easyjsonC5a4559bDecodeGithubComChromedpCdprotoAccessibility13(in *jlexer.Lexer, out *GetChildAXNodesReturns) { - isTopLevel := in.IsStart() - if in.IsNull() { - if isTopLevel { - in.Consumed() - } - in.Skip() - return - } - in.Delim('{') - for !in.IsDelim('}') { - key := in.UnsafeFieldName(false) - in.WantColon() - if in.IsNull() { - in.Skip() - in.WantComma() - continue - } - switch key { - case "nodes": - if in.IsNull() { - in.Skip() - out.Nodes = nil - } else { - in.Delim('[') - if out.Nodes == nil { - if !in.IsDelim(']') { - out.Nodes = make([]*Node, 0, 8) - } else { - out.Nodes = []*Node{} - } - } else { - out.Nodes = (out.Nodes)[:0] - } - for !in.IsDelim(']') { - var v25 *Node - if in.IsNull() { - in.Skip() - v25 = nil - } else { - if v25 == nil { - v25 = new(Node) - } - (*v25).UnmarshalEasyJSON(in) - } - out.Nodes = append(out.Nodes, v25) - in.WantComma() - } - in.Delim(']') - } - default: - in.SkipRecursive() - } - in.WantComma() - } - in.Delim('}') - if isTopLevel { - in.Consumed() - } -} -func easyjsonC5a4559bEncodeGithubComChromedpCdprotoAccessibility13(out *jwriter.Writer, in GetChildAXNodesReturns) { - out.RawByte('{') - first := true - _ = first - if len(in.Nodes) != 0 { - const prefix string = ",\"nodes\":" - first = false - out.RawString(prefix[1:]) - { - out.RawByte('[') - for v26, v27 := range in.Nodes { - if v26 > 0 { - out.RawByte(',') - } - if v27 == nil { - out.RawString("null") - } else { - (*v27).MarshalEasyJSON(out) - } - } - out.RawByte(']') - } - } - out.RawByte('}') -} - -// MarshalJSON supports json.Marshaler interface -func (v GetChildAXNodesReturns) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - easyjsonC5a4559bEncodeGithubComChromedpCdprotoAccessibility13(&w, v) - return w.Buffer.BuildBytes(), w.Error -} - -// MarshalEasyJSON supports easyjson.Marshaler interface -func (v GetChildAXNodesReturns) MarshalEasyJSON(w *jwriter.Writer) { - easyjsonC5a4559bEncodeGithubComChromedpCdprotoAccessibility13(w, v) -} - -// UnmarshalJSON supports json.Unmarshaler interface -func (v *GetChildAXNodesReturns) UnmarshalJSON(data []byte) error { - r := jlexer.Lexer{Data: data} - easyjsonC5a4559bDecodeGithubComChromedpCdprotoAccessibility13(&r, v) - return r.Error() -} - -// UnmarshalEasyJSON supports easyjson.Unmarshaler interface -func (v *GetChildAXNodesReturns) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjsonC5a4559bDecodeGithubComChromedpCdprotoAccessibility13(l, v) -} -func easyjsonC5a4559bDecodeGithubComChromedpCdprotoAccessibility14(in *jlexer.Lexer, out *GetChildAXNodesParams) { - isTopLevel := in.IsStart() - if in.IsNull() { - if isTopLevel { - in.Consumed() - } - in.Skip() - return - } - in.Delim('{') - for !in.IsDelim('}') { - key := in.UnsafeFieldName(false) - in.WantColon() - if in.IsNull() { - in.Skip() - in.WantComma() - continue - } - switch key { - case "id": - out.ID = NodeID(in.String()) - case "frameId": - (out.FrameID).UnmarshalEasyJSON(in) - default: - in.SkipRecursive() - } - in.WantComma() - } - in.Delim('}') - if isTopLevel { - in.Consumed() - } -} -func easyjsonC5a4559bEncodeGithubComChromedpCdprotoAccessibility14(out *jwriter.Writer, in GetChildAXNodesParams) { - out.RawByte('{') - first := true - _ = first - { - const prefix string = ",\"id\":" - out.RawString(prefix[1:]) - out.String(string(in.ID)) - } - if in.FrameID != "" { - const prefix string = ",\"frameId\":" - out.RawString(prefix) - out.String(string(in.FrameID)) - } - out.RawByte('}') -} - -// MarshalJSON supports json.Marshaler interface -func (v GetChildAXNodesParams) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - easyjsonC5a4559bEncodeGithubComChromedpCdprotoAccessibility14(&w, v) - return w.Buffer.BuildBytes(), w.Error -} - -// MarshalEasyJSON supports easyjson.Marshaler interface -func (v GetChildAXNodesParams) MarshalEasyJSON(w *jwriter.Writer) { - easyjsonC5a4559bEncodeGithubComChromedpCdprotoAccessibility14(w, v) -} - -// UnmarshalJSON supports json.Unmarshaler interface -func (v *GetChildAXNodesParams) UnmarshalJSON(data []byte) error { - r := jlexer.Lexer{Data: data} - easyjsonC5a4559bDecodeGithubComChromedpCdprotoAccessibility14(&r, v) - return r.Error() -} - -// UnmarshalEasyJSON supports easyjson.Unmarshaler interface -func (v *GetChildAXNodesParams) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjsonC5a4559bDecodeGithubComChromedpCdprotoAccessibility14(l, v) -} -func easyjsonC5a4559bDecodeGithubComChromedpCdprotoAccessibility15(in *jlexer.Lexer, out *GetAXNodeAndAncestorsReturns) { - isTopLevel := in.IsStart() - if in.IsNull() { - if isTopLevel { - in.Consumed() - } - in.Skip() - return - } - in.Delim('{') - for !in.IsDelim('}') { - key := in.UnsafeFieldName(false) - in.WantColon() - if in.IsNull() { - in.Skip() - in.WantComma() - continue - } - switch key { - case "nodes": - if in.IsNull() { - in.Skip() - out.Nodes = nil - } else { - in.Delim('[') - if out.Nodes == nil { - if !in.IsDelim(']') { - out.Nodes = make([]*Node, 0, 8) - } else { - out.Nodes = []*Node{} - } - } else { - out.Nodes = (out.Nodes)[:0] - } - for !in.IsDelim(']') { - var v28 *Node - if in.IsNull() { - in.Skip() - v28 = nil - } else { - if v28 == nil { - v28 = new(Node) - } - (*v28).UnmarshalEasyJSON(in) - } - out.Nodes = append(out.Nodes, v28) - in.WantComma() - } - in.Delim(']') - } - default: - in.SkipRecursive() - } - in.WantComma() - } - in.Delim('}') - if isTopLevel { - in.Consumed() - } -} -func easyjsonC5a4559bEncodeGithubComChromedpCdprotoAccessibility15(out *jwriter.Writer, in GetAXNodeAndAncestorsReturns) { - out.RawByte('{') - first := true - _ = first - if len(in.Nodes) != 0 { - const prefix string = ",\"nodes\":" - first = false - out.RawString(prefix[1:]) - { - out.RawByte('[') - for v29, v30 := range in.Nodes { - if v29 > 0 { - out.RawByte(',') - } - if v30 == nil { - out.RawString("null") - } else { - (*v30).MarshalEasyJSON(out) - } - } - out.RawByte(']') - } - } - out.RawByte('}') -} - -// MarshalJSON supports json.Marshaler interface -func (v GetAXNodeAndAncestorsReturns) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - easyjsonC5a4559bEncodeGithubComChromedpCdprotoAccessibility15(&w, v) - return w.Buffer.BuildBytes(), w.Error -} - -// MarshalEasyJSON supports easyjson.Marshaler interface -func (v GetAXNodeAndAncestorsReturns) MarshalEasyJSON(w *jwriter.Writer) { - easyjsonC5a4559bEncodeGithubComChromedpCdprotoAccessibility15(w, v) -} - -// UnmarshalJSON supports json.Unmarshaler interface -func (v *GetAXNodeAndAncestorsReturns) UnmarshalJSON(data []byte) error { - r := jlexer.Lexer{Data: data} - easyjsonC5a4559bDecodeGithubComChromedpCdprotoAccessibility15(&r, v) - return r.Error() -} - -// UnmarshalEasyJSON supports easyjson.Unmarshaler interface -func (v *GetAXNodeAndAncestorsReturns) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjsonC5a4559bDecodeGithubComChromedpCdprotoAccessibility15(l, v) -} -func easyjsonC5a4559bDecodeGithubComChromedpCdprotoAccessibility16(in *jlexer.Lexer, out *GetAXNodeAndAncestorsParams) { - isTopLevel := in.IsStart() - if in.IsNull() { - if isTopLevel { - in.Consumed() - } - in.Skip() - return - } - in.Delim('{') - for !in.IsDelim('}') { - key := in.UnsafeFieldName(false) - in.WantColon() - if in.IsNull() { - in.Skip() - in.WantComma() - continue - } - switch key { - case "nodeId": - (out.NodeID).UnmarshalEasyJSON(in) - case "backendNodeId": - (out.BackendNodeID).UnmarshalEasyJSON(in) - case "objectId": - out.ObjectID = runtime.RemoteObjectID(in.String()) - default: - in.SkipRecursive() - } - in.WantComma() - } - in.Delim('}') - if isTopLevel { - in.Consumed() - } -} -func easyjsonC5a4559bEncodeGithubComChromedpCdprotoAccessibility16(out *jwriter.Writer, in GetAXNodeAndAncestorsParams) { - out.RawByte('{') - first := true - _ = first - if in.NodeID != 0 { - const prefix string = ",\"nodeId\":" - first = false - out.RawString(prefix[1:]) - out.Int64(int64(in.NodeID)) - } - if in.BackendNodeID != 0 { - const prefix string = ",\"backendNodeId\":" - if first { - first = false - out.RawString(prefix[1:]) - } else { - out.RawString(prefix) - } - out.Int64(int64(in.BackendNodeID)) - } - if in.ObjectID != "" { - const prefix string = ",\"objectId\":" - if first { - first = false - out.RawString(prefix[1:]) - } else { - out.RawString(prefix) - } - out.String(string(in.ObjectID)) - } - out.RawByte('}') -} - -// MarshalJSON supports json.Marshaler interface -func (v GetAXNodeAndAncestorsParams) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - easyjsonC5a4559bEncodeGithubComChromedpCdprotoAccessibility16(&w, v) - return w.Buffer.BuildBytes(), w.Error -} - -// MarshalEasyJSON supports easyjson.Marshaler interface -func (v GetAXNodeAndAncestorsParams) MarshalEasyJSON(w *jwriter.Writer) { - easyjsonC5a4559bEncodeGithubComChromedpCdprotoAccessibility16(w, v) -} - -// UnmarshalJSON supports json.Unmarshaler interface -func (v *GetAXNodeAndAncestorsParams) UnmarshalJSON(data []byte) error { - r := jlexer.Lexer{Data: data} - easyjsonC5a4559bDecodeGithubComChromedpCdprotoAccessibility16(&r, v) - return r.Error() -} - -// UnmarshalEasyJSON supports easyjson.Unmarshaler interface -func (v *GetAXNodeAndAncestorsParams) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjsonC5a4559bDecodeGithubComChromedpCdprotoAccessibility16(l, v) -} -func easyjsonC5a4559bDecodeGithubComChromedpCdprotoAccessibility17(in *jlexer.Lexer, out *EventNodesUpdated) { - isTopLevel := in.IsStart() - if in.IsNull() { - if isTopLevel { - in.Consumed() - } - in.Skip() - return - } - in.Delim('{') - for !in.IsDelim('}') { - key := in.UnsafeFieldName(false) - in.WantColon() - if in.IsNull() { - in.Skip() - in.WantComma() - continue - } - switch key { - case "nodes": - if in.IsNull() { - in.Skip() - out.Nodes = nil - } else { - in.Delim('[') - if out.Nodes == nil { - if !in.IsDelim(']') { - out.Nodes = make([]*Node, 0, 8) - } else { - out.Nodes = []*Node{} - } - } else { - out.Nodes = (out.Nodes)[:0] - } - for !in.IsDelim(']') { - var v31 *Node - if in.IsNull() { - in.Skip() - v31 = nil - } else { - if v31 == nil { - v31 = new(Node) - } - (*v31).UnmarshalEasyJSON(in) - } - out.Nodes = append(out.Nodes, v31) - in.WantComma() - } - in.Delim(']') - } - default: - in.SkipRecursive() - } - in.WantComma() - } - in.Delim('}') - if isTopLevel { - in.Consumed() - } -} -func easyjsonC5a4559bEncodeGithubComChromedpCdprotoAccessibility17(out *jwriter.Writer, in EventNodesUpdated) { - out.RawByte('{') - first := true - _ = first - { - const prefix string = ",\"nodes\":" - out.RawString(prefix[1:]) - if in.Nodes == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 { - out.RawString("null") - } else { - out.RawByte('[') - for v32, v33 := range in.Nodes { - if v32 > 0 { - out.RawByte(',') - } - if v33 == nil { - out.RawString("null") - } else { - (*v33).MarshalEasyJSON(out) - } - } - out.RawByte(']') - } - } - out.RawByte('}') -} - -// MarshalJSON supports json.Marshaler interface -func (v EventNodesUpdated) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - easyjsonC5a4559bEncodeGithubComChromedpCdprotoAccessibility17(&w, v) - return w.Buffer.BuildBytes(), w.Error -} - -// MarshalEasyJSON supports easyjson.Marshaler interface -func (v EventNodesUpdated) MarshalEasyJSON(w *jwriter.Writer) { - easyjsonC5a4559bEncodeGithubComChromedpCdprotoAccessibility17(w, v) -} - -// UnmarshalJSON supports json.Unmarshaler interface -func (v *EventNodesUpdated) UnmarshalJSON(data []byte) error { - r := jlexer.Lexer{Data: data} - easyjsonC5a4559bDecodeGithubComChromedpCdprotoAccessibility17(&r, v) - return r.Error() -} - -// UnmarshalEasyJSON supports easyjson.Unmarshaler interface -func (v *EventNodesUpdated) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjsonC5a4559bDecodeGithubComChromedpCdprotoAccessibility17(l, v) -} -func easyjsonC5a4559bDecodeGithubComChromedpCdprotoAccessibility18(in *jlexer.Lexer, out *EventLoadComplete) { - isTopLevel := in.IsStart() - if in.IsNull() { - if isTopLevel { - in.Consumed() - } - in.Skip() - return - } - in.Delim('{') - for !in.IsDelim('}') { - key := in.UnsafeFieldName(false) - in.WantColon() - if in.IsNull() { - in.Skip() - in.WantComma() - continue - } - switch key { - case "root": - if in.IsNull() { - in.Skip() - out.Root = nil - } else { - if out.Root == nil { - out.Root = new(Node) - } - (*out.Root).UnmarshalEasyJSON(in) - } - default: - in.SkipRecursive() - } - in.WantComma() - } - in.Delim('}') - if isTopLevel { - in.Consumed() - } -} -func easyjsonC5a4559bEncodeGithubComChromedpCdprotoAccessibility18(out *jwriter.Writer, in EventLoadComplete) { - out.RawByte('{') - first := true - _ = first - { - const prefix string = ",\"root\":" - out.RawString(prefix[1:]) - if in.Root == nil { - out.RawString("null") - } else { - (*in.Root).MarshalEasyJSON(out) - } - } - out.RawByte('}') -} - -// MarshalJSON supports json.Marshaler interface -func (v EventLoadComplete) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - easyjsonC5a4559bEncodeGithubComChromedpCdprotoAccessibility18(&w, v) - return w.Buffer.BuildBytes(), w.Error -} - -// MarshalEasyJSON supports easyjson.Marshaler interface -func (v EventLoadComplete) MarshalEasyJSON(w *jwriter.Writer) { - easyjsonC5a4559bEncodeGithubComChromedpCdprotoAccessibility18(w, v) -} - -// UnmarshalJSON supports json.Unmarshaler interface -func (v *EventLoadComplete) UnmarshalJSON(data []byte) error { - r := jlexer.Lexer{Data: data} - easyjsonC5a4559bDecodeGithubComChromedpCdprotoAccessibility18(&r, v) - return r.Error() -} - -// UnmarshalEasyJSON supports easyjson.Unmarshaler interface -func (v *EventLoadComplete) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjsonC5a4559bDecodeGithubComChromedpCdprotoAccessibility18(l, v) -} -func easyjsonC5a4559bDecodeGithubComChromedpCdprotoAccessibility19(in *jlexer.Lexer, out *EnableParams) { - isTopLevel := in.IsStart() - if in.IsNull() { - if isTopLevel { - in.Consumed() - } - in.Skip() - return - } - in.Delim('{') - for !in.IsDelim('}') { - key := in.UnsafeFieldName(false) - in.WantColon() - if in.IsNull() { - in.Skip() - in.WantComma() - continue - } - switch key { - default: - in.SkipRecursive() - } - in.WantComma() - } - in.Delim('}') - if isTopLevel { - in.Consumed() - } -} -func easyjsonC5a4559bEncodeGithubComChromedpCdprotoAccessibility19(out *jwriter.Writer, in EnableParams) { - out.RawByte('{') - first := true - _ = first - out.RawByte('}') -} - -// MarshalJSON supports json.Marshaler interface -func (v EnableParams) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - easyjsonC5a4559bEncodeGithubComChromedpCdprotoAccessibility19(&w, v) - return w.Buffer.BuildBytes(), w.Error -} - -// MarshalEasyJSON supports easyjson.Marshaler interface -func (v EnableParams) MarshalEasyJSON(w *jwriter.Writer) { - easyjsonC5a4559bEncodeGithubComChromedpCdprotoAccessibility19(w, v) -} - -// UnmarshalJSON supports json.Unmarshaler interface -func (v *EnableParams) UnmarshalJSON(data []byte) error { - r := jlexer.Lexer{Data: data} - easyjsonC5a4559bDecodeGithubComChromedpCdprotoAccessibility19(&r, v) - return r.Error() -} - -// UnmarshalEasyJSON supports easyjson.Unmarshaler interface -func (v *EnableParams) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjsonC5a4559bDecodeGithubComChromedpCdprotoAccessibility19(l, v) -} -func easyjsonC5a4559bDecodeGithubComChromedpCdprotoAccessibility20(in *jlexer.Lexer, out *DisableParams) { - isTopLevel := in.IsStart() - if in.IsNull() { - if isTopLevel { - in.Consumed() - } - in.Skip() - return - } - in.Delim('{') - for !in.IsDelim('}') { - key := in.UnsafeFieldName(false) - in.WantColon() - if in.IsNull() { - in.Skip() - in.WantComma() - continue - } - switch key { - default: - in.SkipRecursive() - } - in.WantComma() - } - in.Delim('}') - if isTopLevel { - in.Consumed() - } -} -func easyjsonC5a4559bEncodeGithubComChromedpCdprotoAccessibility20(out *jwriter.Writer, in DisableParams) { - out.RawByte('{') - first := true - _ = first - out.RawByte('}') -} - -// MarshalJSON supports json.Marshaler interface -func (v DisableParams) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - easyjsonC5a4559bEncodeGithubComChromedpCdprotoAccessibility20(&w, v) - return w.Buffer.BuildBytes(), w.Error -} - -// MarshalEasyJSON supports easyjson.Marshaler interface -func (v DisableParams) MarshalEasyJSON(w *jwriter.Writer) { - easyjsonC5a4559bEncodeGithubComChromedpCdprotoAccessibility20(w, v) -} - -// UnmarshalJSON supports json.Unmarshaler interface -func (v *DisableParams) UnmarshalJSON(data []byte) error { - r := jlexer.Lexer{Data: data} - easyjsonC5a4559bDecodeGithubComChromedpCdprotoAccessibility20(&r, v) - return r.Error() -} - -// UnmarshalEasyJSON supports easyjson.Unmarshaler interface -func (v *DisableParams) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjsonC5a4559bDecodeGithubComChromedpCdprotoAccessibility20(l, v) -} diff --git a/accessibility/types.go b/accessibility/types.go index e6faf785..d576f154 100644 --- a/accessibility/types.go +++ b/accessibility/types.go @@ -4,11 +4,10 @@ package accessibility import ( "fmt" + "strings" "github.com/chromedp/cdproto/cdp" - "github.com/mailru/easyjson" - "github.com/mailru/easyjson/jlexer" - "github.com/mailru/easyjson/jwriter" + "github.com/go-json-experiment/json/jsontext" ) // NodeID unique accessibility node identifier. @@ -52,20 +51,12 @@ const ( ValueTypeValueUndefined ValueType = "valueUndefined" ) -// MarshalEasyJSON satisfies easyjson.Marshaler. -func (t ValueType) MarshalEasyJSON(out *jwriter.Writer) { - out.String(string(t)) -} - -// MarshalJSON satisfies json.Marshaler. -func (t ValueType) MarshalJSON() ([]byte, error) { - return easyjson.Marshal(t) -} +// UnmarshalJSON satisfies [json.Unmarshaler]. +func (t *ValueType) UnmarshalJSON(buf []byte) error { + s := string(buf) + s = strings.TrimSuffix(strings.TrimPrefix(s, `"`), `"`) -// UnmarshalEasyJSON satisfies easyjson.Unmarshaler. -func (t *ValueType) UnmarshalEasyJSON(in *jlexer.Lexer) { - v := in.String() - switch ValueType(v) { + switch ValueType(s) { case ValueTypeBoolean: *t = ValueTypeBoolean case ValueTypeTristate: @@ -100,15 +91,10 @@ func (t *ValueType) UnmarshalEasyJSON(in *jlexer.Lexer) { *t = ValueTypeInternalRole case ValueTypeValueUndefined: *t = ValueTypeValueUndefined - default: - in.AddError(fmt.Errorf("unknown ValueType value: %v", v)) + return fmt.Errorf("unknown ValueType value: %v", s) } -} - -// UnmarshalJSON satisfies json.Unmarshaler. -func (t *ValueType) UnmarshalJSON(buf []byte) error { - return easyjson.Unmarshal(buf, t) + return nil } // ValueSourceType enum of possible property sources. @@ -131,20 +117,12 @@ const ( ValueSourceTypeRelatedElement ValueSourceType = "relatedElement" ) -// MarshalEasyJSON satisfies easyjson.Marshaler. -func (t ValueSourceType) MarshalEasyJSON(out *jwriter.Writer) { - out.String(string(t)) -} - -// MarshalJSON satisfies json.Marshaler. -func (t ValueSourceType) MarshalJSON() ([]byte, error) { - return easyjson.Marshal(t) -} +// UnmarshalJSON satisfies [json.Unmarshaler]. +func (t *ValueSourceType) UnmarshalJSON(buf []byte) error { + s := string(buf) + s = strings.TrimSuffix(strings.TrimPrefix(s, `"`), `"`) -// UnmarshalEasyJSON satisfies easyjson.Unmarshaler. -func (t *ValueSourceType) UnmarshalEasyJSON(in *jlexer.Lexer) { - v := in.String() - switch ValueSourceType(v) { + switch ValueSourceType(s) { case ValueSourceTypeAttribute: *t = ValueSourceTypeAttribute case ValueSourceTypeImplicit: @@ -157,15 +135,10 @@ func (t *ValueSourceType) UnmarshalEasyJSON(in *jlexer.Lexer) { *t = ValueSourceTypePlaceholder case ValueSourceTypeRelatedElement: *t = ValueSourceTypeRelatedElement - default: - in.AddError(fmt.Errorf("unknown ValueSourceType value: %v", v)) + return fmt.Errorf("unknown ValueSourceType value: %v", s) } -} - -// UnmarshalJSON satisfies json.Unmarshaler. -func (t *ValueSourceType) UnmarshalJSON(buf []byte) error { - return easyjson.Unmarshal(buf, t) + return nil } // ValueNativeSourceType enum of possible native property sources (as a @@ -193,20 +166,12 @@ const ( ValueNativeSourceTypeOther ValueNativeSourceType = "other" ) -// MarshalEasyJSON satisfies easyjson.Marshaler. -func (t ValueNativeSourceType) MarshalEasyJSON(out *jwriter.Writer) { - out.String(string(t)) -} - -// MarshalJSON satisfies json.Marshaler. -func (t ValueNativeSourceType) MarshalJSON() ([]byte, error) { - return easyjson.Marshal(t) -} +// UnmarshalJSON satisfies [json.Unmarshaler]. +func (t *ValueNativeSourceType) UnmarshalJSON(buf []byte) error { + s := string(buf) + s = strings.TrimSuffix(strings.TrimPrefix(s, `"`), `"`) -// UnmarshalEasyJSON satisfies easyjson.Unmarshaler. -func (t *ValueNativeSourceType) UnmarshalEasyJSON(in *jlexer.Lexer) { - v := in.String() - switch ValueNativeSourceType(v) { + switch ValueNativeSourceType(s) { case ValueNativeSourceTypeDescription: *t = ValueNativeSourceTypeDescription case ValueNativeSourceTypeFigcaption: @@ -227,39 +192,34 @@ func (t *ValueNativeSourceType) UnmarshalEasyJSON(in *jlexer.Lexer) { *t = ValueNativeSourceTypeTitle case ValueNativeSourceTypeOther: *t = ValueNativeSourceTypeOther - default: - in.AddError(fmt.Errorf("unknown ValueNativeSourceType value: %v", v)) + return fmt.Errorf("unknown ValueNativeSourceType value: %v", s) } -} - -// UnmarshalJSON satisfies json.Unmarshaler. -func (t *ValueNativeSourceType) UnmarshalJSON(buf []byte) error { - return easyjson.Unmarshal(buf, t) + return nil } // ValueSource a single source for a computed AX property. // // See: https://chromedevtools.github.io/devtools-protocol/tot/Accessibility#type-AXValueSource type ValueSource struct { - Type ValueSourceType `json:"type"` // What type of source this is. - Value *Value `json:"value,omitempty"` // The value of this property source. - Attribute string `json:"attribute,omitempty"` // The name of the relevant attribute, if any. - AttributeValue *Value `json:"attributeValue,omitempty"` // The value of the relevant attribute, if any. - Superseded bool `json:"superseded,omitempty"` // Whether this source is superseded by a higher priority source. - NativeSource ValueNativeSourceType `json:"nativeSource,omitempty"` // The native markup source for this value, e.g. a