mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 17:55:07 +02:00
This reduces the recompilation cascade when Document.h is modified. Add explicit includes to files that relied on the transitive dependency.
32 lines
768 B
C++
32 lines
768 B
C++
/*
|
|
* Copyright (c) 2024, Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include <LibGC/Heap.h>
|
|
#include <LibGC/WeakInlines.h>
|
|
#include <LibWeb/Painting/PaintableBox.h>
|
|
#include <LibWeb/Painting/ScrollFrame.h>
|
|
|
|
namespace Web::Painting {
|
|
|
|
ScrollFrame::ScrollFrame(PaintableBox const& paintable_box, size_t id, bool sticky, RefPtr<ScrollFrame const> parent)
|
|
: m_paintable_box(paintable_box)
|
|
, m_id(id)
|
|
, m_sticky(sticky)
|
|
, m_parent(move(parent))
|
|
{
|
|
}
|
|
|
|
RefPtr<ScrollFrame const> ScrollFrame::nearest_scrolling_ancestor() const
|
|
{
|
|
for (auto ancestor = m_parent; ancestor; ancestor = ancestor->parent()) {
|
|
if (!ancestor->is_sticky())
|
|
return ancestor;
|
|
}
|
|
return nullptr;
|
|
}
|
|
|
|
}
|