2017-01-24 15:09:23 +00:00
// Package accessibility provides the Chrome Debugging Protocol
2017-02-12 04:59:33 +00:00
// commands, types, and events for the Accessibility domain.
2017-01-24 15:09:23 +00:00
//
// Generated by the chromedp-gen command.
package accessibility
2017-07-09 02:05:19 +00:00
// Code generated by chromedp-gen. DO NOT EDIT.
2017-01-24 15:09:23 +00:00
import (
"context"
2017-01-26 07:28:34 +00:00
cdp "github.com/knq/chromedp/cdp"
2017-01-24 15:09:23 +00:00
)
// GetPartialAXTreeParams fetches the accessibility node and partial
// accessibility tree for this DOM node, if it exists.
type GetPartialAXTreeParams struct {
2017-01-26 07:28:34 +00:00
NodeID cdp . NodeID ` json:"nodeId" ` // ID of node to get the partial accessibility tree for.
FetchRelatives bool ` json:"fetchRelatives,omitempty" ` // Whether to fetch this nodes ancestors, siblings and children. Defaults to true.
2017-01-24 15:09:23 +00:00
}
// GetPartialAXTree fetches the accessibility node and partial accessibility
// tree for this DOM node, if it exists.
//
// parameters:
2017-01-26 07:28:34 +00:00
// nodeID - ID of node to get the partial accessibility tree for.
func GetPartialAXTree ( nodeID cdp . NodeID ) * GetPartialAXTreeParams {
2017-01-24 15:09:23 +00:00
return & GetPartialAXTreeParams {
2017-01-26 07:28:34 +00:00
NodeID : nodeID ,
2017-01-24 15:09:23 +00:00
}
}
// WithFetchRelatives whether to fetch this nodes ancestors, siblings and
// children. Defaults to true.
func ( p GetPartialAXTreeParams ) WithFetchRelatives ( fetchRelatives bool ) * GetPartialAXTreeParams {
p . FetchRelatives = fetchRelatives
return & p
}
// GetPartialAXTreeReturns return values.
type GetPartialAXTreeReturns struct {
Nodes [ ] * AXNode ` json:"nodes,omitempty" ` // The Accessibility.AXNode for this DOM node, if it exists, plus its ancestors, siblings and children, if requested.
}
2017-02-12 04:59:33 +00:00
// Do executes Accessibility.getPartialAXTree against the provided context and
// target handler.
2017-01-24 15:09:23 +00:00
//
// returns:
// nodes - The Accessibility.AXNode for this DOM node, if it exists, plus its ancestors, siblings and children, if requested.
2017-02-12 04:59:33 +00:00
func ( p * GetPartialAXTreeParams ) Do ( ctxt context . Context , h cdp . Handler ) ( nodes [ ] * AXNode , err error ) {
2017-02-14 08:41:23 +00:00
// execute
var res GetPartialAXTreeReturns
err = h . Execute ( ctxt , cdp . CommandAccessibilityGetPartialAXTree , p , & res )
2017-01-24 15:09:23 +00:00
if err != nil {
return nil , err
}
2017-02-14 08:41:23 +00:00
return res . Nodes , nil
2017-01-24 15:09:23 +00:00
}