[SCM] WebKit Debian packaging branch, debian/experimental, updated. debian/1.3.8-1-1049-g2e11a8e
commit-queue at webkit.org
commit-queue at webkit.org
Fri Jan 21 15:14:58 UTC 2011
The following commit has been merged in the debian/experimental branch:
commit 0a59ff3fd3f7b2184d31b089a7ce73b7d8be1e86
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Mon Jan 10 18:34:10 2011 +0000
2011-01-10 François Sausset <sausset at gmail.com>
Reviewed by Kenneth Rohde Christiansen.
Updated tests and results to take into account new default fraction bar thickness.
https://bugs.webkit.org/show_bug.cgi?id=50018
* mathml/presentation/fractions.xhtml:
* platform/mac/mathml/presentation/fractions-expected.checksum:
* platform/mac/mathml/presentation/fractions-expected.png:
* platform/mac/mathml/presentation/fractions-expected.txt:
2011-01-10 François Sausset <sausset at gmail.com>
Reviewed by Kenneth Rohde Christiansen.
MathML: vertical alignment & bar thickness adjustments of fractions.
https://bugs.webkit.org/show_bug.cgi?id=50018
The fraction bar thickness default value should follow the w3c MathML 3 recommendation:
http://www.w3.org/TR/MathML3/chapter3.html#presm.mfrac
The vertical alignment of the fraction bar should be more accurate, specially with operators (+,=,...).
Test: mathml/presentation/fractions.xhtml
* rendering/mathml/RenderMathMLFraction.cpp:
(WebCore::RenderMathMLFraction::RenderMathMLFraction):
(WebCore::RenderMathMLFraction::updateFromElement):
(WebCore::RenderMathMLFraction::layout):
(WebCore::RenderMathMLFraction::paint):
(WebCore::RenderMathMLFraction::baselinePosition):
* rendering/mathml/RenderMathMLFraction.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75385 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 3d7c17c..f710529 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,15 @@
+2011-01-10 François Sausset <sausset at gmail.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Updated tests and results to take into account new default fraction bar thickness.
+ https://bugs.webkit.org/show_bug.cgi?id=50018
+
+ * mathml/presentation/fractions.xhtml:
+ * platform/mac/mathml/presentation/fractions-expected.checksum:
+ * platform/mac/mathml/presentation/fractions-expected.png:
+ * platform/mac/mathml/presentation/fractions-expected.txt:
+
2011-01-10 Antti Koivisto <antti at apple.com>
Reviewed by Alexey Proskuryakov.
diff --git a/LayoutTests/mathml/presentation/fractions.xhtml b/LayoutTests/mathml/presentation/fractions.xhtml
index 7b5729b..4307c15 100644
--- a/LayoutTests/mathml/presentation/fractions.xhtml
+++ b/LayoutTests/mathml/presentation/fractions.xhtml
@@ -21,7 +21,12 @@
</math>
</p>
<p id='t4'>line thickness by keyword:
-<math xmlns='http://www.w3.org/1998/Math/MathML'><mfrac linethickness='thin'><mn>1</mn><mn>2</mn></mfrac></math><math xmlns='http://www.w3.org/1998/Math/MathML'><mfrac linethickness='medium'><mn>1</mn><mn>2</mn></mfrac></math><math xmlns='http://www.w3.org/1998/Math/MathML'><mfrac linethickness='thick'><mn>1</mn><mn>2</mn></mfrac></math></p>
+<math xmlns='http://www.w3.org/1998/Math/MathML' mathsize="32 px">
+ <mfrac linethickness='thin'><mn>1</mn><mn>2</mn></mfrac>
+ <mfrac linethickness='medium'><mn>1</mn><mn>2</mn></mfrac>
+ <mfrac linethickness='thick'><mn>1</mn><mn>2</mn></mfrac>
+</math>
+</p>
<p id='t5'>numerator alignment:
<math xmlns='http://www.w3.org/1998/Math/MathML'>
<mfrac numalign="left">
diff --git a/LayoutTests/platform/mac/mathml/presentation/fractions-expected.checksum b/LayoutTests/platform/mac/mathml/presentation/fractions-expected.checksum
index e37785a..9e09676 100644
--- a/LayoutTests/platform/mac/mathml/presentation/fractions-expected.checksum
+++ b/LayoutTests/platform/mac/mathml/presentation/fractions-expected.checksum
@@ -1 +1 @@
-08c2ac720e5221dcf5501db5a22c2cb2
\ No newline at end of file
+b481459bc37774ceb0b456b95eff6fa6
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/mathml/presentation/fractions-expected.png b/LayoutTests/platform/mac/mathml/presentation/fractions-expected.png
index 437f7d7..224b9b9 100644
Binary files a/LayoutTests/platform/mac/mathml/presentation/fractions-expected.png and b/LayoutTests/platform/mac/mathml/presentation/fractions-expected.png differ
diff --git a/LayoutTests/platform/mac/mathml/presentation/fractions-expected.txt b/LayoutTests/platform/mac/mathml/presentation/fractions-expected.txt
index 2592bca..fca2fb0 100644
--- a/LayoutTests/platform/mac/mathml/presentation/fractions-expected.txt
+++ b/LayoutTests/platform/mac/mathml/presentation/fractions-expected.txt
@@ -1,8 +1,8 @@
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
-layer at (0,0) size 800x320
- RenderBlock {html} at (0,0) size 800x320
- RenderBody {body} at (8,16) size 784x288
+layer at (0,0) size 800x352
+ RenderBlock {html} at (0,0) size 800x352
+ RenderBody {body} at (8,16) size 784x320
RenderBlock {p} at (0,0) size 784x34
RenderText {#text} at (0,7) size 49x18
text run at (0,7) width 49: "simple: "
@@ -60,40 +60,39 @@ layer at (0,0) size 800x320
RenderText {#text} at (3,2) size 120x16
text run at (3,2) width 120: "number of changes"
RenderText {#text} at (0,0) size 0x0
- RenderBlock {p} at (0,150) size 784x38
- RenderText {#text} at (0,7) size 173x18
- text run at (0,7) width 173: "line thickness by keyword: "
- RenderBlock {math} at (173,0) size 16x34
- RenderBlock {mfrac} at (1,0) size 14x34
- RenderBlock {mfrac} at (0,0) size 14x16
- RenderInline {mn} at (0,0) size 8x16
- RenderText {#text} at (3,0) size 8x16
- text run at (3,0) width 8: "1"
- RenderBlock {mfrac} at (0,16) size 14x18
- RenderInline {mn} at (0,0) size 8x16
- RenderText {#text} at (3,2) size 8x16
- text run at (3,2) width 8: "2"
- RenderBlock {math} at (189,0) size 16x36
- RenderBlock {mfrac} at (1,0) size 14x36
- RenderBlock {mfrac} at (0,0) size 14x16
- RenderInline {mn} at (0,0) size 8x16
- RenderText {#text} at (3,0) size 8x16
- text run at (3,0) width 8: "1"
- RenderBlock {mfrac} at (0,16) size 14x20
- RenderInline {mn} at (0,0) size 8x16
- RenderText {#text} at (3,4) size 8x16
- text run at (3,4) width 8: "2"
- RenderBlock {math} at (205,0) size 16x38
- RenderBlock {mfrac} at (1,0) size 14x38
- RenderBlock {mfrac} at (0,0) size 14x16
- RenderInline {mn} at (0,0) size 8x16
- RenderText {#text} at (3,0) size 8x16
- text run at (3,0) width 8: "1"
- RenderBlock {mfrac} at (0,16) size 14x22
- RenderInline {mn} at (0,0) size 8x16
- RenderText {#text} at (3,6) size 8x16
- text run at (3,6) width 8: "2"
- RenderBlock {p} at (0,204) size 784x34
+ RenderBlock {p} at (0,150) size 784x70
+ RenderText {#text} at (0,26) size 173x18
+ text run at (0,26) width 173: "line thickness by keyword: "
+ RenderBlock {math} at (173,0) size 86x70
+ RenderBlock {mfrac} at (1,0) size 28x67
+ RenderBlock {mfrac} at (0,0) size 28x32
+ RenderInline {mn} at (0,0) size 16x32
+ RenderText {#text} at (6,0) size 16x32
+ text run at (6,0) width 16: "1"
+ RenderBlock {mfrac} at (0,32) size 28x35
+ RenderInline {mn} at (0,0) size 16x32
+ RenderText {#text} at (6,3) size 16x32
+ text run at (6,3) width 16: "2"
+ RenderBlock {mfrac} at (29,0) size 28x68
+ RenderBlock {mfrac} at (0,0) size 28x32
+ RenderInline {mn} at (0,0) size 16x32
+ RenderText {#text} at (6,0) size 16x32
+ text run at (6,0) width 16: "1"
+ RenderBlock {mfrac} at (0,32) size 28x36
+ RenderInline {mn} at (0,0) size 16x32
+ RenderText {#text} at (6,4) size 16x32
+ text run at (6,4) width 16: "2"
+ RenderBlock {mfrac} at (57,0) size 28x70
+ RenderBlock {mfrac} at (0,0) size 28x32
+ RenderInline {mn} at (0,0) size 16x32
+ RenderText {#text} at (6,0) size 16x32
+ text run at (6,0) width 16: "1"
+ RenderBlock {mfrac} at (0,32) size 28x38
+ RenderInline {mn} at (0,0) size 16x32
+ RenderText {#text} at (6,6) size 16x32
+ text run at (6,6) width 16: "2"
+ RenderText {#text} at (0,0) size 0x0
+ RenderBlock {p} at (0,236) size 784x34
RenderText {#text} at (0,7) size 138x18
text run at (0,7) width 138: "numerator alignment: "
RenderBlock {math} at (138,0) size 89x34
@@ -218,7 +217,7 @@ layer at (0,0) size 800x320
RenderText {#text} at (72,0) size 8x16
text run at (72,0) width 8: "5"
RenderText {#text} at (0,0) size 0x0
- RenderBlock {p} at (0,254) size 784x34
+ RenderBlock {p} at (0,286) size 784x34
RenderText {#text} at (0,7) size 153x18
text run at (0,7) width 153: "denominator alignment: "
RenderBlock {math} at (153,0) size 88x34
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index 8870ba7..bb16440 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,24 @@
+2011-01-10 François Sausset <sausset at gmail.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ MathML: vertical alignment & bar thickness adjustments of fractions.
+ https://bugs.webkit.org/show_bug.cgi?id=50018
+
+ The fraction bar thickness default value should follow the w3c MathML 3 recommendation:
+ http://www.w3.org/TR/MathML3/chapter3.html#presm.mfrac
+ The vertical alignment of the fraction bar should be more accurate, specially with operators (+,=,...).
+
+ Test: mathml/presentation/fractions.xhtml
+
+ * rendering/mathml/RenderMathMLFraction.cpp:
+ (WebCore::RenderMathMLFraction::RenderMathMLFraction):
+ (WebCore::RenderMathMLFraction::updateFromElement):
+ (WebCore::RenderMathMLFraction::layout):
+ (WebCore::RenderMathMLFraction::paint):
+ (WebCore::RenderMathMLFraction::baselinePosition):
+ * rendering/mathml/RenderMathMLFraction.h:
+
2011-01-10 Antti Koivisto <antti at apple.com>
Reviewed by Alexey Proskuryakov.
diff --git a/Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp b/Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp
index 1435be7..dcee2f0 100644
--- a/Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp
+++ b/Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp
@@ -39,16 +39,15 @@ namespace WebCore {
using namespace MathMLNames;
static const double gHorizontalPad = 0.2;
-static const int gLineThin = 1;
-static const int gLineMedium = 3;
-static const int gLineThick = 5;
-static const double gFractionAlignment = 0.25;
+static const double gLineThin = 0.33;
+static const double gLineMedium = 1.;
+static const double gLineThick = 3.;
static const double gFractionBarWidth = 0.05;
static const double gDenominatorPad = 0.1;
RenderMathMLFraction::RenderMathMLFraction(Element* fraction)
: RenderMathMLBlock(fraction)
- , m_lineThickness(gLineThin)
+ , m_lineThickness(gLineMedium)
{
setChildrenInline(false);
}
@@ -84,7 +83,7 @@ void RenderMathMLFraction::updateFromElement()
// FIXME: parse units
String thickness = fraction->getAttribute(MathMLNames::linethicknessAttr);
- m_lineThickness = gLineThin;
+ m_lineThickness = gLineMedium;
if (equalIgnoringCase(thickness, "thin"))
m_lineThickness = gLineThin;
else if (equalIgnoringCase(thickness, "medium"))
@@ -125,7 +124,7 @@ void RenderMathMLFraction::layout()
// Adjust the fraction line thickness for the zoom
if (lastChild() && lastChild()->isRenderBlock())
- m_lineThickness = static_cast<int>(m_lineThickness * ceil(gFractionBarWidth * style()->fontSize()));
+ m_lineThickness *= ceil(gFractionBarWidth * style()->fontSize());
RenderBlock::layout();
@@ -143,8 +142,8 @@ void RenderMathMLFraction::paint(PaintInfo& info, int tx, int ty)
int verticalOffset = 0;
// The children are always RenderMathMLBlock instances
if (firstChild()->isRenderMathMLBlock()) {
- int adjustForThickness = m_lineThickness > 1 ? m_lineThickness / 2 : 1;
- if (m_lineThickness % 2 == 1)
+ int adjustForThickness = m_lineThickness > 1 ? int(m_lineThickness / 2) : 1;
+ if (int(m_lineThickness) % 2 == 1)
adjustForThickness++;
RenderMathMLBlock* numerator = toRenderMathMLBlock(firstChild());
if (numerator->isRenderMathMLRow())
@@ -158,7 +157,7 @@ void RenderMathMLFraction::paint(PaintInfo& info, int tx, int ty)
info.context->save();
- info.context->setStrokeThickness(static_cast<float>(m_lineThickness));
+ info.context->setStrokeThickness(m_lineThickness);
info.context->setStrokeStyle(SolidStroke);
info.context->setStrokeColor(style()->visitedDependentColor(CSSPropertyColor), ColorSpaceSRGB);
@@ -171,11 +170,13 @@ int RenderMathMLFraction::baselinePosition(FontBaseline, bool firstLine, LineDir
{
if (firstChild() && firstChild()->isRenderMathMLBlock()) {
RenderMathMLBlock* numerator = toRenderMathMLBlock(firstChild());
- // FIXME: the baseline should adjust so the fraction line aligns
- // relative certain operators (e.g. aligns with the horizontal
- // stroke of the plus). 1/3 of the current font size is just
- // a good guess.
- return numerator->offsetHeight() + style()->fontSize() / 3;
+ RenderStyle* refStyle = style();
+ if (previousSibling())
+ refStyle = previousSibling()->style();
+ else if (nextSibling())
+ refStyle = nextSibling()->style();
+ int shift = int(ceil((refStyle->font().xHeight() + 1) / 2));
+ return numerator->offsetHeight() + shift;
}
return RenderBlock::baselinePosition(AlphabeticBaseline, firstLine, lineDirection, linePositionMode);
}
diff --git a/Source/WebCore/rendering/mathml/RenderMathMLFraction.h b/Source/WebCore/rendering/mathml/RenderMathMLFraction.h
index 8a3a9ed..2a03f81 100644
--- a/Source/WebCore/rendering/mathml/RenderMathMLFraction.h
+++ b/Source/WebCore/rendering/mathml/RenderMathMLFraction.h
@@ -43,7 +43,7 @@ public:
protected:
virtual void layout();
private:
- int m_lineThickness;
+ double m_lineThickness;
};
}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list