about summary refs log tree commit diff stats
path: root/src/html
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2023-06-25 13:23:27 +0200
committerbptato <nincsnevem662@gmail.com>2023-06-25 13:23:27 +0200
commit468d0823bf5c16e0a568858704c073a4896fcb8d (patch)
tree7f0460c0678613bfd90e6e0c3141c81e009040b2 /src/html
parentfd837c155acca689839c5ce184fd5059caa83770 (diff)
downloadchawan-468d0823bf5c16e0a568858704c073a4896fcb8d.tar.gz
css/values: use Result instead of exceptions
Diffstat (limited to 'src/html')
-rw-r--r--src/html/dom.nim6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/html/dom.nim b/src/html/dom.nim
index 0445aa83..4d71c3a3 100644
--- a/src/html/dom.nim
+++ b/src/html/dom.nim
@@ -1581,12 +1581,10 @@ func formmethod*(element: Element): FormMethod =
   return FORM_METHOD_GET
 
 proc parseColor(element: Element, s: string): RGBAColor =
-  try:
-    return cssColor(parseComponentValue(newStringStream(s)))
-  except CSSValueError:
+  return cssColor(parseComponentValue(newStringStream(s)))
     #TODO TODO TODO return element style
     # For now we just use white.
-    return rgb(255, 255, 255)
+    .get(rgb(255, 255, 255))
 
 #TODO ??
 func target0*(element: Element): string =