This page uses <script type="module"> with relative import paths.
Browsers usually block those imports from the file:// URL, so the polyfill will not run if you open this file directly from disk.
Serve the repository root over HTTP and open this page from there, for example:
python -m http.server 8080 then visit
http://localhost:8080/scriptshift/index.html.
Tests for the scriptshift.js polyfill:
MathML 4
subscriptshift / superscriptshift on
msub, msup, and msubsup.
Each row compares the default (no shift attribute) with a shifted script after
_MathTransforms.transform runs.
The blue border is tight and indicates the MathML element's bounding box.
| Description | No subscriptshift (reference) |
subscriptshift="0.5em" (polyfilled) |
|---|---|---|
| Simple subscript | ||
| Nested subscript (i sub j) |
| Description | No superscriptshift (reference) |
superscriptshift="0.5em" (polyfilled) |
|---|---|---|
| Simple superscript | ||
| e to the t squared (nested superscript) |
| Description | No shift attrs (reference) | Both shifts (polyfilled) | Sub only / super only |
|---|---|---|---|
| Integral-style limits | |||
| Variable with sub/sup pair |
Sanity check with absolute lengths: