[webkit-dev] Two Pass Layout?

Roland Steiner rolandsteiner at google.com
Thu Sep 17 23:36:17 PDT 2009


Hi Alex,
I'm in the process of doing ruby layout, currently under review (reviewers:
*hint, hint*), where I had several of the same issues, albeit not quite as
severe as with MathML (in effect, one could see ruby as nothing than a
series of <mover>/<munder> operations). I'm not sure how far my experiences
can help you, but let me add some comments:

On Fri, Sep 18, 2009 at 4:45 AM, Alex Milowski <alex at milowski.org> wrote:

> I'd like to re-oriented the code I have to include an RenderMathOperator
> class
> that can stretch operators that stretchable and do something else for ones
> that aren't (e.g. curly brackets can be stretched but angle brackets can
> only
> be resized by font size to a certain maximum before they look strange).
>

Note that for "correct" rendering, even stacking braces need to change font
sizes from time to time, so that the overall impression of weight stays
proportionate. That is, even if you have stacking braces, their width may
change.
Also note that the DOM may be manipulated afterwards - nodes added or
removed, causing recalculations or even add/remove line breaks (so you need
to be careful when caching values).

As for calulations, adding special anonymous boxes to group stuff into
smaller chunks might help (not sure there is actually a need for such things
in MathML). OTOH, such boxes also adds complexity when it comes to DOM
manipulation.


> The consequence of this, as I've noted before, is that I somehow need
> to "invalidate" the line boxes for the containing inline-block for the
> mrow/mfenced.  I've tried this a number of ways but it seems that things
> go wrong when the mrow/mfenced contains certain kind of replaced
> content (e.g. inline-table).
>

Not sure I understand the requirements correctly, but can't you just nuke
the line boxes with deleteLineBoxTree() and have them rebuilt?


Cheers,

Roland
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20090918/219ea08f/attachment.html>


More information about the webkit-dev mailing list