Skip to content

Commit

Permalink
Move caretPositionFromPoint to Document (#3067)
Browse files Browse the repository at this point in the history
  • Loading branch information
Elchi3 authored Mar 14, 2021
1 parent d1b6168 commit 91ba83a
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 40 deletions.
8 changes: 4 additions & 4 deletions files/en-us/_redirects.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1887,7 +1887,7 @@
/en-US/docs/DOM/document.baseURIObject /en-US/docs/Web/API/Node
/en-US/docs/DOM/document.bgColor /en-US/docs/Web/API/Document/bgColor
/en-US/docs/DOM/document.body /en-US/docs/Web/API/Document/body
/en-US/docs/DOM/document.caretPositionFromPoint /en-US/docs/Web/API/DocumentOrShadowRoot/caretPositionFromPoint
/en-US/docs/DOM/document.caretPositionFromPoint /en-US/docs/Web/API/Document/caretPositionFromPoint
/en-US/docs/DOM/document.characterSet /en-US/docs/Web/API/document/characterSet
/en-US/docs/DOM/document.clear /en-US/docs/Web/API/Document/clear
/en-US/docs/DOM/document.close /en-US/docs/Web/API/Document/close
Expand Down Expand Up @@ -7555,6 +7555,7 @@
/en-US/docs/Web/API/DocumentFragment/firstElementChild /en-US/docs/Web/API/ParentNode/firstElementChild
/en-US/docs/Web/API/DocumentFragment/lastElementChild /en-US/docs/Web/API/ParentNode/lastElementChild
/en-US/docs/Web/API/DocumentOrShadowRoot/activeElement /en-US/docs/Web/API/Document/activeElement
/en-US/docs/Web/API/DocumentOrShadowRoot/caretPositionFromPoint /en-US/docs/Web/API/Document/caretPositionFromPoint
/en-US/docs/Web/API/DocumentOrShadowRoot/fullscreenElement /en-US/docs/Web/API/Document/fullscreenElement
/en-US/docs/Web/API/DocumentOrShadowRoot/getAnimations /en-US/docs/Web/API/Document/getAnimations
/en-US/docs/Web/API/DocumentOrShadowRoot/getSelection /en-US/docs/Web/API/Document/getSelection
Expand Down Expand Up @@ -9263,7 +9264,7 @@
/en-US/docs/Web/API/document.async /en-US/docs/Web/API/XMLDocument/async
/en-US/docs/Web/API/document.bgColor /en-US/docs/Web/API/Document/bgColor
/en-US/docs/Web/API/document.body /en-US/docs/Web/API/Document/body
/en-US/docs/Web/API/document.caretPositionFromPoint /en-US/docs/Web/API/DocumentOrShadowRoot/caretPositionFromPoint
/en-US/docs/Web/API/document.caretPositionFromPoint /en-US/docs/Web/API/Document/caretPositionFromPoint
/en-US/docs/Web/API/document.characterSet /en-US/docs/Web/API/document/characterSet
/en-US/docs/Web/API/document.clear /en-US/docs/Web/API/Document/clear
/en-US/docs/Web/API/document.close /en-US/docs/Web/API/Document/close
Expand Down Expand Up @@ -9353,7 +9354,6 @@
/en-US/docs/Web/API/document.write /en-US/docs/Web/API/Document/write
/en-US/docs/Web/API/document.writeln /en-US/docs/Web/API/Document/writeln
/en-US/docs/Web/API/document.xmlVersion /en-US/docs/Web/API/Document/xmlVersion
/en-US/docs/Web/API/document/caretPositionFromPoint /en-US/docs/Web/API/DocumentOrShadowRoot/caretPositionFromPoint
/en-US/docs/Web/API/document/mozFullScreen /en-US/docs/Web/API/Document/fullscreen
/en-US/docs/Web/API/document/nodePrincipal /en-US/docs/Web/API/Node
/en-US/docs/Web/API/dummyDocument.scripts /en-US/docs/Web/API/Document/scripts
Expand Down Expand Up @@ -11898,7 +11898,7 @@
/en-US/docs/cancelBubble /en-US/docs/Web/API/UIEvent/cancelBubble
/en-US/docs/cancelable /en-US/docs/Web/API/Event/cancelable
/en-US/docs/caption /en-US/docs/Web/HTML/Element/caption
/en-US/docs/caret_temp /en-US/docs/Web/API/DocumentOrShadowRoot/caretPositionFromPoint
/en-US/docs/caret_temp /en-US/docs/Web/API/Document/caretPositionFromPoint
/en-US/docs/ccache /en-US/docs/Mozilla/Developer_guide/Build_Instructions/ccache
/en-US/docs/ccs_temp /en-US/docs/Web/API/Document/createCDATASection
/en-US/docs/cellPadding /en-US/docs/Web/API/HTMLTableElement/cellPadding
Expand Down
22 changes: 11 additions & 11 deletions files/en-us/_wikihistory.json
Original file line number Diff line number Diff line change
Expand Up @@ -44289,17 +44289,6 @@
"david_ross"
]
},
"Web/API/DocumentOrShadowRoot/caretPositionFromPoint": {
"modified": "2020-10-15T21:49:27.908Z",
"contributors": [
"mfluehr",
"myakura",
"fscholz",
"chrisdavidmills",
"david_ross",
"jpmedley"
]
},
"Web/API/DocumentOrShadowRoot/elementFromPoint": {
"modified": "2020-10-15T21:49:27.541Z",
"contributors": [
Expand Down Expand Up @@ -165787,5 +165776,16 @@
"bede",
"david_ross"
]
},
"Web/API/Document/caretPositionFromPoint": {
"modified": "2020-10-15T21:49:27.908Z",
"contributors": [
"mfluehr",
"myakura",
"fscholz",
"chrisdavidmills",
"david_ross",
"jpmedley"
]
}
}
2 changes: 1 addition & 1 deletion files/en-us/mozilla/firefox/releases/20/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ <h3 id="DOMAPIs">DOM/APIs</h3>
<li>{{domxref("TextDecoder")}} and {{domxref("TextEncoder")}} interfaces are now available in Workers ({{bug('795542')}}).</li>
<li>Support for the <code>CSS.supports()</code> method has been added, behind the <code>layout.css.supports-rule.enabled</code> pref (off by default) ({{bug("779917")}}).</li>
<li>Support for UndoManager has been added ({{bug("617532")}}).</li>
<li>The CSSOM {{domxref("DocumentOrShadowRoot/caretPositionFromPoint")}} method, which returns a {{domxref("CaretPosition")}} has been implemented.</li>
<li>The CSSOM {{domxref("Document.caretPositionFromPoint()")}} method, which returns a {{domxref("CaretPosition")}} has been implemented.</li>
<li>The index argument of the {{domxref("tableRow.insertCell")}} and {{domxref("table.insertRow")}} methods has been made optional as per HTML specification.</li>
<li>{{domxref("Navigator.getUserMedia")}}, still prefixed as <code>Navigator.mozGetUserMedia</code> is now activated by default.</li>
<li>The third, optional, <code>transfer</code> argument of {{domxref("Window.postMessage")}} is now supported. It allows to transfer a sequence of {{domxref("Transferable")}} objects to the destination ({{bug("822094")}}).</li>
Expand Down
4 changes: 2 additions & 2 deletions files/en-us/web/api/caretposition/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
---
<p>{{SeeCompatTable}} {{ APIRef("CSSOM") }}</p>

