On Tuesday 2014-07-08 13:46 +1200, Robert O'Callahan wrote: > > > > > > - jack: can we avoid width recalc when changing vertical height? > > pcwalton: that will break with vertical writing modes, among other > > things. not sure it's a good optimization. > > > > > I'm not sure what jack had in mind exactly, but one very important > incremental layout case is appending content to a document (e.g. due to > incremental loading). That increases the heights of container elements, and > that had better not invalidate widths unnecessarily!
In Gecko we have separate optimizations for whether a width change requires reflowing all descendants and for whether a height change does. (The height change case is particularly important to optimize well for the cases where our UI has infobars or the find bar.) See nsHTMLReflowState::ShouldReflowAllKids, and the things that set the mHResize and mVResize flags. These control whether we reflow all children, or for some layout modes only those that have a dirty descendant which we can only do as the different layout modes (block, inline, flexbox, table, etc.) have different abilities to actually skip kids. These optimizations are made each step down the tree; we repeat the decision for each frame's kids, and thus it shouldn't be a problem to adapt this to vertical writing modes or mixed writing modes, although the performance characteristics would obviously swap axes. -David -- 𝄞 L. David Baron http://dbaron.org/ 𝄂 𝄢 Mozilla https://www.mozilla.org/ 𝄂 Before I built a wall I'd ask to know What I was walling in or walling out, And to whom I was like to give offense. - Robert Frost, Mending Wall (1914)
signature.asc
Description: Digital signature
_______________________________________________ dev-servo mailing list dev-servo@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-servo