LibWeb: Respect the document's link_color for Linktext identifiers

This commit is contained in:
implicitfield 2023-11-18 19:50:06 +04:00 committed by Andreas Kling
parent ec190baa55
commit 7a766bdb83
3 changed files with 13 additions and 3 deletions

View file

@ -0,0 +1,4 @@
<!doctype html>
<link rel="match" href="reference/body-link-attribute-ref.html" />
<body link="#FF0000">
<a href="about:blank">link

View file

@ -0,0 +1,8 @@
<!doctype html>
<link rel="match" href="reference/body-link-attribute.html-ref" />
<style>
a {
color: #FF0000;
}
</style>
<a href="about:blank">link

View file

@ -194,8 +194,6 @@ Color IdentifierStyleValue::to_color(Optional<Layout::NodeWithStyle const&> node
return SystemColor::highlight();
case ValueID::Highlighttext:
return SystemColor::highlight_text();
case ValueID::Linktext:
return SystemColor::link_text();
case ValueID::Mark:
return SystemColor::mark();
case ValueID::Marktext:
@ -216,7 +214,7 @@ Color IdentifierStyleValue::to_color(Optional<Layout::NodeWithStyle const&> node
}
auto& document = node->document();
if (id() == CSS::ValueID::LibwebLink)
if (id() == CSS::ValueID::LibwebLink || id() == ValueID::Linktext)
return document.link_color();
if (!document.page())