mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-29 07:03:29 +00:00
refix rebase regressions
This commit is contained in:
@@ -370,7 +370,7 @@ pub const Element = struct {
|
||||
pub fn _getBoundingClientRect(self: *parser.Element, state: *SessionState) !DOMRect {
|
||||
// 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.
|
||||
const root = try parser.nodeGetRootNode(parser.elementToNode(self));
|
||||
if (root != parser.documentToNode(parser.documentHTMLToDocument(state.document.?))) {
|
||||
if (root != parser.documentToNode(parser.documentHTMLToDocument(state.window.document.?))) {
|
||||
return DOMRect{ .x = 0, .y = 0, .width = 0, .height = 0 };
|
||||
}
|
||||
return state.renderer.getRect(self);
|
||||
@@ -381,7 +381,7 @@ pub const Element = struct {
|
||||
// Returns an empty array if the element is eventually detached from the main window
|
||||
pub fn _getClientRects(self: *parser.Element, state: *SessionState) ![]DOMRect {
|
||||
const root = try parser.nodeGetRootNode(parser.elementToNode(self));
|
||||
if (root != parser.documentToNode(parser.documentHTMLToDocument(state.document.?))) {
|
||||
if (root != parser.documentToNode(parser.documentHTMLToDocument(state.window.document.?))) {
|
||||
return &.{};
|
||||
}
|
||||
const heap_ptr = try state.call_arena.create(DOMRect);
|
||||
|
||||
@@ -255,10 +255,10 @@ pub const HTMLDocument = struct {
|
||||
// Thus we can add the HtmlHtmlElement and it's child HTMLBodyElement to the returned list.
|
||||
// TBD Should we instead return every parent that is an element? Note that a child does not physically need to be overlapping the parent.
|
||||
// Should we do a render pass on demand?
|
||||
const doc_elem = try parser.documentGetDocumentElement(parser.documentHTMLToDocument(state.document.?)) orelse {
|
||||
const doc_elem = try parser.documentGetDocumentElement(parser.documentHTMLToDocument(state.window.document.?)) orelse {
|
||||
return list.items;
|
||||
};
|
||||
if (try parser.documentHTMLBody(state.document.?)) |body| {
|
||||
if (try parser.documentHTMLBody(state.window.document.?)) |body| {
|
||||
list.appendAssumeCapacity(try Element.toInterface(parser.bodyToElement(body)));
|
||||
}
|
||||
list.appendAssumeCapacity(try Element.toInterface(doc_elem));
|
||||
|
||||
Reference in New Issue
Block a user