<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>47745</bug_id>
          
          <creation_ts>2010-10-15 15:46:30 -0700</creation_ts>
          <short_desc>Focus on MathML in page causes crash</short_desc>
          <delta_ts>2013-07-22 23:38:06 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>MathML</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>OS X 10.5</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WORKSFORME</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P1</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Alex Milowski">alex</reporter>
          <assigned_to name="Alex Milowski">alex</assigned_to>
          <cc>cfleizach</cc>
    
    <cc>darin</cc>
    
    <cc>donggwan.kim</cc>
    
    <cc>fred.wang</cc>
    
    <cc>sausset</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>294970</commentid>
    <comment_count>0</comment_count>
    <who name="Alex Milowski">alex</who>
    <bug_when>2010-10-15 15:46:30 -0700</bug_when>
    <thetext>After waiting quite awhile for this page to render:

   https://eyeasme.com/Joe/MathML/MathML_browser_test

right click on any MathML content piece to attempt to get the web inspector and an
assertion fails:

ASSERTION FAILED: !renderer()-&gt;needsLayout()
(/Users/alex/workspace/WebKit/WebCore/dom/Node.cpp:793 virtual bool WebCore::Node::isFocusable() const)

I assume this means the MathML is still rendering somehow.

While the MathML should not take this long to render, I&apos;m not certain that we should get a crash
from the focus check.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>295016</commentid>
    <comment_count>1</comment_count>
      <attachid>70920</attachid>
    <who name="Alex Milowski">alex</who>
    <bug_when>2010-10-15 16:51:52 -0700</bug_when>
    <thetext>Created attachment 70920
