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

LibWeb: Update top_level_browsing_context() to use navigables

This commit is contained in:
Aliaksandr Kalenik 2023-09-04 15:33:08 +02:00 committed by Andreas Kling
parent fda420875d
commit 6942bdcfce
9 changed files with 43 additions and 30 deletions

View file

@ -142,15 +142,7 @@ public:
void scroll_to(CSSPixelPoint);
void scroll_to_anchor(DeprecatedString const&);
BrowsingContext& top_level_browsing_context()
{
BrowsingContext* context = this;
while (context->parent())
context = context->parent();
return *context;
}
BrowsingContext const& top_level_browsing_context() const { return const_cast<BrowsingContext*>(this)->top_level_browsing_context(); }
JS::GCPtr<BrowsingContext> top_level_browsing_context() const;
enum class WindowType {
ExistingOrNone,