Changeset 62152 in webkit


Ignore:
Timestamp:
Jun 29, 2010 3:57:46 PM (14 years ago)
Author:
commit-queue@webkit.org
Message:

2010-06-29 François Sausset <François Sausset>

Reviewed by Darin Adler.

Add a test when a msubsup element is wrapped in a mrow element
https://bugs.webkit.org/show_bug.cgi?id=36525

  • mathml/presentation/subsup.xhtml:
  • platform/mac/mathml/presentation/subsup-expected.checksum:
  • platform/mac/mathml/presentation/subsup-expected.png:
  • platform/mac/mathml/presentation/subsup-expected.txt:

2010-06-29 François Sausset <François Sausset>

Reviewed by Darin Adler.

Fix a bug when a msubsup element is inside a mrow element
https://bugs.webkit.org/show_bug.cgi?id=36525

Test: mathml/presentation/subsup.xhtml

  • mathml/RenderMathMLSubSup.cpp: (WebCore::RenderMathMLSubSup::stretchToHeight):
Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r62150 r62152  
     12010-06-29  François Sausset  <sausset@gmail.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        Add a test when a msubsup element is wrapped in a mrow element
     6        https://bugs.webkit.org/show_bug.cgi?id=36525
     7
     8        * mathml/presentation/subsup.xhtml:
     9        * platform/mac/mathml/presentation/subsup-expected.checksum:
     10        * platform/mac/mathml/presentation/subsup-expected.png:
     11        * platform/mac/mathml/presentation/subsup-expected.txt:
     12
    1132010-06-29  Zhenyao Mo  <zmo@google.com>
    214
     
    1585315865
    1585415866== Rolled over to ChangeLog-2010-05-24 ==
     15867>>>>>>> .r55032
  • trunk/LayoutTests/mathml/presentation/subsup.xhtml

    r55386 r62152  
    3636</math>
    3737</p>
     38<p id='t5'>Wrapped in mrow:
     39<math xmlns='http://www.w3.org/1998/Math/MathML'>
     40<mrow><msubsup><mi>x</mi><mn>1</mn><mi>k</mi></msubsup></mrow>
     41</math>
     42</p>
    3843</body>
    3944</html>
  • trunk/LayoutTests/platform/mac/mathml/presentation/subsup-expected.checksum

    r61861 r62152  
    1 27910d937e2cc645933ac84fe1d72eba
     19114a2ab8d9c882e2f4f2fb18014b6e1
  • trunk/LayoutTests/platform/mac/mathml/presentation/subsup-expected.txt

    r61861 r62152  
    11layer at (0,0) size 800x600
    22  RenderView at (0,0) size 800x600
    3 layer at (0,0) size 800x208
    4   RenderBlock {html} at (0,0) size 800x208
    5     RenderBody {body} at (8,16) size 784x176
     3layer at (0,0) size 800x256
     4  RenderBlock {html} at (0,0) size 800x256
     5    RenderBody {body} at (8,16) size 784x224
    66      RenderBlock {p} at (0,0) size 784x32
    77        RenderText {#text} at (0,8) size 36x18
     
    126126                      text run at (24,2) width 5: "z"
    127127        RenderText {#text} at (0,0) size 0x0
     128      RenderBlock {p} at (0,192) size 784x32
     129        RenderText {#text} at (0,8) size 123x18
     130          text run at (0,8) width 123: "Wrapped in mrow: "
     131        RenderBlock {math} at (123,0) size 18x32
     132          RenderBlock {mrow} at (1,0) size 16x32
     133            RenderBlock {msubsup} at (1,0) size 14x32
     134              RenderBlock {msubsup} at (0,8) size 7x19
     135                RenderInline {mi} at (0,0) size 7x16
     136                  RenderText {#text} at (0,3) size 7x16
     137                    text run at (0,3) width 7: "x"
     138              RenderBlock {msubsup} at (8,0) size 6x32
     139                RenderBlock {msubsup} at (0,0) size 6x16
     140                  RenderInline {mi} at (0,0) size 5x12
     141                    RenderText {#text} at (0,3) size 5x12
     142                      text run at (0,3) width 5: "k"
     143                RenderBlock {msubsup} at (0,16) size 6x16
     144                  RenderInline {mn} at (0,0) size 6x12
     145                    RenderText {#text} at (0,3) size 6x12
     146                      text run at (0,3) width 6: "1"
     147        RenderText {#text} at (0,0) size 0x0
  • trunk/WebCore/ChangeLog

    r62150 r62152  
     12010-06-29  François Sausset  <sausset@gmail.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        Fix a bug when a msubsup element is inside a mrow element
     6        https://bugs.webkit.org/show_bug.cgi?id=36525
     7
     8        Test: mathml/presentation/subsup.xhtml
     9
     10        * mathml/RenderMathMLSubSup.cpp:
     11        (WebCore::RenderMathMLSubSup::stretchToHeight):
     12
    1132010-06-29  Zhenyao Mo  <zmo@google.com>
    214
  • trunk/WebCore/mathml/RenderMathMLSubSup.cpp

    r61861 r62152  
    103103}
    104104
    105 void  RenderMathMLSubSup::stretchToHeight(int height)
     105void RenderMathMLSubSup::stretchToHeight(int height)
    106106{
    107107    RenderObject* base = firstChild();
     
    109109        return;
    110110   
    111     if (base->isRenderMathMLBlock()) {
    112         RenderMathMLBlock* block = toRenderMathMLBlock(base);
     111    if (base->firstChild()->isRenderMathMLBlock()) {
     112        RenderMathMLBlock* block = toRenderMathMLBlock(base->firstChild());
    113113        block->stretchToHeight(static_cast<int>(gSubSupStretch * height));
    114     }
    115     if (height > 0 && m_kind == SubSup && m_scripts) {
    116         RenderObject* script = m_scripts->firstChild();
    117         if (script) {
    118             // Calculate the script height without the container margins.
    119             RenderObject* top = script;
    120             int topHeight = getBoxModelObjectHeight(top->firstChild());
    121             int topAdjust = topHeight / gTopAdjustDivisor;
    122             top->style()->setMarginTop(Length(-topAdjust, Fixed));
    123             top->style()->setMarginBottom(Length(height - topHeight + topAdjust, Fixed));
    124             if (top->isBoxModelObject()) {
    125                 RenderBoxModelObject* topBox = toRenderBoxModelObject(top);
    126                 topBox->updateBoxModelInfoFromStyle();
    127             }
    128             m_scripts->setNeedsLayoutAndPrefWidthsRecalc();
    129             m_scripts->markContainingBlocksForLayout();
     114        if (height > 0 && m_kind == SubSup && m_scripts) {
     115            RenderObject* script = m_scripts->firstChild();
     116            if (script) {
     117                // Calculate the script height without the container margins.
     118                RenderObject* top = script;
     119                int topHeight = getBoxModelObjectHeight(top->firstChild());
     120                int topAdjust = topHeight / gTopAdjustDivisor;
     121                top->style()->setMarginTop(Length(-topAdjust, Fixed));
     122                top->style()->setMarginBottom(Length(height - topHeight + topAdjust, Fixed));
     123                if (top->isBoxModelObject()) {
     124                    RenderBoxModelObject* topBox = toRenderBoxModelObject(top);
     125                    topBox->updateBoxModelInfoFromStyle();
     126                }
     127                m_scripts->setNeedsLayoutAndPrefWidthsRecalc();
     128                m_scripts->markContainingBlocksForLayout();
     129            }
    130130        }
    131131    }
Note: See TracChangeset for help on using the changeset viewer.