diff lib/ur/basis.urs @ 1642:c3627f317bfd

Refactor HTML contexts to prevent some illegal nestings (that can crash the JavaScript runtime system)
author Adam Chlipala <adam@chlipala.net>
date Tue, 20 Dec 2011 21:06:25 -0500
parents 68429cfce8db
children b0720700c36e
line wrap: on
line diff
--- a/lib/ur/basis.urs	Tue Dec 20 19:02:04 2011 -0500
+++ b/lib/ur/basis.urs	Tue Dec 20 21:06:25 2011 -0500
@@ -664,11 +664,18 @@
 
 con html = [Html]
 con head = [Head]
-con body = [Dyn, Body]
-con form = [Dyn, Body, Form]
-con subform = [Dyn, Body, Subform]
-con tabl = [Dyn, Table]
-con tr = [Dyn, Tr]
+
+con body' = [MakeForm, Body]
+con form' = [Body, Form]
+con subform' = [Body, Subform]
+con tabl' = [MakeForm, Table]
+con tr' = [MakeForm, Tr]
+
+con body = [Dyn] ++ body'
+con form = [Dyn] ++ form'
+con subform = [Dyn] ++ subform'
+con tabl = [Dyn] ++ tabl'
+con tr = [Dyn] ++ tr'
 
 con xhtml = xml html
 con page = xhtml [] []
@@ -763,10 +770,10 @@
                     Onload = transaction unit] ++ boxAttrs)
           
 val form : ctx ::: {Unit} -> bind ::: {Type}
-           -> [[Body, Form] ~ ctx] =>
+           -> [[MakeForm, Form] ~ ctx] =>
     option css_class
-    -> xml ([Body, Form] ++ ctx) [] bind
-    -> xml ([Body] ++ ctx) [] []
+    -> xml ([Form] ++ ctx) [] bind
+    -> xml ([MakeForm] ++ ctx) [] []
        
 val subform : ctx ::: {Unit} -> use ::: {Type} -> bind ::: {Type}
               -> [[Form] ~ ctx] =>