mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Math
synced 2024-11-24 07:34:22 +00:00
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. Bug: T87007 Change-Id: I5fc21afa61ccc07e9d2126846cf29ee898182a7c
This commit is contained in:
parent
6d4912f6f4
commit
da0e6cab16
1
Math.php
1
Math.php
|
@ -513,6 +513,7 @@ $wgResourceModules['ext.math.visualEditor'] = array(
|
|||
'VisualEditor/ve.ui.MWMathInspectorTool.js',
|
||||
),
|
||||
'styles' => array(
|
||||
'VisualEditor/ve.ce.MWMathNode.css',
|
||||
'VisualEditor/ve.ui.MWMathIcons.css',
|
||||
'VisualEditor/ve.ui.MWMathInspector.css',
|
||||
),
|
||||
|
|
11
modules/VisualEditor/ve.ce.MWMathNode.css
Normal file
11
modules/VisualEditor/ve.ce.MWMathNode.css
Normal file
|
@ -0,0 +1,11 @@
|
|||
/**
|
||||
* Hide math tag completely to avoid extra bounding boxes for Chrome, Safari, Android...
|
||||
* Browser-specific hacks are bad but let's use that for now...
|
||||
* See http://browserhacks.com
|
||||
*/
|
||||
@media screen and (-webkit-min-device-pixel-ratio:0) {
|
||||
.ve-ce-mwMathNode .mwe-math-mathml-a11y {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
|
|
@ -17,12 +17,9 @@
|
|||
* @param {ve.dm.MWMathNode} model Model to observe
|
||||
* @param {Object} [config] Configuration options
|
||||
*/
|
||||
ve.ce.MWMathNode = function VeCeMWMathNode( model, config ) {
|
||||
ve.ce.MWMathNode = function VeCeMWMathNode() {
|
||||
// Parent constructor
|
||||
ve.ce.MWInlineExtensionNode.call( this, model, config );
|
||||
|
||||
// DOM changes
|
||||
this.$element.addClass( 've-ce-mwMathNode' );
|
||||
ve.ce.MWMathNode.super.apply( this, arguments );
|
||||
};
|
||||
|
||||
/* Inheritance */
|
||||
|
@ -37,6 +34,15 @@ ve.ce.MWMathNode.static.primaryCommandName = 'math';
|
|||
|
||||
/* 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();
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
*/
|
||||
ve.dm.MWMathNode = function VeDmMWMathNode() {
|
||||
// Parent constructor
|
||||
ve.dm.MWInlineExtensionNode.apply( this, arguments );
|
||||
ve.dm.MWMathNode.super.apply( this, arguments );
|
||||
};
|
||||
|
||||
/* Inheritance */
|
||||
|
|
Loading…
Reference in a new issue