mozilla
Your Search Results

    Whitespace in the DOM

    Moved from DOM:element.firstChild, doesn't really belong there. --Nickolay 16:09, 19 June 2006 (PDT)

    Whitespace

    More about the phantom nodes issue read at bugĀ 26179 (do not comment in that bug!). One may format his code as shown below to work around the problem:

    <!-- Conventional pretty-print currently
         leading to DOM Tree pollution in Gecko:
     -->
    <div>
     <ul>
      <li>Position 1</li>
      <li>Position 2</li>
      <li>Position 3</li>
     </ul>
    </div>
    
    <!-- Pretty-print adjusted to the
         phantom nodes issue:
     -->
    <div
     ><ul
      ><li>Position 1</li
      ><li>Position 2</li
      ><li>Position 3</li
     ></ul
    ></div>
    

    I have moved the pretty-print workaround back to http://developer.mozilla.org/en/docs...ace_in_the_DOM Thinking back, I see no reason why http://developer.mozilla.org/en/docs..._things_easier would be suitable for Javascript-based tree walker description but not for the common pretty print workaround. They are both solving the same problem and "making things easier".

    Document Tags and Contributors

    Contributors to this page:
    Last updated by: VK,