layout/doc/table_reflow_slides.html

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 <!-- This Source Code Form is subject to the terms of the Mozilla Public
     2    - License, v. 2.0. If a copy of the MPL was not distributed with this
     3    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
     5 <!-- vim:sw=2:et:ts=2:tw=72:
     6 -->
     7 <!DOCTYPE html public "-//W3C//DTD HTML 4.01 Transitional//EN"
     8   "http://www.w3.org/TR/html4/loose.dtd">
     9 <html lang="en-US">
    10 <head>
    11   <title>Table Reflow Tech Talk, 2002-08-05</title>
    12   <style type="text/css">
    14   html, body {
    15     height: 100%;
    16     overflow: visible;
    17   }
    19   body {
    20     font-size: 1.4em;
    21     font-family: Verdana, Arial, Helvetica, sans-serif;
    22     font-weight: bold;
    23     background: white;
    24     color: black;
    25   }
    27   h1, h2, p {
    28     margin: 0;
    29   }
    31   h1 {
    32     font: inherit;
    33     font-size: 1.5em;
    34     /* text-align: center; */
    35     margin-bottom: 0.8em;
    36     border-bottom: 0.1em solid #006;
    37 	color: #006;
    38   }
    40   h2 {
    41     font: inherit;
    42     font-size: 1.2em;
    43     text-align: left;
    44     margin: 0.15em 0;
    45   }
    47   ul {
    48     padding: 0 0 0 1.4em;
    49     margin: 0;
    50   }
    52   li { margin: 0; 
    53        margin-top: 0.5em; 
    54 	   padding: 0; 
    55 	   font-size: 1.0em;}
    57   div.slide {
    58     position: relative;
    59     min-height: 100%;
    60   }
    62   div.nav {
    63     /*
    64     position: absolute;
    65     top: 4px;
    66     right: 4px;
    67     */
    68     float: right;
    69     margin: 4px;
    70   }
    72   div.nav :link, div.nav :visited, div.nav span {
    73     text-decoration: none;
    74     background: #006;
    75     color: white;
    76     padding: 0 0.4em 0.2em 0.4em;
    77     line-height: 1.4em;
    78   }
    80   div.nav :link:hover, div.nav :visited:hover {
    81     background: #00f;
    82   }
    84   table {
    85     margin: auto;
    86   }
    88   table.box {
    89     border-collapse: collapse;
    90 	border: 2px solid black;
    91 	box-sizing: border-box;
    92 	width:98%;
    93 	height:96%;
    94   }
    96   row {
    97     border: 2px solid black;
    98   }
    99   row.title {
   100     border: hidden;
   101   }
   103   table td {
   104     /*text-align: center;*/
   105     empty-cells: hide;
   106   }
   108   table td.box {
   109     height:100%;
   110 	border: 2px solid black;
   111   }
   113   table td.title {
   114     border-top: hidden;
   115     border-right: hidden;
   116     border-left: hidden;
   117 	font-size: .5em;
   118   }
   120   table td.title2 {
   121     border-bottom: hidden;
   122     border-right: hidden;
   123     border-left: hidden;
   124 	font-size: .5em;
   125   }
   127   table.tree tr:not(.arrows) td {
   128     font-family: monospace;
   129     border: 0.1em solid;
   130 	font-size: .7em;
   131 	text-align:center;
   132   }
   134   table td.left-arrow {
   135     text-align: right;
   136   }
   138   table td.right-arrow {
   139     text-align: left;
   140   }
   142   table td.center-arrow {
   143     text-align: center;
   144   }
   146   span.html {
   147     color:purple;
   148   }
   150   table td.space {
   151     width: 5%;
   152   }
   154   table td.frame {
   155     width: 22%;
   156   }
   158   span.comment {
   159     color: red;
   160   }
   162   </style>
   163 </head>
   164 <body>
   166 <div class="slide" id="s0">
   167   <div class="nav">
   168     <a href="#s28">&lt;</a>
   169     <a href="#s1">&gt;</a>
   170   </div>
   171   <table style="margin: auto"><tr><td>
   172   <center>
   173     <h1>Table Reflow Internals<br>Tech Talk</h1>
   174     <p>Aug 5, 2002</p>
   175     <p style="margin-top: 0.5em">Chris Karnaze</a></p>
   176   </center>
   177   </td></tr></table>
   179 </div>
   181 <div class="slide" id="s1">
   182   <div class="nav">
   183     <a href="#s0">&lt;</a>
   184     <a href="#s2">&gt;</a>
   185   </div>
   186   <h1>Overview</h1>
   187   <ul>
   188     <li>Review of reflow</li>
   189     <li>Table frames</li>
   190     <li>Table reflow</li> 
   191     <li>Intro to paginated reflow</li>
   192     <li>Table paginated reflow</li>
   193   </ul>
   194 </div>
   196 <div class="slide" id="s2">
   197   <div class="nav">
   198     <a href="#s1">&lt;</a>
   199     <a href="#s3">&gt;</a>
   200   </div>
   201   <h1>Review of Reflow</h1>
   202   <ul>
   203     <li>Reflow process starts when
   204       <ul>
   205         <li>An html document starts loading (the frame tree contains only viewport, scroll(s), canvas, html, body).</li>
   206         <li>The initial chunk of an xml doc is loaded.</li> 
   207         <li>The initial chunk of an html doc (or a subsequent chunk of an xml doc) is loaded. The container posts a 
   208         dirty reflow command with itself as the target. </li>
   209         <li>Content is inserted, appended, or deleted through the DOM. The container posts a dirty reflow command 
   210         with itself as the target.</li>
   211         <li>Style changes through the DOM - javascript, browser change font (CTRL+/-), a preference changes, etc.</li>
   212       </ul>
   213 	</li>
   214   </ul>
   215 </div>
   217 <div class="slide" id="s3">
   218   <div class="nav">
   219     <a href="#s2">&lt;</a>
   220     <a href="#s4">&gt;</a>
   221   </div>
   222   <h1>Review of Reflow</h1>
   223   <ul>
   224     <li>Reflow starts with pres shell
   225       <ul>
   226         <li>Which reflows the reflow root (usually the view port frame),</li>
   227         <li>Which reflows it children, etc.</li>
   228       </ul>
   229     </li>
   230     <li>Ususally it starts when the pres shell processes its queue of reflow commands.</li>
   231     <li>The reflower
   232 	 <ul>
   233          <li>Positions reflowee (if it can) before actually reflowing in case views are involved 
   234 		 (e.g. absolutely positioned elements) </li>
   235          <li>Reflows reflowee and passes a reflow state (in) and a reflow metrics (in/out)</li> 
   236 	 </ul>
   237     </li>
   238   </ul>
   239 </div>
   241 <div class="slide" id="s4">
   242   <div class="nav">
   243     <a href="#s3">&lt;</a>
   244     <a href="#s5">&gt;</a>
   245   </div>
   246   <h1>Review of Reflow</h1>
   247   <ul>
   248     <li>The reflow state:
   249 	 <ul>
   250       <li>Is a node in a tree structurally equivalent to the frame tree of reflow participants</li>
   251       <li>contains:
   252         <ul> 
   253          <li>reflow type,</li>
   254          <li>avail size,</li> 
   255          <li>various computed values,</li>
   256          <li>resolved style structs</li>
   257          <li>possible request for preferred size and more.</li>
   258         </ul>
   259       </li> 
   260      </ul>
   261     </li>
   262    </ul>
   263 </div>
   265 <div class="slide" id="s5">
   266   <div class="nav">
   267     <a href="#s4">&lt;</a>
   268     <a href="#s6">&gt;</a>
   269   </div>
   270   <h1>Review of Reflow</h1>
   271   <ul>
   272     </li>
   273       <li>the reflow metrics contains:
   274     	 <ul class=nested>
   275       <li>max element size (if requested) - the minimum size it can be</li> 
   276       <li>preferred size (if requested) - the size it would like to be given no size constraints.</li> 
   277       <li>desired size - the size it would like to be given the avail size. This
   278 	  is equivalent to preferred size if the avail size is not constrained.</li>
   279 	 </ul>
   280 	</li>
   281       </ul>
   282 </div>
   284 <div class="slide" id="s6">
   285   <div class="nav">
   286     <a href="#s5">&lt;</a>
   287     <a href="#s7">&gt;</a>
   288   </div>
   289   <h1>Review of Reflow</h1>
   290  <ul>
   291  <li>The reflowee sets various sizes in the reflow metrics after (possibly) reflowing some or all of its children 
   292     which reflows it children, etc.</li>
   293  <li>The reflowee returns a reflow status which indicates
   294 	 <ul class=nested>
   295       <li>if it is complete, and thus not have to continue (split)</li>
   296       <li>breaking status (in the case of some inline frames)</li> 
   297       <li>if there is truncation (it can't fit in the space and can't split). This is just a convience mechanism.</li>
   298 	 </ul>
   299 	</li>
   301 </div>
   303 <div class="slide" id="s7">
   304   <div class="nav">
   305     <a href="#s6">&lt;</a>
   306     <a href="#s8">&gt;</a>
   307   </div>
   309   <h1>Kinds of reflows</h1>
   310   <ul>
   311     <li>Initial - reflowee's first reflow must be of this type (reflower's responsibility).</li> 
   312     <li>Resize - reflowee gets a change in available space only. Similar to initial, except it can reoccur.</li> 
   313     <li>Incremental - has a reflow path (tree) where each node has a command with a target frame, <br>reflow command types are:</li> 
   314    	 <ul class=nested>
   315       <li>dirty - something changed inside a target (e.g. it gains, loses children)</li>
   316       <li>style changed - a target changed stylisticly (recall, size is a style property)</li> 
   317       <li>content changed - a target's content changed (e.g. a text run)</li> 
   318       <li>user defined - currently only used for fixed positioned frames </li> 
   319 	 </ul>
   320 	</li>
   321   </ul>
   322 </div>
   324 <div class="slide" id="s8">
   325   <div class="nav">
   326     <a href="#s7">&lt;</a>
   327     <a href="#s9">&gt;</a>
   328   </div>
   329   <h1>Kinds of reflows</h1>
   330   <ul>
   331     <li>Incremental reflow (continued)
   332 	 <ul class=nested>
   333       <li>reflower not allowed to change available size of reflowee</li>
   334       <li>reflow commands get coalesced to streamline processing</li> 
   335 	 </ul>
   336 	</li>
   337     <li>Style change 
   338 	 <ul class=nested>
   339       <li>a target changed stylistic if there is a target, otherwise every frame may need to respond</li>
   340       <li>parent of target usually turns it into an incremental reflow with a style changed command type</li> 
   341 	 </ul>
   342 	</li>
   343   </ul>
   344 </div>
   346 <div class="slide" id="s9">
   347   <div class="nav">
   348     <a href="#s8">&lt;</a>
   349     <a href="#s10">&gt;</a>
   350   </div>
   351   <h1>Table Frames</h1>
   352   <BR>
   353   <table class="tree" width=90%>
   354   <tr><td class=frame><td class=space style="width:2%"><td class=frame><td class=space style="width:2%">
   355       <td class=frame><td class=space><td class=frame></tr>
   356   <tr><td><td><td class=frame><td>
   357       <td>nsTableOuter Frame<td><td></tr>
   358   <tr class="arrows"><td><td><td><td class=left-arrow>&#x2199;<td><td class=right-arrow>&#x2198;</tr>
   359   <tr><td><td><td>nsTable<BR>Frame<td><td><td><td>nsTableCaption<BR>Frame</tr>
   360   <tr class="arrows"><td><td class=left-arrow>&#x2199;<td><td class=right-arrow>&#x2198;<td><td><td class=center-arrow>&darr;</tr>
   361   <tr><td>nsTableCol<BR>GroupFrame<td><td><TD><td>nsTableRow<BR>GroupFrame<td><td>nsBlockFrame</tr>
   362   <tr class="arrows"><td class=center-arrow>&darr;<td><td><td><td class=center-arrow>&darr;</tr>
   363   <tr><td>nsTableCol<BR>Frame<td><TD><TD><td>nsTableRow<BR>Frame</tr>
   364   <tr class="arrows"><td><td><td><td><td class=center-arrow>&darr;</tr>
   365   <tr><td><td><td><TD><td>nsTableCell<BR>Frame</tr>
   366   <tr class="arrows"><td><td><td><td><td class=center-arrow>&darr;</tr>
   367   <tr><td><td><td><TD><td>nsBlock<BR>Frame</tr>
   368   </table>
   369 </div>
   371 <div class="slide" id="s10">
   372   <div class="nav">
   373     <a href="#s9">&lt;</a>
   374     <a href="#s11">&gt;</a>
   375   </div>
   376   <h1>Table Reflow</h1>
   377   <ul>
   378     <li>Outer table reflows table and caption (if present)</li>
   379 	<li>Table reflows row groups in multiple passes</li> 
   380 	 <ul class=nested>
   381       <li>Pass 1 - unconstrained width, height and requests max elem width.</li>
   382       <li>The table figures out the column widths (balances) given the style width constraints
   383 	  on the table, col groups, cols, cells the preferred and max element sizes of the cells 
   384 	  (from the pass 1 reflow), and considers colspans</li> 
   385       <li>Pass 2 - cell widths are constrained by the column widths (heights are only 
   386 	  constrained in paginated mode).</li> 
   387 	 </ul>
   388 	</li>
   389   </ul>
   390 </div>
   392 <div class="slide" id="s11">
   393   <div class="nav">
   394     <a href="#s10">&lt;</a>
   395     <a href="#s12">&gt;</a>
   396   </div>
   397   <h1>Table Reflow</h1>
   398   <ul>
   399 	<li>Table reflows row groups (continued)</li> 
   400 	 <ul class=nested>
   401       <li>The row group figures out the row heights given the its style height constraints
   402 	  its rows and cells and the actual heights of its rows and cells from the pass 2 reflow</li> 
   403       <li>If the table has a style height, it allocates extra height to its row groups, rows and cells.</li> 
   404 	 </ul>
   405 	</li>
   406     <li>In each pass, row groups reflow rows which reflow cells which reflow cell blocks</li>
   407   </ul>
   408 </div>
   410 <div class="slide" id="s12">
   411   <div class="nav">
   412     <a href="#s11">&lt;</a>
   413     <a href="#s13">&gt;</a>
   414   </div>
   415   <h1>Table Reflow Example</h1>
   416   <table width=100%>
   417    <tr>
   418     <td width=100%>
   419 	 <pre style="font-size:.6em;">
   420 tblO 030176CC r=0 a=8940,UC c=0,0 cnt=429
   421   tbl 030178C4 r=0 a=8940,UC c=4470,UC cnt=430
   422    rowG 03017A7C r=0 a=UC,UC c=UC,UC cnt=431 
   423     row 03017C08 r=0 a=UC,UC c=UC,UC cnt=432
   424      cell 03017DA8 r=0 a=UC,UC c=UC,UC cnt=433
   425       block 03017E08 r=0 a=UC,UC c=UC,UC cnt=434
   426       block 03017E08 d=870,300 me=480
   427      cell 03017DA8 d=930,360 me=540
   428      cell 0301A8CC r=0 a=UC,UC c=UC,UC cnt=436
   429       block 0301A92C r=0 a=UC,UC c=UC,UC cnt=437
   430       block 0301A92C d=1335,300 me=465
   431      cell 0301A8CC d=1395,360 me=525
   432     row 03017C08 d=UC,360
   433    rowG 03017A7C d=UC,360
   434    rowG 03017A7C r=2 a=4470,UC c=4470,UC cnt=442
   435     row 03017C08 r=2 a=4470,UC c=4470,UC cnt=443
   436      cell 03017DA8 r=2 a=1755,UC c=1695,UC cnt=444
   437       block 03017E08 r=2 a=1695,UC c=1695,UC cnt=445
   438       block 03017E08 d=1695,300
   439      cell 03017DA8 d=1755,360
   440      cell 0301A8CC r=2 a=2625,UC c=2565,UC cnt=446
   441       block 0301A92C r=2 a=2565,UC c=2565,UC cnt=447
   442       block 0301A92C d=2565,300
   443      cell 0301A8CC d=2625,360
   444     row 03017C08 d=4470,360
   445    rowG 03017A7C d=4470,360
   446   tbl 030178C4 d=4500,450
   447  tblO 030176CC d=4500,450
   449  <a href="frame_reflow_debug.html">frame reflow debugging</a> gives instructions 
   450  for turning this on.
   451  </pre>
   452    </td>
   453    <td>
   454      <pre style="font-size:.7em;">
   455 &lt;<span class=html>table</span> width=300&gt;
   456   &lt;<span class=html>tr</span>&gt;
   457     &lt;<span class=html>td</span>&gt;foo&lt;<span class=html>/td</span>&gt;
   458     &lt;<span class=html>td</span>&gt;bar zap&lt;<span class=html>/td</span>&gt;
   459   &lt;<span class=html>/tr</span>&gt;
   460 &lt;<span class=html>/table</span>&gt;
   461      </pre>
   462 	 <BR>
   463 	 <BR>
   464 	 <pre style="font-size:.7em;">
   465 Key:
   467   r  = reflow reason, 
   468        0 (initial),
   469        2 (resize) 
   470   a  = avail w, h
   471   c  = computed w, h
   472   d  = desired w, h
   473   me = max elem w
   474      <pre>
   475 	</td>
   476   </tr>
   477  </table>
   478 </div>
   480 <div class="slide" id="s13">
   481   <div class="nav">
   482     <a href="#s12">&lt;</a>
   483     <a href="#s14">&gt;</a>
   484   </div>
   485   <h1>Table reflow optimizations</h1>
   486   <ul>
   487     <li>If the table is already balanced, pass 1 constrains the width (like a normal pass 2) based on the current
   488 	column widths. The pass 2 will get skipped if the table doesn't need to rebalance. <!--<span class="comment">please clarify when can this happen</span>--></li> 
   489     <li>Nested table reflowed with an unconstrained width (i.e. an ancestor is doing a pass 1 reflow)
   490 	will only do a pass 1 reflow on its children</li>
   491     <li>Outer table caches last avail width and avoids reflowing children if resize reflow is the same as previous</li>
   492     <li>Table caches max element, preferred widths in case they are requested and it isn't rebalanced</li>
   493     <li>Cell caches prior avail width. if this doesn't change, the row may not have to reflow the cell</li>
   494   </ul>
   496 </div>
   498 <div class="slide" id="s14">
   499   <div class="nav">
   500     <a href="#s13">&lt;</a>
   501     <a href="#s15">&gt;</a>
   502   </div>
   503   <h1>Table incremental reflow</h1>
   504   <ul>
   505     <li>Outer table is a target when a caption is added or removed (dirty) or the table or caption margin 
   506   changes (style changed).</li> 
   507     <li>Caption is a target when it changes stylistically (style changed).</li>
   508     <li>Table, row group, row, col group, col is a target when a child is added or removed (dirty) or it changes
   509   stylistically (style changed). <!--<span class="comment">please show how the column style change is propagated 
   510                into the cell reflows as the cells are reflowed by their parent rows and not cols</span>--></li>
   511     <li>In the dirty cases, a target posted the reflow command in AppendFrames, InsertFrames, or DeleteFrame.</li>
   512   </ul>
   513 </div>
   515 <div class="slide" id="s15">
   516   <div class="nav">
   517     <a href="#s14">&lt;</a>
   518     <a href="#s16">&gt;</a>
   519   </div>
   520   <h1>Table incremental reflow</h1>
   521   <ul>
   522     <li>In the style change cases where a target is between the table and the cell, the table is told to rebalance.</li>
   523     <li>When a target is the cell or below and the cell changes size, the row tells the table so it can decide if 
   524   it needs to rebalance</li>
   525     <li>When a target is inside the cell's block, the cell
   526   requests max element, preferred sizes of its block in case they change</li>
   527     <li>After the table reflows the row group(s) containing the targets, if it rebalances, it then does a pass 2 reflow.</li>
   528   </ul>
   529 </div>
   531 <div class="slide" id="s16">
   532   <div class="nav">
   533     <a href="#s15">&lt;</a>
   534     <a href="#s17">&gt;</a>
   535   </div>
   536   <h1>Special height reflow</h1>
   537   <ul>
   538     <li>When there is a % height frame inside a cell without a computed height</li>
   539 	  <ul class=nested>
   540 	    <li>the frame will never get a chance to size based on the final cell height</li>
   541         <li>in paginated mode when there is a height on the table, the table doesn't allocate
   542 		extra height to rows until after it does a pass 2 reflow and then it is too late</li>
   543 	  </ul>
   544 	</li>
   545     <li>This can be fixed by doing a special 3rd pass reflow</li>
   546   </ul>
   547   </div>
   548 </div>
   550 <div class="slide" id="s17">
   551   <div class="nav">
   552     <a href="#s16">&lt;</a>
   553     <a href="#s18">&gt;</a>
   554   </div>
   555   <h1>Special Reflow Example</h1>
   556   <table width=100% style="text-align:left;">
   557    <tr>
   558    <td>
   559      <pre style="font-size:.7em; text-align:left;">
   560 &lt;<span class=html>table</span> border=2 width=300&gt;
   561   &lt;<span class=html>tr</span>&gt;
   562     &lt;<span class=html>td</span>&gt;
   563       This cell's width is 
   564       constrained by the 
   565       table and image widths. 
   566       Its exact height is 
   567       hard to determine.
   568     &lt;<span class=html>/td</span>&gt;
   569     &lt;<span class=html>td</span>&gt;
   570       &lt;<span class=html>img</span> src=raptor.jpg
   571        width=200 height=100%>
   572     &lt;<span class=html>/td</span>&gt;
   573   &lt;<span class=html>/tr</span>&gt;
   574 &lt;<span class=html>/table</span>&gt;
   575      </pre>
   576    </td>
   577     <td>
   578 	 <table border=2 width=300>
   579       <tr>
   580        <td style="font-size:.7em;">This cell's width is constrained 
   581         by the table and image widths. <BR><BR>Its height
   582 		is hard to determine.<BR><BR> The image needs to be as high as the cell.
   583        <td>
   584        <!-- need ?raw=1 for lxr to cough up the image data, not a pretty page -->
   585        <img src="raptor.jpg?raw=1" 
   586       width=200 height=100%>
   587     </td>
   588    </tr>
   589   </table>
   591   </tr>
   592  </table>
   593 </div>
   596 <div class="slide" id="s18">
   597   <div class="nav">
   598     <a href="#s17">&lt;</a>
   599     <a href="#s19">&gt;</a>
   600   </div>
   601   <h1>Special height reflow</h1>
   602   <ul>
   603     <li>The reflow state holds an observer and initiator</li>
   604     <li>Observer</li>
   605 	  <ul class=nested>
   606 	    <li>is the table cell used as the height basis</li>
   607         <li>set by frame without computed height in DidReflow</li>
   608         <li>gives its block a computed height during 3rd pass</li>
   609         <li>doesn't change height during 3rd pass</li>
   610 	  </ul>
   611 	</li>
   612     <li>Initiator</li>
   613 	  <ul class=nested>
   614 	    <li>is the table containing the observer</li>
   615         <li>starts the 3rd pass reflow and sets a bit in the reflow state</li>
   616         <li>gives its block a computed height during 3rd pass</li>
   617         <li>could also be inside a cell which is an observer</li>
   618 	  </ul>
   619 	</li>
   620 </div>
   622 <div class="slide" id="s19">
   623   <div class="nav">
   624     <a href="#s18">&lt;</a>
   625     <a href="#s20">&gt;</a>
   626   </div>
   627   <h1>Special height reflow</h1>
   628   <ul>
   629     <li>Optimizations</li>
   630 	  <ul class=nested>
   631 	    <li>only frames needing 3rd pass actually get it</li>
   632         <li>frames gettting a 3rd pass only get it once</li>
   633 	  </ul>
   634 	</li>
   635 </div>
   637 <div class="slide" id="s20">
   638   <div class="nav">
   639     <a href="#s19">&lt;</a>
   640     <a href="#s21">&gt;</a>
   641   </div>
   642   <h1>Intro to paginated reflow</h1>
   643   <ul>
   644     <li>When a reflowee's available height is constrained, it may not fit and need to either 
   645 	split/continue on the next page, or start on the next page.</li>
   646 	  <ul class=nested>
   647 	    <li>If it can continue, it returns an incomplete status.</li>
   648         <li>If it can't continue it returns a complete status.</li>
   649 	  </ul>
   650 	</li>
   651     <li>A continuation may also need to be continued</li>
   652     <li>Continuations are linked together by prevInFlow and nextInFlow pointers </li>
   653   </ul>
   654 </div>
   656 <div class="slide" id="s21">
   657   <div class="nav">
   658     <a href="#s20">&lt;</a>
   659     <a href="#s22">&gt;</a>
   660   </div>
   661   <h1>Pagination Illustration</h1>
   662   <table class=box style="height:500px">
   663    <tr><td class="title">nsSimplePageSequence</td></tr>
   664    <tr>
   665     <td class=box>
   666 	 <table class=box style="height:40%;">
   667 	  <tr><td class=title>nsPageFrame</td></tr>
   668 	  <tr>
   669 	   <td class=box>
   670 	    <table class=box style="height:100%;">
   671 	     <tr><td class=title>nsPageContentFrame</td></tr>
   672 	     <tr>
   673 	      <td class=box style="border-bottom: hidden">
   674 	       <table class=box style="height:100%; border-bottom:hidden">
   675 	        <tr><td class=title>areaFrame (html)</td></tr>
   676 	        <tr>
   677 	         <td class=box>
   678 			  <table class=box style="height:100%; border-bottom:hidden">
   679 	           <tr><td class=title>blockFrame (body)</td></tr>
   680 	           <tr>
   681 	            <td class=box>
   682 			     <table class=box style="height:100%; border-bottom:hidden">
   683 	              <tr><td class=title>nsTableOuterFrame</td></tr>
   684 	              <tr>
   685 	               <td class=box></td>
   686 	              </tr>
   687 	             </table>
   688 				</td>
   689 	           </tr>
   690 	          </table>
   691              </td>
   692 	        </tr>
   693 	       </table>
   694 	     </tr>
   695 	    </table>
   696 	   </td>
   697 	  </tr>
   698 	 </table>
   699 	 <BR>
   700 	 <table class=box style="height:40%;">
   701 	  <tr>
   702 	   <td class=box>
   703 	    <table class=box style="height:100%;">
   704 	     <tr>
   705 	      <td class=box style="border-top: hidden">
   706 	       <table class=box style="height:100%; border-top:hidden">
   707 	        <tr>
   708 	         <td class=box>
   709 			  <table class=box style="height:100%; border-top:hidden">
   710 	           <tr>
   711 	            <td class=box>
   712 			     <table class=box style="height:100%; border-top:hidden">
   713 	              <tr>
   714 	               <td class=box></td>
   715 	              </tr>
   716 	              <tr><td class=title2>nsTableOuterFrame</td></tr>
   717 	             </table>
   718 				</td>
   719 	           </tr>
   720 	           <tr><td class=title2>blockFrame (body)</td></tr>
   721 	          </table>
   722              </td>
   723 	        </tr>
   724 	        <tr><td class=title2>areaFrame (html)</td></tr>
   725 	       </table>
   726 	     </tr>
   727 	     <tr><td class=title2>nsPageContentFrame continued</td></tr>
   728 	    </table>
   729 	   </td>
   730 	  </tr>
   731 	  <tr><td class=title2>nsPageFrame continued</td></tr>
   732 	 </table>
   733 	</td>
   734    </tr>
   735   </table>
   736 </div>
   738 <div class="slide" id="s22">
   739   <div class="nav">
   740     <a href="#s21">&lt;</a>
   741     <a href="#s23">&gt;</a>
   742   </div>
   743   <h1>Intro to paginated reflow</h1>
   744   <ul>
   745     <li>The page sequence starts with one page and reflows it. If the page is incomplete then the page sequence
   746         creates a continuation for the page and sets it as the page's next sibling (it is also the page's 
   747 		nextInFlow).</li>
   748     <li>The page was incomplete because the page content was incomplete because the doc root was incomplete</li>
   749     <li>The doc root was incomplete because it contained lines that didn't fit (or if it was mapped to a table, 
   750 	    because the table didn't fit) becacause a line contained something that didn't fit, etc.</li>
   751   </ul>
   752 </div>
   754 <div class="slide" id="s23">
   755   <div class="nav">
   756     <a href="#s22">&lt;</a>
   757     <a href="#s24">&gt;</a>
   758   </div>
   759   <h1>Intro to paginated reflow</h1>
   760   <ul>
   761     <li>If the reflowee is incomplete, the reflower has the responsiblity to:
   762 	  <ul>
   763 	    <li>Create a continuation for the reflowee</li>
   764 	    <li>Ensure that the continuation gets put in the frame hierarchy at the right place
   765 		and gets reflowed at the right time.</li>
   766 	    <li>Typically, a reflower accomplishes this by putting the continuation (c) on an overflow 
   767 		list which the reflower owns. When the reflower's continuation gets reflowed, it takes c 
   768 		and its siblings as children and reflows them.</li>
   769 	  </ul>
   770 	</li>
   771     <li>If the reflowee is complete, truncated (it didn't fit), not at the top of page, 
   772     the reflower should put the reflowee on its overflow list and return an incomplete status.</li>
   773   </ul>
   774 </div>
   776 <div class="slide" id="s24">
   777   <div class="nav">
   778     <a href="#s23">&lt;</a>
   779     <a href="#s25">&gt;</a>
   780   </div>
   781   <h1>Intro to paginated reflow</h1>
   782   <ul>
   783     <li>Special assumptions
   784 	  <ul>
   785 	    <li>There are only initial and (possibly) resize reflows. Incremental 
   786 		and style change reflows are not allowed.</li>
   787 	    <li>Multiple resize reflows may be necessary (e.g. a child is truncated and gets reflowed on a 
   788 		subsequent page) but they should not change the available width from the last time.</li>
   789 	    <li>Multiple resize reflows may require special handling if a frame split previously. It may need
   790 		to "pull up" children from a continuation.</li>
   791 	  </ul>
   792 	</li>
   793   </ul>
   794 </div>
   796 <div class="slide" id="s25">
   797   <div class="nav">
   798     <a href="#s24">&lt;</a>
   799     <a href="#s26">&gt;</a>
   800   </div>
   801   <h1>Table paginated reflow</h1>
   802   <ul>
   803 	<li>The block containing the outer table reflows it. If it is incomplete, the block will
   804 	  <ul>
   805 	    <li>create a continuation for the outer table (which also creates a continuation for the table).</li>
   806 	    <li>put the continuation on a new line and place that line on its overflow lines property.</li>
   807 	  </ul>
   808 	</li>
   809     <li>The outer table reflows the table and just returns the status of the table.</li>
   810     <li>The table does a pass 1 reflow and balances. If it is incomplete,</li>
   811 	  <ul>
   812 	    <li>it will become the first-in-flow</li>
   813 		<li>it will be the only frame among its continuations to ever balance or calc the cell map, and it only
   814 		does this once</li>
   815 	  </ul>
   816 	</li>
   817   </ul>
   818 </div>
   820 <div class="slide" id="s26">
   821   <div class="nav">
   822     <a href="#s25">&lt;</a>
   823     <a href="#s27">&gt;</a>
   824   </div>
   825   <h1>Table paginated reflow</h1>
   826   <ul>
   827 	<li>The table does a pass 2 reflow constraining both avail heights and widths. If a row group is incomplete, the table
   828 	  <ul>
   829 	    <li>creates a continuation for the row group</li>
   830 	    <li>puts the continuation in its overflow frames property</li>
   831 	  </ul>
   832 	</li>
   833     <li>What follows only applies during the pass 2 reflow.</li>
   834     <li>The row group</li>
   835 	  <ul>
   836 	    <li>reflows all of its rows with unconstrained heights and calculates the row heights,</li>
   837 		<li>figures out which row falls on a page boundary and reflows it with a constrained height. If there
   838         will be a pass 3 reflow then this should (bug) happen at that time instead.</li>
   839 	  </ul>
   840 	</li>
   841   </ul>
   842 </div>
   844 <div class="slide" id="s27">
   845   <div class="nav">
   846     <a href="#s26">&lt;</a>
   847     <a href="#s28">&gt;</a>
   848   </div>
   849   <h1>Table paginated reflow</h1>
   850   <ul>
   851     <li>The row group (continued)</li>
   852 	  <ul>
   853 		<li>creates a continuation for the incomplete row (which also creates continuations for all of its cells
   854         and all of the cell blocks)</li>
   855 		<li>puts the continuation in its overflow frames property. If the row was truncated and not top of page,
   856 		the row is put in the overflow frames property.
   857 	  </ul>
   858 	</li>
   859   </ul>
   860 </div>
   862 <div class="slide" id="s28">
   863   <div class="nav">
   864     <a href="#s27">&lt;</a>
   865     <a href="#s0">&gt;</a>
   866   </div>
   867   <h1>Table paginated reflow</h1>
   868   <ul>
   869 	<li>The row and cells (getting the constrained height reflow) just reflow their children with a constrained height.  
   870     They don't need an overflow list for continued children because the continuations were created when the
   871     row group created the row's continutation.</li>
   872     <li>A cell is incomplete because its block is incomplete. The block uses the overflow lines mechanism 
   873     (mentioned above) for its continued children</li>
   874 	</li>
   875 	<li>There are two splitting scenarios for a table
   876 	  <ul>
   877 	    <li>An incomplete cells block causes the cell, row, row group, table, outer table to
   878 	    be incomplete</li>
   879 	    <li>A truncated row or a row that started too far down the page causes the row group, 
   880 		table, outer table to be incomplete.</li>
   881 	  </ul>
   882 	</li>
   883   </ul>
   884 </div>
   887 </body>
   888 </html>

mercurial