Changeset 54128 in webkit


Ignore:
Timestamp:
Feb 1, 2010 1:27:44 AM (14 years ago)
Author:
eric@webkit.org
Message:

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:
Location:
trunk/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r54127 r54128  
     12010-02-01  Alex Milowski  <alex@milowski.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        Added compile time debug support for mathml layout (block boundary & baseline)
     6
     7        * mathml/RenderMathMLBlock.cpp:
     8        (WebCore::RenderMathMLBlock::stretchToHeight):
     9        (WebCore::RenderMathMLBlock::paint):
     10        * mathml/RenderMathMLBlock.h:
     11
    1122010-02-01  Philippe Normand  <pnormand@igalia.com>
    213
  • trunk/WebCore/mathml/RenderMathMLBlock.cpp

    r53764 r54128  
    3131
    3232#include "FontSelector.h"
     33#include "GraphicsContext.h"
    3334#include "MathMLNames.h"
    3435#include "RenderInline.h"
     
    7475}
    7576
     77#if ENABLE(DEBUG_MATH_LAYOUT)
     78void RenderMathMLBlock::paint(PaintInfo& info, int tx, int ty)
     79{
     80    RenderBlock::paint(info, tx, ty);
     81   
     82    if (info.context->paintingDisabled() || info.phase != PaintPhaseForeground)
     83        return;
     84
     85    tx += x();
     86    ty += y();
     87   
     88    info.context->save();
     89   
     90    info.context->setStrokeThickness(1.0f);
     91    info.context->setStrokeStyle(SolidStroke);
     92    info.context->setStrokeColor(Color(0, 0, 255), sRGBColorSpace);
     93   
     94    info.context->drawLine(IntPoint(tx, ty), IntPoint(tx + offsetWidth(), ty));
     95    info.context->drawLine(IntPoint(tx + offsetWidth(), ty), IntPoint(tx + offsetWidth(), ty + offsetHeight()));
     96    info.context->drawLine(IntPoint(tx, ty + offsetHeight()), IntPoint(tx + offsetWidth(), ty + offsetHeight()));
     97    info.context->drawLine(IntPoint(tx, ty), IntPoint(tx, ty + offsetHeight()));
     98   
     99    int baseline = baselinePosition(true);
     100   
     101    info.context->setStrokeColor(Color(255, 0, 0), sRGBColorSpace);
     102   
     103    info.context->drawLine(IntPoint(tx, ty + baseline), IntPoint(tx + offsetWidth(), ty + baseline));
     104   
     105    info.context->restore();
     106   
     107}
     108#endif // ENABLE(DEBUG_MATH_LAYOUT)
     109
    76110
    77111}   
  • trunk/WebCore/mathml/RenderMathMLBlock.h

    r53764 r54128  
    3131#include "RenderBlock.h"
    3232
     33#define ENABLE_DEBUG_MATH_LAYOUT 0
     34
    3335namespace WebCore {
    3436   
     
    4547    virtual int nonOperatorHeight() const;
    4648    virtual void stretchToHeight(int height);
     49
     50#if ENABLE(DEBUG_MATH_LAYOUT)
     51    virtual void paint(PaintInfo&, int tx, int ty);
     52#endif
    4753   
    4854protected:
Note: See TracChangeset for help on using the changeset viewer.