title: Why does Internet Explorer need the "hasLayout" flag?
body: <p>Like many developers working on web sites for Internet Explorer, I seem to come across a lot of bugs that are caused by the notorious <a href="http://msdn.microsoft.com/en-us/library/bb250481(VS.85).aspx" rel="nofollow noreferrer"><code>hasLayout</code> flag</a>.</p>
  
  <p>I understand what this flag does and how it works (for the most part). A good explanation I read the other day (although I can't find the source) is that <code>hasLayout</code> in IE essentially means "Make this element a rectangle."</p>
  
  <p>It's obviously more complicated than that, but it's pretty well summed up with that (in my opinion).</p>
  
  <p>What I don't understand is why the browser uses this flag. When looking for an answer, I found one that sounded logical: </p>
  
  <blockquote>
    <p>Internet Explorer had to deal with very old legacy code from before CSS was really in full swing. As an architectural decision to make the browser easy to add CSS on to it, the <code>hasLayout</code> flag was used to trigger certain CSS properties so the page would be rendered correctly. This dates back to around the time of IE4.</p>
  </blockquote>
  
  <p>This almost made sense to me, until I realized that Firefox (Netscape at the time) had to deal with the same problem. Netscape has been around for pretty much as long as Internet Explorer, however it doesn't need any internal <code>hasLayout</code> flag, or anything similar,as far as I know.</p>
  
  <p>Seeing as how the <code>hasLayout</code> flag is the source of so many bugs in Internet Explorer, does anyone know why IE has this flag and other browsers don't need it?</p>
  
  <p>This is something I'd like to know purely out of curiosity if anyone has any theories or happens to know the answer. I'd like to understand more about why (or why not) this flag is useful.</p>