diff --git a/cdp/animation/easyjson.go b/cdp/animation/easyjson.go index c052fa0..8d1ac35 100644 --- a/cdp/animation/easyjson.go +++ b/cdp/animation/easyjson.go @@ -1464,12 +1464,14 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpAnimation17(out *jwriter.Write first = false out.RawString("\"fill\":") out.String(string(in.Fill)) - if !first { - out.RawByte(',') + if in.BackendNodeID != 0 { + if !first { + out.RawByte(',') + } + first = false + out.RawString("\"backendNodeId\":") + out.Int64(int64(in.BackendNodeID)) } - first = false - out.RawString("\"backendNodeId\":") - out.Int64(int64(in.BackendNodeID)) if in.KeyframesRule != nil { if !first { out.RawByte(',') @@ -1606,6 +1608,8 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpAnimation19(in *jlexer.Lexer, out.StartTime = float64(in.Float64()) case "currentTime": out.CurrentTime = float64(in.Float64()) + case "type": + (out.Type).UnmarshalEasyJSON(in) case "source": if in.IsNull() { in.Skip() @@ -1616,8 +1620,6 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpAnimation19(in *jlexer.Lexer, } (*out.Source).UnmarshalEasyJSON(in) } - case "type": - (out.Type).UnmarshalEasyJSON(in) case "cssId": out.CSSID = string(in.String()) default: @@ -1680,18 +1682,20 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpAnimation19(out *jwriter.Write out.RawByte(',') } first = false - out.RawString("\"source\":") - if in.Source == nil { - out.RawString("null") - } else { - (*in.Source).MarshalEasyJSON(out) - } - if !first { - out.RawByte(',') - } - first = false out.RawString("\"type\":") (in.Type).MarshalEasyJSON(out) + if in.Source != nil { + if !first { + out.RawByte(',') + } + first = false + out.RawString("\"source\":") + if in.Source == nil { + out.RawString("null") + } else { + (*in.Source).MarshalEasyJSON(out) + } + } if in.CSSID != "" { if !first { out.RawByte(',') diff --git a/cdp/animation/types.go b/cdp/animation/types.go index cd4f7df..facd34c 100644 --- a/cdp/animation/types.go +++ b/cdp/animation/types.go @@ -13,16 +13,16 @@ import ( // Animation animation instance. type Animation struct { - ID string `json:"id"` // Animation's id. - Name string `json:"name"` // Animation's name. - PausedState bool `json:"pausedState"` // Animation's internal paused state. - PlayState string `json:"playState"` // Animation's play state. - PlaybackRate float64 `json:"playbackRate"` // Animation's playback rate. - StartTime float64 `json:"startTime"` // Animation's start time. - CurrentTime float64 `json:"currentTime"` // Animation's current time. - Source *Effect `json:"source"` // Animation's source animation node. - Type Type `json:"type"` // Animation type of Animation. - CSSID string `json:"cssId,omitempty"` // A unique ID for Animation representing the sources that triggered this CSS animation/transition. + ID string `json:"id"` // Animation's id. + Name string `json:"name"` // Animation's name. + PausedState bool `json:"pausedState"` // Animation's internal paused state. + PlayState string `json:"playState"` // Animation's play state. + PlaybackRate float64 `json:"playbackRate"` // Animation's playback rate. + StartTime float64 `json:"startTime"` // Animation's start time. + CurrentTime float64 `json:"currentTime"` // Animation's current time. + Type Type `json:"type"` // Animation type of Animation. + Source *Effect `json:"source,omitempty"` // Animation's source animation node. + CSSID string `json:"cssId,omitempty"` // A unique ID for Animation representing the sources that triggered this CSS animation/transition. } // Effect animationEffect instance. @@ -34,7 +34,7 @@ type Effect struct { Duration float64 `json:"duration"` // AnimationEffect's iteration duration. Direction string `json:"direction"` // AnimationEffect's playback direction. Fill string `json:"fill"` // AnimationEffect's fill mode. - BackendNodeID cdp.BackendNodeID `json:"backendNodeId"` // AnimationEffect's target node. + BackendNodeID cdp.BackendNodeID `json:"backendNodeId,omitempty"` // AnimationEffect's target node. KeyframesRule *KeyframesRule `json:"keyframesRule,omitempty"` // AnimationEffect's keyframes. Easing string `json:"easing"` // AnimationEffect's timing function. } diff --git a/cmd/chromedp-gen/protocol.json b/cmd/chromedp-gen/protocol.json index 504d864..4e20771 100644 --- a/cmd/chromedp-gen/protocol.json +++ b/cmd/chromedp-gen/protocol.json @@ -10456,11 +10456,6 @@ "type": "number", "description": "Animation's current time." }, - { - "name": "source", - "$ref": "AnimationEffect", - "description": "Animation's source animation node." - }, { "name": "type", "type": "string", @@ -10471,6 +10466,12 @@ ], "description": "Animation type of Animation." }, + { + "name": "source", + "$ref": "AnimationEffect", + "optional": true, + "description": "Animation's source animation node." + }, { "name": "cssId", "type": "string", @@ -10523,6 +10524,7 @@ { "name": "backendNodeId", "$ref": "DOM.BackendNodeId", + "optional": true, "description": "AnimationEffect's target node." }, {