mirror of
https://github.com/RGBCube/serenity
synced 2025-05-24 01:15:07 +00:00
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:
parent
83a6474d82
commit
847072c2b1
9 changed files with 68 additions and 13 deletions
|
@ -55,7 +55,7 @@ void LayoutNode::render(RenderingContext& context)
|
|||
|
||||
auto bgcolor = style().property("background-color");
|
||||
if (bgcolor.has_value() && bgcolor.value()->is_color()) {
|
||||
context.painter().fill_rect(padded_rect, bgcolor.value()->to_color());
|
||||
context.painter().fill_rect(padded_rect, bgcolor.value()->to_color(document()));
|
||||
}
|
||||
|
||||
auto border_width_value = style().property("border-width");
|
||||
|
@ -63,7 +63,7 @@ void LayoutNode::render(RenderingContext& context)
|
|||
auto border_style_value = style().property("border-style");
|
||||
if (border_width_value.has_value() && border_color_value.has_value()) {
|
||||
int border_width = border_width_value.value()->to_length().to_px();
|
||||
Color border_color = border_color_value.value()->to_color();
|
||||
Color border_color = border_color_value.value()->to_color(document());
|
||||
|
||||
if (border_style_value.has_value() && border_style_value.value()->to_string() == "inset") {
|
||||
// border-style: inset
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue