Skip to content

Commit 79895ee

Browse files
committed
Rename ClientRect{,List} to DOMRect{,List}.
To match the actual name of what these things represent in the standard.
1 parent c30d7df commit 79895ee

File tree

3 files changed

+17
-9
lines changed

3 files changed

+17
-9
lines changed

src/main/scala/org/scalajs/dom/lib.scala

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ trait NodeSelector extends js.Object {
532532

533533
@js.native
534534
@JSGlobal
535-
class ClientRect extends js.Object {
535+
class DOMRect extends js.Object {
536536
var left: Double = js.native
537537
var width: Double = js.native
538538
var right: Double = js.native
@@ -884,7 +884,7 @@ abstract class Element
884884
*
885885
* MDN
886886
*/
887-
def getBoundingClientRect(): ClientRect = js.native
887+
def getBoundingClientRect(): DOMRect = js.native
888888

889889
/**
890890
* getAttributeNS returns the string value of the attribute with the specified
@@ -948,7 +948,7 @@ abstract class Element
948948
*
949949
* MDN
950950
*/
951-
def getClientRects(): ClientRectList = js.native
951+
def getClientRects(): DOMRectList = js.native
952952

953953
/**
954954
* setAttributeNode() adds a new Attr node to the specified element.
@@ -4668,13 +4668,13 @@ class Range extends js.Object {
46684668
def detach(): Unit = js.native
46694669

46704670
/**
4671-
* The Range.getBoundingClientRect() method returns a ClientRect object that
4671+
* The Range.getBoundingClientRect() method returns a DOMRect object that
46724672
* bounds the contents of the range; this a rectangle enclosing the union of the
46734673
* bounding rectangles for all the elements in the range.
46744674
*
46754675
* MDN
46764676
*/
4677-
def getBoundingClientRect(): ClientRect = js.native
4677+
def getBoundingClientRect(): DOMRect = js.native
46784678

46794679
/**
46804680
* The Range.compareBoundaryPoints() method compares the boundary points of the
@@ -4737,7 +4737,7 @@ class Range extends js.Object {
47374737
*
47384738
* MDN
47394739
*/
4740-
def getClientRects(): ClientRectList = js.native
4740+
def getClientRects(): DOMRectList = js.native
47414741

47424742
/**
47434743
* The Range.surroundContents() method moves content of the Range into a new node,
@@ -6765,7 +6765,7 @@ trait LinkStyle extends js.Object {
67656765

67666766
@js.native
67676767
@JSGlobal
6768-
class ClientRectList extends DOMList[ClientRect]
6768+
class DOMRectList extends DOMList[DOMRect]
67696769

67706770
@js.native
67716771
trait External extends js.Object

src/main/scala/org/scalajs/dom/package.scala

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,10 @@ package object dom {
3232
@js.native
3333
@JSGlobal("console")
3434
val console: Console = js.native
35+
36+
@deprecated("use DOMRect instead", "2.0.0")
37+
type ClientRect = DOMRect
38+
39+
@deprecated("use DOMRectList instead", "2.0.0")
40+
type ClientRectList = DOMRectList
3541
}

src/main/scala/org/scalajs/dom/raw.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ object raw {
4747
type ChannelMergerNode = dom.ChannelMergerNode
4848
type ChannelSplitterNode = dom.ChannelSplitterNode
4949
type CharacterData = dom.CharacterData
50-
type ClientRect = dom.ClientRect
51-
type ClientRectList = dom.ClientRectList
50+
type ClientRect = dom.DOMRect
51+
type ClientRectList = dom.DOMRectList
5252
type ClipboardEvent = dom.ClipboardEvent
5353
type ClipboardEventInit = dom.ClipboardEventInit
5454
type CloseEvent = dom.CloseEvent
@@ -83,6 +83,8 @@ object raw {
8383
lazy val DOMException: dom.DOMException.type = dom.DOMException
8484
type DOMList[T] = dom.DOMList[T]
8585
type DOMParser = dom.DOMParser
86+
type DOMRect = dom.DOMRect
87+
type DOMRectList = dom.DOMRectList
8688
type DOMSettableTokenList = dom.DOMSettableTokenList
8789
type DOMStringList = dom.DOMStringList
8890
type DOMTokenList = dom.DOMTokenList

0 commit comments

Comments
 (0)