Changeset 55386 in webkit


Ignore:
Timestamp:
Mar 1, 2010 4:22:13 PM (14 years ago)
Author:
eric@webkit.org
Message:

2010-03-01 Alex Milowski <alex@milowski.com>

Reviewed by Kenneth Rohde Christiansen.

Added test for basic msubsup support.

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

2010-03-01 Alex Milowski <alex@milowski.com>

Reviewed by Kenneth Rohde Christiansen.

Added support for the msubsup element that also handles the msup and msub elements.

Test: mathml/presentation/subsup.xhtml

  • WebCore.xcodeproj/project.pbxproj:
  • mathml/MathMLInlineContainerElement.cpp: (WebCore::MathMLInlineContainerElement::createRenderer):
  • mathml/RenderMathMLSubSup.cpp: Added. (WebCore::RenderMathMLSubSup::RenderMathMLSubSup): (WebCore::RenderMathMLSubSup::addChild): (WebCore::RenderMathMLSubSup::stretchToHeight): (WebCore::RenderMathMLSubSup::nonOperatorHeight): (WebCore::RenderMathMLSubSup::layout): (WebCore::RenderMathMLSubSup::baselinePosition):
  • mathml/RenderMathMLSubSup.h: Added. (WebCore::RenderMathMLSubSup::hasBase): (WebCore::RenderMathMLSubSup::):
