1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 08:27:46 +00:00

LibWeb: Add BlockFormattingContext::root()

The CSS spec uses the name "block formatting context root" when talking
about a box that establishes a BFC. So let's call it BFC::root() in our
code as well, instead of the less specific BFC::context_box().
This commit is contained in:
Andreas Kling 2021-10-06 19:47:10 +02:00
parent bce3bf9f1e
commit 5408913b22
2 changed files with 17 additions and 12 deletions

View file

@ -12,6 +12,7 @@
namespace Web::Layout {
// https://drafts.csswg.org/css-display/#block-formatting-context
class BlockFormattingContext : public FormattingContext {
public:
explicit BlockFormattingContext(Box&, FormattingContext* parent);
@ -27,6 +28,10 @@ public:
static float compute_theoretical_height(const Box&);
void compute_width(Box&);
// https://drafts.csswg.org/css-display/#block-formatting-context-root
Box& root() { return context_box(); }
Box const& root() const { return context_box(); }
protected:
static void compute_height(Box&);
void compute_position(Box&);