Commit Graph

670 Commits

Author SHA1 Message Date
Gabriel Wicke d7954691c1 Use more consistent background image scaling
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
2014-10-15 17:05:53 +00:00
Gabriel Wicke 97d6f8ff89 Work around tidy by using a meta element instead of an empty span
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
2014-10-15 13:13:41 +00:00
Reedy 672df7dcc8 Fix file permissions
Bug: 71941
Change-Id: I7b0eddc0ca679cf233ef29dcdfeca024ecc71d38
2014-10-15 12:16:20 +00:00
Translation updater bot d3e21a1044 Localisation updates from https://translatewiki.net.
Change-Id: Idfb438a17ff33fb6255b77e4144610ca95221d0e
2014-10-14 23:01:41 +02:00
Translation updater bot be90a7f4dc Localisation updates from https://translatewiki.net.
Change-Id: I0450d88fd0c79263821297f16763c116d1bdb623
2014-10-13 21:53:44 +02:00
jenkins-bot 67fbac7d67 Merge "Use radio buttons only for math mode selection" 2014-10-13 07:59:21 +00:00
Gabriel Wicke c61b8becac Use radio buttons only for math mode selection
While the combination of all redering modes, might
be useful for some power users it will confuse the
average user and makes bug reporting harder.

Therefore, source rendering on the server side is
used when MathJax is enabled on the client side.

Change-Id: I05a20d7c2298115dbf0429db6c107e8132cc15ff
2014-10-13 09:42:37 +02:00
Frédéric Wang d4e928a486 SVG images should not be loaded when MathML is used
- 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
2014-10-12 23:00:55 +00:00
C. Scott Ananian 209f3218ad Regularize spacing in `texvc` and `texvccheck`
Tweak the position of spaces between function invocations and arguments
so that the expansion of mediawiki-specific functions (`\Rho`, etc) is
consistent with how spacing is added to normal function invocations.

This helps ensure that `texvc`/`texvccheck` is idempotent -- that is,
that it can parse what it emits, and render it without change.

Change-Id: I05fc8fa0201debf611ed4900d3cc953a6a8188ac
2014-10-12 22:04:41 +02:00
C. Scott Ananian e38a70ef9e Some commands should require arguments in `texvc` and `texvccheck`
The \overbrace, \overleftarrow, \overleftrightarrow, \overline,
\overrightarrow, \underbrace, \underline, \widehat, and \widetilde
commands take a single mandatory argument.  Move \overbrace and
\underbrace to the fun_ar1nb list, since they handle trailing
subscripts and superscripts specially.  Move the other functions to
the fun_ar1 list.

Change-Id: I449c8611eeb2eaa7ccb30d3b325975868a160f95
2014-10-12 21:31:36 +02:00
C. Scott Ananian 9d0ed80bf9 Remove unused empty production for `litsq_zq` in texvc
It is impossible to take the empty alternative for this production,
since any input which matches `litsq_aq` would instead match `lit_aq`
if the empty alternative is used.  In addition, there is no action
clause for the empty alternative, so it wouldn't typecheck if the
empty alternative was possible.

This has no effect on the generated parser, but clarifies the grammar.
This commit matches a25078ff9d to
texvccheck.

Change-Id: I52eddd7321bd8450b47a5d57f2d704f0dd669f16
2014-10-12 19:28:03 +00:00
C. Scott Ananian b8161615f4 Switch to text mode before emitting \AA or \textvisiblespace.
The \AA and \textvisible space commands aren't valid in math mode.
Surround them with \mbox so that we switch to text mode before
emitting them.

Change-Id: I36c23c80751401be4bbce6aca6c3333912f67add
2014-10-12 21:18:25 +02:00
Frédéric Wang 3d0b787cbe Move vertical-align back to ext.math.css
This improves If8ee1cf6453257a0a2f6aa186d4007954a8e5d8e

Change-Id: I794b39a5d322a92d9f722ded790e213803448127
2014-10-12 18:22:06 +00:00
C. Scott Ananian 7914fbea61 MathCoverageTest: encode test file using JSON instead of PHP serialize.
This ensures that changes to the test inputs or outputs yield readable
diffs when reviewing.

