StyleValue.cpp 592 B

123456789101112131415161718192021222324252627282930
  1. #include <LibHTML/CSS/StyleValue.h>
  2. #include <LibHTML/DOM/Document.h>
  3. StyleValue::StyleValue(Type type)
  4. : m_type(type)
  5. {
  6. }
  7. StyleValue::~StyleValue()
  8. {
  9. }
  10. String IdentifierStyleValue::to_string() const
  11. {
  12. switch (id()) {
  13. case CSS::ValueID::Invalid:
  14. return "(invalid)";
  15. case CSS::ValueID::VendorSpecificLink:
  16. return "-libhtml-link";
  17. default:
  18. ASSERT_NOT_REACHED();
  19. }
  20. }
  21. Color IdentifierStyleValue::to_color(const Document& document) const
  22. {
  23. if (id() == CSS::ValueID::VendorSpecificLink)
  24. return document.link_color();
  25. return {};
  26. }