File tree 2 files changed +4
-4
lines changed
2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -370,7 +370,7 @@ pub const Element = struct {
370
370
pub fn _getBoundingClientRect (self : * parser.Element , state : * SessionState ) ! DOMRect {
371
371
// Since we are lazy rendering we need to do this check. We could store the renderer in a viewport such that it could cache these, but it would require tracking changes.
372
372
const root = try parser .nodeGetRootNode (parser .elementToNode (self ));
373
- if (root != parser .documentToNode (parser .documentHTMLToDocument (state .document .? ))) {
373
+ if (root != parser .documentToNode (parser .documentHTMLToDocument (state .window . document .? ))) {
374
374
return DOMRect { .x = 0 , .y = 0 , .width = 0 , .height = 0 };
375
375
}
376
376
return state .renderer .getRect (self );
@@ -381,7 +381,7 @@ pub const Element = struct {
381
381
// Returns an empty array if the element is eventually detached from the main window
382
382
pub fn _getClientRects (self : * parser.Element , state : * SessionState ) ! []DOMRect {
383
383
const root = try parser .nodeGetRootNode (parser .elementToNode (self ));
384
- if (root != parser .documentToNode (parser .documentHTMLToDocument (state .document .? ))) {
384
+ if (root != parser .documentToNode (parser .documentHTMLToDocument (state .window . document .? ))) {
385
385
return &.{};
386
386
}
387
387
const heap_ptr = try state .call_arena .create (DOMRect );
Original file line number Diff line number Diff line change @@ -255,10 +255,10 @@ pub const HTMLDocument = struct {
255
255
// Thus we can add the HtmlHtmlElement and it's child HTMLBodyElement to the returned list.
256
256
// TBD Should we instead return every parent that is an element? Note that a child does not physically need to be overlapping the parent.
257
257
// Should we do a render pass on demand?
258
- const doc_elem = try parser .documentGetDocumentElement (parser .documentHTMLToDocument (state .document .? )) orelse {
258
+ const doc_elem = try parser .documentGetDocumentElement (parser .documentHTMLToDocument (state .window . document .? )) orelse {
259
259
return list .items ;
260
260
};
261
- if (try parser .documentHTMLBody (state .document .? )) | body | {
261
+ if (try parser .documentHTMLBody (state .window . document .? )) | body | {
262
262
list .appendAssumeCapacity (try Element .toInterface (parser .bodyToElement (body )));
263
263
}
264
264
list .appendAssumeCapacity (try Element .toInterface (doc_elem ));
You can’t perform that action at this time.
0 commit comments