1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 01:47:34 +00:00

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. :^)
This commit is contained in:
Andreas Kling 2022-07-16 23:43:48 +02:00
parent 52862c72d0
commit 9b46091f38
10 changed files with 76 additions and 76 deletions

View file

@ -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 {