about summary refs log tree commit diff stats
path: root/src/css
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2023-10-25 11:56:54 +0200
committerbptato <nincsnevem662@gmail.com>2023-10-25 12:04:37 +0200
commit98865ac747766118b94f39f749aba4be62c78022 (patch)
treedd0d6520997eef16fa7238d1dc486affd49057b6 /src/css
parente4cccbeb7488dfe8afbbe51c60fd16557dea923f (diff)
downloadchawan-98865ac747766118b94f39f749aba4be62c78022.tar.gz
Add jspropnames, CSSStyleDeclaration stub
Diffstat (limited to 'src/css')
-rw-r--r--src/css/cascade.nim8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/css/cascade.nim b/src/css/cascade.nim
index 1eaa643c..c0900394 100644
--- a/src/css/cascade.nim
+++ b/src/css/cascade.nim
@@ -1,6 +1,5 @@
 import algorithm
 import options
-import streams
 import strutils
 
 import css/cssparser
@@ -254,10 +253,9 @@ proc applyDeclarations(styledNode: StyledNode, parent: CSSComputedValues,
     builder.addValues(rule[pseudo], ORIGIN_AUTHOR)
   if styledNode.node != nil:
     let element = Element(styledNode.node)
-    let style = element.attr("style")
-    if style.len > 0:
-      let inline_rules = newStringStream(style).parseListOfDeclarations2()
-      builder.addValues(inline_rules, ORIGIN_AUTHOR)
+    let style = element.style_cached
+    if style != nil:
+      builder.addValues(style.decls, ORIGIN_AUTHOR)
     builder.preshints = element.calcPresentationalHints()
 
   styledNode.computed = builder.buildComputedValues()