[webkit-dev] Focus Crash Relating to MathML
David Hyatt
hyatt at apple.com
Tue Oct 19 11:29:01 PDT 2010
(1) Make sure any layout methods you call do setNeedsLayout(false) at the end of them.
(2) Look for any early returns in any of your layout methods, since maybe you did an early return causing the setNeedsLayout(false) to be missed.
(3) Make sure you aren't dirtying a child for a re-layout without immediately doing that re-layout, e.g., don't call setChildNeedsLayout(true, false) on some child and then bail without doing a layout.
dave
On Oct 18, 2010, at 10:22 PM, Alex Milowski wrote:
> Most of the MathML rendering objects have a display style property value
> of inline-block. Whenever these rendering objects are used, somehow the
> parent "container" gets marked as having children in need of layout. The
> MathML math rendering object completes its layout and marks itself as
> not needing layout. In the end, the container (e.g. the anchor element)
> render object has itself in a state where m_normalChildNeedsLayout is
> true but no child is marked as needing layout.
>
> I've gone through the MathML rendering objects and remove all uses
> of markContaingBlocksForLayout() and setNeedsLayoutPrefWidthsRecalc()
> which generally cause the container to be marked with a child needing
> layout. These calls were unnecessary and the resulting code should be
> more efficient.
>
> In situations where the MathML does not contain a rendering object
> that is an inline-block, everything works fine. For example:
>
> <a href='#'>
> <math xmlns='http://www.w3.org/1998/Math/MathML'><mi>x</mi></math>
> </a>
>
> Keep in mind, in the above, the 'mi' element just uses RenderInline as it
> has no special semantics as of yet.
>
> In cases where specialized render objects (typically with display
> inline-block) are used (e.g. an operator), the assert fires:
>
> <a href='#'>
> <math xmlns='http://www.w3.org/1998/Math/MathML'><mo>x</mo></math>
> </a>
>
> At this point, I don't think my code is directly causing the anchor to
> get marked
> with a child needing layout. I do rely on RenderBlock::layout() within most
> of the rendering objects to handle the actual layout after adjustments.
>
> I've tried making sure that the parent or container schedule a re-layout but
> that hasn't really helped.
>
> You can see all these adjustments and optimizations in the patch for:
>
> https://bugs.webkit.org/show_bug.cgi?id=43462
>
> Any ideas of what to look at next would be appreciated.
>
>
> --
> --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
> considered."
>
> Bertrand Russell in a footnote of Principles of Mathematics
> _______________________________________________
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
> http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
More information about the webkit-dev
mailing list