From ded344aa2cd7d56f1744be3eccba7f8caad0f888 Mon Sep 17 00:00:00 2001 From: PGHales Date: Tue, 16 Apr 2024 10:53:09 -0600 Subject: [PATCH] LibWeb/DOM: Rename link_color to normal_link_color --- .../LibWeb/CSS/StyleValues/IdentifierStyleValue.cpp | 2 +- Userland/Libraries/LibWeb/DOM/Document.cpp | 10 +++++----- Userland/Libraries/LibWeb/DOM/Document.h | 6 +++--- Userland/Libraries/LibWeb/HTML/HTMLBodyElement.cpp | 2 +- Userland/Libraries/LibWeb/Painting/BorderPainting.cpp | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/IdentifierStyleValue.cpp b/Userland/Libraries/LibWeb/CSS/StyleValues/IdentifierStyleValue.cpp index 1de5c776bd4..c8b192fc889 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/IdentifierStyleValue.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/IdentifierStyleValue.cpp @@ -215,7 +215,7 @@ Color IdentifierStyleValue::to_color(Optional node auto& document = node->document(); if (id() == CSS::ValueID::LibwebLink || id() == ValueID::Linktext) - return document.link_color(); + return document.normal_link_color(); auto palette = document.page().palette(); switch (id()) { diff --git a/Userland/Libraries/LibWeb/DOM/Document.cpp b/Userland/Libraries/LibWeb/DOM/Document.cpp index 3e496ea75a4..fcb94e648e1 100644 --- a/Userland/Libraries/LibWeb/DOM/Document.cpp +++ b/Userland/Libraries/LibWeb/DOM/Document.cpp @@ -1221,9 +1221,9 @@ void Document::update_paint_and_hit_testing_properties_if_needed() paintable->resolve_paint_only_properties(); } -void Document::set_link_color(Color color) +void Document::set_normal_link_color(Color color) { - m_link_color = color; + m_normal_link_color = color; } void Document::set_active_link_color(Color color) @@ -1468,10 +1468,10 @@ void Document::release_events() // Do nothing } -Color Document::link_color() const +Color Document::normal_link_color() const { - if (m_link_color.has_value()) - return m_link_color.value(); + if (m_normal_link_color.has_value()) + return m_normal_link_color.value(); return CSS::SystemColor::link_text(); } diff --git a/Userland/Libraries/LibWeb/DOM/Document.h b/Userland/Libraries/LibWeb/DOM/Document.h index f79d2d07237..90c64400180 100644 --- a/Userland/Libraries/LibWeb/DOM/Document.h +++ b/Userland/Libraries/LibWeb/DOM/Document.h @@ -198,8 +198,8 @@ public: Color background_color() const; Vector const* background_layers() const; - Color link_color() const; - void set_link_color(Color); + Color normal_link_color() const; + void set_normal_link_color(Color); Color active_link_color() const; void set_active_link_color(Color); @@ -679,7 +679,7 @@ private: JS::GCPtr m_layout_root; - Optional m_link_color; + Optional m_normal_link_color; Optional m_active_link_color; Optional m_visited_link_color; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLBodyElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLBodyElement.cpp index 377e3f9ee02..06e9e31fa3a 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLBodyElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLBodyElement.cpp @@ -65,7 +65,7 @@ void HTMLBodyElement::attribute_changed(FlyString const& name, Optional // https://html.spec.whatwg.org/multipage/rendering.html#the-page:rules-for-parsing-a-legacy-colour-value-3 auto color = parse_legacy_color_value(value.value_or(String {})); if (color.has_value()) - document().set_link_color(color.value()); + document().set_normal_link_color(color.value()); } else if (name.equals_ignoring_ascii_case("alink"sv)) { // https://html.spec.whatwg.org/multipage/rendering.html#the-page:rules-for-parsing-a-legacy-colour-value-5 auto color = parse_legacy_color_value(value.value_or(String {})); diff --git a/Userland/Libraries/LibWeb/Painting/BorderPainting.cpp b/Userland/Libraries/LibWeb/Painting/BorderPainting.cpp index bbe67fc5330..4fbfce27dac 100644 --- a/Userland/Libraries/LibWeb/Painting/BorderPainting.cpp +++ b/Userland/Libraries/LibWeb/Painting/BorderPainting.cpp @@ -579,7 +579,7 @@ Optional borders_data_for_outline(Layout::Node const& layout_node, if (outline_style == CSS::OutlineStyle::Auto) { // `auto` lets us do whatever we want for the outline. 2px of the link colour seems reasonable. line_style = CSS::LineStyle::Dotted; - outline_color = layout_node.document().link_color(); + outline_color = layout_node.document().normal_link_color(); outline_width = 2; } else { line_style = CSS::value_id_to_line_style(CSS::to_value_id(outline_style)).value_or(CSS::LineStyle::None);