On 6/5/13 8:30 AM, Boris Zbarsky wrote:
On 6/4/13 9:47 PM, Patrick Walton wrote:
We're trying to figure out what to do when an inline RenderBox of an
inline flow becomes non-inline. This is a vexing issue, as it violates
the invariant that a flow's descendants and the flow itself are the only
flows that need to be reconstructed from scratch when a box's style
changes.

This invariant simply isn't.  ;)  Consider this simple testcase:

   <div>
     <span style="display: table-cell">Some</span>
     <div id="willChange">text</div>
     <span style="display: table-cell">here</span>
   </div>

and then toggling the display of the id="willChange" div to
"table-cell".  Or to "none", for that matter.

I'm wondering if any layout gurus have any advice as to what to do here.
What is the most elegant way to handle this case? Is there anything we
should be aware of in order to optimize this path?

So first off, this is usually a rare case.  So in practice, I believe
the Gecko approach of "wipe out part of the render tree and recreate it"
is perfectly reasonable here as a complexity/performance tradeoff.

Do you mean that having to wipe the parent flow when a child render box changes is a rare case in general or that this specific case (an inline becoming non-inline) is rare?

So what I'm thinking is that, in general, we should structure incremental layout under the general assumption that parent flows don't need to be recreated when their children change (note: they may well have to be *reflowed*, but not recreated from scratch), and in the corner cases in which this isn't true, wipe and rebuild the parent flows. Does this seem OK?

Patrick
_______________________________________________
dev-servo mailing list
dev-servo@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-servo

Reply via email to