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

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>20935</bug_id>
          
          <creation_ts>2013-02-09 13:32:53 +0000</creation_ts>
          <short_desc>code example input breaks layout</short_desc>
          <delta_ts>2013-05-27 02:23:06 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>webplatform.org</product>
          <component>infrastructure</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc>www.meow1.com</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>mail</reporter>
          <assigned_to name="Doug Schepers">schepers</assigned_to>
          <cc>cmills</cc>
    
    <cc>shmcl9</cc>
    
    <cc>team-webplatform-admin</cc>
          
          <qa_contact name="public-webplatform-bugs list">public-webplatform-bugs</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>82841</commentid>
    <comment_count>0</comment_count>
    <who name="">mail</who>
    <bug_when>2013-02-09 13:32:53 +0000</bug_when>
    <thetext>This code example breaks the layout, though I don&apos;t know whats the reason for this:

&lt;!doctype html&gt;
&lt;html&gt;
&lt;head&gt;
&lt;meta content=&quot;text/html; charset=UTF-8&quot; http-equiv=&quot;Content-Type&quot; /&gt;
&lt;title&gt;Image preview example&lt;/title&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
oFReader = new FileReader(), rFilter = &apos;image/jpg&apos;;
 
oFReader.onload = function (oFREvent) {
  document.getElementById(&quot;uploadPreview&quot;).src = oFREvent.target.result;
};
 
function loadImageFile() {
  if (document.getElementById(&quot;uploadImage&quot;).files.length === 0) { return; }
  var oFile = document.getElementById(&quot;uploadImage&quot;).files[0];
  if (!rFilter.test(oFile.type)) { alert(&quot;You must select a valid image file!&quot;); return; }
  oFReader.readAsDataURL(oFile);
}
&lt;/script&gt;
&lt;/head&gt;
 
&lt;body onload=&quot;loadImageFile();&quot;&gt;
  &lt;form name=&quot;uploadForm&quot;&gt;
    &lt;table&gt;
      &lt;tbody&gt;
        &lt;tr&gt;
          &lt;td&gt;&lt;img id=&quot;uploadPreview&quot; style=&quot;width: 100px; height: 100px;&quot; src=&quot;&quot; alt=&quot;Image preview&quot; /&gt;&lt;/td&gt;
          &lt;td&gt;&lt;input id=&quot;uploadImage&quot; type=&quot;file&quot; name=&quot;myPhoto&quot; onchange=&quot;loadImageFile();&quot; /&gt;&lt;/td&gt;
        &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
 
    &lt;p&gt;&lt;input type=&quot;submit&quot; value=&quot;Send&quot; /&gt;&lt;/p&gt;
  &lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82844</commentid>
    <comment_count>1</comment_count>
    <who name="Chris Mills">cmills</who>
    <bug_when>2013-02-09 14:03:03 +0000</bug_when>
    <thetext>It sucks, but the code example fields don&apos;t get escaped automatically, so some of the HTML is being interpreted.

For the display code, try escaping the angle brackets, for example with HTML entity references.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82845</commentid>
    <comment_count>2</comment_count>
    <who name="">mail</who>
    <bug_when>2013-02-09 14:04:39 +0000</bug_when>
    <thetext>replacing all html entities helps, but this could be automated</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82846</commentid>
    <comment_count>3</comment_count>
    <who name="Chris Mills">cmills</who>
    <bug_when>2013-02-09 14:05:56 +0000</bug_when>
    <thetext>Agreed.

I&apos;ve got it on my feedback list for this weekend, and will raise it as a task to be done.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82848</commentid>
    <comment_count>4</comment_count>
    <who name="David Kirstein (Frozenice)">frozenice</who>
    <bug_when>2013-02-09 14:27:57 +0000</bug_when>
    <thetext>*** Bug 20936 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>