Changeset 157613 in webkit
- Timestamp:
- Oct 17, 2013, 4:33:53 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
rendering/mathml/RenderMathMLSpace.cpp (modified) (3 diffs)
-
rendering/mathml/RenderMathMLSpace.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r157611 r157613 1 2013-10-17 Andreas Kling <akling@apple.com> 2 3 CTTE: RenderMathMLSpace always has a MathMLTextElement. 4 <https://webkit.org/b/122992> 5 6 The renderer is never anonymous and always has a corresponding 7 MathMLTextElement. Overload element() with a tighter return type. 8 9 Also marked the class FINAL and made most methods private. 10 11 Reviewed by Antti Koivisto. 12 13 * rendering/mathml/RenderMathMLSpace.cpp: 14 (WebCore::RenderMathMLSpace::RenderMathMLSpace): 15 (WebCore::RenderMathMLSpace::updateFromElement): 16 * rendering/mathml/RenderMathMLSpace.h: 17 1 18 2013-10-17 Tim Horton <timothy_horton@apple.com> 2 19 -
trunk/Source/WebCore/rendering/mathml/RenderMathMLSpace.cpp
r157408 r157613 37 37 using namespace MathMLNames; 38 38 39 RenderMathMLSpace::RenderMathMLSpace( Element& element)39 RenderMathMLSpace::RenderMathMLSpace(MathMLTextElement& element) 40 40 : RenderMathMLBlock(element) 41 41 , m_width(0) … … 53 53 void RenderMathMLSpace::updateFromElement() 54 54 { 55 Element* space= element();55 const auto& spaceElement = element(); 56 56 57 57 // This parses the mspace attributes, using 0 as the default values. … … 59 59 m_height = 0; 60 60 m_depth = 0; 61 parseMathMLLength(space ->getAttribute(MathMLNames::widthAttr), m_width, style());62 parseMathMLLength(space ->getAttribute(MathMLNames::heightAttr), m_height, style());63 parseMathMLLength(space ->getAttribute(MathMLNames::depthAttr), m_depth, style());61 parseMathMLLength(spaceElement.getAttribute(MathMLNames::widthAttr), m_width, style()); 62 parseMathMLLength(spaceElement.getAttribute(MathMLNames::heightAttr), m_height, style()); 63 parseMathMLLength(spaceElement.getAttribute(MathMLNames::depthAttr), m_depth, style()); 64 64 65 65 // FIXME: Negative width values should be accepted. -
trunk/Source/WebCore/rendering/mathml/RenderMathMLSpace.h
r157509 r157613 29 29 #if ENABLE(MATHML) 30 30 31 #include "MathMLTextElement.h" 31 32 #include "RenderMathMLBlock.h" 32 33 33 34 namespace WebCore { 34 35 35 class RenderMathMLSpace : public RenderMathMLBlock {36 class RenderMathMLSpace FINAL : public RenderMathMLBlock { 36 37 public: 37 explicit RenderMathMLSpace(Element&); 38 explicit RenderMathMLSpace(MathMLTextElement&); 39 MathMLTextElement& element() { return static_cast<MathMLTextElement&>(nodeForNonAnonymous()); } 38 40 41 private: 42 virtual const char* renderName() const OVERRIDE { return isAnonymous() ? "RenderMathMLSpace (anonymous)" : "RenderMathMLSpace"; } 43 virtual bool isRenderMathMLSpace() const OVERRIDE { return true; } 44 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) OVERRIDE; 45 virtual bool isChildAllowed(const RenderObject&, const RenderStyle&) const OVERRIDE { return false; } 46 virtual void computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const OVERRIDE; 47 virtual void updateFromElement() OVERRIDE; 39 48 virtual int firstLineBoxBaseline() const OVERRIDE; 40 49 virtual void updateLogicalWidth() OVERRIDE; 41 50 virtual void updateLogicalHeight() OVERRIDE; 42 43 private:44 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) OVERRIDE;45 virtual const char* renderName() const OVERRIDE { return isAnonymous() ? "RenderMathMLSpace (anonymous)" : "RenderMathMLSpace"; }46 47 virtual bool isRenderMathMLSpace() const OVERRIDE { return true; }48 49 virtual bool isChildAllowed(const RenderObject&, const RenderStyle&) const OVERRIDE { return false; }50 virtual void computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const OVERRIDE;51 52 virtual void updateFromElement() OVERRIDE;53 51 54 52 LayoutUnit m_width;
Note:
See TracChangeset
for help on using the changeset viewer.