1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:47:45 +00:00

LibWeb: Move <display-foo> definitions into Enums.json

This eliminates a fair bit of boilerplate.
This commit is contained in:
Sam Atkins 2023-09-04 17:39:15 +01:00 committed by Sam Atkins
parent 3b0980c89f
commit 125d161b3f
10 changed files with 182 additions and 313 deletions

View file

@ -830,7 +830,7 @@ CSS::Display Node::display() const
{
if (!has_style()) {
// NOTE: No style means this is dumb text content.
return CSS::Display(CSS::Display::Outside::Inline, CSS::Display::Inside::Flow);
return CSS::Display(CSS::DisplayOutside::Inline, CSS::DisplayInside::Flow);
}
return computed_values().display();
@ -856,7 +856,7 @@ bool Node::is_inline_table() const
JS::NonnullGCPtr<NodeWithStyle> NodeWithStyle::create_anonymous_wrapper() const
{
auto wrapper = heap().allocate_without_realm<BlockContainer>(const_cast<DOM::Document&>(document()), nullptr, m_computed_values.clone_inherited_values());
static_cast<CSS::MutableComputedValues&>(wrapper->m_computed_values).set_display(CSS::Display(CSS::Display::Outside::Block, CSS::Display::Inside::Flow));
static_cast<CSS::MutableComputedValues&>(wrapper->m_computed_values).set_display(CSS::Display(CSS::DisplayOutside::Block, CSS::DisplayInside::Flow));
wrapper->m_font = m_font;
wrapper->m_line_height = m_line_height;
return *wrapper;