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

LibWeb: Increase clarity with CSS token debug logging

Had to adjust some places that were using Token.to_string() for
non-debug-logging purposes. Changed its name to to_debug_string()
to make the usage clearer.
This commit is contained in:
Sam Atkins 2021-07-07 21:29:24 +01:00 committed by Andreas Kling
parent e5ac5e1fab
commit fabc09a593
5 changed files with 29 additions and 27 deletions

View file

@ -70,7 +70,7 @@ void append_with_to_string(StringBuilder& builder, SeparatorType& separator, Col
first = false;
else
builder.append(separator);
builder.append(item.to_string());
builder.append(item.to_debug_string());
}
}
@ -133,18 +133,21 @@ String StyleBlockRule::to_string() const
return builder.to_string();
}
String StyleComponentValueRule::to_string() const
String StyleComponentValueRule::to_debug_string() const
{
StringBuilder builder;
switch (m_type) {
case ComponentType::Token:
builder.append(m_token.to_string());
builder.append("Token: ");
builder.append(m_token.to_debug_string());
break;
case ComponentType::Function:
builder.append("Function: ");
builder.append(m_function->to_string());
break;
case ComponentType::Block:
builder.append("Block: ");
builder.append(m_block->to_string());
break;
}