summaryrefslogtreecommitdiff
path: root/tests/styleRt.ur
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2012-05-06 16:08:48 -0400
committerGravatar Adam Chlipala <adam@chlipala.net>2012-05-06 16:08:48 -0400
commit40cfc262411e37ef754664b1abb9233b772093c2 (patch)
treea956507879ff7df344774dc30dabdc5438d4cb63 /tests/styleRt.ur
parent26f04ac120daaf16f40e104a5a72a4bb6a28553c (diff)
Run-time CSS style validation
Diffstat (limited to 'tests/styleRt.ur')
-rw-r--r--tests/styleRt.ur38
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/styleRt.ur b/tests/styleRt.ur
new file mode 100644
index 00000000..583649a1
--- /dev/null
+++ b/tests/styleRt.ur
@@ -0,0 +1,38 @@
+fun handler r =
+ return <xml><body>
+ <span style={oneProperty
+ (oneProperty noStyle (value (property r.Prop) (atom r.Valu)))
+ (value (property "background") (css_url (bless r.Url)))}>
+ Teeeest
+ </span>
+ </body></xml>
+
+fun main () =
+ prop <- source "";
+ valu <- source "";
+ url <- source "";
+ xm <- source <xml/>;
+ return <xml><body>
+ Property: <ctextbox source={prop}/><br/>
+ Value: <ctextbox source={valu}/><br/>
+ URL: <ctextbox source={url}/><br/>
+ <button value="Go!" onclick={prop <- get prop;
+ valu <- get valu;
+ url <- get url;
+ set xm <xml><span style={oneProperty
+ (oneProperty noStyle (value (property prop) (atom valu)))
+ (value (property "background") (css_url (bless url)))}>
+ Teeeest
+ </span></xml>}/>
+ <hr/>
+ <dyn signal={signal xm}/>
+ <hr/>
+ <h2>Or the old fashioned way...</h2>
+
+ <form>
+ Property: <textbox{#Prop}/><br/>
+ Value: <textbox{#Valu}/><br/>
+ URL: <textbox{#Url}/><br/>
+ <submit action={handler}/>
+ </form>
+ </body></xml>