mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 10:07:15 +02:00
LibWeb: Ignore window-forwarded document.body.onfoo in detached DOM
Normally, assigning to e.g document.body.onload will forward to window.onload. However, in a detached DOM tree, there is no associated window, so we have nowhere to forward to, making this a no-op. The bulk of this change is making Document::window() return a nullable pointer, as documents created by DOMParser or DOMImplementation do not have an associated window object, and so must be able to return null from here.
This commit is contained in:
Notes:
sideshowbarker
2024-07-19 01:59:31 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/b98a2be96b Pull-request: https://github.com/SerenityOS/serenity/pull/23549
@@ -44,7 +44,7 @@ JS::NonnullGCPtr<ResizeObserverSize> ResizeObserverSize::calculate_box_size(JS::
|
||||
computed_size->set_block_size(paintable_box.content_height().to_double());
|
||||
break;
|
||||
case Bindings::ResizeObserverBoxOptions::DevicePixelContentBox: {
|
||||
auto device_pixel_ratio = target.document().window().device_pixel_ratio();
|
||||
auto device_pixel_ratio = target.document().window()->device_pixel_ratio();
|
||||
// 1. Set computedSize’s inlineSize attribute to target’s content area inline length, in integral device pixels.
|
||||
computed_size->set_inline_size(paintable_box.border_box_width().to_double() * device_pixel_ratio);
|
||||
// 2. Set computedSize’s blockSize attribute to target’s content area block length, in integral device pixels.
|
||||
|
||||
Reference in New Issue
Block a user