about summary refs log tree commit diff stats
path: root/src/css
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2022-12-25 03:04:30 +0100
committerbptato <nincsnevem662@gmail.com>2022-12-25 03:04:30 +0100
commitb493b135ac052a1ae4bb126ea23a8fc991d7e8d6 (patch)
tree74206995f6561640f2abbef6c08ff8240fd6ba8d /src/css
parentbee3b59bb886ef32ee810f61ef48cd082a0ed443 (diff)
downloadchawan-b493b135ac052a1ae4bb126ea23a8fc991d7e8d6.tar.gz
Add font color presentational hint
Diffstat (limited to 'src/css')
-rw-r--r--src/css/cascade.nim6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/css/cascade.nim b/src/css/cascade.nim
index 4d594785..35732e60 100644
--- a/src/css/cascade.nim
+++ b/src/css/cascade.nim
@@ -113,6 +113,10 @@ func calcPresentationalHints(element: Element): CSSComputedValues =
     let c = parseLegacyColor(element.attr("text"))
     if c.isSome:
       set_cv(PROPERTY_COLOR, color, c.get)
+  template map_color =
+    let c = parseLegacyColor(element.attr("color"))
+    if c.isSome:
+      set_cv(PROPERTY_COLOR, color, c.get)
 
   case element.tagType
   of TAG_DIV:
@@ -144,6 +148,8 @@ func calcPresentationalHints(element: Element): CSSComputedValues =
     let textarea = HTMLTextAreaElement(element)
     set_cv(PROPERTY_WIDTH, length, CSSLength(unit: UNIT_CH, num: float64(textarea.cols)))
     set_cv(PROPERTY_HEIGHT, length, CSSLength(unit: UNIT_EM, num: float64(textarea.rows)))
+  of TAG_FONT:
+    map_color
   else: discard
  
 proc applyDeclarations(styledNode: StyledNode, parent: CSSComputedValues, ua, user: DeclarationList, author: seq[DeclarationList]) =