getContainerForNode method

Future<NodeId> getContainerForNode(
  1. NodeId nodeId, {
  2. String? containerName,
  3. PhysicalAxes? physicalAxes,
  4. LogicalAxes? logicalAxes,
})

Returns the query container of the given node based on container query conditions: containerName, physical, and logical axes. If no axes are provided, the style container is returned, which is the direct parent or the closest element with a matching container-name. Returns: The container node for the given node, or null if not found.

Implementation

Future<NodeId> getContainerForNode(NodeId nodeId,
    {String? containerName,
    PhysicalAxes? physicalAxes,
    LogicalAxes? logicalAxes}) async {
  var result = await _client.send('DOM.getContainerForNode', {
    'nodeId': nodeId,
    if (containerName != null) 'containerName': containerName,
    if (physicalAxes != null) 'physicalAxes': physicalAxes,
    if (logicalAxes != null) 'logicalAxes': logicalAxes,
  });
  return NodeId.fromJson(result['nodeId'] as int);
}