mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 22:17:44 +00:00
LibWeb: Rename "position" enum to "positioning"
The postitioning enum values are used by the position CSS property. Unfortunately, the prior naming clashes with the CSS Values-4 type named position, which will be implemented in a later commit.
This commit is contained in:
parent
60640fe38d
commit
6602b1ddb1
10 changed files with 23 additions and 23 deletions
|
@ -1204,7 +1204,7 @@ void FormattingContext::compute_height_for_absolutely_positioned_replaced_elemen
|
|||
// https://www.w3.org/TR/css-position-3/#relpos-insets
|
||||
void FormattingContext::compute_inset(NodeWithStyleAndBoxModelMetrics const& box)
|
||||
{
|
||||
if (box.computed_values().position() != CSS::Position::Relative)
|
||||
if (box.computed_values().position() != CSS::Positioning::Relative)
|
||||
return;
|
||||
|
||||
auto resolve_two_opposing_insets = [&](CSS::LengthPercentage const& computed_first, CSS::LengthPercentage const& computed_second, CSSPixels& used_start, CSSPixels& used_end, CSSPixels reference_for_percentage) {
|
||||
|
@ -1486,7 +1486,7 @@ CSS::Length FormattingContext::calculate_inner_height(Layout::Box const& box, Av
|
|||
auto const* containing_block = box.non_anonymous_containing_block();
|
||||
auto const& containing_block_state = m_state.get(*containing_block);
|
||||
auto height_of_containing_block = containing_block_state.content_height();
|
||||
if (box.computed_values().position() == CSS::Position::Absolute) {
|
||||
if (box.computed_values().position() == CSS::Positioning::Absolute) {
|
||||
// https://www.w3.org/TR/css-position-3/#def-cb
|
||||
// If the box has position: absolute, then the containing block is formed by the padding edge of the ancestor
|
||||
height_of_containing_block += containing_block_state.padding_top + containing_block_state.padding_bottom;
|
||||
|
|
|
@ -163,7 +163,7 @@ void LayoutState::resolve_relative_positions(Vector<Painting::PaintableWithLines
|
|||
offset = used_values.offset;
|
||||
}
|
||||
// Apply relative position inset if appropriate.
|
||||
if (node.computed_values().position() == CSS::Position::Relative && is<NodeWithStyleAndBoxModelMetrics>(node)) {
|
||||
if (node.computed_values().position() == CSS::Positioning::Relative && is<NodeWithStyleAndBoxModelMetrics>(node)) {
|
||||
auto& inset = static_cast<NodeWithStyleAndBoxModelMetrics const&>(node).box_model().inset;
|
||||
offset.translate_by(inset.left, inset.top);
|
||||
}
|
||||
|
@ -184,7 +184,7 @@ void LayoutState::resolve_relative_positions(Vector<Painting::PaintableWithLines
|
|||
break;
|
||||
if (!ancestor->display().is_inline_outside() || !ancestor->display().is_flow_inside())
|
||||
break;
|
||||
if (ancestor->computed_values().position() == CSS::Position::Relative) {
|
||||
if (ancestor->computed_values().position() == CSS::Positioning::Relative) {
|
||||
auto const& ancestor_node = static_cast<Layout::NodeWithStyleAndBoxModelMetrics const&>(*ancestor);
|
||||
auto const& inset = ancestor_node.box_model().inset;
|
||||
offset.translate_by(inset.left, inset.top);
|
||||
|
|
|
@ -75,7 +75,7 @@ bool Node::is_out_of_flow(FormattingContext const& formatting_context) const
|
|||
|
||||
bool Node::can_contain_boxes_with_position_absolute() const
|
||||
{
|
||||
if (computed_values().position() != CSS::Position::Static)
|
||||
if (computed_values().position() != CSS::Positioning::Static)
|
||||
return true;
|
||||
|
||||
if (is<Viewport>(*this))
|
||||
|
@ -110,7 +110,7 @@ Box const* Node::containing_block() const
|
|||
auto position = computed_values().position();
|
||||
|
||||
// https://drafts.csswg.org/css-position-3/#absolute-cb
|
||||
if (position == CSS::Position::Absolute) {
|
||||
if (position == CSS::Positioning::Absolute) {
|
||||
auto const* ancestor = parent();
|
||||
while (ancestor && !ancestor->can_contain_boxes_with_position_absolute())
|
||||
ancestor = ancestor->parent();
|
||||
|
@ -119,7 +119,7 @@ Box const* Node::containing_block() const
|
|||
return static_cast<Box const*>(ancestor);
|
||||
}
|
||||
|
||||
if (position == CSS::Position::Fixed)
|
||||
if (position == CSS::Positioning::Fixed)
|
||||
return &root();
|
||||
|
||||
return nearest_ancestor_capable_of_forming_a_containing_block(*this);
|
||||
|
@ -157,14 +157,14 @@ bool Node::establishes_stacking_context() const
|
|||
auto position = computed_values().position();
|
||||
|
||||
// Element with a position value absolute or relative and z-index value other than auto.
|
||||
if (position == CSS::Position::Absolute || position == CSS::Position::Relative) {
|
||||
if (position == CSS::Positioning::Absolute || position == CSS::Positioning::Relative) {
|
||||
if (computed_values().z_index().has_value()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// Element with a position value fixed or sticky.
|
||||
if (position == CSS::Position::Fixed || position == CSS::Position::Sticky)
|
||||
if (position == CSS::Positioning::Fixed || position == CSS::Positioning::Sticky)
|
||||
return true;
|
||||
|
||||
if (!computed_values().transformations().is_empty())
|
||||
|
@ -273,7 +273,7 @@ bool Node::is_floating() const
|
|||
|
||||
bool Node::is_positioned() const
|
||||
{
|
||||
return has_style() && computed_values().position() != CSS::Position::Static;
|
||||
return has_style() && computed_values().position() != CSS::Positioning::Static;
|
||||
}
|
||||
|
||||
bool Node::is_absolutely_positioned() const
|
||||
|
@ -281,7 +281,7 @@ bool Node::is_absolutely_positioned() const
|
|||
if (!has_style())
|
||||
return false;
|
||||
auto position = computed_values().position();
|
||||
return position == CSS::Position::Absolute || position == CSS::Position::Fixed;
|
||||
return position == CSS::Positioning::Absolute || position == CSS::Positioning::Fixed;
|
||||
}
|
||||
|
||||
bool Node::is_fixed_position() const
|
||||
|
@ -289,7 +289,7 @@ bool Node::is_fixed_position() const
|
|||
if (!has_style())
|
||||
return false;
|
||||
auto position = computed_values().position();
|
||||
return position == CSS::Position::Fixed;
|
||||
return position == CSS::Positioning::Fixed;
|
||||
}
|
||||
|
||||
NodeWithStyle::NodeWithStyle(DOM::Document& document, DOM::Node* node, NonnullRefPtr<CSS::StyleProperties> computed_style)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue