Commits

Anonymous committed 9df5dd8

Small fixes to ensure proper functioning and appearance on Firefox. Eliminated end tags on things like <img>, <area>, etc., by adding a new property to tags (:noendtag) that controls default content rendering. Changed page doctype, because the lack of end tags implies no longer XHTML, but HTML 4.01.

Comments (0)

Files changed (1)

 		  )
   )
 
-(defgeneric tag-has-body-p (somet-tag-symbol)
+(defgeneric tag-has-body-p (some-tag-symbol)
   (:documentation "Return t (the default) if a tag expects to 
    have a tag body; nil otherwise.  If no body, that implies
    the tag treats the raw body as an initializer for the tag,
 		  )
   )
 
+(defgeneric tag-has-end-tag-p (*current-tag*)
+  (:documentation "Return t (the default) if a tag expects to 
+   have an end tag rendered (e.g., </a>); nil otherwise.  If nil,
+   then the tag's rendering only includes the start tag and content
+   (if any).  Examples of use is the <img> and <input> tags."
+		  )
+  )
+
+
 (defgeneric tag-separate-initializer-and-body (some-tag-symbol raw-body)
   (:documentation "Return 2 values (nil if the value is not applicable):
    the first is the tag initializer, the 2nd is the tag's computed body.
   t
   )
 
+(defmethod tag-has-end-tag-p ( (*current-tag* htmltag) )
+  t
+  )
+
 (defmethod tag-separate-initializer-and-body ( (some-tag-symbol symbol) raw-body)
   (if (tag-has-body-p some-tag-symbol)
       (let (
 (defmethod render-tag-content ( (*current-tag* htmltag) )
   (render-tag-start *current-tag* )
   (render-tag-body *current-tag* )
-  (render-tag-end *current-tag* )
+  (if (tag-has-end-tag-p *current-tag*)
+      (render-tag-end *current-tag* )
+      )
   )
 
 ;;;------------------------------------------------------------------------------------
 		      ((:bases bases) nil) ; other base classes here
 		      ((:attributes attributes) nil)
 		      ((:hasbody hasbody) t)
+		      ((:noendtag noendtag) nil)
 		      ((:content content) nil)
 		      ((:script script) nil)
 		      ((:ready ready) nil)
 		 )
 	      )
 
+     ,(when noendtag
+	      `(defmethod tag-has-end-tag-p ( (some-tag  ,name) )
+		 nil
+		 )
+	      )
+
      ,(when script
 	    `(defmethod render-tag-scripts ( (*current-tag* ,name) )
 	         (union-ordered (list ,script) *page-scripts* )
 	   (html (list ,@raw-body) )
 					; now render the page
 	 (with-output-to-string (*html-out*)
-	   (hout "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>~%")
-	   (hout "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"")
-	   (hout" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">~%")
+	   (hout "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01//EN\">~%")
 	   (hout "<html xmlns=\"http://www.w3.org/1999/xhtml\">~%")
 	   (hout "<head>~%")