* Do not contact RESTbase in texvc rendering mode and
use the well established tex checking that is already build
into texvc.
* Do not use RESTbase in LaTeXML mode.
Background:
In I1982612e8c6a356e3dbdf447724ac82e5968cc77 RESTbased replaced
texvccheck that was a derivate of texvc designed for people
that wanted to use secure MathML rendering using mathoid.
The integration of mathoid to restbase made this feature obsolete.
However, texvccheck was not only used to check the latex input
that was sent to mathoid, but also the string which was sent to texvc.
Since texvc has already build in tex checking this is not
required and does not improve security.
Finally, users updating from old versions of the math extension
(prior to 2014) that do not have textexvccheck installed,
do not need to compile the texvccheck binary after this change.
PS5: Also treats the case where VisualEditor is not installed.
Bug: T121173
Change-Id: I1bd076b09206869b5ed75280d22e1b36bfb8d8ad
* Currently the Math extension stores the rendering result from restbase
in the database.
* This creates unnecessary write operations on the database
Change-Id: I5f07474fbf8017e39e94ac2b17676db1c3e92e72
* For tex input, the only form of Math input that
is accepted on WMF wikis, we retrieve MathML and SVG
image from Restbase without using the database cache.
Change-Id: Ief1b6345c17db41f92684e00233d57240e97599f
Redo Ibf6bdbd4ea36b4905445d5878f32f7e0b2bc8bac, which was
reverted by I029328849f05ec2afcabf38d2b79b337cb54cbd5.
In addition this patch simplifies the tex sent to the mathoid
server. Instead of {\displaystyle {\textstyle ... } } only
{\textstyle is sent (which overwrites \displaystyle anyway).
Change-Id: I16d6f67215c2f85ecd1d3a0bddacfc1700681557
The style information for the fallback image is quite sophisticated
and should not be changed.
Bug: 72626
Change-Id: I553cf7209d87517b8c8841cc25df74ebd4c683f4
* Use string constants instead of integers
* Derive new names from old via conversion of constant
naming convention to CamelCase.
* Replace old constant string e.g. 'MW_MATH_ABC_DEF'
with new string 'abcDef'
* Replace old constant value with new string.
* Tests to demonstrates what is actually done.
* Rename constants
Bug: T106630
Bug: T106631
Bug: T87941
Change-Id: I6d1094ece79e912d9ddbef6681a25196c7a6e801
* This problem was introduced in
I6fad69b5d9b9ca8a7d12c7e410d3ae6180fbddbf
* The $render variable is undefined in that context
* $this should be used instead
Change-Id: I70e0a03e41f0312a458d1dd27b766452ae093093
* MathDebug was intended to provide advanced debugging functionality
for the math extension. However, the interesting debugging and
logging feature never made it from the debug branch to the master.
* The current debug functionality is mostly useless. Only some values
are written to memory and never used thereafter.
* This change moves the existing functionality to the MathSearch
extension and introduced the required hook for that.
Details:
* $wgMathDebug is removed
* A new Hook MathRenderingResultRetrieved is created
* The math rendering object is printed to the svg error
page if wgDebugComments is active (instead of wgMathDebug)
Change-Id: I6fad69b5d9b9ca8a7d12c7e410d3ae6180fbddbf
In some cases the SVG property of the mathoid JSON result
seems to be empty.
In that case we ignore the SVG rendering.
Bug: T87379
Change-Id: I98398ec59e1d0205ee32cca137ad29dbc9dddec9
- We don't localize errors and debug logs like this, it makes them
impossible to decipher
- Also remove some 1.21 and below back-compat while we're here
Change-Id: Idb23fe5b434fa9fa3518672d57ec6e5466d005ac
MathMathML::renderingRequired called the getSvg
function in MathLaTeXML that caused an automatic
rerendering of the SVG image if it was not cached.
That this rendering is triggered from the function
renderingRequired is contra intutive and should be
avoided.
Change-Id: Ifa14f50193a05b3058624a18974c56897fcec09e
* Handle-error-first approach for consistent function body
termination at the root with the main intend, and less indention.
* __DIR__ instead of dirname( __FILE__ )
* Single quotes.
* Correct pickHost documentation: wgMathMathMLUrl is not an array,
and is not used in this method, that's at a different level
of abstraction (via the constructor).
* White spacing.
* require_once is not a function.
Change-Id: Id4bec8415893245e2569a39ab5406a0820238ae4
Chrome in particular would end up with fairly small and inconsistent
background sizes when using background-size: contain;. This makes sense
according to the docs at
https://developer.mozilla.org/en-US/docs/Web/CSS/background-size, which
doesn't specify that the background actually has to fill the entire element.
background-size: 100% 100%; does force full-size scaling, which is what we
want. Verified to work as expected in Chrome 38 on Linux.
Change-Id: I508e08dac1480491efcd1d27cfac16187bfbd4fe
HTML tidy will strip empty spans, so don't use one for the fallback image. We
use a meta element instead, as that does not normally render at all & doesn't
have any default styling coming with it.
Change-Id: I5bcbbc9468433e3c8722c09ce813a6f5ac741333
- Use span with a background-image instead of <img> for the fallback SVG so
that they don't load in Gecko.
- Make the image fallback a span inline-block so that it can have a dimension.
Bug: 71929
Change-Id: I7f820cd5766db1fece452ebfc72915a55e42c82e
- Merge fallback-svg and fallback-png into one fallback-image class.
- Move the vertical centering of PNG to MathTexvc and ext.math.js.
- Remove "img" from ext.math.css to reduce CSS specificity and make
style easier to override by user stylesheets.
- Add a comment about the !important rules for centering in
display mode.
- Only load ext.math.scripts in MathML mode.
Bug: 71955
Change-Id: If8ee1cf6453257a0a2f6aa186d4007954a8e5d8e
- Remove the special handling for the PNG fallback in
getFallbackImageUrl, getFallbackImage and getClassName.
- Make these functions private and remove useless parameters.
Bug: 71912
Change-Id: I569f2dd3d32a0c9690a5d9674a1c6ae0b8698f08
- remove the default "display: none" style on the SVG fallback
- remove the IE CSS hacks from ext.math.css
- add a client-side implementation of the PNG fallback
Bug: 71912
Change-Id: I91b11313aae25c4d05f8f2333d2f21537c9b8887
When MathPlayer is installed, we show the MathML instead of the SVG fallback.
This will in particular allow the sync highlighting feature of MathPlayer.
This also introduces a module ext.math.js that could be used to do some
Javascript postprocessing.
Bug: 71748
Change-Id: I438a20032c312d12321ca4c5686bcfd107656b37
- These images currently return server errors
- We don't really want to load PNG images for browsers that support MathML or
SVG.
Bug: 69702
Change-Id: Idd339623efd19a0726b43a6c4adc2fcd832511f6
- Mark the png and svg fallback as aria-hidden="true".
- For browsers without good enough MathML visual rendering,
hide the <math> tag in a way that still makes it accessible to
screen readers.
Bug: 66537
Change-Id: I7ecf07a4da669d927e11265fd497a813786c6410
Use the cached function isInDatabase rather than readFromDatabase to
avoid unnecessary read operations on the database.
Currently, readFromDatabase is usually called only once during instance
livetime. But after I455b41c8b8d918f4c34f6c115194d227a8394e0a has bben
merged chances are that it's called twice.
Change-Id: I6434195ad1d323a578a8fdca1b4555e11ab30a15
Currently the error reporting in MathML mode is
misleading.
The old error message suggested that the MathML
produced is not well formed.
This change displays the actual error
message occurred during the conversion process.
Change-Id: I6a8201107f9280f0cba97509f19b97d8e248c99f
In the default style MathML was rendered as inline and
not as display-style which was consistent to the current
behaviour of the PNG rendering.
By using the 'inline-TeX' rendering type the
display rendering is done independent of the rendering
of the surrounding block layout.
Change-Id: I87e669d5dc71d6937d4cc987d306b3c4648773c4
The PNG fallback for old IE versions worked
only if the PNG image was already stored in the
database.
This change enables the Specialpage that displays
the PNG images to create new PNG images and to
show them directly.
To test this commit you need an old IE version
(IE<9). If you don't have access you can use
an online service such as http://netrenderer.com.
Change-Id: I74163da94e2d7a2f07d78bfe0f5ce134564ba97f
Beginning from Mathoid 0.2.5 the specification
of a height and width attribute of the image will be required.
This patch gets those information from the SVG and copies
them to the img tag.
See also
Bug: 20202
Bug: 68295
Change-Id: I93e26a9f538acf21aea1501144bb1dd886ae0410
In some cases 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
Beginning from mathoid 0.2.5 displaystyle is the default
option. This property has to be removed as default.
Change-Id: I3c176f4227f32709f6db4014e1e3b435c3c853c4
Currently, the PNG fallback is hidden in the MathML mode and the MathML & SVG
are respectively hidden and visible by default; the visibility of the
SVG/MathML output is only changed for Gecko. This does not work well for
IE < 9, which does not support SVG. This commit tries to improve the selection
of PNG, SVG or MathML according to the browser capatibility.
Change-Id: Ie9b0fdb66c51fbf6be98df092ce4de29fbba6068
This change allows to registered users
to test the new MathML rendering mode.
Invalid settings for math rendering mode
will default to MathMathML.
Change-Id: I75f24cb762609d6728247e3758fcc18f2ebfc6e6
Currently the method render always returns
a html string that can be a string that
represents the correct result or a rendered
error message.
This change splits rendering and
fetching of the HTML output.
This simplifies the logic of the rendering
and caching mechanism.
Now the render method returns a boolean that
indicates if the rendering was sucessful or
not.
Step 2/2
Warning: Errors in this change might affect
caching logic and squid caches.
Change-Id: I00502b84212ed70cdf63bd69916a35afbd6fdbc1
Currently the method render always returns
a html string that can be a string that
represents the correct result or a rendered
error message.
This change adds a mechanism that allows
to fetch the HTML output.
In a followup commit the rendering function
is changed to return a boolean value rather
than the rendering result.
This will simplify the error handling and caching.
Change-Id: I80760493e391911c41eb69d75a93c6a34db8852e
The LaTeXML class contains some code that is
not specific to LaTeXML but to MathML.
This code can be shared between LaTeXML and Mathoid.
This change introduces a new class called MathMathML
and moves the shared code from the LaTeXML class to this
new class.
Bug: 65973
Change-Id: I50517ba83f9a0d2aa8e237f062f18e4319ddbac8