From 0bd86cec8a712d19d4378d84584c7d0ba4e5a7af Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Tue, 20 Dec 2011 21:06:25 -0500 Subject: Refactor HTML contexts to prevent some illegal nestings (that can crash the JavaScript runtime system) --- lib/ur/basis.urs | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'lib/ur') diff --git a/lib/ur/basis.urs b/lib/ur/basis.urs index a2209150..17e969ef 100644 --- a/lib/ur/basis.urs +++ b/lib/ur/basis.urs @@ -664,11 +664,18 @@ val useMore : ctx ::: {Unit} -> use1 ::: {Type} -> use2 ::: {Type} 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 @@ val img : bodyTag ([Alt = string, Src = url, Width = int, Height = int, 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] => -- cgit v1.2.3