forked from LadybirdBrowser/ladybird
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LibWeb: Store final box model metrics in paint tree, not layout tree
This was a weird case of layout results being stored in the layout tree instead of in the paint tree like everything else.
- Loading branch information
1 parent
dcfc552
commit fadf0a2
Showing
8 changed files
with
65 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
Libraries/LibWeb/Layout/BoxModelMetrics.cpp → ...aries/LibWeb/Painting/BoxModelMetrics.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
/* | ||
* Copyright (c) 2018-2020, Andreas Kling <[email protected]> | ||
* Copyright (c) 2018-2025, Andreas Kling <[email protected]> | ||
* | ||
* SPDX-License-Identifier: BSD-2-Clause | ||
*/ | ||
|
||
#include <LibWeb/Layout/BoxModelMetrics.h> | ||
#include <LibWeb/Painting/BoxModelMetrics.h> | ||
|
||
namespace Web::Layout { | ||
namespace Web::Painting { | ||
|
||
PixelBox BoxModelMetrics::margin_box() const | ||
{ | ||
|
5 changes: 2 additions & 3 deletions
5
Libraries/LibWeb/Layout/BoxModelMetrics.h → Libraries/LibWeb/Painting/BoxModelMetrics.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,14 @@ | ||
/* | ||
* Copyright (c) 2018-2020, Andreas Kling <[email protected]> | ||
* Copyright (c) 2018-2025, Andreas Kling <[email protected]> | ||
* | ||
* SPDX-License-Identifier: BSD-2-Clause | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <LibGfx/Size.h> | ||
#include <LibWeb/PixelUnits.h> | ||
|
||
namespace Web::Layout { | ||
namespace Web::Painting { | ||
|
||
struct PixelBox { | ||
CSSPixels top { 0 }; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* | ||
* Copyright (c) 2022, Andreas Kling <[email protected]> | ||
* Copyright (c) 2022-2025, Andreas Kling <[email protected]> | ||
* Copyright (c) 2024, Aliaksandr Kalenik <[email protected]> | ||
* | ||
* SPDX-License-Identifier: BSD-2-Clause | ||
|
@@ -13,6 +13,7 @@ | |
#include <LibWeb/Painting/BackgroundPainting.h> | ||
#include <LibWeb/Painting/BorderPainting.h> | ||
#include <LibWeb/Painting/BorderRadiusCornerClipper.h> | ||
#include <LibWeb/Painting/BoxModelMetrics.h> | ||
#include <LibWeb/Painting/ClipFrame.h> | ||
#include <LibWeb/Painting/ClippableAndScrollable.h> | ||
#include <LibWeb/Painting/Paintable.h> | ||
|
@@ -49,7 +50,8 @@ class PaintableBox : public Paintable | |
Layout::NodeWithStyleAndBoxModelMetrics& layout_node_with_style_and_box_metrics() { return static_cast<Layout::NodeWithStyleAndBoxModelMetrics&>(Paintable::layout_node()); } | ||
Layout::NodeWithStyleAndBoxModelMetrics const& layout_node_with_style_and_box_metrics() const { return static_cast<Layout::NodeWithStyleAndBoxModelMetrics const&>(Paintable::layout_node()); } | ||
|
||
auto const& box_model() const { return layout_node_with_style_and_box_metrics().box_model(); } | ||
auto& box_model() { return m_box_model; } | ||
auto const& box_model() const { return m_box_model; } | ||
|
||
struct OverflowData { | ||
CSSPixelRect scrollable_overflow_rect; | ||
|
@@ -306,6 +308,8 @@ class PaintableBox : public Paintable | |
|
||
RefPtr<CSS::GridTrackSizeListStyleValue> m_used_values_for_grid_template_columns; | ||
RefPtr<CSS::GridTrackSizeListStyleValue> m_used_values_for_grid_template_rows; | ||
|
||
BoxModelMetrics m_box_model; | ||
}; | ||
|
||
class PaintableWithLines : public PaintableBox { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters