1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:17:44 +00:00

LibWeb: Rename Web::Frame to Web::BrowsingContext

Our "frame" concept very closely matches what the web specs call a
"browsing context", so let's rename it to that. :^)

The "main frame" becomes the "top-level browsing context",
and "sub-frames" are now "nested browsing contexts".
This commit is contained in:
Andreas Kling 2021-05-30 12:36:53 +02:00
parent 8be98af77c
commit 4190fd2199
43 changed files with 241 additions and 241 deletions

View file

@ -26,7 +26,7 @@
#include <LibWeb/DOM/Event.h>
#include <LibWeb/DOM/Window.h>
#include <LibWeb/Origin.h>
#include <LibWeb/Page/Frame.h>
#include <LibWeb/Page/BrowsingContext.h>
#include <LibWeb/WebAssembly/WebAssemblyObject.h>
#include <LibWeb/Bindings/WindowObjectHelper.h>
@ -344,10 +344,10 @@ JS_DEFINE_NATIVE_GETTER(WindowObject::top_getter)
auto* impl = impl_from(vm, global_object);
if (!impl)
return {};
auto* this_frame = impl->document().frame();
VERIFY(this_frame);
VERIFY(this_frame->main_frame().document());
auto& top_window = this_frame->main_frame().document()->window();
auto* this_browsing_context = impl->document().browsing_context();
VERIFY(this_browsing_context);
VERIFY(this_browsing_context->top_level_browsing_context().document());
auto& top_window = this_browsing_context->top_level_browsing_context().document()->window();
return top_window.wrapper();
}
@ -356,14 +356,14 @@ JS_DEFINE_NATIVE_GETTER(WindowObject::parent_getter)
auto* impl = impl_from(vm, global_object);
if (!impl)
return {};
auto* this_frame = impl->document().frame();
VERIFY(this_frame);
if (this_frame->parent()) {
VERIFY(this_frame->parent()->document());
auto& parent_window = this_frame->parent()->document()->window();
auto* this_browsing_context = impl->document().browsing_context();
VERIFY(this_browsing_context);
if (this_browsing_context->parent()) {
VERIFY(this_browsing_context->parent()->document());
auto& parent_window = this_browsing_context->parent()->document()->window();
return parent_window.wrapper();
}
VERIFY(this_frame == &this_frame->main_frame());
VERIFY(this_browsing_context == &this_browsing_context->top_level_browsing_context());
return impl->wrapper();
}