Bug 1581367 [wpt PR 19062] - Avoid more MathML false negative results, a=testonly

Automatic update from web-platform-tests
Avoid more MathML false negative results (#19062)

--

wpt-commits: 6fd5e1e086ce590a4780a30d129688abe2115bb9
wpt-pr: 19062
This commit is contained in:
Frédéric Wang 2019-09-18 02:22:32 +00:00 committed by moz-wptsync-bot
parent b0f24d9f49
commit 660cbe29bc
19 changed files with 67 additions and 0 deletions

View File

@ -75,5 +75,8 @@
</math>
</p>
<script src="/mathml/support/feature-detection.js"></script>
<script>MathMLFeatureDetection.ensure_for_match_reftest("has_dir");</script>
</body>
</html>

View File

@ -46,5 +46,8 @@
</math>
</p>
<script src="/mathml/support/feature-detection.js"></script>
<script>MathMLFeatureDetection.ensure_for_match_reftest("has_dir");</script>
</body>
</html>

View File

@ -29,5 +29,8 @@
</math>
</p>
<script src="/mathml/support/feature-detection.js"></script>
<script>MathMLFeatureDetection.ensure_for_match_reftest("has_dir");</script>
</body>
</html>

View File

@ -23,5 +23,8 @@
</math>
</p>
<script src="/mathml/support/feature-detection.js"></script>
<script>MathMLFeatureDetection.ensure_for_match_reftest("has_dir");</script>
</body>
</html>

View File

@ -47,5 +47,8 @@
</math>
</p>
<script src="/mathml/support/feature-detection.js"></script>
<script>MathMLFeatureDetection.ensure_for_match_reftest("has_dir");</script>
</body>
</html>

View File

@ -10,5 +10,6 @@
<mspace width="64px" height="48px" style="background: lightblue"></mspace>
<mspace width="128px" height="96px" style="background: lightgreen"></mspace>
</mfrac>
</math>
</body>
</html>

View File

@ -33,5 +33,8 @@
<mspace height="16px" width="12px" class="oof2"/>
<mspace height="8px" width="4px" class="nobox"/>
</mfrac>
</math>
<script src="/mathml/support/feature-detection.js"></script>
<script>MathMLFeatureDetection.ensure_for_match_reftest("has_mfrac");</script>
</body>
</html>

View File

@ -45,5 +45,7 @@
_<math><msqrt><mi id="x5">x</mi><mo></mo><mi>y</mi></msqrt></math>_
_<math><mstyle><mi id="x6">x</mi><mo></mo><mi>y</mi></mstyle></math>_
<script src="/mathml/support/feature-detection.js"></script>
<script>MathMLFeatureDetection.ensure_for_match_reftest("has_operator_spacing");</script>
</body>
</html>

View File

@ -22,5 +22,7 @@
<mo>(</mo> <mspace height="3em" depth="3em"/> <mo>)</mo>
</math>
<script src="/mathml/support/feature-detection.js"></script>
<script>MathMLFeatureDetection.ensure_for_match_reftest("has_mspace");</script>
</body>
</html>

View File

@ -83,5 +83,7 @@
_<math><msqrt><mi>x</mi><mo></mo><mi>y</mi></msqrt></math>_
_<math><mstyle><mi>x</mi><mo></mo><mi>y</mi></mstyle></math>_
<script src="/mathml/support/feature-detection.js"></script>
<script>MathMLFeatureDetection.ensure_for_match_reftest("has_operator_spacing");</script>
</body>
</html>

View File

@ -24,5 +24,7 @@
_<math><mo form="prefix"></mo></math>_
_<math><mo form="postfix"></mo></math>_
<script src="/mathml/support/feature-detection.js"></script>
<script>MathMLFeatureDetection.ensure_for_match_reftest("has_operator_spacing");</script>
</body>
</html>

View File

@ -18,5 +18,7 @@
<mi>x</mi>
</munder>
</math>
<script src="/mathml/support/feature-detection.js"></script>
<script>MathMLFeatureDetection.ensure_for_match_reftest("has_munderover");</script>
</body>
</html>

View File

@ -21,5 +21,7 @@
<mi>x</mi>
</munder>
</math>
<script src="/mathml/support/feature-detection.js"></script>
<script>MathMLFeatureDetection.ensure_for_match_reftest("has_munderover");</script>
</body>
</html>

View File

@ -47,5 +47,7 @@
<mn>2</mn>
</munderover>
</math>
<script src="/mathml/support/feature-detection.js"></script>
<script>MathMLFeatureDetection.ensure_for_match_reftest("has_munderover");</script>
</body>
</html>

View File

@ -28,5 +28,7 @@
<mi>B</mi>
</munder>
</math>
<script src="/mathml/support/feature-detection.js"></script>
<script>MathMLFeatureDetection.ensure_for_match_reftest("has_munderover");</script>
</body>
</html>

View File

@ -65,5 +65,7 @@
<mo lspace="200px" rspace="100px"></mo>
<mspace width="100px" height="10px" depth="10px" style="background: black"></mspace>
</math>
<script src="/mathml/support/feature-detection.js"></script>
<script>MathMLFeatureDetection.ensure_for_match_reftest("has_operator_spacing");</script>
</body>
</html>

View File

@ -13,5 +13,6 @@
<mspace width="64px" height="12px" style="background: lightblue"></mspace>
<mspace width="128px" height="24px" style="background: lightgreen"></mspace>
</mroot>
</math>
</body>
</html>

View File

@ -42,5 +42,8 @@
<mspace width="16px" class="oof2"/>
<mspace width="8px" class="nobox"/>
</mroot>
</math>
<script src="/mathml/support/feature-detection.js"></script>
<script>MathMLFeatureDetection.ensure_for_match_reftest("has_msqrt");</script>
</body>
</html>

View File

@ -119,6 +119,32 @@ var MathMLFeatureDetection = {
return this._has_menclose;
},
has_munderover: function() {
if (!this.hasOwnProperty("_has_munderover")) {
document.body.insertAdjacentHTML("beforeend", "<math>\
<munderover>\
<mspace width='20px'></mspace>\
<mspace width='20px'></mspace>\
<mspace width='20px'></mspace>\
</munderover>\
<munderover>\
<mspace width='40px'></mspace>\
<mspace width='40px'></mspace>\
<mspace width='40px'></mspace>\
</munderover>\
</math>");
var math = document.body.lastElementChild;
var munderover = math.getElementsByTagName("munderover");
// width_delta will be 20px per MathML, 3 * 20 = 60px if mundeover does not stack its children and 0px if mspace is not supported.
var width_delta =
munderover[1].getBoundingClientRect().width -
munderover[0].getBoundingClientRect().width;
this._has_munderover = width_delta > 10 && width_delta < 30;
document.body.removeChild(math);
}
return this._has_munderover;
},
has_dir: function() {
if (!this.hasOwnProperty("_has_dir")) {
document.body.insertAdjacentHTML("beforeend", "<math style='direction: ltr !important;'>\