<p>The <code>CaretPosition</code> interface represents the caret position, an indicator for the text insertion point. You can get a <code>CaretPosition</code> using the {{domxref("DocumentOrShadowRoot/caretPositionFromPoint", "document.caretPositionFromPoint()")}} method.</p>
<p>The <code>CaretPosition</code> interface represents the caret position, an indicator for the text insertion point. You can get a <code>CaretPosition</code> using the {{domxref("Document.caretPositionFromPoint()")}} method.</p>

<h2 id="Properties">Properties</h2>

Expand Down Expand Up @@ -60,7 +60,7 @@ <h2 id="Browser_compatibility">Browser compatibility</h2>
<h2 id="See_also">See also</h2>

<ul>
<li>{{domxref("DocumentOrShadowRoot/caretPositionFromPoint", "document.caretPositionFromPoint()")}}</li>
<li>{{domxref("Document.caretPositionFromPoint()")}}</li>
<li>{{domxref("Range")}}</li>
<li>{{domxref("Node")}}</li>
</ul>
Original file line number Diff line number Diff line change
@@ -1,26 +1,23 @@
---
title: DocumentOrShadowRoot.caretPositionFromPoint()
slug: Web/API/DocumentOrShadowRoot/caretPositionFromPoint
title: Document.caretPositionFromPoint()
slug: Web/API/Document/caretPositionFromPoint
tags:
- API
- Document
- DocumentOrShadowRoot
- Method
- Reference
- ShadowRoot
- caretPositionFromPoint()
- API
- Document
- Method
- Reference
---
<p>{{APIRef("CSSOM View")}}{{SeeCompatTable}}</p>
<p>{{APIRef("CSSOM View")}} {{SeeCompatTable}}</p>

