summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/Layout/LineBuilder.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2022-07-16 23:43:48 +0200
committerAndreas Kling <kling@serenityos.org>2022-07-17 14:11:37 +0200
commit9b46091f389c3239f455c8dbc46a25f4bc54b2fe (patch)
treef5ed85a06b20a4c3c938e7d7a6c1520f3b07cb6f /Userland/Libraries/LibWeb/Layout/LineBuilder.cpp
parent52862c72d00e50ae51197e18917b1950643b5f08 (diff)
downloadserenity-9b46091f389c3239f455c8dbc46a25f4bc54b2fe.zip
LibWeb: Rename LayoutState::NodeState => LayoutState::UsedValues
This object contains all the CSS "used values" as seen during the layout process, so calling it "used values" seems appropriate. :^)
Diffstat (limited to 'Userland/Libraries/LibWeb/Layout/LineBuilder.cpp')
-rw-r--r--Userland/Libraries/LibWeb/Layout/LineBuilder.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/Userland/Libraries/LibWeb/Layout/LineBuilder.cpp b/Userland/Libraries/LibWeb/Layout/LineBuilder.cpp
index dfbc906e84..be03f1222d 100644
--- a/Userland/Libraries/LibWeb/Layout/LineBuilder.cpp
+++ b/Userland/Libraries/LibWeb/Layout/LineBuilder.cpp
@@ -9,10 +9,10 @@
namespace Web::Layout {
-LineBuilder::LineBuilder(InlineFormattingContext& context, LayoutState& formatting_state, LayoutMode layout_mode)
+LineBuilder::LineBuilder(InlineFormattingContext& context, LayoutState& layout_state, LayoutMode layout_mode)
: m_context(context)
- , m_formatting_state(formatting_state)
- , m_containing_block_state(formatting_state.get_mutable(context.containing_block()))
+ , m_layout_state(layout_state)
+ , m_containing_block_state(layout_state.get_mutable(context.containing_block()))
, m_layout_mode(layout_mode)
{
begin_new_line(false);
@@ -50,7 +50,7 @@ LineBox& LineBuilder::ensure_last_line_box()
void LineBuilder::append_box(Box const& box, float leading_size, float trailing_size, float leading_margin, float trailing_margin)
{
- auto& box_state = m_formatting_state.get_mutable(box);
+ auto& box_state = m_layout_state.get_mutable(box);
auto& line_box = ensure_last_line_box();
line_box.add_fragment(box, 0, 0, leading_size, trailing_size, leading_margin, trailing_margin, box_state.content_width, box_state.content_height, box_state.border_box_top(), box_state.border_box_bottom());
m_max_height_on_current_line = max(m_max_height_on_current_line, box_state.border_box_height());
@@ -147,7 +147,7 @@ void LineBuilder::update_last_line()
fragment_baseline = font_metrics.ascent;
} else {
auto const& box = verify_cast<Layout::Box>(fragment.layout_node());
- fragment_baseline = box_baseline(m_formatting_state, box);
+ fragment_baseline = box_baseline(m_layout_state, box);
}
fragment_baseline += half_leading;
@@ -213,7 +213,7 @@ void LineBuilder::update_last_line()
{
// FIXME: Support inline-table elements.
if (fragment.layout_node().is_replaced_box() || fragment.layout_node().is_inline_block()) {
- auto const& fragment_box_state = m_formatting_state.get(static_cast<Box const&>(fragment.layout_node()));
+ auto const& fragment_box_state = m_layout_state.get(static_cast<Box const&>(fragment.layout_node()));
top_of_inline_box = fragment.offset().y() - fragment_box_state.margin_box_top();
bottom_of_inline_box = fragment.offset().y() + fragment_box_state.content_height + fragment_box_state.margin_box_bottom();
} else {