diff --git a/lib/hyperscript/parser.sx b/lib/hyperscript/parser.sx index aba0bf5d..2f4dd2cc 100644 --- a/lib/hyperscript/parser.sx +++ b/lib/hyperscript/parser.sx @@ -1618,8 +1618,11 @@ (if (and (not (at-end?)) - (= (tp-type) "ident") - (not (hs-keyword? (tp-val)))) + (or + (= (tp-type) "style") + (and + (= (tp-type) "ident") + (not (hs-keyword? (tp-val)))))) (collect-transitions (append acc (list (parse-one-transition)))) acc))) diff --git a/shared/static/wasm/sx/hs-parser.sx b/shared/static/wasm/sx/hs-parser.sx index aba0bf5d..2f4dd2cc 100644 --- a/shared/static/wasm/sx/hs-parser.sx +++ b/shared/static/wasm/sx/hs-parser.sx @@ -1618,8 +1618,11 @@ (if (and (not (at-end?)) - (= (tp-type) "ident") - (not (hs-keyword? (tp-val)))) + (or + (= (tp-type) "style") + (and + (= (tp-type) "ident") + (not (hs-keyword? (tp-val)))))) (collect-transitions (append acc (list (parse-one-transition)))) acc))) diff --git a/spec/tests/test-hyperscript-behavioral.sx b/spec/tests/test-hyperscript-behavioral.sx index 9cf2beb5..9847409b 100644 --- a/spec/tests/test-hyperscript-behavioral.sx +++ b/spec/tests/test-hyperscript-behavioral.sx @@ -12798,6 +12798,7 @@ end") (dom-set-attr _el-div "_" "on click transition *width from 0px to 100px *height from 0px to 100px") (dom-append (dom-body) _el-div) (hs-activate! _el-div) + (dom-dispatch _el-div "click" nil) (assert= (dom-get-style _el-div "width") "100px") (assert= (dom-get-style _el-div "height") "100px") )) diff --git a/tests/hs-run-filtered.js b/tests/hs-run-filtered.js index 7dcc155d..a2176f1a 100755 --- a/tests/hs-run-filtered.js +++ b/tests/hs-run-filtered.js @@ -52,6 +52,10 @@ class El { contains(o) { if(o===this)return true; for(const c of this.children)if(c===o||c.contains(o))return true; return false; } cloneNode(d) { const e=new El(this.tagName.toLowerCase()); Object.assign(e.attributes,this.attributes); e.id=this.id; e.className=this.className; e.classList._sync(this.className); for(const k of Object.keys(this.style)){if(typeof this.style[k]!=='function')e.style[k]=this.style[k];} e.textContent=this.textContent; e.innerHTML=this.innerHTML; e.value=this.value; if(d)for(const c of this.children)e.appendChild(c.cloneNode(true)); return e; } focus(){} blur(){} click(){this.dispatchEvent(new Ev('click',{bubbles:true}));} remove(){if(this.parentElement)this.parentElement.removeChild(this);} + get nextSibling(){const p=this.parentElement;if(!p)return null;const i=p.children.indexOf(this);return i>=0&&i