1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-16 20:15:07 +00:00

LibHTML: Parse link, alink and vlink in <body> and pass to Document

This patch adds HTMLBodyElement::parse_attribute() where we extract the
link colors and stash them away on Document.
This commit is contained in:
Andreas Kling 2019-10-06 10:11:54 +02:00
parent 772718b8d8
commit 83a6474d82
4 changed files with 48 additions and 1 deletions

View file

@ -99,7 +99,7 @@ Color Document::background_color() const
if (!background_color.has_value() || !background_color.value()->is_color())
return Color::White;
return background_color.value()->to_color();
return background_color.value()->to_color(*this);
}
URL Document::complete_url(const String& string) const
@ -130,3 +130,18 @@ RefPtr<LayoutNode> Document::create_layout_node(const StyleResolver&, const Styl
{
return adopt(*new LayoutDocument(*this, StyleProperties::create()));
}
void Document::set_link_color(Color color)
{
m_link_color = color;
}
void Document::set_active_link_color(Color color)
{
m_active_link_color = color;
}
void Document::set_visited_link_color(Color color)
{
m_visited_link_color = color;
}