17
edits
No edit summary |
|||
| Line 28: | Line 28: | ||
This is the most important optimization. | This is the most important optimization. | ||
The table reflow has to be a two stage process, as outlined in the [www CSS 2.1 specification]. The initial reflow of a table is a unconstrained reflow to get the maximum width and the MEW for all table cells. Once this is done we will know the three main sizes, maxwidth, MEW and specified size for all table cells. This information is balanced and the widths for every column is computed. The table cells will have the same width as the column. With the column information we do a resize reflow. | The table reflow has to be a two stage process, as outlined in the [http://www.w3.org/TR/CSS21/tables.html#auto-table-layout CSS 2.1 specification]. The initial reflow of a table is a unconstrained reflow to get the maximum width and the MEW for all table cells. Once this is done we will know the three main sizes, maxwidth, MEW and specified size for all table cells. This information is balanced and the widths for every column is computed. The table cells will have the same width as the column. With the column information we do a resize reflow. | ||
Now assume a nested table and look at the innermost table, the outer table will cause first a unconstrained initial reflow. So the inner table will execute a initial unconstrained reflow too as a result we will know the table maximum width and MEW, but it will defer the resize reflow. There is '''no unconstrained resize reflow'''. Then the outer table will cause a contrained resize reflow based on the information that the inner table provided. By this the inner table will not execute more than two reflows regardless how deep the nesting is. The optimization is done at [lxr nsTableFrame::Reflow]. | Now assume a nested table and look at the innermost table, the outer table will cause first a unconstrained initial reflow. So the inner table will execute a initial unconstrained reflow too as a result we will know the table maximum width and MEW, but it will defer the resize reflow. There is '''no unconstrained resize reflow'''. Then the outer table will cause a contrained resize reflow based on the information that the inner table provided. By this the inner table will not execute more than two reflows regardless how deep the nesting is. The optimization is done at [http://lxr.mozilla.org/seamonkey/search?string=nsTableFrame%3A%3AReflow%28 nsTableFrame::Reflow]. | ||
=== Resize without available size change === | === Resize without available size change === | ||
As we cache all neccessary sizes, there is no need to reflow just to return the MEW or the maximum width. We do this at the outermost level in [lxr nsTableOuterFrame::Reflow]. | As we cache all neccessary sizes, there is no need to reflow just to return the MEW or the maximum width. We do this at the outermost level in [lxr nsTableOuterFrame::Reflow]. | ||
edits