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