Change-Id: I7b4ef8102ad7fbf7c289a27db60f304a140b93a5
2014-10-12 18:02:50 +00:00
Frédéric Wang 296c79e070 Rename fallback-svg and fallback-png to fallback-image
- 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
2014-10-12 13:42:01 +02:00
Frédéric Wang 74e4c3733d (Experimental) Fix centering of SVG image in display mode.
Change-Id: I7d5ec171c39b2eec563e074a4062b3e3682790f7
2014-10-11 21:21:46 +02:00
Frédéric Wang ee479e8e68 Fix centering of PNG image in display mode.
Revert the mistake made in https://gerrit.wikimedia.org/r/#/c/139120.

Change-Id: I31420ba3ab1e1b47c3e7307ac4a9aca2a6a8223f
2014-10-11 21:17:15 +02:00
Frédéric Wang 8e66e40780 Improvements to the PNG fallback style.
- create a new <img> tag to avoid copying unwanted style from the SVG fallback.
- keep the legacy tex class for consistency with the PNG mode.

Bug: 71912
Change-Id: Ibe4683d2898b49fda190e2f1535cab1b952250b0
2014-10-11 17:21:30 +00:00
Frédéric Wang 61a3d9c719 Merge "Revert "Disable failing latexml integration tests"" 2014-10-11 17:20:00 +00:00
Physikerwelt 2a20654ab9 Revert "Disable failing latexml integration tests"
This reverts commit 4c544f002b.

Change-Id: Ifafb5782e10e80240a282beb449ab069ad93c37f
2014-10-11 19:17:29 +02:00
Frédéric Wang 80361d2911 Merge "Avoid calling readFromDatabase in source mode" 2014-10-11 15:47:01 +00:00
physikerwelt (Moritz Schubotz) 3564b7cfe8 Avoid calling readFromDatabase in source mode
In source mode there is no database cache,
so we do not need to call readFromDatabase there.

Change-Id: I791eab923f5ed6e0a3e28dbaf49ba1ae8fdb6cdc
2014-10-11 16:41:38 +02:00
Frédéric Wang d1eef046af Cleanup MathMathML.php after the PNG fallback removal.
- 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
2014-10-11 16:13:04 +02:00
Frédéric Wang 0ddd3afaea Cleanup after the removal of the PNG fallback
- 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
2014-10-11 13:21:59 +00:00
Frédéric Wang 82f919b496 Upgrade Latin Modern Math to 1.959
Bug: 70360
Change-Id: Icb6ae3770a3d56bc03453ff5604eabb4699f2595
2014-10-11 13:26:37 +02:00
physikerwelt (Moritz Schubotz) ccc4114812 Fine grained options for wgMathDisableTeXFilter
Add new option to filter only new input.
Now the complete list of possible settings is:
MW_MATH_CHECK_ALWAYS  backwards compatible to false
MW_MATH_CHECK_NEVER   backwards compatible to true
MW_MATH_CHECK_NEW     new option

Change-Id: I455b41c8b8d918f4c34f6c115194d227a8394e0a
2014-10-10 18:27:04 +00:00
Frédéric Wang c3894c2c49 Display MathML when MathPlayer is installed
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
2014-10-10 20:20:47 +02:00
GWicke b59a37640c Merge "Revert "Bug 70119: Strip style from SVG image"" 2014-10-10 01:01:27 +00:00
GWicke 579591f932 Revert "Bug 70119: Strip style from SVG image"
This is now handled in mathoid by https://gerrit.wikimedia.org/r/165948

This reverts commit 1b41241091.

Change-Id: Ia8bc6eb6daebc4d28135602f483492b878928565
2014-10-10 01:01:13 +00:00
jenkins-bot 457ff9d992 Merge "Modify the math font-family for native MathML" 2014-10-09 20:09:51 +00:00
Gabriel Wicke 1b41241091 Bug 70119: Strip style from SVG image
The style would set a margin both on the SVG & the surrounding img. We
transfer the styles to the image, so don't want them on the SVG. This avoids
applying margins twice, which led to clipping.

