Skip to content

Commit 469f30c

Browse files
Drop getBoundingClientRect (#73)
1 parent 12c06ef commit 469f30c

File tree

3 files changed

+1
-27
lines changed

3 files changed

+1
-27
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Notable changes to this project are documented in this file. The format is based
55
## [Unreleased]
66

77
Breaking changes:
8+
- Move `getBoundingClientRect` to `purescript-web-dom` (#73 by @JordanMartinez)
89

910
New features:
1011

src/Web/HTML/HTMLElement.js

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -185,20 +185,6 @@ export function blur(elt) {
185185

186186
// - CSSOM ---------------------------------------------------------------------
187187

188-
export function getBoundingClientRect(el) {
189-
return function () {
190-
var rect = el.getBoundingClientRect();
191-
return {
192-
top: rect.top,
193-
right: rect.right,
194-
bottom: rect.bottom,
195-
left: rect.left,
196-
width: rect.width,
197-
height: rect.height
198-
};
199-
};
200-
}
201-
202188
export function _offsetParent(el) {
203189
return function () {
204190
return el.offsetParent;

src/Web/HTML/HTMLElement.purs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ module Web.HTML.HTMLElement
3535
, click
3636
, focus
3737
, blur
38-
, getBoundingClientRect
39-
, DOMRect
4038
, offsetParent
4139
, offsetTop
4240
, offsetLeft
@@ -133,17 +131,6 @@ foreign import click :: HTMLElement -> Effect Unit
133131
foreign import focus :: HTMLElement -> Effect Unit
134132
foreign import blur :: HTMLElement -> Effect Unit
135133

136-
type DOMRect =
137-
{ top :: Number
138-
, right :: Number
139-
, bottom :: Number
140-
, left :: Number
141-
, width :: Number
142-
, height :: Number
143-
}
144-
145-
foreign import getBoundingClientRect :: HTMLElement -> Effect DOMRect
146-
147134
foreign import _offsetParent :: HTMLElement -> Effect (Nullable Element)
148135

149136
offsetParent :: HTMLElement -> Effect (Maybe Element)

0 commit comments

Comments
 (0)