comparison lib/ur/basis.urs @ 1641:68429cfce8db

Redo HTML context classification, to keep regular <body> tags out of <table> and <tr>
author Adam Chlipala <adam@chlipala.net>
date Tue, 20 Dec 2011 19:02:04 -0500
parents 2b312f6d4007
children c3627f317bfd
comparison
equal deleted inserted replaced
1640:dc986eb6113c 1641:68429cfce8db
660 -> bind ::: {Type} 660 -> bind ::: {Type}
661 -> [use1 ~ use2] => 661 -> [use1 ~ use2] =>
662 xml ctx use1 bind 662 xml ctx use1 bind
663 -> xml ctx (use1 ++ use2) bind 663 -> xml ctx (use1 ++ use2) bind
664 664
665 con xhtml = xml [Html]
666 con page = xhtml [] []
667 con xbody = xml [Body] [] []
668 con xtable = xml [Body, Table] [] []
669 con xtr = xml [Body, Tr] [] []
670 con xform = xml [Body, Form] [] []
671
672
673 (*** HTML details *)
674
675 con html = [Html] 665 con html = [Html]
676 con head = [Head] 666 con head = [Head]
677 con body = [Body] 667 con body = [Dyn, Body]
678 con form = [Body, Form] 668 con form = [Dyn, Body, Form]
679 con subform = [Body, Subform] 669 con subform = [Dyn, Body, Subform]
680 con tabl = [Body, Table] 670 con tabl = [Dyn, Table]
681 con tr = [Body, Tr] 671 con tr = [Dyn, Tr]
672
673 con xhtml = xml html
674 con page = xhtml [] []
675 con xbody = xml body [] []
676 con xtable = xml tabl [] []
677 con xtr = xml tr [] []
678 con xform = xml form [] []
679
680
681 (*** HTML details *)
682 682
683 type queryString 683 type queryString
684 val show_queryString : show queryString 684 val show_queryString : show queryString
685 685
686 type url 686 type url
695 val redirect : t ::: Type -> url -> transaction t 695 val redirect : t ::: Type -> url -> transaction t
696 696
697 type id 697 type id
698 val fresh : transaction id 698 val fresh : transaction id
699 699
700 val dyn : ctx ::: {Unit} -> use ::: {Type} -> bind ::: {Type} -> [ctx ~ body] => unit 700 val dyn : ctx ::: {Unit} -> use ::: {Type} -> bind ::: {Type} -> [ctx ~ [Dyn]] => unit
701 -> tag [Signal = signal (xml (body ++ ctx) use bind)] (body ++ ctx) [] use bind 701 -> tag [Signal = signal (xml ([Dyn] ++ ctx) use bind)] ([Dyn] ++ ctx) [] use bind
702 702
703 val head : unit -> tag [] html head [] [] 703 val head : unit -> tag [] html head [] []
704 val title : unit -> tag [] head [] [] [] 704 val title : unit -> tag [] head [] [] []
705 val link : unit -> tag [Id = id, Rel = string, Typ = string, Href = url, Media = string] head [] [] [] 705 val link : unit -> tag [Id = id, Rel = string, Typ = string, Href = url, Media = string] head [] [] []
706 706
761 val img : bodyTag ([Alt = string, Src = url, Width = int, Height = int, 761 val img : bodyTag ([Alt = string, Src = url, Width = int, Height = int,
762 Onabort = transaction unit, Onerror = transaction unit, 762 Onabort = transaction unit, Onerror = transaction unit,
763 Onload = transaction unit] ++ boxAttrs) 763 Onload = transaction unit] ++ boxAttrs)
764 764
765 val form : ctx ::: {Unit} -> bind ::: {Type} 765 val form : ctx ::: {Unit} -> bind ::: {Type}
766 -> [[Body, Form, Table] ~ ctx] => 766 -> [[Body, Form] ~ ctx] =>
767 option css_class 767 option css_class
768 -> xml ([Body, Form] ++ ctx) [] bind 768 -> xml ([Body, Form] ++ ctx) [] bind
769 -> xml ([Body] ++ ctx) [] [] 769 -> xml ([Body] ++ ctx) [] []
770 770
771 val subform : ctx ::: {Unit} -> use ::: {Type} -> bind ::: {Type} 771 val subform : ctx ::: {Unit} -> use ::: {Type} -> bind ::: {Type}
862 862
863 (*** Tables *) 863 (*** Tables *)
864 864
865 val tabl : other ::: {Unit} -> [other ~ [Body, Table]] => unit 865 val tabl : other ::: {Unit} -> [other ~ [Body, Table]] => unit
866 -> tag ([Border = int] ++ boxAttrs) 866 -> tag ([Border = int] ++ boxAttrs)
867 ([Body] ++ other) ([Body, Table] ++ other) [] [] 867 ([Body] ++ other) ([Table] ++ other) [] []
868 val tr : other ::: {Unit} -> [other ~ [Body, Table, Tr]] => unit 868 val tr : other ::: {Unit} -> [other ~ [Table, Tr]] => unit
869 -> tag tableAttrs 869 -> tag tableAttrs
870 ([Body, Table] ++ other) ([Body, Tr] ++ other) [] [] 870 ([Table] ++ other) ([Tr] ++ other) [] []
871 val th : other ::: {Unit} -> [other ~ [Body, Tr]] => unit 871 val th : other ::: {Unit} -> [other ~ [Body, Tr]] => unit
872 -> tag ([Colspan = int, Rowspan = int] ++ tableAttrs) 872 -> tag ([Colspan = int, Rowspan = int] ++ tableAttrs)
873 ([Body, Tr] ++ other) ([Body] ++ other) [] [] 873 ([Tr] ++ other) ([Body] ++ other) [] []
874 val td : other ::: {Unit} -> [other ~ [Body, Tr]] => unit 874 val td : other ::: {Unit} -> [other ~ [Body, Tr]] => unit
875 -> tag ([Colspan = int, Rowspan = int] ++ tableAttrs) 875 -> tag ([Colspan = int, Rowspan = int] ++ tableAttrs)
876 ([Body, Tr] ++ other) ([Body] ++ other) [] [] 876 ([Tr] ++ other) ([Body] ++ other) [] []
877 877
878 878
879 (** Aborting *) 879 (** Aborting *)
880 880
881 val error : t ::: Type -> xbody -> t 881 val error : t ::: Type -> xbody -> t