mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
LibWeb: Delete unused functions in FormattingContext
This commit is contained in:
parent
a8c1d12e84
commit
a073e35562
Notes:
github-actions[bot]
2024-11-11 19:21:37 +00:00
Author: https://github.com/kalenikaliaksandr Commit: https://github.com/LadybirdBrowser/ladybird/commit/a073e355620 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2285
2 changed files with 0 additions and 69 deletions
|
@ -1640,21 +1640,6 @@ CSSPixels FormattingContext::containing_block_width_for(NodeWithStyleAndBoxModel
|
||||||
VERIFY_NOT_REACHED();
|
VERIFY_NOT_REACHED();
|
||||||
}
|
}
|
||||||
|
|
||||||
CSSPixels FormattingContext::containing_block_height_for(NodeWithStyleAndBoxModelMetrics const& node) const
|
|
||||||
{
|
|
||||||
auto const& used_values = m_state.get(node);
|
|
||||||
|
|
||||||
switch (used_values.height_constraint) {
|
|
||||||
case SizeConstraint::MinContent:
|
|
||||||
return 0;
|
|
||||||
case SizeConstraint::MaxContent:
|
|
||||||
return CSSPixels::max();
|
|
||||||
case SizeConstraint::None:
|
|
||||||
return used_values.containing_block_used_values()->content_height();
|
|
||||||
}
|
|
||||||
VERIFY_NOT_REACHED();
|
|
||||||
}
|
|
||||||
|
|
||||||
// https://drafts.csswg.org/css-sizing-3/#stretch-fit-size
|
// https://drafts.csswg.org/css-sizing-3/#stretch-fit-size
|
||||||
CSSPixels FormattingContext::calculate_stretch_fit_width(Box const& box, AvailableSize const& available_width) const
|
CSSPixels FormattingContext::calculate_stretch_fit_width(Box const& box, AvailableSize const& available_width) const
|
||||||
{
|
{
|
||||||
|
@ -1829,46 +1814,6 @@ CSSPixelRect FormattingContext::margin_box_rect(LayoutState::UsedValues const& u
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
CSSPixelRect FormattingContext::margin_box_rect(Box const& box) const
|
|
||||||
{
|
|
||||||
return margin_box_rect(m_state.get(box));
|
|
||||||
}
|
|
||||||
|
|
||||||
CSSPixelRect FormattingContext::border_box_rect(LayoutState::UsedValues const& used_values) const
|
|
||||||
{
|
|
||||||
return {
|
|
||||||
used_values.offset.translated(-used_values.border_box_left(), -used_values.border_box_top()),
|
|
||||||
{
|
|
||||||
used_values.border_box_left() + used_values.content_width() + used_values.border_box_right(),
|
|
||||||
used_values.border_box_top() + used_values.content_height() + used_values.border_box_bottom(),
|
|
||||||
},
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
CSSPixelRect FormattingContext::border_box_rect(Box const& box) const
|
|
||||||
{
|
|
||||||
return border_box_rect(m_state.get(box));
|
|
||||||
}
|
|
||||||
|
|
||||||
CSSPixelRect FormattingContext::border_box_rect_in_ancestor_coordinate_space(LayoutState::UsedValues const& used_values, Box const& ancestor_box) const
|
|
||||||
{
|
|
||||||
auto rect = border_box_rect(used_values);
|
|
||||||
if (&used_values.node() == &ancestor_box)
|
|
||||||
return rect;
|
|
||||||
for (auto const* current = used_values.containing_block_used_values(); current; current = current->containing_block_used_values()) {
|
|
||||||
if (¤t->node() == &ancestor_box)
|
|
||||||
return rect;
|
|
||||||
rect.translate_by(current->offset);
|
|
||||||
}
|
|
||||||
// If we get here, ancestor_box was not a containing block ancestor of `box`!
|
|
||||||
VERIFY_NOT_REACHED();
|
|
||||||
}
|
|
||||||
|
|
||||||
CSSPixelRect FormattingContext::border_box_rect_in_ancestor_coordinate_space(Box const& box, Box const& ancestor_box) const
|
|
||||||
{
|
|
||||||
return border_box_rect_in_ancestor_coordinate_space(m_state.get(box), ancestor_box);
|
|
||||||
}
|
|
||||||
|
|
||||||
CSSPixelRect FormattingContext::content_box_rect(Box const& box) const
|
CSSPixelRect FormattingContext::content_box_rect(Box const& box) const
|
||||||
{
|
{
|
||||||
return content_box_rect(m_state.get(box));
|
return content_box_rect(m_state.get(box));
|
||||||
|
@ -1893,11 +1838,6 @@ CSSPixelRect FormattingContext::content_box_rect_in_ancestor_coordinate_space(La
|
||||||
VERIFY_NOT_REACHED();
|
VERIFY_NOT_REACHED();
|
||||||
}
|
}
|
||||||
|
|
||||||
CSSPixelRect FormattingContext::content_box_rect_in_ancestor_coordinate_space(Box const& box, Box const& ancestor_box) const
|
|
||||||
{
|
|
||||||
return content_box_rect_in_ancestor_coordinate_space(m_state.get(box), ancestor_box);
|
|
||||||
}
|
|
||||||
|
|
||||||
CSSPixelRect FormattingContext::margin_box_rect_in_ancestor_coordinate_space(LayoutState::UsedValues const& used_values, Box const& ancestor_box) const
|
CSSPixelRect FormattingContext::margin_box_rect_in_ancestor_coordinate_space(LayoutState::UsedValues const& used_values, Box const& ancestor_box) const
|
||||||
{
|
{
|
||||||
auto rect = margin_box_rect(used_values);
|
auto rect = margin_box_rect(used_values);
|
||||||
|
|
|
@ -50,7 +50,6 @@ public:
|
||||||
FormattingContext const* parent() const { return m_parent; }
|
FormattingContext const* parent() const { return m_parent; }
|
||||||
|
|
||||||
Type type() const { return m_type; }
|
Type type() const { return m_type; }
|
||||||
bool is_block_formatting_context() const { return type() == Type::Block; }
|
|
||||||
|
|
||||||
virtual bool inhibits_floating() const { return false; }
|
virtual bool inhibits_floating() const { return false; }
|
||||||
|
|
||||||
|
@ -82,24 +81,16 @@ public:
|
||||||
virtual CSSPixels greatest_child_width(Box const&) const;
|
virtual CSSPixels greatest_child_width(Box const&) const;
|
||||||
|
|
||||||
[[nodiscard]] CSSPixelRect absolute_content_rect(Box const&) const;
|
[[nodiscard]] CSSPixelRect absolute_content_rect(Box const&) const;
|
||||||
[[nodiscard]] CSSPixelRect absolute_content_rect(LayoutState::UsedValues const&) const;
|
|
||||||
[[nodiscard]] CSSPixelRect margin_box_rect(Box const&) const;
|
|
||||||
[[nodiscard]] CSSPixelRect margin_box_rect_in_ancestor_coordinate_space(Box const&, Box const& ancestor_box) const;
|
[[nodiscard]] CSSPixelRect margin_box_rect_in_ancestor_coordinate_space(Box const&, Box const& ancestor_box) const;
|
||||||
[[nodiscard]] CSSPixelRect margin_box_rect(LayoutState::UsedValues const&) const;
|
[[nodiscard]] CSSPixelRect margin_box_rect(LayoutState::UsedValues const&) const;
|
||||||
[[nodiscard]] CSSPixelRect margin_box_rect_in_ancestor_coordinate_space(LayoutState::UsedValues const&, Box const& ancestor_box) const;
|
[[nodiscard]] CSSPixelRect margin_box_rect_in_ancestor_coordinate_space(LayoutState::UsedValues const&, Box const& ancestor_box) const;
|
||||||
[[nodiscard]] CSSPixelRect border_box_rect(Box const&) const;
|
|
||||||
[[nodiscard]] CSSPixelRect border_box_rect(LayoutState::UsedValues const&) const;
|
|
||||||
[[nodiscard]] CSSPixelRect border_box_rect_in_ancestor_coordinate_space(Box const&, Box const& ancestor_box) const;
|
|
||||||
[[nodiscard]] CSSPixelRect border_box_rect_in_ancestor_coordinate_space(LayoutState::UsedValues const&, Box const& ancestor_box) const;
|
|
||||||
[[nodiscard]] CSSPixelRect content_box_rect(Box const&) const;
|
[[nodiscard]] CSSPixelRect content_box_rect(Box const&) const;
|
||||||
[[nodiscard]] CSSPixelRect content_box_rect(LayoutState::UsedValues const&) const;
|
[[nodiscard]] CSSPixelRect content_box_rect(LayoutState::UsedValues const&) const;
|
||||||
[[nodiscard]] CSSPixelRect content_box_rect_in_ancestor_coordinate_space(Box const&, Box const& ancestor_box) const;
|
|
||||||
[[nodiscard]] CSSPixelRect content_box_rect_in_ancestor_coordinate_space(LayoutState::UsedValues const&, Box const& ancestor_box) const;
|
[[nodiscard]] CSSPixelRect content_box_rect_in_ancestor_coordinate_space(LayoutState::UsedValues const&, Box const& ancestor_box) const;
|
||||||
[[nodiscard]] CSSPixels box_baseline(Box const&) const;
|
[[nodiscard]] CSSPixels box_baseline(Box const&) const;
|
||||||
[[nodiscard]] CSSPixelRect content_box_rect_in_static_position_ancestor_coordinate_space(Box const&, Box const& ancestor_box) const;
|
[[nodiscard]] CSSPixelRect content_box_rect_in_static_position_ancestor_coordinate_space(Box const&, Box const& ancestor_box) const;
|
||||||
|
|
||||||
[[nodiscard]] CSSPixels containing_block_width_for(NodeWithStyleAndBoxModelMetrics const&) const;
|
[[nodiscard]] CSSPixels containing_block_width_for(NodeWithStyleAndBoxModelMetrics const&) const;
|
||||||
[[nodiscard]] CSSPixels containing_block_height_for(NodeWithStyleAndBoxModelMetrics const&) const;
|
|
||||||
|
|
||||||
[[nodiscard]] CSSPixels calculate_stretch_fit_width(Box const&, AvailableSize const&) const;
|
[[nodiscard]] CSSPixels calculate_stretch_fit_width(Box const&, AvailableSize const&) const;
|
||||||
[[nodiscard]] CSSPixels calculate_stretch_fit_height(Box const&, AvailableSize const&) const;
|
[[nodiscard]] CSSPixels calculate_stretch_fit_height(Box const&, AvailableSize const&) const;
|
||||||
|
|
Loading…
Reference in a new issue