Skip to content

Commit

Permalink
FF131 document.caretPositionFromPoint() - support for shadow DOM (#35911
Browse files Browse the repository at this point in the history
)

* FF131 document.caretPositionFromPoint() - support for shadow DOM

* Apply suggestions from code review

Co-authored-by: Brian Thomas Smith <[email protected]>

* Make the if statements bullets

---------

Co-authored-by: Brian Thomas Smith <[email protected]>
  • Loading branch information
hamishwillee and bsmth authored Sep 30, 2024
1 parent 0e715d2 commit ae524b0
Show file tree
Hide file tree
Showing 2 changed files with 334 additions and 20 deletions.
6 changes: 4 additions & 2 deletions files/en-us/web/api/caretposition/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ browser-compat: api.CaretPosition

{{ APIRef("CSSOM") }}

The `CaretPosition` interface represents the caret position, an indicator for the text insertion point. You can get a `CaretPosition` using the {{domxref("Document.caretPositionFromPoint()")}} method.
The `CaretPosition` interface represents the caret position, an indicator for the text insertion point.
You can get a `CaretPosition` using the {{domxref("Document.caretPositionFromPoint()")}} method.

## Instance properties

Expand All @@ -16,7 +17,8 @@ _This interface doesn't inherit any properties._
- {{domxref("CaretPosition.offsetNode")}} {{ReadOnlyInline}}
- : Returns a {{domxref("Node")}} containing the found node at the caret's position.
- {{domxref("CaretPosition.offset")}} {{ReadOnlyInline}}
- : Returns a `long` representing the character offset in the caret position node.
- : Returns a `long` representing the offset of the selection in the caret position node.
This will be the character offset in a text node or the selected child node's index in an element node.

## Instance methods

Expand Down
Loading

0 comments on commit ae524b0

Please sign in to comment.