<p><span class="seoSummary">The <strong><code>caretPositionFromPoint()</code></strong>
property of the {{domxref("DocumentOrShadowRoot")}} interface returns a
property of the {{domxref("Document")}} interface returns a
{{domxref('CaretPosition')}} object, containing the DOM node, along with the caret and
caret's character offset within that node.</span></p>

<h2 id="Syntax">Syntax</h2>

<pre
class="brush: js">var caretPosition = document.caretPositionFromPoint(float x, float y);</pre>
class="brush: js">caretPositionFromPoint(x, y);</pre>

<h3 id="Parameters">Parameters</h3>

Expand Down Expand Up @@ -90,17 +87,20 @@ <h2 id="Specifications">Specifications</h2>
<tbody>
<tr>
<th scope="col">Specification</th>
<th scope="col">Status</th>
<th scope="col">Comment</th>
</tr>
<tr>
<td>{{SpecName('CSSOM View','#dom-document-caretpositionfrompoint','caretPositionFromPoint()')}}</td>
<td>{{Spec2('CSSOM View')}}</td>
<td>Initial definition.</td>
</tr>
</tbody>
</table>

<h2 id="Browser_compatibility">Browser compatibility</h2>

<p>{{Compat("api.DocumentOrShadowRoot.caretPositionFromPoint")}}</p>
<p>{{Compat("api.Document.caretPositionFromPoint")}}</p>


<h2 id="See_also">See also</h2>

<ul>
<li>{{domxref('CaretPosition')}}</li>
</ul>
4 changes: 2 additions & 2 deletions files/en-us/web/api/document/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ <h2 id="Methods">Methods</h2>
<dd>Adopt node from an external document.</dd>
<dt>{{DOMxRef("Document.captureEvents()")}} {{Deprecated_Inline}}</dt>
<dd>See {{DOMxRef("Window.captureEvents")}}.</dd>
<dt>{{DOMxRef("Document.caretPositionFromPoint()")}}</dt>
<dd>Returns a {{DOMxRef('CaretPosition')}} object containing the DOM node containing the caret, and caret's character offset within that node.</dd>
<dt>{{DOMxRef("Document.caretRangeFromPoint()")}} {{Non-standard_Inline}}</dt>
<dd>Gets a {{DOMxRef("Range")}} object for the document fragment under the specified coordinates.</dd>
<dt>{{DOMxRef("Document.createAttribute()")}}</dt>
Expand Down Expand Up @@ -336,8 +338,6 @@ <h3 id="Methods_included_from_DocumentOrShadowRoot">Methods included from Docume
<p><em>The <code>Document</code> interface includes the following methods defined on the {{DOMxRef("DocumentOrShadowRoot")}} mixin. Note that this is currently only implemented by Chrome; other browsers still implement them on the {{DOMxRef("Document")}} interface.</em></p>

<dl>
<dt>{{DOMxRef("DocumentOrShadowRoot.caretPositionFromPoint()")}}</dt>
<dd>Returns a {{DOMxRef('CaretPosition')}} object containing the DOM node containing the caret, and caret's character offset within that node.</dd>
<dt>{{DOMxRef("DocumentOrShadowRoot.elementFromPoint()")}}</dt>
<dd>Returns the topmost element at the specified coordinates.</dd>
<dt>{{DOMxRef("DocumentOrShadowRoot.elementsFromPoint()")}}</dt>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
coordinate is negative, the result is <code>null</code>.</p>

<p>If you need to find the specific position inside the element, use
{{domxref("DocumentOrShadowRoot.caretPositionFromPoint")}}.</p>
{{domxref("Document.caretPositionFromPoint()")}}.</p>

<h2 id="Syntax">Syntax</h2>

Expand Down
2 changes: 0 additions & 2 deletions files/en-us/web/api/shadowroot/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ <h2 id="Methods">Methods</h2>
<dd>Returns the topmost element at the specified coordinates.</dd>
<dt>{{domxref("ShadowRoot.elementsFromPoint()")}}</dt>
<dd>Returns an array of all elements at the specified coordinates.</dd>
<dt>{{domxref("ShadowRoot.caretPositionFromPoint()")}}</dt>
<dd>Returns a {{domxref('CaretPosition')}} object containing the DOM node containing the caret, and caret's character offset within that node.</dd>
</dl>

<h2 id="Examples">Examples</h2>
Expand Down

0 comments on commit 91ba83a

Please sign in to comment.