Esanders has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/172972

Change subject: Fix rendering issues in MathML mode
......................................................................

Fix rendering issues in MathML mode

Force display:none on a hidden MathML rendering to avoid generating
focusable node highlights.

Move adding of class to setup to ensure it persists after render.

Change-Id: I5fc21afa61ccc07e9d2126846cf29ee898182a7c
---
M Math.php
A modules/VisualEditor/ve.ce.MWMathNode.css
M modules/VisualEditor/ve.ce.MWMathNode.js
3 files changed, 16 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Math 
refs/changes/72/172972/1

diff --git a/Math.php b/Math.php
index c4ccba9..89070b0 100644
--- a/Math.php
+++ b/Math.php
@@ -513,6 +513,7 @@
                'VisualEditor/ve.ui.MWMathInspectorTool.js',
        ),
        'styles' => array(
+               'VisualEditor/ve.ce.MWMathNode.css',
                'VisualEditor/ve.ui.MWMathIcons.css',
        ),
        'dependencies' => array(
diff --git a/modules/VisualEditor/ve.ce.MWMathNode.css 
b/modules/VisualEditor/ve.ce.MWMathNode.css
new file mode 100644
index 0000000..eedce52
--- /dev/null
+++ b/modules/VisualEditor/ve.ce.MWMathNode.css
@@ -0,0 +1,6 @@
+/**
+ * Hide math tag completely to avoid extra bounding boxes
+ */
+.ve-ce-mwMathNode .mwe-math-mathml-a11y {
+       display: none!important;
+}
diff --git a/modules/VisualEditor/ve.ce.MWMathNode.js 
b/modules/VisualEditor/ve.ce.MWMathNode.js
index 971a6b9..0ea8bf3 100644
--- a/modules/VisualEditor/ve.ce.MWMathNode.js
+++ b/modules/VisualEditor/ve.ce.MWMathNode.js
@@ -20,9 +20,6 @@
 ve.ce.MWMathNode = function VeCeMWMathNode( model, config ) {
        // Parent constructor
        ve.ce.MWInlineExtensionNode.call( this, model, config );
-
-       // DOM changes
-       this.$element.addClass( 've-ce-mwMathNode' );
 };
 
 /* Inheritance */
@@ -38,6 +35,15 @@
 /* Methods */
 
 /** */
+ve.ce.MWMathNode.prototype.onSetup = function () {
+       // Parent method
+       ve.ce.MWMathNode.super.prototype.onSetup.call( this );
+
+       // DOM changes
+       this.$element.addClass( 've-ce-mwMathNode' );
+};
+
+/** */
 ve.ce.MWMathNode.prototype.onParseSuccess = function ( deferred, response ) {
        var data = response.visualeditor, contentNodes = this.$( data.content 
).get();
        if ( contentNodes[0] && contentNodes[0].childNodes ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/172972
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5fc21afa61ccc07e9d2126846cf29ee898182a7c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Math
Gerrit-Branch: master
Gerrit-Owner: Esanders <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to