2019-10-06 10:25:08 +02:00
|
|
|
#include <LibHTML/CSS/StyleValue.h>
|
|
|
|
#include <LibHTML/DOM/Document.h>
|
2019-06-22 21:48:21 +02:00
|
|
|
|
|
|
|
StyleValue::StyleValue(Type type)
|
|
|
|
: m_type(type)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
StyleValue::~StyleValue()
|
|
|
|
{
|
|
|
|
}
|
2019-10-06 10:25:08 +02:00
|
|
|
|
|
|
|
String IdentifierStyleValue::to_string() const
|
|
|
|
{
|
|
|
|
switch (id()) {
|
|
|
|
case CSS::ValueID::Invalid:
|
|
|
|
return "(invalid)";
|
|
|
|
case CSS::ValueID::VendorSpecificLink:
|
|
|
|
return "-libhtml-link";
|
|
|
|
default:
|
|
|
|
ASSERT_NOT_REACHED();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Color IdentifierStyleValue::to_color(const Document& document) const
|
|
|
|
{
|
|
|
|
if (id() == CSS::ValueID::VendorSpecificLink)
|
|
|
|
return document.link_color();
|
|
|
|
return {};
|
|
|
|
}
|