Parcourir la source

LibWeb/DOM: Rename link_color to normal_link_color

PGHales il y a 1 an
Parent
commit
ded344aa2c

+ 1 - 1
Userland/Libraries/LibWeb/CSS/StyleValues/IdentifierStyleValue.cpp

@@ -215,7 +215,7 @@ Color IdentifierStyleValue::to_color(Optional<Layout::NodeWithStyle const&> 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()) {

+ 5 - 5
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();
 }
 

+ 3 - 3
Userland/Libraries/LibWeb/DOM/Document.h

@@ -198,8 +198,8 @@ public:
     Color background_color() const;
     Vector<CSS::BackgroundLayerData> 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<Layout::Viewport> m_layout_root;
 
-    Optional<Color> m_link_color;
+    Optional<Color> m_normal_link_color;
     Optional<Color> m_active_link_color;
     Optional<Color> m_visited_link_color;
 

+ 1 - 1
Userland/Libraries/LibWeb/HTML/HTMLBodyElement.cpp

@@ -65,7 +65,7 @@ void HTMLBodyElement::attribute_changed(FlyString const& name, Optional<String>
         // 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 {}));

+ 1 - 1
Userland/Libraries/LibWeb/Painting/BorderPainting.cpp

@@ -579,7 +579,7 @@ Optional<BordersData> 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);