<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>19573</bug_id>
          
          <creation_ts>2008-06-16 02:57:21 -0700</creation_ts>
          <short_desc>REGRESSION: Doctype is not parsed unless it&apos;s at the very beginning of the document (font-size didn&apos;t inherit from body to table elements)</short_desc>
          <delta_ts>2008-06-17 00:15:31 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>DOM</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Mac (Intel)</rep_platform>
          <op_sys>OS X 10.5</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P1</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Rafa Barbera">rbarberac</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ap</cc>
    
    <cc>mitz</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>83442</commentid>
    <comment_count>0</comment_count>
    <who name="Rafa Barbera">rbarberac</who>
    <bug_when>2008-06-16 02:57:21 -0700</bug_when>
    <thetext>When using 

body { font-size:20px; }

the table elements didn&apos;t show at this size.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83443</commentid>
    <comment_count>1</comment_count>
      <attachid>21724</attachid>
    <who name="Rafa Barbera">rbarberac</who>
    <bug_when>2008-06-16 02:59:18 -0700</bug_when>
    <thetext>Created attachment 21724
Case reduction

All the text in this page should present the same size. It works fine in Safari 3.1.1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83482</commentid>
    <comment_count>2</comment_count>
    <who name="">mitz</who>
    <bug_when>2008-06-16 09:54:21 -0700</bug_when>
    <thetext>From quirks.css:

/* Tables reset both line-height and white-space in quirks mode. */
/* Compatible with WinIE. Note that font-family is *not* reset. */
table {
    white-space: normal;
    line-height: normal;
    font-weight: normal;
    font-size: medium;
    font-variant: normal;
    font-style: normal;
    color: -webkit-text;
    text-align: -webkit-auto
}</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83490</commentid>
    <comment_count>3</comment_count>
    <who name="Rafa Barbera">rbarberac</who>
    <bug_when>2008-06-16 10:44:29 -0700</bug_when>
    <thetext>I don&apos;t understand the quirks mode issue. The sample is declared as HTML 4.01 strict.

&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD HTML 4.01//EN&quot; &quot;http://www.w3.org/TR/html4/strict.dtd&quot;&gt;

Regards</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83496</commentid>
    <comment_count>4</comment_count>
    <who name="">mitz</who>
    <bug_when>2008-06-16 10:54:50 -0700</bug_when>
    <thetext>(In reply to comment #3)
&gt; I don&apos;t understand the quirks mode issue. The sample is declared as HTML 4.01
&gt; strict.

The DOCTYPE is not parsed. Looking at the source, I see that it begins with *two* UTF-8-encoded BOMs (EF BB BF repeated twice), and I believe the second one throws the parser off.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83526</commentid>
    <comment_count>5</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2008-06-16 13:08:33 -0700</bug_when>
    <thetext>Safari 3.1.1 is OK even with text garbage before the DOCTYPE (just as Firefox is), so this change is not just something caused by BOM handling changes.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83566</commentid>
    <comment_count>6</comment_count>
    <who name="">mitz</who>
    <bug_when>2008-06-16 22:30:22 -0700</bug_when>
    <thetext>Looks like entering quirks mode and ignoring the DOCTYPE is the right thing to do according to &lt;http://www.whatwg.org/specs/web-apps/current-work/multipage/tree-construction.html#the-initial&gt;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83568</commentid>
    <comment_count>7</comment_count>
    <who name="">mitz</who>
    <bug_when>2008-06-16 22:40:33 -0700</bug_when>
    <thetext>...and IE agrees with TOT: attachment 21724 is rendered the same in IE. Removing one BOM changes the rendering (so that the table text is the same size as body text) in IE and in TOT.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83570</commentid>
    <comment_count>8</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2008-06-16 22:55:08 -0700</bug_when>
    <thetext>After a discussion in #webkit, the consensus appears to be that we want to match IE, Opera and HTML5, not Firefox. According to HTML5, only whitespace and comments are allowed before DOCTYPE (and implicitly, a single BOM as the very first character).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83573</commentid>
    <comment_count>9</comment_count>
    <who name="Rafa Barbera">rbarberac</who>
    <bug_when>2008-06-16 23:33:23 -0700</bug_when>
    <thetext>Ok, I&apos;m with you in that the correct way to handle this case is to go into quirks mode. But are there any way to know that the browser is working in quirks mode? All the &lt;DOCTYPE&gt; related conditions are easy to spot looking at the HTML source. But the BOM one is not, because it&apos;s an invisible-no-breaking-space character, so you need to use a hexeditor to see them. 

In my case, there are two developers working on a django project, one is working with TextMate in OS X and other with a windows editor (notepad+). This last one is putting a UTF-8 BOM. After that the Django development server is adding other UTF-8 BOM. But looking at the sources of the HTML with a text editor, I can&apos;t see nothing before the &lt;DOCTYPE&gt;. This will be a hard to spot &quot;feature-working-as-a-bug&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83580</commentid>
    <comment_count>10</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2008-06-17 00:09:09 -0700</bug_when>
    <thetext>(In reply to comment #9)
&gt; But are there any way to know that the browser is working in
&gt; quirks mode?

There is always alert(document.compatMode), although it is admittedly only helpful when you already suspect something like that.

&gt; But the BOM one is not, because it&apos;s an invisible-no-breaking-space character,
&gt; so you need to use a hexeditor to see them. 

This is very true. In some similar cases, this can even lead to security bugs, so it is particularly important to handle invisible characters to the letter of the spec, so that all browsers and security filters agree on the same behavior.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83581</commentid>
    <comment_count>11</comment_count>
    <who name="Rafa Barbera">rbarberac</who>
    <bug_when>2008-06-17 00:15:31 -0700</bug_when>
    <thetext>&gt;There is always alert(document.compatMode), although it is admittedly only
&gt;helpful when you already suspect something like that.

Well, after this incident I&apos;ll always suspect something like that ;-).

&gt;In some similar cases, this can even lead to security bugs,
&gt;so it is particularly important to handle invisible characters to the letter of
&gt;the spec, so that all browsers and security filters agree on the same behavior.

Yes, it seems the way to go. </thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>21724</attachid>
            <date>2008-06-16 02:59:18 -0700</date>
            <delta_ts>2008-06-16 02:59:18 -0700</delta_ts>
            <desc>Case reduction</desc>
            <filename>font-size.html</filename>
            <type>text/html</type>
            <size>2308</size>
            <attacher name="Rafa Barbera">rbarberac</attacher>
            
              <data encoding="base64">77u/77u/PCFET0NUWVBFIGh0bWwgUFVCTElDICItLy9XM0MvL0RURCBIVE1MIDQuMDEvL0VOIgog
ICAiaHR0cDovL3d3dy53My5vcmcvVFIvaHRtbDQvc3RyaWN0LmR0ZCI+Cgo8aHRtbCBsYW5nPSJl
biI+CjxoZWFkPgoJPHRpdGxlPkZvbnQtc2l6ZSBpbiBib2R5PC90aXRsZT4KCTxzdHlsZSB0eXBl
PSJ0ZXh0L2NzcyIgbWVkaWE9InNjcmVlbiI+CgkJYm9keSB7IAoJCQlmb250LXNpemU6MjRweDsg
CgkJfQoJPC9zdHlsZT4KPC9oZWFkPgo8Ym9keT4KCTxwPkxvcmVtIGlwc3VtIGRvbG9yIHNpdCBh
bWV0LCBjb25zZWN0ZXR1ciBhZGlwaXNpY2luZyBlbGl0LCBzZW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