mirror of
https://github.com/servo/servo.git
synced 2025-08-07 14:35:33 +01:00
Remove DOMRectList and use sequences instead.
DOMRectList was removed last back in 2015. See https://www.w3.org/Bugs/Public/show_bug.cgi?id=26200 for details.
This commit is contained in:
parent
56435db820
commit
853c91781e
6 changed files with 7 additions and 77 deletions
|
@ -34,7 +34,6 @@ use dom::create::create_element;
|
|||
use dom::document::{Document, LayoutDocumentHelpers};
|
||||
use dom::documentfragment::DocumentFragment;
|
||||
use dom::domrect::DOMRect;
|
||||
use dom::domrectlist::DOMRectList;
|
||||
use dom::domtokenlist::DOMTokenList;
|
||||
use dom::event::Event;
|
||||
use dom::eventtarget::EventTarget;
|
||||
|
@ -1632,17 +1631,16 @@ impl ElementMethods for Element {
|
|||
}
|
||||
|
||||
// https://drafts.csswg.org/cssom-view/#dom-element-getclientrects
|
||||
fn GetClientRects(&self) -> Root<DOMRectList> {
|
||||
fn GetClientRects(&self) -> Vec<Root<DOMRect>> {
|
||||
let win = window_from_node(self);
|
||||
let raw_rects = self.upcast::<Node>().content_boxes();
|
||||
let rects = raw_rects.iter().map(|rect| {
|
||||
raw_rects.iter().map(|rect| {
|
||||
DOMRect::new(win.upcast(),
|
||||
rect.origin.x.to_f64_px(),
|
||||
rect.origin.y.to_f64_px(),
|
||||
rect.size.width.to_f64_px(),
|
||||
rect.size.height.to_f64_px())
|
||||
});
|
||||
DOMRectList::new(&win, rects)
|
||||
}).collect()
|
||||
}
|
||||
|
||||
// https://drafts.csswg.org/cssom-view/#dom-element-getboundingclientrect
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue