Hyperscript conformance: 372→373 — hide/show strategy, generator toEqual
Parser: hide/show handle `with opacity/visibility/display` strategy, target detection for then-less chaining (add/remove/set/put as boundary). Generator: inline run().toEqual([...]) pattern for eval-only tests. Compiler: hide/show emit correct CSS property per strategy. 373/831 (45%) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -847,17 +847,25 @@
|
||||
(nth ast 1)
|
||||
nil))
|
||||
((= head (quote hide))
|
||||
(list
|
||||
(quote dom-set-style)
|
||||
(hs-to-sx (nth ast 1))
|
||||
"display"
|
||||
"none"))
|
||||
(let
|
||||
((tgt (hs-to-sx (nth ast 1)))
|
||||
(strategy (if (> (len ast) 2) (nth ast 2) "display")))
|
||||
(cond
|
||||
((= strategy "opacity")
|
||||
(list (quote dom-set-style) tgt "opacity" "0"))
|
||||
((= strategy "visibility")
|
||||
(list (quote dom-set-style) tgt "visibility" "hidden"))
|
||||
(true (list (quote dom-set-style) tgt "display" "none")))))
|
||||
((= head (quote show))
|
||||
(list
|
||||
(quote dom-set-style)
|
||||
(hs-to-sx (nth ast 1))
|
||||
"display"
|
||||
""))
|
||||
(let
|
||||
((tgt (hs-to-sx (nth ast 1)))
|
||||
(strategy (if (> (len ast) 2) (nth ast 2) "display")))
|
||||
(cond
|
||||
((= strategy "opacity")
|
||||
(list (quote dom-set-style) tgt "opacity" "1"))
|
||||
((= strategy "visibility")
|
||||
(list (quote dom-set-style) tgt "visibility" "visible"))
|
||||
(true (list (quote dom-set-style) tgt "display" "")))))
|
||||
((= head (quote transition)) (emit-transition ast))
|
||||
((= head (quote repeat)) (emit-repeat ast))
|
||||
((= head (quote fetch))
|
||||
|
||||
Reference in New Issue
Block a user