[webkit-dev] Focus Crash Relating to MathML

Alex Milowski alex at milowski.org
Tue Oct 19 17:35:35 PDT 2010

On Tue, Oct 19, 2010 at 1:44 PM, David Hyatt <hyatt at apple.com> wrote:
> Also, if your pattern of code in a layout method is
> (1) Call base class RenderBlock::layout
> (2) Do other stuff that might cause dirtying
> Then you should really bulletproof that code by adding
> (1) Call base class RenderBlock::layout
> (2) Do a setChildNeedsLayout(true, false) on yourself just to make yourself already dirty.
> (3) Do other stuff that might cause dirtying
> (4) Do a setNeedsLayout(false)
> We don't really have a good setup for calling base class layout methods... technically you should stay dirty throughout the lifetime of your own layout method, but the base class method will mark you as "clean."  We should come up with something better at some point, but for now I think if you just dirty for the rest of the code you want to run and then mark yourself clean at the end, you'd stop the problem as well.

This all sounds good.  I'm going to experiment a bit and see if there
is a better solution than using destroyLeftoverChildren() in
RenderMathMLOperator.  That will probably solve my immediate problem.

I'll also look into changing when setNeedsLayout(false) is called as
you have described.  I think that change would be good to make sure
that inline contents can't leave the tree in a strange state as it is
quite easy to cause ancestors to get marked with descendants needing
layout when, at the end of the layout for the subtree, that is no
longer true.

--Alex Milowski
"The excellence of grammar as a guide is proportional to the paucity of the
inflexions, i.e. to the degree of analysis effected by the language

Bertrand Russell in a footnote of Principles of Mathematics

More information about the webkit-dev mailing list