Physikerwelt has uploaded a new change for review. https://gerrit.wikimedia.org/r/145453
Change subject: Add default display options ...................................................................... Add default display options In some caseses for example if the vagrant role mobilefrontend is enabled the stylesheets are not processed on mobile devices. Without a default setting for the display attribute all elements are displayed at the same time. Change-Id: Ic0e95effaf0b413ec4c5878e1cfd5c269daa44c3 --- M MathMathML.php M modules/ext.math.css 2 files changed, 6 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Math refs/changes/53/145453/1 diff --git a/MathMathML.php b/MathMathML.php index 94ec085..2d3dd9a 100644 --- a/MathMathML.php +++ b/MathMathML.php @@ -381,14 +381,16 @@ $attribs = array(); if ( $classOverride === false ) { // $class = '' suppresses class attribute $class = $this->getClassName( true, $png ); + $style = $png ? 'display: none;' : ''; } else { $class = $classOverride; + $style = ''; } - $style = ''; if ( !$png ) { $this->correctSvgStyle( $this->getSvg(), $style , $attribs ); } + if ( $class ) { $attribs['class'] = $class; } if ( $style ) { $attribs['style'] = $style; } // an alternative for svg might be an object with type="image/svg+xml" @@ -445,7 +447,7 @@ if ( $this->getMathStyle() == MW_MATHSTYLE_DISPLAY ) { $mml = preg_replace( '/<math/', '<math display="block"', $mml ); } - $output .= Xml::tags( $element, array( 'class' => $this->getClassName() ), $mml ); + $output .= Xml::tags( $element, array( 'class' => $this->getClassName(), 'style' => 'display: none;' ), $mml ); $output .= $this->getFallbackImage( $this->getMode() ) . "\n"; $output .= $this->getFallbackImage( MW_MATH_PNG ) . "\n"; $output .= HTML::closeElement( $element ); diff --git a/modules/ext.math.css b/modules/ext.math.css index b427a16..9043caf 100644 --- a/modules/ext.math.css +++ b/modules/ext.math.css @@ -47,8 +47,8 @@ @-moz-document url-prefix() { /* For Gecko browsers, hide the SVG fallback and show the MathML instead. We override the style for SVG and MathML above */ - .mwe-math-mathml-inline { display: inline; } - .mwe-math-mathml-display { display: block; } + .mwe-math-mathml-inline { display: inline !important; } + .mwe-math-mathml-display { display: block !important; } :root * > .mwe-math-mathml-inline + img.mwe-math-fallback-svg-inline, :root * > .mwe-math-mathml-display + img.mwe-math-fallback-svg-display { display: none; } } -- To view, visit https://gerrit.wikimedia.org/r/145453 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic0e95effaf0b413ec4c5878e1cfd5c269daa44c3 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Math Gerrit-Branch: master Gerrit-Owner: Physikerwelt <w...@physikerwelt.de> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits