getNodesForSubtreeByStyle method

Future<List<NodeId>> getNodesForSubtreeByStyle(
  1. NodeId nodeId,
  2. List<CSSComputedStyleProperty> computedStyles, {
  3. bool? pierce,
})

Finds nodes with a given computed style in a subtree. nodeId Node ID pointing to the root of a subtree. computedStyles The style to filter nodes by (includes nodes if any of properties matches). pierce Whether or not iframes and shadow roots in the same target should be traversed when returning the results (default is false). Returns: Resulting nodes.

Implementation

Future<List<NodeId>> getNodesForSubtreeByStyle(
    NodeId nodeId, List<CSSComputedStyleProperty> computedStyles,
    {bool? pierce}) async {
  var result = await _client.send('DOM.getNodesForSubtreeByStyle', {
    'nodeId': nodeId,
    'computedStyles': [...computedStyles],
    if (pierce != null) 'pierce': pierce,
  });
  return (result['nodeIds'] as List)
      .map((e) => NodeId.fromJson(e as int))
      .toList();
}