1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:48:11 +00:00

LibWeb: Convert some CSS parser *Rule classes to using pointers

Previously these were all passed around by value, but some of them
(StyleComponentValueRule and StyleBlockRule) want to include each
other as fields, so this had to change.
This commit is contained in:
Sam Atkins 2021-07-01 14:13:48 +01:00 committed by Andreas Kling
parent a558916e1f
commit 89bfde29dc
7 changed files with 47 additions and 29 deletions

View file

@ -45,7 +45,10 @@ StyleComponentValueRule::~StyleComponentValueRule() { }
StyleDeclarationRule::StyleDeclarationRule() { }
StyleDeclarationRule::~StyleDeclarationRule() { }
StyleFunctionRule::StyleFunctionRule() { }
StyleFunctionRule::StyleFunctionRule(String name)
: m_name(name)
{
}
StyleFunctionRule::~StyleFunctionRule() { }
template<class SeparatorType, class CollectionType>
@ -106,7 +109,7 @@ String QualifiedStyleRule::to_string() const
StringBuilder builder;
append_with_to_string(builder, " ", m_prelude);
builder.append(m_block.to_string());
builder.append(m_block->to_string());
return builder.to_string();
}
@ -131,10 +134,10 @@ String StyleComponentValueRule::to_string() const
builder.append(m_token.to_string());
break;
case ComponentType::Function:
builder.append(m_function.to_string());
builder.append(m_function->to_string());
break;
case ComponentType::Block:
builder.append(m_block.to_string());
builder.append(m_block->to_string());
break;
}