mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +00:00
LibWeb/DOM: Rename link_color to normal_link_color
This commit is contained in:
parent
7b75d0c1f0
commit
ded344aa2c
Notes:
sideshowbarker
2024-07-16 23:34:44 +09:00
Author: https://github.com/PGHales 🔰
Commit: ded344aa2c
Pull-request: https://github.com/SerenityOS/serenity/pull/23956
Reviewed-by: https://github.com/LucasChollet
Reviewed-by: https://github.com/awesomekling
Reviewed-by: https://github.com/tcl3
5 changed files with 11 additions and 11 deletions
|
@ -215,7 +215,7 @@ Color IdentifierStyleValue::to_color(Optional<Layout::NodeWithStyle const&> node
|
||||||
|
|
||||||
auto& document = node->document();
|
auto& document = node->document();
|
||||||
if (id() == CSS::ValueID::LibwebLink || id() == ValueID::Linktext)
|
if (id() == CSS::ValueID::LibwebLink || id() == ValueID::Linktext)
|
||||||
return document.link_color();
|
return document.normal_link_color();
|
||||||
|
|
||||||
auto palette = document.page().palette();
|
auto palette = document.page().palette();
|
||||||
switch (id()) {
|
switch (id()) {
|
||||||
|
|
|
@ -1221,9 +1221,9 @@ void Document::update_paint_and_hit_testing_properties_if_needed()
|
||||||
paintable->resolve_paint_only_properties();
|
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)
|
void Document::set_active_link_color(Color color)
|
||||||
|
@ -1468,10 +1468,10 @@ void Document::release_events()
|
||||||
// Do nothing
|
// Do nothing
|
||||||
}
|
}
|
||||||
|
|
||||||
Color Document::link_color() const
|
Color Document::normal_link_color() const
|
||||||
{
|
{
|
||||||
if (m_link_color.has_value())
|
if (m_normal_link_color.has_value())
|
||||||
return m_link_color.value();
|
return m_normal_link_color.value();
|
||||||
return CSS::SystemColor::link_text();
|
return CSS::SystemColor::link_text();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -198,8 +198,8 @@ public:
|
||||||
Color background_color() const;
|
Color background_color() const;
|
||||||
Vector<CSS::BackgroundLayerData> const* background_layers() const;
|
Vector<CSS::BackgroundLayerData> const* background_layers() const;
|
||||||
|
|
||||||
Color link_color() const;
|
Color normal_link_color() const;
|
||||||
void set_link_color(Color);
|
void set_normal_link_color(Color);
|
||||||
|
|
||||||
Color active_link_color() const;
|
Color active_link_color() const;
|
||||||
void set_active_link_color(Color);
|
void set_active_link_color(Color);
|
||||||
|
@ -679,7 +679,7 @@ private:
|
||||||
|
|
||||||
JS::GCPtr<Layout::Viewport> m_layout_root;
|
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_active_link_color;
|
||||||
Optional<Color> m_visited_link_color;
|
Optional<Color> m_visited_link_color;
|
||||||
|
|
||||||
|
|
|
@ -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
|
// 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 {}));
|
auto color = parse_legacy_color_value(value.value_or(String {}));
|
||||||
if (color.has_value())
|
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)) {
|
} 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
|
// 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 {}));
|
auto color = parse_legacy_color_value(value.value_or(String {}));
|
||||||
|
|
|
@ -579,7 +579,7 @@ Optional<BordersData> borders_data_for_outline(Layout::Node const& layout_node,
|
||||||
if (outline_style == CSS::OutlineStyle::Auto) {
|
if (outline_style == CSS::OutlineStyle::Auto) {
|
||||||
// `auto` lets us do whatever we want for the outline. 2px of the link colour seems reasonable.
|
// `auto` lets us do whatever we want for the outline. 2px of the link colour seems reasonable.
|
||||||
line_style = CSS::LineStyle::Dotted;
|
line_style = CSS::LineStyle::Dotted;
|
||||||
outline_color = layout_node.document().link_color();
|
outline_color = layout_node.document().normal_link_color();
|
||||||
outline_width = 2;
|
outline_width = 2;
|
||||||
} else {
|
} else {
|
||||||
line_style = CSS::value_id_to_line_style(CSS::to_value_id(outline_style)).value_or(CSS::LineStyle::None);
|
line_style = CSS::value_id_to_line_style(CSS::to_value_id(outline_style)).value_or(CSS::LineStyle::None);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue