mirror of
https://github.com/servo/servo.git
synced 2025-08-07 14:35:33 +01:00
DOMRectList interface implementation (#34025)
* rechecking all file changes and additions Signed-off-by: L Ashwin B <lashwinib@gmail.com> * added comments with specification links Signed-off-by: L Ashwin B <lashwinib@gmail.com> * added space before the links Signed-off-by: L Ashwin B <lashwinib@gmail.com> * modified the doc link format Signed-off-by: L Ashwin B <lashwinib@gmail.com> * suggested changes + updated interfaces.https.html + updated passing test expectations Signed-off-by: L Ashwin B <lashwinib@gmail.com> * needed to do an update-manifest Signed-off-by: L Ashwin B <lashwinib@gmail.com> * updated the idlharness.any.html expectations Signed-off-by: L Ashwin B <lashwinib@gmail.com> --------- Signed-off-by: L Ashwin B <lashwinib@gmail.com>
This commit is contained in:
parent
d2c4448ac8
commit
257f4b84db
10 changed files with 86 additions and 42 deletions
|
@ -103,6 +103,7 @@ use crate::dom::document::{
|
|||
};
|
||||
use crate::dom::documentfragment::DocumentFragment;
|
||||
use crate::dom::domrect::DOMRect;
|
||||
use crate::dom::domrectlist::DOMRectList;
|
||||
use crate::dom::domtokenlist::DOMTokenList;
|
||||
use crate::dom::elementinternals::ElementInternals;
|
||||
use crate::dom::eventtarget::EventTarget;
|
||||
|
@ -2431,10 +2432,10 @@ impl ElementMethods for Element {
|
|||
}
|
||||
|
||||
// https://drafts.csswg.org/cssom-view/#dom-element-getclientrects
|
||||
fn GetClientRects(&self, can_gc: CanGc) -> Vec<DomRoot<DOMRect>> {
|
||||
fn GetClientRects(&self, can_gc: CanGc) -> DomRoot<DOMRectList> {
|
||||
let win = window_from_node(self);
|
||||
let raw_rects = self.upcast::<Node>().content_boxes(can_gc);
|
||||
raw_rects
|
||||
let rects: Vec<DomRoot<DOMRect>> = raw_rects
|
||||
.iter()
|
||||
.map(|rect| {
|
||||
DOMRect::new(
|
||||
|
@ -2446,7 +2447,8 @@ impl ElementMethods for Element {
|
|||
can_gc,
|
||||
)
|
||||
})
|
||||
.collect()
|
||||
.collect();
|
||||
DOMRectList::new(&win, rects, can_gc)
|
||||
}
|
||||
|
||||
// https://drafts.csswg.org/cssom-view/#dom-element-getboundingclientrect
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue