[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.19-706-ge5415e9

eric at webkit.org eric at webkit.org
Thu Feb 4 21:35:07 UTC 2010


The following commit has been merged in the webkit-1.1 branch:
commit 903fe3a89b385fb6dc724f6a135cffe7e0589b64
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Feb 1 09:27:44 2010 +0000

    2010-02-01  Alex Milowski  <alex at 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: http://svn.webkit.org/repository/webkit/trunk@54128 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index d4ff396..cdd9b09 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,14 @@
+2010-02-01  Alex Milowski  <alex at 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 at igalia.com>
 
         Rubber stamped by Xan Lopez.
diff --git a/WebCore/mathml/RenderMathMLBlock.cpp b/WebCore/mathml/RenderMathMLBlock.cpp
index 249c136..a897ff5 100644
--- a/WebCore/mathml/RenderMathMLBlock.cpp
+++ b/WebCore/mathml/RenderMathMLBlock.cpp
@@ -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)
+
 
 }    
 
diff --git a/WebCore/mathml/RenderMathMLBlock.h b/WebCore/mathml/RenderMathMLBlock.h
index b274a69..e01a325 100644
--- a/WebCore/mathml/RenderMathMLBlock.h
+++ b/WebCore/mathml/RenderMathMLBlock.h
@@ -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();

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list