Commit e932cfd9 authored by eric@webkit.org's avatar eric@webkit.org

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

        Reviewed by Darin Adler.

        Added compile time debug support for mathml layout (block boundary & baseline)

        * mathml/RenderMathMLBlock.cpp:
        (WebCore::RenderMathMLBlock::stretchToHeight):
        (WebCore::RenderMathMLBlock::paint):
        * mathml/RenderMathMLBlock.h:

git-svn-id: svn://svn.chromium.org/blink/trunk@54128 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent aa9e023d
2010-02-01 Alex Milowski <alex@milowski.com>
Reviewed by Darin Adler.
Added compile time debug support for mathml layout (block boundary & baseline)
* mathml/RenderMathMLBlock.cpp:
(WebCore::RenderMathMLBlock::stretchToHeight):
(WebCore::RenderMathMLBlock::paint):
* mathml/RenderMathMLBlock.h:
2010-02-01 Philippe Normand <pnormand@igalia.com>
Rubber stamped by Xan Lopez.
......
......@@ -30,6 +30,7 @@
#include "RenderMathMLBlock.h"
#include "FontSelector.h"
#include "GraphicsContext.h"
#include "MathMLNames.h"
#include "RenderInline.h"
#include "RenderText.h"
......@@ -73,6 +74,39 @@ void RenderMathMLBlock::stretchToHeight(int height)
}
}
#if ENABLE(DEBUG_MATH_LAYOUT)
void RenderMathMLBlock::paint(PaintInfo& info, int tx, int ty)
{
RenderBlock::paint(info, tx, ty);
if (info.context->paintingDisabled() || info.phase != PaintPhaseForeground)
return;
tx += x();
ty += y();
info.context->save();
info.context->setStrokeThickness(1.0f);
info.context->setStrokeStyle(SolidStroke);
info.context->setStrokeColor(Color(0, 0, 255), sRGBColorSpace);
info.context->drawLine(IntPoint(tx, ty), IntPoint(tx + offsetWidth(), ty));
info.context->drawLine(IntPoint(tx + offsetWidth(), ty), IntPoint(tx + offsetWidth(), ty + offsetHeight()));
info.context->drawLine(IntPoint(tx, ty + offsetHeight()), IntPoint(tx + offsetWidth(), ty + offsetHeight()));
info.context->drawLine(IntPoint(tx, ty), IntPoint(tx, ty + offsetHeight()));
int baseline = baselinePosition(true);
info.context->setStrokeColor(Color(255, 0, 0), sRGBColorSpace);
info.context->drawLine(IntPoint(tx, ty + baseline), IntPoint(tx + offsetWidth(), ty + baseline));
info.context->restore();
}
#endif // ENABLE(DEBUG_MATH_LAYOUT)
}
......
......@@ -30,6 +30,8 @@
#include "RenderBlock.h"
#define ENABLE_DEBUG_MATH_LAYOUT 0
namespace WebCore {
class RenderMathMLBlock : public RenderBlock {
......@@ -44,6 +46,10 @@ public:
virtual bool hasBase() const { return false; }
virtual int nonOperatorHeight() const;
virtual void stretchToHeight(int height);
#if ENABLE(DEBUG_MATH_LAYOUT)
virtual void paint(PaintInfo&, int tx, int ty);
#endif
protected:
virtual PassRefPtr<RenderStyle> makeBlockStyle();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment