LibHTML: Respect the link color set via <body link>

The default style for "a" tags now has { color: -libhtml-link; }.
We implement this vendor-specific property by querying the containing
document for the appropriate link color.

Currently we only use the basic link color, but in the future this can
be extended to remember visited links, etc.
This commit is contained in:
Andreas Kling 2019-10-06 10:25:08 +02:00
parent 83a6474d82
commit 847072c2b1
Notes: sideshowbarker 2024-07-19 11:48:12 +09:00
9 changed files with 68 additions and 13 deletions

View file

@ -41,6 +41,9 @@ NonnullRefPtr<StyleValue> parse_css_value(const StringView& view)
if (color.has_value())
return ColorStyleValue::create(color.value());
if (string == "-libhtml-link")
return IdentifierStyleValue::create(CSS::ValueID::VendorSpecificLink);
return StringStyleValue::create(string);
}