Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,15 @@

class CdpGeneratePlugin : Plugin<Project> {

private val schemaUrl =
"https://raw.githubusercontent.com/ChromeDevTools/debugger-protocol-viewer/master/pages/_data/tot.json"
/*
As said on their repo's README:
> FYI: The protocol files here in debugger-protocol-viewer#master don't get updated. A deployment writes to the devtools-protocol#ghpages branch.

Check warning on line 13 in cdp-generate/src/main/kotlin/dev/kdriver/cdp/generate/CdpGeneratePlugin.kt

View check run for this annotation

codefactor.io / CodeFactor

cdp-generate/src/main/kotlin/dev/kdriver/cdp/generate/CdpGeneratePlugin.kt#L13

Line detected, which is longer than the defined maximum line length in the code style. (detekt.MaxLineLength)
The protocol is now split into two files: browser_protocol.json and js_protocol.json.
*/
private val schemaUrls = listOf(
"https://raw.githubusercontent.com/ChromeDevTools/devtools-protocol/refs/heads/master/json/browser_protocol.json",

Check warning on line 17 in cdp-generate/src/main/kotlin/dev/kdriver/cdp/generate/CdpGeneratePlugin.kt

View check run for this annotation

codefactor.io / CodeFactor

cdp-generate/src/main/kotlin/dev/kdriver/cdp/generate/CdpGeneratePlugin.kt#L17

Line detected, which is longer than the defined maximum line length in the code style. (detekt.MaxLineLength)
"https://raw.githubusercontent.com/ChromeDevTools/devtools-protocol/refs/heads/master/json/js_protocol.json",
)

override fun apply(project: Project) {
project.tasks.register("generateCdp") {
Expand All @@ -19,8 +26,10 @@
val destination = File(listOf(project.projectDir.path, "src", "commonMain", "kotlin").joinToString("/"))
File(destination, listOf("dev", "kdriver", "cdp", "domain").joinToString("/")).deleteRecursively()

val json = JsonSlurper().parse(URL(schemaUrl)) as Map<*, *>
val domains = json["domains"] as List<Map<String, *>>
val domains = schemaUrls.flatMap { schemaUrl ->
val json = JsonSlurper().parse(URL(schemaUrl)) as Map<*, *>
json["domains"] as List<Map<String, *>>
}
val parsed = domains.map { domain ->
Domain(
domain = domain["domain"] as String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,8 @@ public class Accessibility(
* - from 'live' to 'root': attributes which apply to nodes in live regions
* - from 'autocomplete' to 'valuetext': attributes which apply to widgets
* - from 'checked' to 'selected': states which apply to widgets
* - from 'activedescendant' to 'owns' - relationships between elements other than parent/child/sibling.
* - from 'activedescendant' to 'owns': relationships between elements other than parent/child/sibling
* - from 'activeFullscreenElement' to 'uninteresting': reasons why this noode is hidden
*/
@Serializable
public enum class AXPropertyName {
Expand Down Expand Up @@ -588,6 +589,57 @@ public class Accessibility(

@SerialName("url")
URL,

@SerialName("activeFullscreenElement")
ACTIVEFULLSCREENELEMENT,

@SerialName("activeModalDialog")
ACTIVEMODALDIALOG,

@SerialName("activeAriaModalDialog")
ACTIVEARIAMODALDIALOG,

@SerialName("ariaHiddenElement")
ARIAHIDDENELEMENT,

@SerialName("ariaHiddenSubtree")
ARIAHIDDENSUBTREE,

@SerialName("emptyAlt")
EMPTYALT,

@SerialName("emptyText")
EMPTYTEXT,

@SerialName("inertElement")
INERTELEMENT,

@SerialName("inertSubtree")
INERTSUBTREE,

@SerialName("labelContainer")
LABELCONTAINER,

@SerialName("labelFor")
LABELFOR,

@SerialName("notRendered")
NOTRENDERED,

@SerialName("notVisible")
NOTVISIBLE,

@SerialName("presentationalRole")
PRESENTATIONALROLE,

@SerialName("probablyPresentational")
PROBABLYPRESENTATIONAL,

@SerialName("inactiveCarouselTabContent")
INACTIVECAROUSELTABCONTENT,

@SerialName("uninteresting")
UNINTERESTING,
}

/**
Expand Down
4 changes: 2 additions & 2 deletions cdp/src/commonMain/kotlin/dev/kdriver/cdp/domain/Animation.kt
Original file line number Diff line number Diff line change
Expand Up @@ -328,9 +328,9 @@ public class Animation(
*/
public val iterationStart: Double,
/**
* `AnimationEffect`'s iterations.
* `AnimationEffect`'s iterations. Omitted if the value is infinite.
*/
public val iterations: Double,
public val iterations: Double? = null,
/**
* `AnimationEffect`'s iteration duration.
* Milliseconds for time based animations and
Expand Down
Loading
Loading