|
241 | 241 |
|
242 | 242 | var EVENT, TOUCH, HOVER; // filled in later
|
243 | 243 |
|
| 244 | + var oldIE = MathJax.Hub.Browser.isMSIE && (document.documentMode||0) < 8; |
| 245 | + |
244 | 246 | HTMLCSS.Augment({
|
245 | 247 | config: {
|
246 | 248 | styles: {
|
|
278 | 280 | "min-width": 0, "min-height": 0,
|
279 | 281 | width: "100%"
|
280 | 282 | },
|
| 283 | + |
| 284 | + ".MathJax.MathJax_FullWidth": { |
| 285 | + display: "table-cell!important", |
| 286 | + width: "10000em!important" |
| 287 | + }, |
281 | 288 |
|
282 | 289 | ".MathJax img, .MathJax nobr, .MathJax a": {
|
283 | 290 | border: 0, padding: 0, margin: 0,
|
|
331 | 338 | width:"1px", height:"60em",
|
332 | 339 | "min-height": 0, "max-height":"none"
|
333 | 340 | },
|
| 341 | + ".MathJax_LineBox": { |
| 342 | + display: (oldIE ? "inline-block" : "table-cell") + "!important", |
| 343 | + width: (oldIE ? "100%" : "10000em") + "!important", |
| 344 | + "min-width":0, "max-width":"none", |
| 345 | + padding:0, border:0, margin:0 |
| 346 | + }, |
334 | 347 |
|
335 | 348 | ".MathJax .MathJax_HitBox": {
|
336 | 349 | cursor: "text",
|
|
340 | 353 | ".MathJax .MathJax_HitBox *": {
|
341 | 354 | filter: "none", opacity:1, background:"transparent" // for IE
|
342 | 355 | },
|
343 |
| - |
| 356 | + |
344 | 357 | "#MathJax_Tooltip": {
|
345 | 358 | position: "absolute", left: 0, top: 0,
|
346 | 359 | width: "auto", height: "auto",
|
|
482 | 495 | );
|
483 | 496 |
|
484 | 497 | // Used in preTranslate to get linebreak width
|
485 |
| - this.linebreakSpan = this.Element("span",null, |
486 |
| - [["hr",{style: {width:"100%", size:1, padding:0, border:0, margin:0}}]]); |
| 498 | + this.linebreakSpan = MathJax.HTML.Element("span",{className:"MathJax_LineBox"}); |
487 | 499 |
|
488 | 500 | // Set up styles and preload web fonts
|
489 | 501 | return AJAX.Styles(this.config.styles,["InitializeHTML",this]);
|
|
539 | 551 | document.body.appendChild(this.linebreakSpan);
|
540 | 552 | this.defaultEx = this.EmExSpan.firstChild.offsetHeight/60;
|
541 | 553 | this.defaultEm = this.EmExSpan.lastChild.firstChild.offsetHeight/60;
|
542 |
| - this.defaultWidth = this.linebreakSpan.firstChild.offsetWidth; |
| 554 | + this.defaultWidth = this.linebreakSpan.offsetWidth; |
543 | 555 | document.body.removeChild(this.linebreakSpan);
|
544 | 556 | document.body.removeChild(this.EmExSpan);
|
545 | 557 | },
|
|
609 | 621 | jax = script.MathJax.elementJax; if (!jax) continue;
|
610 | 622 | ex = test.firstChild.offsetHeight/60;
|
611 | 623 | em = test.lastChild.firstChild.offsetHeight/60;
|
612 |
| - cwidth = div.previousSibling.firstChild.offsetWidth; |
| 624 | + cwidth = Math.max(0,div.previousSibling.offsetWidth - 2); |
613 | 625 | if (relwidth) {maxwidth = cwidth}
|
614 | 626 | if (ex === 0 || ex === "NaN") {
|
615 | 627 | // can't read width, so move to hidden div for processing
|
|
2951 | 2963 | if (math && math.bbox.width != null) {
|
2952 | 2964 | span.style.minWidth = (math.bbox.minWidth || span.style.width);
|
2953 | 2965 | span.style.width = math.bbox.width;
|
2954 |
| - box.style.width = stack.style.width = SPAN.style.width = "100%"; |
| 2966 | + box.style.width = stack.style.width = "100%"; |
| 2967 | + SPAN.className += " MathJax_FullWidth"; |
2955 | 2968 | }
|
2956 | 2969 | //
|
2957 | 2970 | // Add color (if any)
|
|
0 commit comments