From 7a766bdb8307b17846f130208fe42159ad91f25a Mon Sep 17 00:00:00 2001 From: implicitfield <114500360+implicitfield@users.noreply.github.com> Date: Sat, 18 Nov 2023 19:50:06 +0400 Subject: [PATCH] LibWeb: Respect the document's link_color for Linktext identifiers --- Tests/LibWeb/Ref/body-link-attribute.html | 4 ++++ Tests/LibWeb/Ref/reference/body-link-attribute-ref.html | 8 ++++++++ .../LibWeb/CSS/StyleValues/IdentifierStyleValue.cpp | 4 +--- 3 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 Tests/LibWeb/Ref/body-link-attribute.html create mode 100644 Tests/LibWeb/Ref/reference/body-link-attribute-ref.html diff --git a/Tests/LibWeb/Ref/body-link-attribute.html b/Tests/LibWeb/Ref/body-link-attribute.html new file mode 100644 index 0000000000..defc9b9c01 --- /dev/null +++ b/Tests/LibWeb/Ref/body-link-attribute.html @@ -0,0 +1,4 @@ + + + +link diff --git a/Tests/LibWeb/Ref/reference/body-link-attribute-ref.html b/Tests/LibWeb/Ref/reference/body-link-attribute-ref.html new file mode 100644 index 0000000000..94fc993a07 --- /dev/null +++ b/Tests/LibWeb/Ref/reference/body-link-attribute-ref.html @@ -0,0 +1,8 @@ + + + +link diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/IdentifierStyleValue.cpp b/Userland/Libraries/LibWeb/CSS/StyleValues/IdentifierStyleValue.cpp index 7adaeb53b2..47e3aa74bc 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/IdentifierStyleValue.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/IdentifierStyleValue.cpp @@ -194,8 +194,6 @@ Color IdentifierStyleValue::to_color(Optional 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 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())