Re: Testing the DOM and head elements at the wrong place

With Firefox 2.0.0.3 - Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; 
rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3 on Windows XP SP2 :
Title is "Invalid HTML 4.01 Test file"
meta : H
link : H
base : R
style : R
title : R

Result :

    * DOCTYPE: |HTML|
    * |HTML| |lang|="|en|"
          o |HEAD|
                + |TITLE|
                      # |#text|: Invalid HTML 4.01 Test file
                + |#text|:
                + |META| |content|="|Karl Dubost|" |name|="|author|"
                + |LINK| |charset|="|utf-8|" |title|="|no title|"
                  |media|="|screen|" |type|="|text/css|"
                  |href|="|/2005/10/w3cdoc.css|" |rel|="|stylesheet|"
          o |BODY|
                + |#text|:

Same result with IceWeasel (Mozilla/5.0 (X11; U; Linux i686; fr; 
rv:1.8.1.3) Gecko/20070310 Iceweasel/2.0.0.3 (Debian-2.0.0.3-1))

With IE 6.0.2900.2180.xpsp_sp2_gdr.070227-2254 on Windows XP SP2 :
Title is ""
meta : B
link : B
base : B
style : B
title : R

Result :

    * |#comment|: CTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//E
    * |HTML| |lang|="|en|"
          o |HEAD|
                + |TITLE|
          o |BODY|
                + |META| |content|="|Karl Dubost|" |name|="|author|"
                + |LINK| |title|="|no title|" |media|="|screen|"
                  |href|="|/2005/10/w3cdoc.css|" |type|="|text/css|"
                  |charset|="|utf-8|" |rel|="|stylesheet|"
                + |BASE| |href|="|http://www.w3.org|" |target|="|_new|"
                      # |STYLE| |type|="|text/css|" |media|="|screen|"

Same result with IE7 (7.0.5730.11) on Windows XP SP2.

With Opera 9.10 rev 8679 (win32) on Windows XP SP2 :
Title is "Invalid HTML 4.01 Test file"
meta : B
link : B
base : B
style : B
title : B

Result :
HTML LANG="en"
HEAD
TITLE
#text: Invalid HTML 4.01 Test file
BODY
#text:
META NAME="author" CONTENT="Karl Dubost"
#text:
LINK REL="stylesheet" HREF="/2005/10/w3cdoc.css" TYPE="text/css" 
MEDIA="screen" TITLE="no title" CHARSET="utf-8"
#text:
BASE HREF="http://www.w3.org" TARGET="_new"
#text:
STYLE TYPE="text/css" MEDIA="screen"
#text: /*style element*/
#text:
TITLE
#text: Title in the body
#text:
#text:

Same result with Opera 9.21 rev 8776 (Win32) on Windows XP SP2.

With Konqueror 3.5.5 - UserAgent : Mozilla/5.0 (compatible; 
Konqueror/3.5; Linux) KHTML/3.5.5 (like Gecko) (Debian) :
Title is "Invalid HTML 4.01 Test file"
meta : H
link : H
base : H
style : H
title : R

Result :

    * |HTML| |lang|="|en|"
          o |HEAD|
                + |TITLE|
                      # |#text|: Invalid HTML 4.01 Test file
                + |META| |content|="|Karl Dubost|" |name|="|author|"
                + |LINK| |charset|="|utf-8|" |title|="|no title|"
                  |media|="|screen|" |type|="|text/css|"
                  |href|="|/2005/10/w3cdoc.css|" |rel|="|stylesheet|"
                + |style type="text/css" media="screen"|
                      # |#text|: /* style element */
          o |BODY|
                + |#text|:
                + |#text|:
                + |#text|:
                + |#text|:
                + |#text|:
                + |#text|:
                + |#text|:


Karl Dubost a écrit :
>
> Hi,
>
> After a discussion on IRC, I decided to create a quick test to see 
> what was happening with elements put in the wrong place. For example 
> when you put an element (link, base, etc.) in the "body" which is 
> supposed to be in "head".
>
> I have created an [HTML 4.01 test file][1] for this purpose
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
>     <html lang="en">
>     <head>
>     <title>Invalid HTML 4.01 Test file</title>
>     </head>
>     <body>
>     <meta name="author" content="Karl Dubost">
>         <link rel="stylesheet" href="/2005/10/w3cdoc.css" 
> type="text/css" media="screen" title="no title" charset="utf-8">
>         <base href="http://www.w3.org" target="_new">
>         <style type="text/css" media="screen">
>             /*style element*/
>         </style>
>         <title>Title in the body</title>
>     </body>
>     </html>
>
> And I have used the [DOM Live Viewer][2] from Ian Hickson
>
> The results so far are interesting. If you could send me the results 
> you get with the
>
> * Name of the browser
> * Product version
> * the results: B, H, R
>     B: the element is left in the body in the DOM view
>     H: the element is put in the head in the DOM view
>     R: the element is removed in the DOM view
>
> that would be very helpful.
>
>
>
>
> [1]: http://www.w3.org/2007/05/dom-html401.html
> [2]: http://software.hixie.ch/utilities/js/live-dom-viewer/
> [3]: http://www.w3.org/2007/05/dom-head-body.xhtml
>

Received on Tuesday, 22 May 2007 14:43:30 UTC