Web page layout in Mozilla

L. David Baron

Mozilla Corporation

dbaron@dbaron.org

Mozilla Online Ltd. (谋智网络), Běijīng, China

Saturday, September 8, 2007, 15:00 CST

Web standards for Layout

Web standards for Layout

Origins

Origins

Traditional document layout

Image of Rosetta Stone, with lines of text

Traditional document layout

Image of Koran, with lines of text

Traditional document layout

Image of part of Strasbourg Oaths, with lines of text

Traditional document layout

Image of Rigveda, showing lines of text

Traditional document layout

Image of Chinese calligraphy, showing vertical lines of text

Traditional document layout

Image of Chinese calligraphy, showing vertical lines of text

Traditional document layout, enhanced

Image of Gutenberg Bible, showing two columns of text, with some enhanced first-letter effects

Traditional document layout, on the Web

W3C HTML4 specification, showing traditional document layout

Traditional document layout, on the Web

W3C CSS2 specification, showing traditional document layout with tables

Traditional document layout for user interface

W3C TR page, showing mostly traditional document layout

User interface layout

Image of GNOME desktop background preferences, showing a dialog that behaves well when resized

User interface layout

Image of Firefox browser, showing a window that behaves well when resized

Document formats

Document formats: Trees

<html>
  <head>
    <title>A few quotes</title>
  </head>
  <body>
    <p class="emph">
      Franklin said that <q>A penny
      saved is a penny earned.</q>
    </p>
    <p>
      FDR said <q>We have nothing to
      fear but <span class="emph">fear
      itself.</span></q>
    </p>
  </body>
</html>

Document formats: Trees

html
headbody
titlep
class="emph"
p
qq
span
class="emph"

Document formats: Trees

Document formats: Parsing

Document formats: Parsing: Future

Document formats: content tree

What do content nodes hold?

everything we store from the markup

<html>
  <head>
    <title>A few quotes</title>
  </head>
  <body>
    <p class="emph">
      Franklin said that <q>A penny
      saved is a penny earned.</q>
    </p>
    <p>
      FDR said <q>We have nothing to
      fear but <span class="emph">fear
      itself.</span></q>
    </p>
  </body>
</html>

What do content nodes hold?

form state

What do content nodes hold?

results of script modifications to that state

A table

What else uses content nodes?

Cascading Style Sheets

Frame tree

Layout

Style Computation

Frame construction

Reflow

Intrinsic sizes

preferred width

Intrinsic sizes

minimum width

Painting

Graphics

Scripting