From ee2b3c3d8740dcfccf6d6a0c5a371335dd198654 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Wang?= Date: Mon, 20 Jan 2020 09:18:32 +0100 Subject: [PATCH] Relax feature-detection for (#21256) Discussion is still open: https://github.com/mathml-refresh/mathml/issues/105 so let's only check some minimal support. Igalia does not plan to implement this element in Chromium for now so making detection too strict is causing test failures. --- mathml/support/feature-detection.js | 34 +++++------------------------ 1 file changed, 5 insertions(+), 29 deletions(-) diff --git a/mathml/support/feature-detection.js b/mathml/support/feature-detection.js index 1952d3b06c1239..7ad4d953d0822c 100644 --- a/mathml/support/feature-detection.js +++ b/mathml/support/feature-detection.js @@ -24,35 +24,11 @@ var MathMLFeatureDetection = { }, "has_menclose": function() { - if (!this.hasOwnProperty("_has_menclose")) { - document.body.insertAdjacentHTML("beforeend", "\ -\ - \ - \ - \ - A\ - \ - \ - \ -\ -\ - \ - \ - \ - A\ - \ - \ - \ -\ -"); - var math = document.body.lastElementChild; - // The boxes will make menclose wider than mrow, if the former is supported. - this._has_menclose = - math.lastElementChild.getBoundingClientRect().width - - math.firstElementChild.getBoundingClientRect().width > 5; - document.body.removeChild(math); - } - return this._has_menclose; + // Just check whether is supported because discussion on this is + // still open ( https://github.com/mathml-refresh/mathml/issues/105 ) + // and it would have to behave at least like an mrow, even if it becomes + // an unknown element at the end. + return this.has_mrow(); }, "has_merror": function() {