Bug + fix for empty iframe elements being incorrectly trimmed

Here's a (hopefully simple) bug fix.

4-Aug-2000 Tidy incorrectly trims empty iframe elements (empty iframe
elements are valid and semantically meaningful according to the HTML 4.01
spec).

This can be fixed by adding the following check to CanPrune() in parser.c:

--- parser.c        Fri Aug 04 16:32:04 2000
+++ parser.NEW.c    Sun Mar 11 12:37:41 2001
@@ -240,6 +240,9 @@
     if (element->tag == tag_object)
         return no;

+    if (element->tag == tag_iframe)
+        return no;
+
     if ( element->attributes != null &&
             (GetAttrByName(element, "id") ||
                GetAttrByName(element, "name")) )


You must also declare tag_iframe in tags.c:

--- tags.c        Fri Jul 07 17:55:14 2000
+++ tags.NEW.c    Sun Mar 11 12:35:32 2001
@@ -24,6 +24,7 @@
 Dict *tag_body;
 Dict *tag_frameset;
 Dict *tag_frame;
+Dict *tag_iframe;
 Dict *tag_noframes;
 Dict *tag_hr;
 Dict *tag_h1;
@@ -348,6 +349,7 @@
     tag_body = lookup("body");
     tag_frameset = lookup("frameset");
     tag_frame = lookup("frame");
+    tag_iframe = lookup("iframe");
     tag_noframes = lookup("noframes");
     tag_meta = lookup("meta");
     tag_title = lookup("title");

Thanks,
Randy

Received on Monday, 12 March 2001 13:45:27 UTC