Skip to content

Commit cdba9fd

Browse files
committed
Relax feature-detection for <menclose>
Discussion is still open: w3c/mathml#105 so let's only check some minimal <mrow> support. Igalia does not plan to implement this element in Chromium for now so making detection too strict is causing test failures.
1 parent d7faaa6 commit cdba9fd

File tree

1 file changed

+5
-29
lines changed

1 file changed

+5
-29
lines changed

mathml/support/feature-detection.js

+5-29
Original file line numberDiff line numberDiff line change
@@ -24,35 +24,11 @@ var MathMLFeatureDetection = {
2424
},
2525

2626
"has_menclose": function() {
27-
if (!this.hasOwnProperty("_has_menclose")) {
28-
document.body.insertAdjacentHTML("beforeend", "<math>\
29-
<mrow style='font-size: 20px !important'>\
30-
<mrow>\
31-
<mrow>\
32-
<mrow>\
33-
<mtext>A</mtext>\
34-
</mrow>\
35-
</mrow>\
36-
</mrow>\
37-
</mrow>\
38-
<menclose notation='box' style='font-size: 20px !important'>\
39-
<menclose notation='box'>\
40-
<menclose notation='box'>\
41-
<menclose notation='box'>\
42-
<mtext>A</mtext>\
43-
</menclose>\
44-
</menclose>\
45-
</menclose>\
46-
</menclose>\
47-
</math>");
48-
var math = document.body.lastElementChild;
49-
// The boxes will make menclose wider than mrow, if the former is supported.
50-
this._has_menclose =
51-
math.lastElementChild.getBoundingClientRect().width -
52-
math.firstElementChild.getBoundingClientRect().width > 5;
53-
document.body.removeChild(math);
54-
}
55-
return this._has_menclose;
27+
// Just check whether <mrow> is supported because discussion on this is
28+
// still open ( https://github.com/mathml-refresh/mathml/issues/105 )
29+
// and it would have to behave at least like an mrow, even if it becomes
30+
// an unknown element at the end.
31+
return this.has_mrow();
5632
},
5733

5834
"has_merror": function() {

0 commit comments

Comments
 (0)