mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-22 17:29:01 +00:00
LibWeb: Pass ResizeObserver instance as a second argument to callback
This commit is contained in:
parent
1cc9fb6135
commit
ad15edf2ff
Notes:
github-actions[bot]
2025-09-08 16:41:18 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: ad15edf2ff
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6117
Reviewed-by: https://github.com/tcl3
2 changed files with 5 additions and 2 deletions
|
@ -116,7 +116,7 @@ void ResizeObserver::invoke_callback(ReadonlySpan<GC::Ref<ResizeObserverEntry>>
|
|||
MUST(wrapped_records->create_data_property(property_index, record.ptr()));
|
||||
}
|
||||
|
||||
(void)WebIDL::invoke_callback(callback, this, WebIDL::ExceptionBehavior::Report, { { wrapped_records } });
|
||||
(void)WebIDL::invoke_callback(callback, this, WebIDL::ExceptionBehavior::Report, { { wrapped_records, this } });
|
||||
}
|
||||
|
||||
void ResizeObserver::unregister_observer_if_needed()
|
||||
|
|
|
@ -23,10 +23,13 @@
|
|||
});
|
||||
}
|
||||
|
||||
const resizeObserver = new ResizeObserver(function (entries) {
|
||||
const resizeObserver = new ResizeObserver(function (entries, ro) {
|
||||
if (this !== resizeObserver) {
|
||||
println("this is not the ResizeObserver instance inside callback");
|
||||
}
|
||||
if (ro !== resizeObserver) {
|
||||
println("observer argument is not the ResizeObserver instance inside callback");
|
||||
}
|
||||
|
||||
for (let entry of entries) {
|
||||
const { width, height } = entry.contentRect;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue