Search completed in 1.20 seconds.
24 results for "frompoint":
Your results are loading. Please wait...
DocumentOrShadowRoot.caretPositionFromPoint() - Web APIs
y The vertical coordinate of a point. Returns A CaretPosition object. Example This example inserts line breaks wherever you click. The code for it is below the demo. Demo HTML Content <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. ...
..., consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. ...
...eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. ...
...And 3 more matches
Document.caretRangeFromPoint() - Web APIs
y A vertical position within the current viewport. Returns One of the following: A Range. Null, if x or y are negative, outside viewport, or there is no text entry node. Example Basic demo: When clicking in a paragraph insert a line break at the caret position: HTML <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. ...
...sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. ...
... nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. ...
...And 2 more matches
DocumentOrShadowRoot.elementFromPoint() - Web APIs
If the element at the specified point belongs to another document (for example, the document of an <iframe>), that document's parent element is returned (the <iframe> itself). If the element at the given point is anonymous or XBL generated content, such as a textbox's scroll bars, then the first non-anonymous ancestor element (for example, the textbox) is returned. Elements with pointer-events set to none will be ignored, and the element below it will be returned. If the method is run on another document (like an <iframe>'s subdocument), the coordinates are relative to the document where the method is being called. ...
...ment below it will be returned. If the method is run on another document (like an <iframe>'s subdocument), the coordinates are relative to the document where the method is being called. If the specified point is outside the visible bounds of the document or either coordinate is negative, the result is null. If you need to find the specific position inside the element, use Document.caretPositionFromPoint(). Syntax const element = document.elementFromPoint(x, y) Parameters x The horizontal coordinate of a point, relative to the left edge of the current viewport. y The vertical coordinate of a point, relative to the top edge of the current viewport. Return value The topmost Element object located at the specified coordinates. Example This example creates two buttons which let you set ...
...rrent viewport. y The vertical coordinate of a point, relative to the top edge of the current viewport. Return value The topmost Element object located at the specified coordinates. Example This example creates two buttons which let you set the current color of the paragraph element located under the coordinates (2, 2). JavaScript function changeColor(newColor) { elem = document.elementFromPoint(2, 2); elem.style.color = newColor; } The changeColor() method simply obtains the element located at the specified point, then sets that element's current foreground color property to the color specified by the newColor parameter. HTML <p id="para1">Some text here</p> <button onclick="changeColor('blue');">Blue</button> <button onclick="changeColor('red');">Red</button> The HTML provides t...
...And 2 more matches
DOMPoint.fromPoint() - Web APIs
Return value A new DOMPoint object whose coordinate and perspective values are identical to those in the source point. ...
...ew mutable DOMPoint object given a source point. The source point is specified as a DOMPointInit-compatible object, which includes both DOMPoint and DOMPointReadOnly. You can also create a new DOMPoint object using the new DOMPoint() constructor. Although this interface is based on DOMPointReadOnly, it is not read-only; the properties within may be changed at will. Syntax var point = DOMPoint.fromPoint(sourcePoint); Properties sourcePoint A DOMPointInit-compliant object, which includes both DOMPoint and DOMPointReadOnly, from which to take the values of the new point's properties. Return value A new DOMPoint object whose coordinate and perspective values are identical to those in the source point. The point's properties are mutable and may be changed at any time. Examples Creating a m...
...of the new point's properties. Return value A new DOMPoint object whose coordinate and perspective values are identical to those in the source point. The point's properties are mutable and may be changed at any time. ...
...ead-only point If you have a DOMPointReadOnly object, you can easily create a mutable copy of that point: var mutablePoint = DOMPoint.fromPoint(readOnlyPoint); Creating a 2D point This sample creates a 2D point, specifying an inline object that includes the values to use for x and y. The z and w properties are allowed to keep their default values (0 and 1 respectively). var center = DOMPoint.fromPoint({x: 75, y: -50, z: -55, w: 0.25}); Specifications Specification Status Comment Geometry Interfaces Module Level 1The definition of 'fromPoint()' in that specification. Candidate Recommendation Initial definition ...
DOMPointReadOnly.fromPoint() - Web APIs
Return value A new DOMPointReadOnly object (which is identical to the source point). ...
... Return value A new DOMPointReadOnly object (which is identical to the source point). ...
...ch to take the values of the new point's properties. Return value A new DOMPointReadOnly object (which is identical to the source point). Examples Creating a 2D point This sample creates a 2D point, specifying an inline object that includes the values to use for x and y. The z and w properties are allowed to keep their default values (0 and 1 respectively). ...
... 2D point, specifying an inline object that includes the values to use for x and y. The z and w properties are allowed to keep their default values (0 and 1 respectively). const point2D = DOMPointReadOnly.fromPoint({x: 25, y: 25}) Creating a 3D point using an existing point This example creates a point, origPoint, of type DOMPoint, using new DOMPoint(). That point is then used as the input for fromPoint() to create a new point, newPoint. const origPoint = new DOMPoint(25, 25, 100, 0.5) const newPoint = DOMPointReadOnly.fromPoint(origPoint) Specifications Specification Status Comment Geometry Interfaces Module Level 1The definition of 'fromPoint()' in that specification. Candidate Recommendation Initial definition ...
DocumentOrShadowRoot.elementsFromPoint() - Web APIs
The elementsFromPoint() method of the DocumentOrShadowRoot interface returns an array of all elements at the specified coordinates (relative to the viewport). It operates in a similar way to the elementFromPoint() method. Syntax const elements = document.elementsFromPoint(x, y); Parameters x The horizontal coordinate of a point. y The vertical coordinate of a point. Return value An array of element objects. ...
...() method. Syntax const elements = document.elementsFromPoint(x, y); Parameters x The horizontal coordinate of a point. y The vertical coordinate of a point. Return value An array of element objects. ...
...lementsFromPoint(x, y); Parameters x The horizontal coordinate of a point. y The vertical coordinate of a point. Return value An array of element objects. ...
...ementById("output"); if (document.elementsFromPoint) { let elements = document.elementsFromPoint(30, 20); for (var i = 0; i < elements.length; i++) { output.textContent += elements[i].localName; if (i < elements.length - 1) { output.textContent += " < "; } } } else { output.innerHTML = "<span style=\"color: red;\">" + "Browser does not support <code>document.elementsFromPoint()</code>" + "</span>"; } Specifications Specification Status Shadow DOMThe definition of 'elementsFromPoint()' in that specification. Obsolete CSS Object Model (CSSOM) View ModuleThe definition of 'elementsFromPoint()' in that specification. Working Draft ...
DocumentOrShadowRoot.nodesFromPoint() - Web APIs
The nodesFromPoint() property of the DocumentOrShadowRoot interface returns an array of all nodes at the specified coordinates (relative to the viewport). Currently this method is only implemented in Firefox, and only available to chrome code. Syntax var nodes = document.nodesFromPoint(x, y); Parameters x The horizontal coordinate of a point. y The vertical coordinate of a point. Returns An array of Node objects. ...
... to chrome code. Syntax var nodes = document.nodesFromPoint(x, y); Parameters x The horizontal coordinate of a point. y The vertical coordinate of a point. Returns An array of Node objects. ...
...ument.nodesFromPoint(x, y); Parameters x The horizontal coordinate of a point. y The vertical coordinate of a point. Returns An array of Node objects. Example HTML Content <div> <p>Some text</p> </div> <p>Nodes at point 30, 20:</p> <div id="output"></div> JavaScript Content var output = document.getElementById("output"); if (document.nodesFromPoint) { var nodes = document.nodesFromPoint(30, 20); for(var i = 0; i < nodes.length; i++) { output.textContent += nodes[i].localName; if (i < nodes.length - 1) { output.textContent += " < "; } } } else { output.innerHTML = "<span style=\"color: red;\">" + "Browser does not support <code>document.nodesFromPoint()</code>" + "</span>"; } Specifications Not part of any specification at present. ...
DocumentOrShadowRoot.nodeFromPoint() - Web APIs
The nodeFromPoint() property of the DocumentOrShadowRoot interface returns the topmost node at the specified coordinates (relative to the viewport). Currently this method is only implemented in Firefox, and only available to chrome code. Syntax var node = document.nodeFromPoint(x, y); Parameters x A double representing the horizontal coordinate of a point. y A double representing the vertical coordinate of a point. Returns A Node object. ...
... = document.nodeFromPoint(x, y); Parameters x A double representing the horizontal coordinate of a point. y A double representing the vertical coordinate of a point. Returns A Node object. Examples HTML Content <div> <p>Some text</p> </div> <p>Top node at point 30, 20:</p> <div id="output"></div> JavaScript Content var output = document.getElementById("output"); if (document.nodeFromPoint) { var node = document.nodeFromPoint(30, 20); output.textContent += node.localName; } else { output.innerHTML = "<span style=\"color: red;\">" + "Browser does not support <code>document.nodeFromPoint()</code>" + "</span>"; } Specifications Not part of any specification at present. ...
Index - Web APIs
Web › API › Index
hod, Reference The CanvasRenderingContext2D.translate() method of the Canvas 2D API adds a translation transformation to the current matrix. 611 CaretPosition API, CSSOM View, Experimental, Interface, Reference The CaretPosition interface represents the caret position, an indicator for the text insertion point. You can get a CaretPosition using the document.caretPositionFromPoint method. 612 Channel Messaging API API, Channel messaging, HTML API, Overview, Reference The Channel Messaging API allows two separate scripts running in different browsing contexts attached to the same document (e.g., two IFrames, or the main document and an IFrame, two documents via a SharedWorker, or two workers) to communicate directly, passing messages between one another...
...ystem; it includes values for the coordinates in up to three dimensions, as well as an optional perspective value. 729 DOMPoint.DOMPoint() API, Constructor, Coordinates, DOM, DOMPoint, Geometry, Geometry Interfaces, Point, Reference The DOMPoint() constructor creates and returns a new DOMPoint object, given the values for some or all of its properties. 730 DOMPoint.fromPoint() API, Coordiantes, DOM, DOMPoint, Geometry, Geometry Interfaces, Method, Point, Reference, Static, Static Method, fromPoint The static DOMPoint method fromPoint() creates and returns a new mutable DOMPoint object given a source point. 731 DOMPoint.w API, DOM, DOMPoint, Geometry, Geometry Interfaces, Point, Property, Reference, W, perspective The DOMPoint interface'...
...n a coordinate system. 741 DOMPointReadOnly() API, Constructor, Coordinates, DOM, DOMPointReadOnly, Geometry, Geometry Interfaces, Point, Position, Reference The DOMPointReadOnly() constructor returns a new DOMPointReadOnly object representing a point in 2D or 3D space, optionally with perspective, whose values cannot be altered by script code. 742 DOMPointReadOnly.fromPoint() API, Coordinates, DOM, DOMPointReadOnly, Geometry, Geometry Interfaces, Method, Point, Reference, Static Method, fromPoint The static DOMPointReadOnly method fromPoint() creates and returns a new DOMPointReadOnly object given a source point. 743 DOMPointReadOnly.toJSON() API, Coordinates, DOM, DOMPointReadOnly, Geometry, Geometry Interfaces, JSON, Method, Point, Referen...
...And 10 more matches
DocumentOrShadowRoot - Web APIs
ly Returns the element set as the target for mouse events while the pointer is locked. It returns null if lock is pending, the pointer is unlocked, or if the target is in another document. DocumentOrShadowRoot.styleSheetsRead only Returns a StyleSheetList of CSSStyleSheet objects for stylesheets explicitly linked into, or embedded in a document. Methods DocumentOrShadowRoot.caretPositionFromPoint() Returns a CaretPosition object containing the DOM node containing the caret, and caret's character offset within that node. DocumentOrShadowRoot.elementFromPoint() Returns the topmost element at the specified coordinates. DocumentOrShadowRoot.elementsFromPoint() Returns an array of all elements at the specified coordinates. DocumentOrShadowRoot.getSelection() Returns a Selection object r...
... Specifications Specification Status Comment Shadow DOMThe definition of 'DocumentOrShadowRoot' in that specification. Obsolete Implementation in Shadow DOM. ...
... Specifications Specification Status Comment Shadow DOMThe definition of 'DocumentOrShadowRoot' in that specification. Obsolete Implementation in Shadow DOM. DOMThe definition of 'DocumentOrShadowRoot' in that specification. ...
nsIDOMWindowUtils
n nsIDOMElement element, in AString property, in AString value1, in AString value2); nsICompositionStringSynthesizer createCompositionStringSynthesizer(); Obsolete since Gecko 38.0 void disableNonTestMouseEvents(in boolean aDisable); boolean dispatchDOMEventViaPresShell(in nsIDOMNode aTarget, in nsIDOMEvent aEvent, in boolean aTrusted); nsIDOMElement elementFromPoint(in float aX, in float aY, in boolean aIgnoreRootScrollFrame, in boolean aFlushLayout); void enterModalState(); nsIDOMElement findElementWithViewId(in nsViewID aId); void focus(in nsIDOMElement aElement); void forceUpdateNativeMenuAt(in AString indexString); void garbageCollect([optional] in nsICycleCollectorListener aListener); short get...
... error if called without UniversalXPConnect privileges. Note: Event handlers won't get aEvent as parameter, but a similar event. Also, aEvent should not be reused. boolean dispatchDOMEventViaPresShell( in nsIDOMNode aTarget, in nsIDOMEvent aEvent, in boolean aTrusted ); Parameters aTarget aEvent aTrusted Return value boolean to show if the event was successful elementFromPoint() Retrieve the element at point aX, aY in the window's document. nsIDOMElement elementFromPoint( in float aX, in float aY, in boolean aIgnoreRootScrollFrame, in boolean aFlushLayout ); Parameters aX aY aIgnoreRootScrollFrame Whether or not to ignore the root scroll frame when retrieving the element. If false, this method returns null for coordinates outside of the viewport...
DOMPoint.DOMPoint() - Web APIs
Web › API › DOMPoint › DOMPoint
That function accepts as input a DOMPointInit compatible object, including a DOMPoint or DOMPointReadOnly. Syntax point = new DOMPoint(x, y, z, w); Parameters x Optional The x coordinate for the new DOMPoint. y Optional The y coordinate for the new DOMPoint. z Optional The z coordinate for the new DOMPoint. w Optional The perspective value of the new DOMPoint. ...
... z coordinate for the new DOMPoint. w Optional The perspective value of the new DOMPoint. Examples This example creates a DOMPoint representing the top-left corner of the current window, then creates a second point based on the first, which is then offset by 100 pixels both vertically and horizontally. var windTopLeft = new DOMPoint(window.screenX, window.screenY); var newTopLeft = DOMPoint.fromPoint(windTopLeft); newTopLeft.x += 100; newTopLeft.y += 100; Specifications Specification Status Comment Geometry Interfaces Module Level 1The definition of 'DOMPoint()' in that specification. Candidate Recommendation Initial definition ...
DOMPointInit.w - Web APIs
Web › API › DOMPointInit › w
= { w: wPerspective }; DOMPointInit.w = wPerspective; var wPerspective = DOMPointInit.w; Value A double-precision floating-point value indicating the point's w perspective value. This value is unrestricted, meaning that it is allowed to be infinite or invalid (that is, its value may be NaN or +-Infinity). There are two methods which use DOMPointInit: The static function DOMPointReadOnly.fromPoint() takes an object that complies with DOMPointInit as its sole input parameter, to specify the coordinates and perspective value of the new point to be created. This method is, by inheritance, also available as DOMPoint.fromPoint(). The DOMPointReadOnly.toJSON() method returns a DOMPointInit object that describes the same point as the original point. By inheritance, this method is also available ...
...ve value of the new point to be created. This method is, by inheritance, also available as DOMPoint.fromPoint(). The DOMPointReadOnly.toJSON() method returns a DOMPointInit object that describes the same point as the original point. By inheritance, this method is also available as DOMPoint.toJSON(). This value is assumed to be 1 by default if not included in the DOMPointInit object passed into fromPoint(). Specifications Specification Status Comment Geometry Interfaces Module Level 1The definition of 'w' in that specification. Candidate Recommendation Initial definition ...
DOMPointInit.z - Web APIs
Web › API › DOMPointInit › z
ion. Syntax var DOMPointInit = { z: zPos }; DOMPointInit.z = zPos; var zPos = DOMPointInit.z; Value A double-precision floating-point value indicating the point's z-coordinate. This value is unrestricted, meaning that it is allowed to be infinite or invalid (that is, its value may be NaN or +-Infinity). There are two methods which use DOMPointInit: The static function DOMPointReadOnly.fromPoint() takes an object that complies with DOMPointInit as its sole input parameter, to specify the coordinates and perspective value of the new point to be created. This method is, by inheritance, also available as DOMPoint.fromPoint(). The DOMPointReadOnly.toJSON() method returns a DOMPointInit object that describes the same point as the original point. By inheritance, this method is also available ...
...oordinates and perspective value of the new point to be created. This method is, by inheritance, also available as DOMPoint.fromPoint(). The DOMPointReadOnly.toJSON() method returns a DOMPointInit object that describes the same point as the original point. By inheritance, this method is also available as DOMPoint.toJSON(). If this property is missing when the DOMPointInit object is passed into fromPoint(), the value is assumed to be 0 by default. Specifications Specification Status Comment Geometry Interfaces Module Level 1The definition of 'z' in that specification. Candidate Recommendation Initial definition ...
DOMPointInit - Web APIs
It's used as the return value when calling toJSON(). Properties DOMPointInit.x An unrestricted floating-point value indicating the x-coordinate of the point in space. This is generally the horizontal coordinate, with positive values being to the right and negative values to the left. The default value is 0. ...
...ber. The default is 1. Example This example creates a new DOMPoint representing the top-left corner of the current window, with a z component added to move the point closer to the user. This same code will work to create a DOMPointReadOnly object; just change the interface name in the code. const pointDesc = { x: window.screenX, y: window.screenY, z: 5.0 }; const windTopLeft = DOMPoint.fromPoint(pointDesc) Specifications Specification Status Comment Geometry Interfaces Module Level 1The definition of 'DOMPointReadOnly.fromPoint()' in that specification. Candidate Recommendation Initial definition ...
DOMPointReadOnly - Web APIs
tReadOnly instance. First, you can use its constructor, passing in the values of the parameters for each dimension and, optionally, the perspective: /* 2D */ const point = new DOMPointReadOnly(50, 50); /* 3D */ const point = new DOMPointReadOnly(50, 50, 25); /* 3D with perspective */ const point = new DOMPointReadOnly(100, 100, 100, 1.0); The other option is to use the static DOMPointReadOnly.fromPoint() method: const point = DOMPointReadOnly.fromPoint({x: 100, y: 100, z: 50; w: 1.0}); Constructor DOMPointReadOnly() Creates a new DOMPointReadOnly object given the values of its coordinates and perspective. To create a point using aDOMPointInit object, you can instead use DOMPointReadOnly.fromPoint(). Properties DOMPointReadOnly.x Read only The point's horizontal coordinate, x. DOMP...
... Methods matrixTransform() Applies a matrix transform specified as a DOMMatrixInit object to the DOMPointReadOnly object. toJSON() Returns a JSON representation of the DOMPointReadOnly object. ...
Document - Web APIs
Web › API › Document
ocument's content), else false. Document.xmlVersion Obsolete since Gecko 10 Returns the version number as specified in the XML declaration or "1.0" if the declaration is absent. Methods This interface also inherits from the Node and EventTarget interfaces. Document.adoptNode() Adopt node from an external document. Document.captureEvents() See Window.captureEvents. Document.caretRangeFromPoint() Gets a Range object for the document fragment under the specified coordinates. Document.createAttribute() Creates a new Attr object and returns it. Document.createAttributeNS() Creates a new attribute node in a given namespace and returns it. Document.createCDATASection() Creates a new CDATA node and returns it. Document.createComment() Creates a new comment node and returns it. Doc...
... Document interface includes the following methods defined on the DocumentOrShadowRoot mixin. Note that this is currently only implemented by Chrome; other browsers still implement them on the Document interface. DocumentOrShadowRoot.getSelection() Returns a Selection object representing the range of text selected by the user, or the current position of the caret. DocumentOrShadowRoot.elementFromPoint() Returns the topmost element at the specified coordinates. DocumentOrShadowRoot.elementsFromPoint() Returns an array of all elements at the specified coordinates. DocumentOrShadowRoot.caretPositionFromPoint() Returns a CaretPosition object containing the DOM node containing the caret, and caret's character offset within that node. Events Listen to these events using addEventListener() or...
CaretPosition - Web APIs
Properties This interface doesn't inherit any properties. CaretPosition.offsetNode Read only Returns a Node containing the found node at the caret's position. CaretPosition.offset Read only Returns a long representing the character offset in the caret position node. ...
DOMPoint - Web APIs
Web › API › DOMPoint
and a positive z component extends outward from the screen (in other words, toward the user). Constructor DOMPoint() Creates and returns a new DOMPoint object given the values of zero or more of its coordinate components and optionally the w perspective value. You can also use an existing DOMPoint or DOMPointReadOnly or a DOMPointInit dictionary to create a new point by calling the DOMPoint.fromPoint() static method. Methods DOMPoint inherits methods from its parent, DOMPointReadOnly. Static methods DOMPoint.fromPoint() Creates a new mutable DOMPoint object given an existing point (or a DOMPointInit dictionary) which provides the values for its properties. Properties DOMPoint inherits properties from its parent, DOMPointReadOnly. DOMPoint.x The x coordinate of the DOMPoint.
DOMPointInit.x - Web APIs
Web › API › DOMPointInit › x
ation of the axes. Syntax var DOMPointInit = { x: xPos }; DOMPointInit.x = xPos; var xPos = DOMPointInit.x; Value A double-precision floating-point value indicating the point's x coordinate. This value is unrestricted, meaning that it is allowed to be infinite or invalid (that is, its value may be NaN or +-Infinity). If this property is missing when the DOMPointInit object is passed into fromPoint(), the value is assumed to be 0 by default. DOMPointInit is used as an input when calling either DOMPointReadOnly.fromPoint() or DOMPoint.fromPoint(), and is returned by the DOMPointReadOnly.toJSON() and DOMPoint.toJSON() methods. Specifications Specification Status Comment Geometry Interfaces Module Level 1The definition of 'x' in that specification. Candidate Recom...
DOMPointInit.y - Web APIs
Web › API › DOMPointInit › y
ntation to change. Syntax var DOMPointInit = { y: yPos }; DOMPointInit.y = yPos; var yPos = DOMPointInit.y; Value A double-precision floating-point value indicating the point's y-coordinate. This value is unrestricted, meaning that it is allowed to be infinite or invalid (that is, its value may be NaN or +-Infinity). If this property is missing when the DOMPointInit object is passed into fromPoint(), the value is assumed to be 0 by default. There are two methods which use DOMPointInit: The static function DOMPointReadOnly.fromPoint() takes an object that complies with DOMPointInit as its sole input parameter, to specify the coordinates and perspective value of the new point to be created. This method is, by inheritance, also available as DOMPoint.fromPoint(). The DOMPointReadOnly.toJS...
DocumentOrShadowRoot.msElementsFromRect() - Web APIs
proprietary method is specific to Internet Explorer and Microsoft Edge. Syntax object.msElementsFromRect(left, top, width, height, retVal) Parameters left [in] Type: Floating-point top[in] Type: Floating-point width[in] Type: Floating-point height [in] Type: Floating-point retVal [out, reval] Type: NodeList Example To find all of the elements under a given point, use msElementsFromPoint(x, y). To find all of the elements which intersect a rectangle, use msElementsFromRect(top, left, width, height). var nodeList = document.msElementsFromRect(x,y,width,height) var nodeList = document.msElementsFromPoint(x,y) The returned nodeList is sorted by z-index so that you can tell the relative stacking order of the elements. See also Advanced Hit Testing APIs Demo for msElementsFromP...
Range - Web APIs
Web › API › Range
There also is the Range() constructor available. Properties There are no inherited properties. ...
ShadowRoot - Web APIs
hadowRoot interface includes the following methods defined on the DocumentOrShadowRoot mixin. Note that this is currently only implemented by Chrome; other browsers still implement them on the Document interface. DocumentOrShadowRoot.getSelection() Returns a Selection object representing the range of text selected by the user, or the current position of the caret. DocumentOrShadowRoot.elementFromPoint() Returns the topmost element at the specified coordinates. DocumentOrShadowRoot.elementsFromPoint() Returns an array of all elements at the specified coordinates. DocumentOrShadowRoot.caretPositionFromPoint() Returns a CaretPosition object containing the DOM node containing the caret, and caret's character offset within that node. Examples The following snippets are taken from our life-c...