W3C home > Mailing lists > Public > html-tidy@w3.org > April to June 2000

Re: Infinite loop fix for <noframes><frame></noframe>

From: Kyle Kartchner <kylek@mycomputer.com>
Date: Sun, 25 Jun 2000 15:18:58 -0600
Message-ID: <39567742.F9B45090@mycomputer.com>
To: html-tidy@w3.org
Sorry, but I have syntax error in my code below where I opened an 'if' block
two curly braces on line 2892.  Sorry about that.

Regards,

Kyle Kartchner

> Infinite loop fix for <noframes><frame></noframe>
>
> From: Kyle Kartchner (kylek@mycomputer.com)
> Date: Sun, Jun 25 2000
>
>    * Previous message: Dave Raggett: "Re: XHTML and lower-casing HTML tags."
>    * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
>    * Other mail archives: [this mailing list] [other W3C mailing lists]
>    * Mail actions: [ respond to this message ] [ mail a new topic ]
>
>   ------------------------------------------------------------------------
>
> Message-ID: <395674EC.EA220A75@mycomputer.com>
> Date: Sun, 25 Jun 2000 15:09:00 -0600
> From: Kyle Kartchner <kylek@mycomputer.com>
> To: html-tidy@w3.org
> Subject: Infinite loop fix for <noframes><frame></noframe>
>
> First off Dave, I want to commend your excellent organization of code,
> and structure.  I'm very impressed with how thought out, and how nicely
> designed it is.  I am coding a daemon that will use tidy's parser, and I
> found that your data structure was very easy to traverse, so I grabbed
> it.
>
> In being that my program is a daemon, I can't afford any infinite
> loops.  In parsing a user's site I found an infinite loop that was
> caused by the parser.c ParseNoFrames() function.  It would would cause a
> loop on the following HTML snippet:
>
> <noframes>
> <body bgcolor="#000000" text="#ffffff">
> <h1>Need a Frame Capable Browser!</h1>
> <frame src="title.html" name="p1" scrolling=no>
> </body>
> </noframes>
>
> This is obviously a poorly written piece of html code, and I'm sure a
> very rare occurance which is why I'm sure Dave did not find it.  I'm not
> sure that this is how Dave would want to handle this code, but I have a
> fix (without the warning because I don't use them) below:
>
> Old code -
> 2890-
> 2891-        if ((node->tag == tag_frame || node->tag == tag_frameset))
> 2892-        {
> 2893-            ReportWarning(lexer, noframes, node,
> MISSING_ENDTAG_BEFORE);
> 2894-            TrimSpaces(lexer, noframes);
> 2895-            UngetToken(lexer);
> 2896-            return;
> 2897-        }
> 2898-
>
> Fixed code -
> 2890-
> 2891-        if (node->tag == tag_frameset)
> 2892-        {
> 2893-        {
> 2894-            ReportWarning(lexer, noframes, node,
> MISSING_ENDTAG_BEFORE);
> 2895-            TrimSpaces(lexer, noframes);
> 2896-            UngetToken(lexer);
> 2897-            return;
> 2898-        }
> 2899-
> 2900-        if (node->tag == tag_frame)
> 2901-        {
> 2902-            // Didn't worry about a warning message here, but it
> should have one. Just discard tag.
> 2903-            // Kyle Kartchner
> 2904-            FreeNode(node);
> 2905-            continue;
> 2906-        }
> 2907-
>
> Regards,
>
> --
> Kyle Kartchner
> Software Engineer
> -----------------------------
> MyComputer.com
> tools to power your eBusiness
>
>   ------------------------------------------------------------------------
>
>    * Previous message: Dave Raggett: "Re: XHTML and lower-casing HTML tags."
>    * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
>    * Other mail archives: [this mailing list] [other W3C mailing lists]
>    * Mail actions: [ respond to this message ] [ mail a new topic ]

--
Kyle Kartchner
Software Engineer
-----------------------------
MyComputer.com
tools to power your eBusiness
Received on Sunday, 25 June 2000 17:23:55 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 3 April 2012 06:13:44 GMT