Attachment #8361049: Patch for bug #945254

View | Details | Raw Unified | Return to bug 945254
Collapse All | Expand All

(-)a/layout/mathml/nsMathMLmmultiscriptsFrame.cpp (+6 lines)
Line     Link Here 
 Lines 591-606   nsMathMLmmultiscriptsFrame::PlaceMultiSc Link Here 
591
          width = std::max(subScriptSize.Width(), supScriptSize.Width());
591
          width = std::max(subScriptSize.Width(), supScriptSize.Width());
592
592
593
          if (subScriptFrame) {
593
          if (subScriptFrame) {
594
            nscoord x = dx;
594
            nscoord x = dx;
595
            // prescripts should be right aligned
595
            // prescripts should be right aligned
596
            // https://bugzilla.mozilla.org/show_bug.cgi?id=928675
596
            // https://bugzilla.mozilla.org/show_bug.cgi?id=928675
597
            if (isPreScript)
597
            if (isPreScript)
598
              x += width - subScriptSize.Width();
598
              x += width - subScriptSize.Width();
599
            else if (baseFrame &&
600
                     baseFrame->GetNextSibling() == subScriptFrame) {
601
              // a postscript subscript should be immediately after the base, so
602
              // we subtract the italic correction that was added above
603
              x -= italicCorrection;
604
            }
599
            dy = aDesiredSize.TopAscent() - subScriptSize.TopAscent() +
605
            dy = aDesiredSize.TopAscent() - subScriptSize.TopAscent() +
600
              maxSubScriptShift;
606
              maxSubScriptShift;
601
            FinishReflowChild (subScriptFrame, aPresContext, nullptr,
607
            FinishReflowChild (subScriptFrame, aPresContext, nullptr,
602
                               subScriptSize,
608
                               subScriptSize,
603
                               aFrame->MirrorIfRTL(aDesiredSize.Width(),
609
                               aFrame->MirrorIfRTL(aDesiredSize.Width(),
604
                                                   subScriptSize.Width(),
610
                                                   subScriptSize.Width(),
605
                                                   x),
611
                                                   x),
606
                               dy, 0);
612
                               dy, 0);
(-)a/layout/reftests/mathml/reftest.list (+1 lines)
Line     Link Here 
 Lines 150-165   fails == whitespace-trim-4.html whitespa Link Here 
150
== operator-1.xhtml operator-1-ref.xhtml
150
== operator-1.xhtml operator-1-ref.xhtml
151
== scriptshift-1.xhtml scriptshift-1-ref.xhtml
151
== scriptshift-1.xhtml scriptshift-1-ref.xhtml
152
== number-size-1.xhtml number-size-1-ref.xhtml
152
== number-size-1.xhtml number-size-1-ref.xhtml
153
== multiscripts-1.html multiscripts-1-ref.html
153
== multiscripts-1.html multiscripts-1-ref.html
154
== mathml-mmultiscript-base.html mathml-mmultiscript-base-ref.html
154
== mathml-mmultiscript-base.html mathml-mmultiscript-base-ref.html
155
== mathml-mmultiscript-mprescript.html mathml-mmultiscript-mprescript-ref.html
155
== mathml-mmultiscript-mprescript.html mathml-mmultiscript-mprescript-ref.html
156
!= menclose-1.html menclose-1-ref.html
156
!= menclose-1.html menclose-1-ref.html
157
== mmultiscript-align.html mmultiscript-align-ref.html
157
== mmultiscript-align.html mmultiscript-align-ref.html
158
== subscript-italic-correction.html subscript-italic-correction-ref.html
158
== mathvariant-1a.html mathvariant-1a-ref.html
159
== mathvariant-1a.html mathvariant-1a-ref.html
159
== mathvariant-1b.html mathvariant-1b-ref.html
160
== mathvariant-1b.html mathvariant-1b-ref.html
160
== mathvariant-1c.html mathvariant-1c-ref.html
161
== mathvariant-1c.html mathvariant-1c-ref.html
161
== mathvariant-1d.html mathvariant-1d-ref.html
162
== mathvariant-1d.html mathvariant-1d-ref.html
162
== mathvariant-2.html mathvariant-2-ref.html
163
== mathvariant-2.html mathvariant-2-ref.html
163
== mathvariant-3.html mathvariant-3-ref.html
164
== mathvariant-3.html mathvariant-3-ref.html
164
== mathvariant-4.html mathvariant-4-ref.html
165
== mathvariant-4.html mathvariant-4-ref.html
165
== mathvariant-5.html mathvariant-5-ref.html
166
== mathvariant-5.html mathvariant-5-ref.html
(-)a/layout/reftests/mathml/subscript-italic-correction-ref.html (+32 lines)
Line     Link Here 
Line 0    Link Here 
1
<!doctype html>
2
<html>
3
  <head>
4
    <title>subscript</title>
5
    <meta charset="utf-8"/>
6
  </head>
7
  <body style="background: #5f5; font-size: 50px;">
8
9
    <div>
10
      <math>
11
        <msubsup>
12
          <mi>f</mi>
13
          <mspace id="s1" width="50px" height="50px" mathbackground="blue"/>
14
          <mspace id="s2" width="50px" height="50px" mathbackground="blue"/>
15
        </msubsup>
16
      </math>
17
    </div>
18
19
    <br/>
20
21
    <div>
22
      <math>
23
        <mmultiscripts>
24
          <mi>f</mi>
25
          <mspace id="s3" width="50px" height="50px" mathbackground="blue"/>
26
          <mspace id="s4" width="50px" height="50px" mathbackground="blue"/>
27
        </mmultiscripts>
28
      </math>
29
    </div>
30
31
  </body>
32
</html>
(-)a/layout/reftests/mathml/subscript-italic-correction.html (+51 lines)
Line     Link Here 
Line 0    Link Here 
1
<!doctype html>
2
<html class="reftest-wait">
3
  <head>
4
    <title>subscript</title>
5
    <meta charset="utf-8"/>
6
    <script type="text/javascript">
7
      function doTest()
8
      {
9
        var s1 = document.getElementById("s1");
10
        var s2 = document.getElementById("s2");
11
        var s3 = document.getElementById("s3");
12
        var s4 = document.getElementById("s4");
13
        var epsilon = 5;
14
        var shift1 = (s1.getBoundingClientRect().left <
15
                      s2.getBoundingClientRect().left - epsilon);
16
        var shift2 = (s3.getBoundingClientRect().left <
17
                      s4.getBoundingClientRect().left - epsilon);
18
        if (shift1 && shift2) {
19
          document.body.style.background = "#5f5";
20
        }
21
        document.documentElement.removeAttribute("class");
22
      }
23
      window.addEventListener("MozReftestInvalidate", doTest, false);
24
    </script>
25
  </head>
26
  <body style="background: #f00; font-size: 50px;">
27
28
    <div>
29
      <math>
30
        <msubsup>
31
          <mi>f</mi>
32
          <mspace id="s1" width="50px" height="50px" mathbackground="blue"/>
33
          <mspace id="s2" width="50px" height="50px" mathbackground="blue"/>
34
        </msubsup>
35
      </math>
36
    </div>
37
38
    <br/>
39
40
    <div>
41
      <math>
42
        <mmultiscripts>
43
          <mi>f</mi>
44
          <mspace id="s3" width="50px" height="50px" mathbackground="blue"/>
45
          <mspace id="s4" width="50px" height="50px" mathbackground="blue"/>
46
        </mmultiscripts>
47
      </math>
48
    </div>
49
50
  </body>
51
</html>

Return to bug 945254