Smallest Example of Crash</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>295017</commentid>
    <comment_count>2</comment_count>
    <who name="Alex Milowski">alex</who>
    <bug_when>2010-10-15 16:52:52 -0700</bug_when>
    <thetext>This crash is caused by an anchor wrapping the MathML.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>295164</commentid>
    <comment_count>3</comment_count>
    <who name="Alex Milowski">alex</who>
    <bug_when>2010-10-16 14:28:09 -0700</bug_when>
    <thetext>After a bit of testing and debugging, the crash is coming from the anchor element (a) being marked for layout.  When the focus event happens, the crash asserts that the element shouldn&apos;t need layout.  I&apos;m not sure why the anchor element needs layout but it is probably due to something from the child MathML element.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>295250</commentid>
    <comment_count>4</comment_count>
    <who name="Alex Milowski">alex</who>
    <bug_when>2010-10-17 11:48:45 -0700</bug_when>
    <thetext>Digging a bit further I find that the inline renderer for anchor has m_normalChildNeedsLayout set to true but none of the children are marked as needing layout.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>295263</commentid>
    <comment_count>5</comment_count>
    <who name="Alex Milowski">alex</who>
    <bug_when>2010-10-17 12:35:43 -0700</bug_when>
    <thetext>Bug 47781 may be related to this.  In that case, the MathML overflows the table cell so the table cell may also have unfinished layouts.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>295462</commentid>
    <comment_count>6</comment_count>
    <who name="François Sausset">sausset</who>
    <bug_when>2010-10-18 05:44:05 -0700</bug_when>
    <thetext>I just tried with r69946 and no crash occurs on the mentioned webpage or with the test case, even when using the Web Inspector.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>295688</commentid>
    <comment_count>7</comment_count>
    <who name="Alex Milowski">alex</who>
    <bug_when>2010-10-18 12:28:14 -0700</bug_when>
    <thetext>(In reply to comment #6)
&gt; I just tried with r69946 and no crash occurs on the mentioned webpage or with the test case, even when using the Web Inspector.

The crash only happens in the debug build.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>295703</commentid>
    <comment_count>8</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2010-10-18 12:45:04 -0700</bug_when>
    <thetext>This “crash” is an assertion. Assertions are in debug builds only. Some assertions detect theoretical inconsistencies that are not always practical problems.

One possibility is that there is a different approach to layout here, and we just have to teach the assertion about the special objects that will always think they need layout.

Another possibility is that we can make some simple adjustment so these objects will be marked as not needing layout.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>295707</commentid>
    <comment_count>9</comment_count>
    <who name="Alex Milowski">alex</who>
    <bug_when>2010-10-18 12:52:15 -0700</bug_when>
    <thetext>(In reply to comment #8)
&gt; This “crash” is an assertion. Assertions are in debug builds only. Some assertions detect theoretical inconsistencies that are not always practical problems.
&gt; 
&gt; One possibility is that there is a different approach to layout here, and we just have to teach the assertion about the special objects that will always think they need layout.
&gt; 
&gt; Another possibility is that we can make some simple adjustment so these objects will be marked as not needing layout.

OK.  That makes sense.  Somehow I thought assertions were always on.

Nevertheless, what doesn&apos;t make sense is all the children are marked as not needing layout but the parent thinks that a child needs layout.  That is, m_normalChildNeedsLayout is true.

If you change the wrapping anchor to a block (i.e. a { display: block }) in the test, everything works as expected.   There is something odd going on.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>295712</commentid>
    <comment_count>10</comment_count>
      <attachid>71074</attachid>
    <who name="Alex Milowski">alex</who>
    <bug_when>2010-10-18 13:02:47 -0700</bug_when>
    <thetext>Created attachment 71074
Another example with a second non-mathml child in the anchor

Clicking on &apos;bingo&apos; also crashs in debug builds.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>295713</commentid>
    <comment_count>11</comment_count>
    <who name="Alex Milowski">alex</who>
    <bug_when>2010-10-18 13:04:37 -0700</bug_when>
    <thetext>As expected, if you remove the MathML math element, the assertion doesn&apos;t fail.  Somehow MathML rendering must be notifying its parent that it needs to relayout its children yet the layout is never scheduled.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>830958</commentid>
    <comment_count>12</comment_count>
    <who name="Alex Milowski">alex</who>
    <bug_when>2013-02-12 08:13:14 -0800</bug_when>
    <thetext>I don&apos;t think this crash exists anymore.  I cannot reproduce it in the latest version.

What&apos;s the process for closing this?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>910914</commentid>
    <comment_count>13</comment_count>
    <who name="chris fleizach">cfleizach</who>
    <bug_when>2013-07-22 23:38:06 -0700</bug_when>
    <thetext>Moving to resolved based on Alex&apos;s comments</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>70920</attachid>
            <date>2010-10-15 16:51:52 -0700</date>
            <delta_ts>2010-10-15 16:51:52 -0700</delta_ts>
            <desc>Smallest Example of Crash</desc>
            <filename>mathml-focus-crash-3.xhtml</filename>
            <type>application/xhtml+xml</type>
            <size>205</size>
            <attacher name="Alex Milowski">alex</attacher>
            
              <data encoding="base64">PGh0bWwgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzE5OTkveGh0bWwnPgo8aGVhZD4KPHRpdGxl
Pk1yb3cgYW5kIFN1YnN1cCB0ZXN0PC90aXRsZT4KPC9oZWFkPgo8Ym9keT4KPGEgaHJlZj0iIyI+
CjxtYXRoIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8xOTk4L01hdGgvTWF0aE1MIj4KPG1pPng8
L21pPgo8L21hdGg+CjwvYT4KPC9ib2R5Pgo8L2h0bWw+Cg==
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>71074</attachid>
            <date>2010-10-18 13:02:47 -0700</date>
            <delta_ts>2010-10-18 13:02:47 -0700</delta_ts>
            <desc>Another example with a second non-mathml child in the anchor</desc>
            <filename>mathml-focus-crash-4.xhtml</filename>
            <type>application/xhtml+xml</type>
            <size>241</size>
            <attacher name="Alex Milowski">alex</attacher>
            
              <data encoding="base64">PGh0bWwgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzE5OTkveGh0bWwnPgo8aGVhZD4KPHRpdGxl
PmlzRm9jdXNhYmxlIENyYXNoPC90aXRsZT4KPC9oZWFkPgo8Ym9keT4KPGRpdj4KPGEgaHJlZj0i
IyI+PG1hdGggeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzE5OTgvTWF0aC9NYXRoTUwiPjxtaT54
PC9taT48L21hdGg+IDxzcGFuIGlkPSdiaW5nbyc+YmluZ288L3NwYW4+PC9hPgo8L2Rpdj4KPC9i
b2R5Pgo8L2h0bWw+Cg==
</data>

          </attachment>
      

    </bug>

</bugzilla>