<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Overflow of formulas is hidden for display mathematics"
   href="https://bugs.webkit.org/show_bug.cgi?id=160547#c2">Comment # 2</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Overflow of formulas is hidden for display mathematics"
   href="https://bugs.webkit.org/show_bug.cgi?id=160547">bug 160547</a>
              from <span class="vcard"><a class="email" href="mailto:fred.wang&#64;free.fr" title="Frédéric Wang (:fredw) &lt;fred.wang&#64;free.fr&gt;"> <span class="fn">Frédéric Wang (:fredw)</span></a>
</span></b>
        <pre>Created <span class=""><a href="attachment.cgi?id=285326&amp;action=diff" name="attach_285326" title="Experimental Patch">attachment 285326</a> <a href="attachment.cgi?id=285326&amp;action=edit" title="Experimental Patch">[details]</a></span>
Experimental Patch

Some first thoughts: In general, because the preferred width of operators is overestimated (see <a href="https://bug-130326-attachments.webkit.org/attachment.cgi?id=283599">https://bug-130326-attachments.webkit.org/attachment.cgi?id=283599</a>). Hence all the MathML layoutBlock functions must set the correct logical width rather than relying on the preferred width. Then the RenderBox code use this logical width rather than filling the all available width.

There is an exception for &lt;math display=&quot;block&quot;&gt;: this must be rendered as a formula centered in the available space. Hence RenderMathMLRow::layoutBlock does not set the its logicalWidth to the width of the math content so that the centering done is this function is correct (<a href="http://tests.mathml-association.org/mathml/relations/html5-tree/display-1.html">http://tests.mathml-association.org/mathml/relations/html5-tree/display-1.html</a>). I guess something in RenderBox also make it also occupy the whole available width. But when the available width is less than the width of the math content, the &lt;math&gt; tag is too narrow.

I'm attaching a hack that just injects the preferredLogicalWidth to force a minimal width but the ideal would be for RenderMathMLRow to expose the width of the math content and let RenderBox calculate the logical width by taking the maximum of the available width and of the width of the math content. Maybe rego or jfernandez have suggestions about how to do that.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>