mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 12:38:12 +00:00
LibWeb: Remove Layout::Node::set_inline()
Now that this flag is no longer used, we can stop setting it.
This commit is contained in:
parent
8a3ca6416d
commit
a0e6882d99
12 changed files with 7 additions and 34 deletions
|
@ -304,11 +304,8 @@ RefPtr<Layout::Node> Element::create_layout_node_for_display_type(DOM::Document&
|
||||||
}
|
}
|
||||||
|
|
||||||
if (display.is_inline_outside()) {
|
if (display.is_inline_outside()) {
|
||||||
if (display.is_flow_root_inside()) {
|
if (display.is_flow_root_inside())
|
||||||
auto block = adopt_ref(*new Layout::BlockContainer(document, element, move(style)));
|
return adopt_ref(*new Layout::BlockContainer(document, element, move(style)));
|
||||||
block->set_inline(true);
|
|
||||||
return block;
|
|
||||||
}
|
|
||||||
if (display.is_flow_inside())
|
if (display.is_flow_inside())
|
||||||
return adopt_ref(*new Layout::InlineNode(document, element, move(style)));
|
return adopt_ref(*new Layout::InlineNode(document, element, move(style)));
|
||||||
|
|
||||||
|
|
|
@ -87,11 +87,7 @@ void HTMLImageElement::parse_attribute(FlyString const& name, String const& valu
|
||||||
|
|
||||||
RefPtr<Layout::Node> HTMLImageElement::create_layout_node(NonnullRefPtr<CSS::StyleProperties> style)
|
RefPtr<Layout::Node> HTMLImageElement::create_layout_node(NonnullRefPtr<CSS::StyleProperties> style)
|
||||||
{
|
{
|
||||||
auto display = style->display();
|
return adopt_ref(*new Layout::ImageBox(document(), *this, move(style), m_image_loader));
|
||||||
auto layout_node = adopt_ref(*new Layout::ImageBox(document(), *this, move(style), m_image_loader));
|
|
||||||
if (display.is_block_outside())
|
|
||||||
layout_node->set_inline(false);
|
|
||||||
return layout_node;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Gfx::Bitmap const* HTMLImageElement::bitmap() const
|
Gfx::Bitmap const* HTMLImageElement::bitmap() const
|
||||||
|
|
|
@ -65,9 +65,7 @@ RefPtr<Layout::Node> HTMLInputElement::create_layout_node(NonnullRefPtr<CSS::Sty
|
||||||
if (type_state() == TypeAttributeState::RadioButton)
|
if (type_state() == TypeAttributeState::RadioButton)
|
||||||
return adopt_ref(*new Layout::RadioButton(document(), *this, move(style)));
|
return adopt_ref(*new Layout::RadioButton(document(), *this, move(style)));
|
||||||
|
|
||||||
auto layout_node = adopt_ref(*new Layout::BlockContainer(document(), this, move(style)));
|
return adopt_ref(*new Layout::BlockContainer(document(), this, move(style)));
|
||||||
layout_node->set_inline(true);
|
|
||||||
return layout_node;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void HTMLInputElement::set_checked(bool checked, ChangeSource change_source)
|
void HTMLInputElement::set_checked(bool checked, ChangeSource change_source)
|
||||||
|
|
|
@ -20,9 +20,7 @@ HTMLLabelElement::~HTMLLabelElement() = default;
|
||||||
|
|
||||||
RefPtr<Layout::Node> HTMLLabelElement::create_layout_node(NonnullRefPtr<CSS::StyleProperties> style)
|
RefPtr<Layout::Node> HTMLLabelElement::create_layout_node(NonnullRefPtr<CSS::StyleProperties> style)
|
||||||
{
|
{
|
||||||
auto layout_node = adopt_ref(*new Layout::Label(document(), this, move(style)));
|
return adopt_ref(*new Layout::Label(document(), this, move(style)));
|
||||||
layout_node->set_inline(true);
|
|
||||||
return layout_node;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,14 +25,10 @@ HTMLProgressElement::~HTMLProgressElement() = default;
|
||||||
|
|
||||||
RefPtr<Layout::Node> HTMLProgressElement::create_layout_node(NonnullRefPtr<CSS::StyleProperties> style)
|
RefPtr<Layout::Node> HTMLProgressElement::create_layout_node(NonnullRefPtr<CSS::StyleProperties> style)
|
||||||
{
|
{
|
||||||
RefPtr<Layout::Node> layout_node;
|
|
||||||
if (style->appearance().value_or(CSS::Appearance::Auto) == CSS::Appearance::None) {
|
if (style->appearance().value_or(CSS::Appearance::Auto) == CSS::Appearance::None) {
|
||||||
layout_node = adopt_ref(*new Layout::BlockContainer(document(), this, move(style)));
|
return adopt_ref(*new Layout::BlockContainer(document(), this, move(style)));
|
||||||
layout_node->set_inline(true);
|
|
||||||
} else {
|
|
||||||
layout_node = adopt_ref(*new Layout::Progress(document(), *this, move(style)));
|
|
||||||
}
|
}
|
||||||
return layout_node;
|
return adopt_ref(*new Layout::Progress(document(), *this, move(style)));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool HTMLProgressElement::using_system_appearance() const
|
bool HTMLProgressElement::using_system_appearance() const
|
||||||
|
|
|
@ -13,7 +13,6 @@ namespace Web::Layout {
|
||||||
BreakNode::BreakNode(DOM::Document& document, HTML::HTMLBRElement& element, NonnullRefPtr<CSS::StyleProperties> style)
|
BreakNode::BreakNode(DOM::Document& document, HTML::HTMLBRElement& element, NonnullRefPtr<CSS::StyleProperties> style)
|
||||||
: Layout::NodeWithStyleAndBoxModelMetrics(document, &element, move(style))
|
: Layout::NodeWithStyleAndBoxModelMetrics(document, &element, move(style))
|
||||||
{
|
{
|
||||||
set_inline(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
BreakNode::~BreakNode() = default;
|
BreakNode::~BreakNode() = default;
|
||||||
|
|
|
@ -17,7 +17,6 @@ namespace Web::Layout {
|
||||||
InlineNode::InlineNode(DOM::Document& document, DOM::Element* element, NonnullRefPtr<CSS::StyleProperties> style)
|
InlineNode::InlineNode(DOM::Document& document, DOM::Element* element, NonnullRefPtr<CSS::StyleProperties> style)
|
||||||
: Layout::NodeWithStyleAndBoxModelMetrics(document, element, move(style))
|
: Layout::NodeWithStyleAndBoxModelMetrics(document, element, move(style))
|
||||||
{
|
{
|
||||||
set_inline(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
InlineNode::~InlineNode() = default;
|
InlineNode::~InlineNode() = default;
|
||||||
|
|
|
@ -579,8 +579,6 @@ String Node::debug_description() const
|
||||||
return builder.to_string();
|
return builder.to_string();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Node::set_inline(bool) { }
|
|
||||||
|
|
||||||
bool Node::is_inline() const
|
bool Node::is_inline() const
|
||||||
{
|
{
|
||||||
if (!has_style()) {
|
if (!has_style()) {
|
||||||
|
|
|
@ -68,9 +68,6 @@ public:
|
||||||
|
|
||||||
virtual bool can_have_children() const { return true; }
|
virtual bool can_have_children() const { return true; }
|
||||||
|
|
||||||
// FIXME: Remove this.
|
|
||||||
void set_inline(bool);
|
|
||||||
|
|
||||||
bool is_inline() const;
|
bool is_inline() const;
|
||||||
bool is_inline_block() const;
|
bool is_inline_block() const;
|
||||||
|
|
||||||
|
|
|
@ -14,8 +14,6 @@ namespace Web::Layout {
|
||||||
ReplacedBox::ReplacedBox(DOM::Document& document, DOM::Element& element, NonnullRefPtr<CSS::StyleProperties> style)
|
ReplacedBox::ReplacedBox(DOM::Document& document, DOM::Element& element, NonnullRefPtr<CSS::StyleProperties> style)
|
||||||
: Box(document, &element, move(style))
|
: Box(document, &element, move(style))
|
||||||
{
|
{
|
||||||
// FIXME: Allow non-inline replaced elements.
|
|
||||||
set_inline(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ReplacedBox::~ReplacedBox() = default;
|
ReplacedBox::~ReplacedBox() = default;
|
||||||
|
|
|
@ -18,7 +18,6 @@ namespace Web::Layout {
|
||||||
TextNode::TextNode(DOM::Document& document, DOM::Text& text)
|
TextNode::TextNode(DOM::Document& document, DOM::Text& text)
|
||||||
: Node(document, &text)
|
: Node(document, &text)
|
||||||
{
|
{
|
||||||
set_inline(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TextNode::~TextNode() = default;
|
TextNode::~TextNode() = default;
|
||||||
|
|
|
@ -254,8 +254,6 @@ void TreeBuilder::create_layout_tree(DOM::Node& dom_node, TreeBuilder::Context&
|
||||||
int child_index = layout_node->parent()->index_of_child<ListItemBox>(*layout_node).value();
|
int child_index = layout_node->parent()->index_of_child<ListItemBox>(*layout_node).value();
|
||||||
auto marker_style = style_computer.compute_style(element, CSS::Selector::PseudoElement::Marker);
|
auto marker_style = style_computer.compute_style(element, CSS::Selector::PseudoElement::Marker);
|
||||||
auto list_item_marker = adopt_ref(*new ListItemMarkerBox(document, layout_node->computed_values().list_style_type(), child_index + 1, *marker_style));
|
auto list_item_marker = adopt_ref(*new ListItemMarkerBox(document, layout_node->computed_values().list_style_type(), child_index + 1, *marker_style));
|
||||||
if (layout_node->first_child())
|
|
||||||
list_item_marker->set_inline(layout_node->first_child()->is_inline());
|
|
||||||
static_cast<ListItemBox&>(*layout_node).set_marker(list_item_marker);
|
static_cast<ListItemBox&>(*layout_node).set_marker(list_item_marker);
|
||||||
element.set_pseudo_element_node({}, CSS::Selector::PseudoElement::Marker, list_item_marker);
|
element.set_pseudo_element_node({}, CSS::Selector::PseudoElement::Marker, list_item_marker);
|
||||||
layout_node->append_child(move(list_item_marker));
|
layout_node->append_child(move(list_item_marker));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue