Title: [157791] trunk/Source/WebCore
- Revision
- 157791
- Author
- akl...@apple.com
- Date
- 2013-10-22 07:43:01 -0700 (Tue, 22 Oct 2013)
Log Message
CTTE: RenderMathMLFraction always has a MathMLInlineContainerElement.
<https://webkit.org/b/123154>
This renderer is never anonymous and always has a corresponding
MathMLInlineContainerElement. Overload element() with a tighter
return type.
Also marked the class FINAL and made most member functions private.
Reviewed by Antti Koivisto.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (157790 => 157791)
--- trunk/Source/WebCore/ChangeLog 2013-10-22 14:42:28 UTC (rev 157790)
+++ trunk/Source/WebCore/ChangeLog 2013-10-22 14:43:01 UTC (rev 157791)
@@ -1,5 +1,18 @@
2013-10-22 Andreas Kling <akl...@apple.com>
+ CTTE: RenderMathMLFraction always has a MathMLInlineContainerElement.
+ <https://webkit.org/b/123154>
+
+ This renderer is never anonymous and always has a corresponding
+ MathMLInlineContainerElement. Overload element() with a tighter
+ return type.
+
+ Also marked the class FINAL and made most member functions private.
+
+ Reviewed by Antti Koivisto.
+
+2013-10-22 Andreas Kling <akl...@apple.com>
+
FontGlyphs constructor functions should return PassRef.
<https://webkit.org/b/123159>
Modified: trunk/Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp (157790 => 157791)
--- trunk/Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp 2013-10-22 14:42:28 UTC (rev 157790)
+++ trunk/Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp 2013-10-22 14:43:01 UTC (rev 157791)
@@ -43,7 +43,7 @@
static const float gLineThick = 3.f;
static const float gFractionBarWidth = 0.05f;
-RenderMathMLFraction::RenderMathMLFraction(Element& element)
+RenderMathMLFraction::RenderMathMLFraction(MathMLInlineContainerElement& element)
: RenderMathMLBlock(element)
, m_lineThickness(gLineMedium)
{
@@ -62,15 +62,13 @@
// FIXME: mfrac where bevelled=true will need to reorganize the descendants
if (isEmpty())
return;
-
- Element* fraction = element();
-
+
RenderObject* numeratorWrapper = firstChild();
RenderObject* denominatorWrapper = numeratorWrapper->nextSibling();
if (!denominatorWrapper)
return;
-
- String thickness = fraction->getAttribute(MathMLNames::linethicknessAttr);
+
+ String thickness = element().getAttribute(MathMLNames::linethicknessAttr);
m_lineThickness = gLineMedium;
if (equalIgnoringCase(thickness, "thin"))
m_lineThickness = gLineThin;
Modified: trunk/Source/WebCore/rendering/mathml/RenderMathMLFraction.h (157790 => 157791)
--- trunk/Source/WebCore/rendering/mathml/RenderMathMLFraction.h 2013-10-22 14:42:28 UTC (rev 157790)
+++ trunk/Source/WebCore/rendering/mathml/RenderMathMLFraction.h 2013-10-22 14:43:01 UTC (rev 157791)
@@ -29,31 +29,31 @@
#if ENABLE(MATHML)
+#include "MathMLInlineContainerElement.h"
#include "RenderMathMLBlock.h"
namespace WebCore {
-class RenderMathMLFraction : public RenderMathMLBlock {
+class RenderMathMLFraction FINAL : public RenderMathMLBlock {
public:
- explicit RenderMathMLFraction(Element&);
- virtual void addChild(RenderObject* child, RenderObject* beforeChild = 0) OVERRIDE;
+ explicit RenderMathMLFraction(MathMLInlineContainerElement&);
+
+ MathMLInlineContainerElement& element() { return static_cast<MathMLInlineContainerElement&>(nodeForNonAnonymous()); }
+ float lineThickness() const { return m_lineThickness; }
+
+private:
+ virtual bool isRenderMathMLFraction() const OVERRIDE { return true; }
+ virtual const char* renderName() const OVERRIDE { return "RenderMathMLFraction"; }
+
+ virtual void addChild(RenderObject* child, RenderObject* beforeChild) OVERRIDE;
virtual void updateFromElement() OVERRIDE;
-
- virtual RenderMathMLOperator* unembellishedOperator() OVERRIDE;
-
virtual int firstLineBoxBaseline() const OVERRIDE;
- float lineThickness() const { return m_lineThickness; }
virtual void paint(PaintInfo&, const LayoutPoint&) OVERRIDE;
-
-protected:
+ virtual RenderMathMLOperator* unembellishedOperator() OVERRIDE;
virtual void layout() OVERRIDE;
-
-private:
- virtual bool isRenderMathMLFraction() const OVERRIDE { return true; }
- void fixChildStyle(RenderObject* child);
virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) OVERRIDE;
- virtual const char* renderName() const OVERRIDE { return "RenderMathMLFraction"; }
+ void fixChildStyle(RenderObject*);
LayoutUnit m_lineThickness;
};
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes