getAnchorElement method

Future<NodeId> getAnchorElement(
  1. NodeId nodeId, {
  2. String? anchorSpecifier,
})

Returns the target anchor element of the given anchor query according to https://www.w3.org/TR/css-anchor-position-1/#target. nodeId Id of the positioned element from which to find the anchor. anchorSpecifier An optional anchor specifier, as defined in https://www.w3.org/TR/css-anchor-position-1/#anchor-specifier. If not provided, it will return the implicit anchor element for the given positioned element. Returns: The anchor element of the given anchor query.

Implementation

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