Changeset 202572 in webkit


Ignore:
Timestamp:
Jun 28, 2016 10:01:29 AM (8 years ago)
Author:
fred.wang@free.fr
Message:

Phrasing content should be accepted in <mo> elements
https://bugs.webkit.org/show_bug.cgi?id=130245

Patch by Frederic Wang <fwang@igalia.com> on 2016-06-28
Reviewed by Brent Fulgham.

Source/WebCore:

After r202420, the RenderMathMLOperator element no longer messes with anonymous block and
text nodes. Hence it is now safe to allow foreign content inside <mo>.

We extend foreign-element-in-token.html to cover the mo case.

  • mathml/MathMLTextElement.cpp:

(WebCore::MathMLTextElement::childShouldCreateRenderer): Remove the early return for <mo> so
that it accepts phrasing content children.

LayoutTests:

  • mathml/presentation/foreign-element-in-token.html: Copy test cases to

check <mo> elements too.

  • mathml/presentation/foreign-element-in-token-expected.txt: Add the

expectations for <mo>.

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r202571 r202572  
     12016-06-28  Frederic Wang  <fwang@igalia.com>
     2
     3        Phrasing content should be accepted in <mo> elements
     4        https://bugs.webkit.org/show_bug.cgi?id=130245
     5
     6        Reviewed by Brent Fulgham.
     7
     8        * mathml/presentation/foreign-element-in-token.html: Copy test cases to
     9        check <mo> elements too.
     10        * mathml/presentation/foreign-element-in-token-expected.txt: Add the
     11        expectations for <mo>.
     12
    1132016-06-28  Alexey Proskuryakov  <ap@apple.com>
    214
  • trunk/LayoutTests/mathml/presentation/foreign-element-in-token-expected.txt

    r166065 r202572  
    325325mtext
    326326
     327a:
     328mo
     329
     330abbr:
     331mo
     332
     333b:
     334mo
     335
     336bdi:
     337mo
     338
     339bdo:
     340mo
     341
     342button:
     343mo
     344
     345cite:
     346mo
     347
     348code:
     349mo
     350
     351datalist:
     352mo
     353
     354del:
     355mo
     356
     357dfn:
     358mo
     359
     360em:
     361mo
     362
     363embed:
     364mo
     365
     366i:
     367mo
     368
     369img:
     370mo
     371
     372input:
     373mo
     374
     375ins:
     376mo
     377
     378kbd:
     379mo
     380
     381keygen:
     382mo
     383
     384label:
     385mo
     386
     387mark:
     388mo
     389
     390math:
     391mo
     392
     393object:
     394mo
     395
     396output:
     397mo
     398
     399q:
     400mo
     401
     402ruby:
     403mo
     404
     405s:
     406mo
     407
     408samp:
     409mo
     410
     411small:
     412mo
     413
     414span:
     415mo
     416
     417strong:
     418mo
     419
     420sub:
     421mo
     422
     423sup:
     424mo
     425
     426svg:
     427mo
     428
     429u:
     430mo
     431
     432var:
     433mo
     434
    327435Foreign non-phrasing content should not create renderers:
    328436
  • trunk/LayoutTests/mathml/presentation/foreign-element-in-token.html

    r166065 r202572  
    127127    <p>var: <math><mtext><var>mtext</var></mtext></math></p>
    128128
     129    <p>a: <math><mo><a>mo</a></mo></math></p>
     130    <p>abbr: <math><mo><abbr>mo</abbr></mo></mth></p>
     131    <p>b: <math><mo><b>mo</b></mo></math></p>
     132    <p>bdi: <math><mo><bdi>mo</bdi></mo></math></p>
     133    <p>bdo: <math><mo><bdo>mo</bdo></mo></math></p>
     134    <p>button: <math><mo><button>mo</button></mo></math></p>
     135    <p>cite: <math><mo><cite>mo</cite></mo></math></p>
     136    <p>code: <math><mo><code>mo</code></mo></math></p>
     137    <p>datalist: <math><mo><datalist>mo</datalist></mo></math></p>
     138    <p>del: <math><mo><del>mo</del></mo></math></p>
     139    <p>dfn: <math><mo><dfn>mo</dfn></mo></math></p>
     140    <p>em: <math><mo><em>mo</em></mo></math></p>
     141    <p>embed: <math><mo><embed>mo</embed></mo></math></p>
     142    <p>i: <math><mo><i>mo</i></mo></math></p>
     143    <p>img: <math><mo><img>mo</img></mo></math></p>
     144    <p>input: <math><mo><input>mo</input></mo></math></p>
     145    <p>ins: <math><mo><ins>mo</ins></mo></math></p>
     146    <p>kbd: <math><mo><kbd>mo</kbd></mo></math></p>
     147    <p>keygen: <math><mo><keygen>mo</keygen></mo></math></p>
     148    <p>label: <math><mo><label>mo</label></mo></math></p>
     149    <p>mark: <math><mo><mark>mo</mark></mo></math></p>
     150    <p>math: <math><mo><math><mo>mo</mo></math></mo></math></p>
     151    <p>object: <math><mo><object>mo</object></mo></math></p>
     152    <p>output: <math><mo><output>mo</output></mo></math></p>
     153    <p>q: <math><mo><q>mo</q></mo></math></p>
     154    <p>ruby: <math><mo><ruby>mo</ruby></mo></math></p>
     155    <p>s: <math><mo><s>mo</s></mo></math></p>
     156    <p>samp: <math><mo><samp>mo</samp></mo></math></p>
     157    <p>small: <math><mo><small>mo</small></mo></math></p>
     158    <p>span: <math><mo><span>mo</span></mo></math></p>
     159    <p>strong: <math><mo><strong>mo</strong></mo></math></p>
     160    <p>sub: <math><mo><sub>mo</sub></mo></math></p>
     161    <p>sup: <math><mo><sup>mo</sup></mo></math></p>
     162    <p>svg: <math><mo><svg><text>mo</text></svg></mo></math></p>
     163    <p>u: <math><mo><u>mo</u></mo></math></p>
     164    <p>var: <math><mo><var>mo</var></mo></math></p>
     165
    129166    <p>Foreign non-phrasing content should not create renderers:</p>
    130167
    131     <p>p: <math><mi><p>mi</p></mi><mtext><p>mi</p></mtext><mn><p>mn</p></mn></math></p>
    132     <p>div: <math><mi><div>mi</div></mi><mtext><div>mi</div></mtext><mn><div>mn</div></mn></math></p>
    133     <p>h1: <math><mi><h1>mi</h1></mi><mtext><h1>mi</h1></mtext><mn><h1>mn</h1></mn></math></p>
    134     <p>h2: <math><mi><h2>mi</h2></mi><mtext><h2>mi</h2></mtext><mn><h2>mn</h2></mn></math></p>
    135     <p>h3: <math><mi><h3>mi</h3></mi><mtext><h3>mi</h3></mtext><mn><h3>mn</h3></mn></math></p>
    136     <p>h4: <math><mi><h4>mi</h4></mi><mtext><h4>mi</h4></mtext><mn><h4>mn</h4></mn></math></p>
    137     <p>h6: <math><mi><h6>mi</h6></mi><mtext><h6>mi</h6></mtext><mn><h6>mn</h6></mn></math></p>
    138     <p>blockquote: <math><mi><blockquote>mi</blockquote></mi><mtext><blockquote>mi</blockquote></mtext><mn><blockquote>mn</blockquote></mn></math></p>
     168    <p>p: <math><mi><p>mi</p></mi><mtext><p>mi</p></mtext><mn><p>mn</p></mn><mo><p>mo</p></mo></math></p>
     169    <p>div: <math><mi><div>mi</div></mi><mtext><div>mi</div></mtext><mn><div>mn</div></mn><mo><div>mo</div></mo></math></p>
     170    <p>h1: <math><mi><h1>mi</h1></mi><mtext><h1>mi</h1></mtext><mn><h1>mn</h1></mn><mo><h1>mo</h1></mo></math></p>
     171    <p>h2: <math><mi><h2>mi</h2></mi><mtext><h2>mi</h2></mtext><mn><h2>mn</h2></mn><mo><h2>mo</h2></mo></math></p>
     172    <p>h3: <math><mi><h3>mi</h3></mi><mtext><h3>mi</h3></mtext><mn><h3>mn</h3></mn><mo><h3>mo</h3></mo></math></p>
     173    <p>h4: <math><mi><h4>mi</h4></mi><mtext><h4>mi</h4></mtext><mn><h4>mn</h4></mn><mo><h4>mo</h4></mo></math></p>
     174    <p>h6: <math><mi><h6>mi</h6></mi><mtext><h6>mi</h6></mtext><mn><h6>mn</h6></mn><mo><h6>mo</h6></mo></math></p>
     175    <p>blockquote: <math><mi><blockquote>mi</blockquote></mi><mtext><blockquote>mi</blockquote></mtext><mn><blockquote>mn</blockquote></mn><mo><blockquote>mo</blockquote></mo></math></p>
    139176
    140177  </body>
  • trunk/Source/WebCore/ChangeLog

    r202570 r202572  
     12016-06-28  Frederic Wang  <fwang@igalia.com>
     2
     3        Phrasing content should be accepted in <mo> elements
     4        https://bugs.webkit.org/show_bug.cgi?id=130245
     5
     6        Reviewed by Brent Fulgham.
     7
     8        After r202420, the RenderMathMLOperator element no longer messes with anonymous block and
     9        text nodes. Hence it is now safe to allow foreign content inside <mo>.
     10
     11        We extend foreign-element-in-token.html to cover the mo case.
     12
     13        * mathml/MathMLTextElement.cpp:
     14        (WebCore::MathMLTextElement::childShouldCreateRenderer): Remove the early return for <mo> so
     15        that it accepts phrasing content children.
     16
    1172016-06-27  Anders Carlsson  <andersca@apple.com>
    218
  • trunk/Source/WebCore/mathml/MathMLTextElement.cpp

    r200938 r202572  
    9595        return false;
    9696
    97     // FIXME: phrasing content should be accepted in <mo> elements too (https://bugs.webkit.org/show_bug.cgi?id=130245).
    98     if (hasTagName(MathMLNames::annotationTag) || hasTagName(MathMLNames::moTag))
     97    if (hasTagName(MathMLNames::annotationTag))
    9998        return child.isTextNode();
    10099
Note: See TracChangeset for help on using the changeset viewer.