Skip to content

Commit 933bad9

Browse files
authored
Merge pull request #17 from cdpdriver/update-cdp-schemas
update cdp models
2 parents 2352c99 + 9e447d9 commit 933bad9

36 files changed

+5292
-304
lines changed

cdp-generate/src/main/kotlin/dev/kdriver/cdp/generate/Poetize.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ fun Domain.Type.Property.generateTypeProperty(parentDomain: Domain, domains: Lis
116116
return PropertySpec.builder(name, typeName)
117117
.initializer(name)
118118
.apply {
119-
description?.let { addKdoc(it) }
119+
description?.let { addKdoc(it.replace("%", "%%")) }
120120
}
121121
.build()
122122
}

cdp/src/commonMain/kotlin/dev/kdriver/cdp/domain/Accessibility.kt

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public class Accessibility(
106106
* @param depth The maximum depth at which descendants of the root node should be retrieved.
107107
* If omitted, the full tree is returned.
108108
* @param frameId The frame for whose document the AX tree should be retrieved.
109-
* If omited, the root frame is used.
109+
* If omitted, the root frame is used.
110110
*/
111111
public suspend fun getFullAXTree(depth: Int? = null, frameId: String? = null): GetFullAXTreeReturn {
112112
val parameter = GetFullAXTreeParameter(depth = depth, frameId = frameId)
@@ -189,7 +189,7 @@ public class Accessibility(
189189
/**
190190
* Query a DOM node's accessibility subtree for accessible name and role.
191191
* This command computes the name and role for all nodes in the subtree, including those that are
192-
* ignored for accessibility, and returns those that mactch the specified name and role. If no DOM
192+
* ignored for accessibility, and returns those that match the specified name and role. If no DOM
193193
* node is specified, or the DOM node does not exist, the command returns an error. If neither
194194
* `accessibleName` or `role` is specified, it returns all the accessibility nodes in the subtree.
195195
*/
@@ -202,7 +202,7 @@ public class Accessibility(
202202
/**
203203
* Query a DOM node's accessibility subtree for accessible name and role.
204204
* This command computes the name and role for all nodes in the subtree, including those that are
205-
* ignored for accessibility, and returns those that mactch the specified name and role. If no DOM
205+
* ignored for accessibility, and returns those that match the specified name and role. If no DOM
206206
* node is specified, or the DOM node does not exist, the command returns an error. If neither
207207
* `accessibleName` or `role` is specified, it returns all the accessibility nodes in the subtree.
208208
*
@@ -450,6 +450,9 @@ public class Accessibility(
450450
*/
451451
@Serializable
452452
public enum class AXPropertyName {
453+
@SerialName("actions")
454+
ACTIONS,
455+
453456
@SerialName("busy")
454457
BUSY,
455458

@@ -566,6 +569,9 @@ public class Accessibility(
566569

567570
@SerialName("owns")
568571
OWNS,
572+
573+
@SerialName("url")
574+
URL,
569575
}
570576

571577
/**
@@ -688,7 +694,7 @@ public class Accessibility(
688694
public val depth: Int? = null,
689695
/**
690696
* The frame for whose document the AX tree should be retrieved.
691-
* If omited, the root frame is used.
697+
* If omitted, the root frame is used.
692698
*/
693699
public val frameId: String? = null,
694700
)

cdp/src/commonMain/kotlin/dev/kdriver/cdp/domain/Animation.kt

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,16 @@ public class Animation(
4949
.filterNotNull()
5050
.map { Serialization.json.decodeFromJsonElement(it) }
5151

52+
/**
53+
* Event for animation that has been updated.
54+
*/
55+
public val animationUpdated: Flow<AnimationUpdatedParameter> = cdp
56+
.events
57+
.filter { it.method == "Animation.animationUpdated" }
58+
.map { it.params }
59+
.filterNotNull()
60+
.map { Serialization.json.decodeFromJsonElement(it) }
61+
5262
/**
5363
* Disables animation domain notifications.
5464
*/
@@ -237,6 +247,9 @@ public class Animation(
237247
public val playbackRate: Double,
238248
/**
239249
* `Animation`'s start time.
250+
* Milliseconds for time based animations and
251+
* percentage [0 - 100] for scroll driven animations
252+
* (i.e. when viewOrScrollTimeline exists).
240253
*/
241254
public val startTime: Double,
242255
/**
@@ -256,6 +269,41 @@ public class Animation(
256269
* animation/transition.
257270
*/
258271
public val cssId: String? = null,
272+
/**
273+
* View or scroll timeline
274+
*/
275+
public val viewOrScrollTimeline: ViewOrScrollTimeline? = null,
276+
)
277+
278+
/**
279+
* Timeline instance
280+
*/
281+
@Serializable
282+
public data class ViewOrScrollTimeline(
283+
/**
284+
* Scroll container node
285+
*/
286+
public val sourceNodeId: Int? = null,
287+
/**
288+
* Represents the starting scroll position of the timeline
289+
* as a length offset in pixels from scroll origin.
290+
*/
291+
public val startOffset: Double? = null,
292+
/**
293+
* Represents the ending scroll position of the timeline
294+
* as a length offset in pixels from scroll origin.
295+
*/
296+
public val endOffset: Double? = null,
297+
/**
298+
* The element whose principal box's visibility in the
299+
* scrollport defined the progress of the timeline.
300+
* Does not exist for animations with ScrollTimeline
301+
*/
302+
public val subjectNodeId: Int? = null,
303+
/**
304+
* Orientation of the scroll
305+
*/
306+
public val axis: DOM.ScrollOrientation,
259307
)
260308

261309
/**
@@ -281,6 +329,9 @@ public class Animation(
281329
public val iterations: Double,
282330
/**
283331
* `AnimationEffect`'s iteration duration.
332+
* Milliseconds for time based animations and
333+
* percentage [0 - 100] for scroll driven animations
334+
* (i.e. when viewOrScrollTimeline exists).
284335
*/
285336
public val duration: Double,
286337
/**
@@ -368,6 +419,17 @@ public class Animation(
368419
public val animation: Animation,
369420
)
370421

422+
/**
423+
* Event for animation that has been updated.
424+
*/
425+
@Serializable
426+
public data class AnimationUpdatedParameter(
427+
/**
428+
* Animation that was updated.
429+
*/
430+
public val animation: Animation,
431+
)
432+
371433
@Serializable
372434
public data class GetCurrentTimeParameter(
373435
/**

0 commit comments

Comments
 (0)