getContainerForNode method

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

Returns the query container of the given node based on container query conditions: containerName, physical and logical axes, and whether it queries scroll-state or anchored elements. If no axes are provided and queriesScrollState is false, 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,
  bool? queriesScrollState,
  bool? queriesAnchored,
}) async {
  var result = await _client.send('DOM.getContainerForNode', {
    'nodeId': nodeId,
    'containerName': ?containerName,
    'physicalAxes': ?physicalAxes,
    'logicalAxes': ?logicalAxes,
    'queriesScrollState': ?queriesScrollState,
    'queriesAnchored': ?queriesAnchored,
  });
  return NodeId.fromJson(result['nodeId'] as int);
}