Change-Id: I89ab3f6727d978d64df6f97f30decf5cb9c0bc92
2014-10-09 12:54:02 -07:00
Frédéric Wang 050564646d Modify the math font-family for native MathML
- add "Cambria" to workaround a bug on Firefox Windows.
- remove obsolete local fonts (MathJax and STIXGeneral).

Change-Id: I06e757b029b8778b88bc6e75e20929e0c945e364
2014-10-09 21:09:10 +02:00
Gabriel Wicke b762bef909 Bug 71857: Strip position style in all math modes
Change-Id: Ib965e687ae4e7afe86f92b497ffcbc349950fecf
2014-10-09 18:37:48 +00:00
Gabriel Wicke b7bd5196f2 Fix style stripping by adding missing /g flag
Change-Id: I6cd4b853638010d60809cecc87499113bd189d4c
2014-10-09 11:09:57 -07:00
jenkins-bot 9774aceb4b Merge "Bug 71857: Strip positioning from SVG fallback image styles" 2014-10-09 16:23:23 +00:00
Gabriel Wicke fd7fcc6ada Remove PNG image fallback image references
- 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
2014-10-09 05:50:04 +00:00
Gabriel Wicke f2e9dbe70c Bug 71857: Strip positioning from SVG fallback image styles
Change-Id: Ie664b421ee40c3d278605bd03cb669509319d862
2014-10-09 00:49:39 +00:00
Gabriel Wicke 4c544f002b Disable failing latexml integration tests
Change-Id: Ib0ea79155f87f036464756b3d303048f8df84897
2014-10-08 17:45:24 -07:00
Translation updater bot 8f12ba9ecb Localisation updates from https://translatewiki.net.
Change-Id: Iaaf724bee822fe92c5fce74776138a434be3828b
2014-10-08 21:26:18 +02:00
Translation updater bot 89131d3945 Localisation updates from https://translatewiki.net.
Change-Id: Ib1368d9f0a8fafae32a0d1c02c32e0d589df3693
2014-10-07 21:00:21 +02:00
Translation updater bot 8c2cc389b5 Localisation updates from https://translatewiki.net.
Change-Id: Idd621add0a7b5e5adad78a520927c73ffe86252f
2014-10-05 22:13:47 +02:00
Frédéric Wang 9f6257c329 Improve the way mathematical formulas are exposed to screen readers.
- 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
2014-10-05 17:48:41 +00:00
Translation updater bot ccd0819ffc Localisation updates from https://translatewiki.net.
Change-Id: If9aeddc029d63385ed21faebcfacee8b0eb2685f
2014-09-25 23:06:02 +02:00
Translation updater bot a19de888a3 Localisation updates from https://translatewiki.net.
Change-Id: Iaf6e4b13da5d2b5b7a31e65e7378dbe144325dc4
2014-09-19 22:05:56 +02:00
physikerwelt 21c89c22b1 tests: Add missing parent::tearDown() call
Follows-up 6a0af8f3b4.

Change-Id: I9418205479053c4129b6a9b888e38150799edcc5
2014-09-16 00:50:30 +00:00
Translation updater bot ac7ff979fb Localisation updates from https://translatewiki.net.
Change-Id: I2370ff821eafdbf379695ac4f1048c6c7e16683e
2014-09-15 02:06:09 +02:00
Translation updater bot b28c67ef03 Localisation updates from https://translatewiki.net.
Change-Id: I1c53b858b22d1ff67c220c2596943cafe281f082
2014-09-11 23:58:09 +02:00
Translation updater bot 3adca3ab15 Localisation updates from https://translatewiki.net.
Change-Id: I628f0f52678e8a0a92db28e3aab6f13a707c532d
2014-09-10 23:40:36 +02:00
jenkins-bot dfdf55b9ce Merge "Avoid unnecessary database reads" 2014-09-10 17:42:33 +00:00
Translation updater bot 20e86c0924 Localisation updates from https://translatewiki.net.
Change-Id: I0866f9ce618ea78f9cc6e01f90b43981142b0d94
2014-09-08 21:35:45 +02:00