Add scrollbars to displaystyle formulae

Add mwe-math-element class attribute to the outermost element
holding mathematical expressions. Add a css rule that adds a
scrollbar to the element in case it's a div, which is the case
for displaystyle formulae.

Note, there will be no scroll bar if long formulae are not
explicitly marked up das displaystyle formulae.ƒ

Bug: T134281
Change-Id: Iba462601bb15f8667d1284282ba4f6c2020a02b9
This commit is contained in:
Moritz Schubotz 2017-01-11 10:43:10 -08:00
parent f5778bafd2
commit c877e564fc
2 changed files with 6 additions and 1 deletions

View File

@ -446,7 +446,7 @@ class MathMathML extends MathRenderer {
} else {
$element = 'span';
}
$attribs = [];
$attribs = [ 'class' => 'mwe-math-element' ];
if ( $this->getID() !== '' ) {
$attribs['id'] = $this->getID();
}

View File

@ -57,3 +57,8 @@ generated by Mathoid. See https://gerrit.wikimedia.org/r/#/c/166213/ */
img.tex {
vertical-align: middle;
}
.mwe-math-element {
overflow-x: auto;
max-width: 100%;
}