Location:
trunk
Files:
5 added
9 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r55381 r55386  
     12010-03-01  Alex Milowski  <alex@milowski.com>
     2
     3        Reviewed by Kenneth Rohde Christiansen.
     4
     5        Added test for basic msubsup support.
     6
     7        * mathml/presentation/subsup.xhtml: Added.
     8        * platform/mac/mathml/presentation/subsup-expected.checksum: Added.
     9        * platform/mac/mathml/presentation/subsup-expected.png: Added.
     10        * platform/mac/mathml/presentation/subsup-expected.txt: Added.
     11
    1122010-03-01  Thatcher Ulrich  <tulrich@google.com>
    213
  • trunk/LayoutTests/platform/mac/mathml/presentation/sub-expected.checksum

    r53764 r55386  
    1 86ca442a628788281b851fcf581c6abe
     1e43f7c2c817b3102010bfa84e4bbb771
  • trunk/LayoutTests/platform/mac/mathml/presentation/sup-expected.checksum

    r53764 r55386  
    1 702e3992b12242981f2a6ecd54df28b3
     13cb060a09cc106603e87617b82aa4e27
  • trunk/WebCore/ChangeLog

    r55383 r55386  
     12010-03-01  Alex Milowski  <alex@milowski.com>
     2
     3        Reviewed by Kenneth Rohde Christiansen.
     4
     5        Added support for the msubsup element that also handles the msup and msub elements.
     6
     7        Test: mathml/presentation/subsup.xhtml
     8
     9        * WebCore.xcodeproj/project.pbxproj:
     10        * mathml/MathMLInlineContainerElement.cpp:
     11        (WebCore::MathMLInlineContainerElement::createRenderer):
     12        * mathml/RenderMathMLSubSup.cpp: Added.
     13        (WebCore::RenderMathMLSubSup::RenderMathMLSubSup):
     14        (WebCore::RenderMathMLSubSup::addChild):
     15        (WebCore::RenderMathMLSubSup::stretchToHeight):
     16        (WebCore::RenderMathMLSubSup::nonOperatorHeight):
     17        (WebCore::RenderMathMLSubSup::layout):
     18        (WebCore::RenderMathMLSubSup::baselinePosition):
     19        * mathml/RenderMathMLSubSup.h: Added.
     20        (WebCore::RenderMathMLSubSup::hasBase):
     21        (WebCore::RenderMathMLSubSup::):
     22
    1232010-03-01  Pavel Feldman  <pfeldman@chromium.org>
    224
  • trunk/WebCore/WebCore.xcodeproj/project.pbxproj

    r55312 r55386  
    48674867                FABE72FD1059C21100D999DD /* MathMLElementFactory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FABE72FB1059C21100D999DD /* MathMLElementFactory.cpp */; };
    48684868                FABE72FE1059C21100D999DD /* MathMLNames.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FABE72FC1059C21100D999DD /* MathMLNames.cpp */; };
     4869                FAC12CC41120DA6900DACC36 /* RenderMathMLSubSup.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FAC12CC21120DA6900DACC36 /* RenderMathMLSubSup.cpp */; };
     4870                FAC12CC51120DA6900DACC36 /* RenderMathMLSubSup.h in Headers */ = {isa = PBXBuildFile; fileRef = FAC12CC31120DA6900DACC36 /* RenderMathMLSubSup.h */; };
    48694871                FE6FD4880F676E5700092873 /* Coordinates.h in Headers */ = {isa = PBXBuildFile; fileRef = FE6FD4850F676E5700092873 /* Coordinates.h */; settings = {ATTRIBUTES = (Private, ); }; };
    48704872                FE6FD48D0F676E9300092873 /* JSCoordinates.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FE6FD48B0F676E9300092873 /* JSCoordinates.cpp */; };
     
    1020310205                FABE72FB1059C21100D999DD /* MathMLElementFactory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MathMLElementFactory.cpp; sourceTree = "<group>"; };
    1020410206                FABE72FC1059C21100D999DD /* MathMLNames.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MathMLNames.cpp; sourceTree = "<group>"; };
     10207                FAC12CC21120DA6900DACC36 /* RenderMathMLSubSup.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderMathMLSubSup.cpp; sourceTree = "<group>"; };
     10208                FAC12CC31120DA6900DACC36 /* RenderMathMLSubSup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderMathMLSubSup.h; sourceTree = "<group>"; };
    1020510209                FE136AE710643BE50078CF6D /* WebCore.OrientationEvents.exp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.exports; path = WebCore.OrientationEvents.exp; sourceTree = "<group>"; };
    1020610210                FE49BD301061719100D0E1AE /* WebCore.Inspector.exp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.exports; path = WebCore.Inspector.exp; sourceTree = "<group>"; };
     
    1609716101                                FA654A6D1108ABFF002615E0 /* RenderMathMLBlock.cpp */,
    1609816102                                FA654A6E1108ABFF002615E0 /* RenderMathMLBlock.h */,
     16103                                FAC12CC21120DA6900DACC36 /* RenderMathMLSubSup.cpp */,
     16104                                FAC12CC31120DA6900DACC36 /* RenderMathMLSubSup.h */,
    1609916105                                FA7EFB031120D25400CF79C7 /* RenderMathMLUnderOver.cpp */,
    1610016106                                FA7EFB041120D25400CF79C7 /* RenderMathMLUnderOver.h */,
     
    1856918575                                9F72304F11184B4100AD0126 /* ScriptProfile.h in Headers */,
    1857018576                                9F72305111184B4100AD0126 /* ScriptProfiler.h in Headers */,
     18577                                FAC12CC51120DA6900DACC36 /* RenderMathMLSubSup.h in Headers */,
    1857118578                                FA7EFB061120D25400CF79C7 /* RenderMathMLUnderOver.h in Headers */,
    1857218579                                BCE789161120D6080060ECE5 /* InlineIterator.h in Headers */,
     
    2075920766                                B776D43D1104527500BEB0EC /* PrintContext.cpp in Sources */,
    2076020767                                9F72305011184B4100AD0126 /* ScriptProfiler.cpp in Sources */,
     20768                                FAC12CC41120DA6900DACC36 /* RenderMathMLSubSup.cpp in Sources */,
    2076120769                                FA7EFB051120D25400CF79C7 /* RenderMathMLUnderOver.cpp in Sources */,
    2076220770                                BCE7898B1120E8020060ECE5 /* BidiRun.cpp in Sources */,
  • trunk/WebCore/mathml/MathMLInlineContainerElement.cpp

    r55310 r55386  
    3232#include "MathMLNames.h"
    3333#include "RenderMathMLBlock.h"
     34#include "RenderMathMLSubSup.h"
    3435#include "RenderMathMLUnderOver.h"
    3536
     
    5051RenderObject* MathMLInlineContainerElement::createRenderer(RenderArena *arena, RenderStyle* style)
    5152{
    52 
    5353    RenderObject* object = 0;
    54     if (hasLocalName(MathMLNames::moverTag))
     54    if (hasLocalName(MathMLNames::msubTag))
     55        object = new (arena) RenderMathMLSubSup(this);
     56    else if (hasLocalName(MathMLNames::msupTag))
     57        object = new (arena) RenderMathMLSubSup(this);
     58    else if (hasLocalName(MathMLNames::msubsupTag))
     59        object = new (arena) RenderMathMLSubSup(this);
     60    else if (hasLocalName(MathMLNames::moverTag))
    5561        object = new (arena) RenderMathMLUnderOver(this);
    5662    else if (hasLocalName(MathMLNames::munderTag))
  • trunk/WebCore/mathml/RenderMathMLBlock.h

    r54128 r55386  
    5353   
    5454protected:
     55    int getBoxModelObjectHeight(RenderObject* object)
     56    {
     57        if (object && object->isBoxModelObject()) {
     58            RenderBoxModelObject* box = toRenderBoxModelObject(object);
     59            return box->offsetHeight();
     60        }
     61       
     62        return 0;
     63    }
     64    int getBoxModelObjectHeight(const RenderObject* object)
     65    {
     66        if (object && object->isBoxModelObject()) {
     67            const RenderBoxModelObject* box = toRenderBoxModelObject(object);
     68            return box->offsetHeight();
     69        }
     70       
     71        return 0;
     72    }
     73    int getBoxModelObjectWidth(RenderObject* object)
     74    {
     75        if (object && object->isBoxModelObject()) {
     76            RenderBoxModelObject* box = toRenderBoxModelObject(object);
     77            return box->offsetWidth();
     78        }
     79       
     80        return 0;
     81    }
     82    int getBoxModelObjectWidth(const RenderObject* object)
     83    {
     84        if (object && object->isBoxModelObject()) {
     85            const RenderBoxModelObject* box = toRenderBoxModelObject(object);
     86            return box->offsetWidth();
     87        }
     88       
     89        return 0;
     90    }
    5591    virtual PassRefPtr<RenderStyle> makeBlockStyle();
    5692   
     
    68104    return static_cast<const RenderMathMLBlock*>(object);
    69105}
    70    
     106
    71107}
    72108
  • trunk/WebCore/mathml/RenderMathMLSubSup.h

    r55384 r55386  
    2424 */
    2525
    26 #ifndef RenderMathMLBlock_h
    27 #define RenderMathMLBlock_h
     26
     27#ifndef RenderMathMLSubSup_h
     28#define RenderMathMLSubSup_h
    2829
    2930#if ENABLE(MATHML)
    3031
    31 #include "RenderBlock.h"
    32 
    33 #define ENABLE_DEBUG_MATH_LAYOUT 0
     32#include "RenderMathMLBlock.h"
     33#include "RenderTable.h"
    3434
    3535namespace WebCore {
    3636   
    37 class RenderMathMLBlock : public RenderBlock {
     37class RenderMathMLSubSup : public RenderMathMLBlock {
    3838public:
    39     RenderMathMLBlock(Node* container);
    40     virtual bool isChildAllowed(RenderObject*, RenderStyle*) const;
     39    RenderMathMLSubSup(Element* fraction);
     40    virtual void addChild(RenderObject* child, RenderObject* beforeChild = 0);
     41    virtual bool hasBase() const { return true; }
     42    virtual int nonOperatorHeight() const;
     43    virtual void stretchToHeight(int pixelHeight);
     44    virtual int baselinePosition(bool, bool) const;   
     45
     46protected:
     47    virtual void layout();
    4148   
    42     virtual bool isRenderMathMLBlock() const { return true; }
    43     virtual bool isRenderMathMLOperator() const { return false; }
    44     virtual bool isRenderMathMLRow() const { return false; }
    45     virtual bool isRenderMathMLMath() const { return false; }
    46     virtual bool hasBase() const { return false; }
    47     virtual int nonOperatorHeight() const;
    48     virtual void stretchToHeight(int height);
    49 
    50 #if ENABLE(DEBUG_MATH_LAYOUT)
    51     virtual void paint(PaintInfo&, int tx, int ty);
    52 #endif
    53    
    54 protected:
    55     virtual PassRefPtr<RenderStyle> makeBlockStyle();
    56    
     49private:
     50    enum SubSupType { Sub, Sup, SubSup };
     51    SubSupType m_kind;
     52    RenderBlock* m_scripts;
    5753};
    58 
    59 inline RenderMathMLBlock* toRenderMathMLBlock(RenderObject* object)
    60 {
    61     ASSERT(!object || object->isRenderMathMLBlock());
    62     return static_cast<RenderMathMLBlock*>(object);
    63 }
    64 
    65 inline const RenderMathMLBlock* toRenderMathMLBlock(const RenderObject* object)
    66 {
    67     ASSERT(!object || object->isRenderMathMLBlock());
    68     return static_cast<const RenderMathMLBlock*>(object);
    69 }
    7054   
    7155}
    7256
     57#endif // ENABLE(MATHML)
    7358
    74 #endif // ENABLE(MATHML)
    75 #endif // RenderMathMLBlock_h
     59#endif // RenderMathMLSubSup_h
     60
Note: See TracChangeset for help on using the changeset viewer.