[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

eric at webkit.org eric at webkit.org
Thu Apr 8 02:01:42 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 5a4794ccad7cc95d22aa891722ec0859e9bc1002
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Feb 26 22:07:37 2010 +0000

    2010-02-26  Alex Milowski  <alex at milowski.com>
    
            Reviewed by Kenneth Rohde Christiansen.
    
            Basic tests for munder, munderover, and mover elements.
    
            * mathml/presentation/over.xhtml: Added.
            * mathml/presentation/under.xhtml: Added.
            * mathml/presentation/underover.xhtml: Added.
            * platform/mac/mathml/presentation/over-expected.checksum: Added.
            * platform/mac/mathml/presentation/over-expected.png: Added.
            * platform/mac/mathml/presentation/over-expected.txt: Added.
            * platform/mac/mathml/presentation/under-expected.checksum: Added.
            * platform/mac/mathml/presentation/under-expected.png: Added.
            * platform/mac/mathml/presentation/under-expected.txt: Added.
            * platform/mac/mathml/presentation/underover-expected.checksum: Added.
            * platform/mac/mathml/presentation/underover-expected.png: Added.
            * platform/mac/mathml/presentation/underover-expected.txt: Added.
    2010-02-26  Alex Milowski  <alex at milowski.com>
    
            Reviewed by Kenneth Rohde Christiansen.
    
            Added basic support for the munder, munderover, and mover elements.
    
            Tests: mathml/presentation/over.xhtml
                   mathml/presentation/under.xhtml
                   mathml/presentation/underover.xhtml
    
            * WebCore.xcodeproj/project.pbxproj:
            * mathml/MathMLInlineContainerElement.cpp:
            (WebCore::MathMLInlineContainerElement::createRenderer):
            * mathml/RenderMathMLUnderOver.cpp: Added.
            (WebCore::RenderMathMLUnderOver::RenderMathMLUnderOver):
            (WebCore::RenderMathMLUnderOver::addChild):
            (WebCore::getOffsetHeight):
            (WebCore::RenderMathMLUnderOver::stretchToHeight):
            (WebCore::RenderMathMLUnderOver::layout):
            (WebCore::RenderMathMLUnderOver::baselinePosition):
            (WebCore::RenderMathMLUnderOver::nonOperatorHeight):
            * mathml/RenderMathMLUnderOver.h: Added.
            (WebCore::RenderMathMLUnderOver::hasBase):
            (WebCore::RenderMathMLUnderOver::):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55310 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 53e7160..7e27bc4 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,22 @@
+2010-02-26  Alex Milowski  <alex at milowski.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Basic tests for munder, munderover, and mover elements.
+
+        * mathml/presentation/over.xhtml: Added.
+        * mathml/presentation/under.xhtml: Added.
+        * mathml/presentation/underover.xhtml: Added.
+        * platform/mac/mathml/presentation/over-expected.checksum: Added.
+        * platform/mac/mathml/presentation/over-expected.png: Added.
+        * platform/mac/mathml/presentation/over-expected.txt: Added.
+        * platform/mac/mathml/presentation/under-expected.checksum: Added.
+        * platform/mac/mathml/presentation/under-expected.png: Added.
+        * platform/mac/mathml/presentation/under-expected.txt: Added.
+        * platform/mac/mathml/presentation/underover-expected.checksum: Added.
+        * platform/mac/mathml/presentation/underover-expected.png: Added.
+        * platform/mac/mathml/presentation/underover-expected.txt: Added.
+
 2010-02-26  Gustavo Noronha Silva  <gustavo.noronha at collabora.co.uk>
 
         Rebaseline of platform-specific results for test.
diff --git a/LayoutTests/mathml/presentation/over.xhtml b/LayoutTests/mathml/presentation/over.xhtml
new file mode 100644
index 0000000..64e8eea
--- /dev/null
+++ b/LayoutTests/mathml/presentation/over.xhtml
@@ -0,0 +1,50 @@
+<html xmlns='http://www.w3.org/1999/xhtml'>
+<head>
+<title>Over</title>
+<style type='text/css'>
+</style>
+</head>
+<body>
+<p id='t1'>over: 
+<math xmlns='http://www.w3.org/1998/Math/MathML'>
+<mover>
+<mi>B</mi>
+<mi>x</mi>
+</mover>
+</math>
+</p>
+<p id='t2'>over: 
+<math xmlns='http://www.w3.org/1998/Math/MathML'>
+<mover>
+<mi>B</mi>
+<mi>y</mi>
+</mover>
+</math>
+</p>
+<p id='t3'>over: 
+<math xmlns='http://www.w3.org/1998/Math/MathML'>
+<mover>
+<mi mathsize='big'>B</mi>
+<mi>y</mi>
+</mover>
+</math>
+</p>
+<p id='t4'>over: 
+<math xmlns='http://www.w3.org/1998/Math/MathML'>
+<mover>
+<mo mathsize='big'>&#x2211;</mo>
+<mi>y</mi>
+</mover>
+</math>
+</p>
+<p id='t5'>over: 
+<math xmlns='http://www.w3.org/1998/Math/MathML'>
+<mover>
+<mo>∫</mo>
+<mi>y</mi>
+</mover>
+<div style="display: inline-block; height: 40px; width: 40px"/>
+</math>
+</p>
+</body>
+</html>
diff --git a/LayoutTests/mathml/presentation/under.xhtml b/LayoutTests/mathml/presentation/under.xhtml
new file mode 100644
index 0000000..66c6ba5
--- /dev/null
+++ b/LayoutTests/mathml/presentation/under.xhtml
@@ -0,0 +1,23 @@
+<html xmlns='http://www.w3.org/1999/xhtml'>
+<head>
+<title>Under</title>
+</head>
+<body>
+<p id='t1'>under: 
+<math xmlns='http://www.w3.org/1998/Math/MathML'>
+<munder>
+<mi>B</mi>
+<mi>x</mi>
+</munder>
+</math>
+</p>
+<p id='t2'>under: 
+<math xmlns='http://www.w3.org/1998/Math/MathML'>
+<munder>
+<mi>B</mi>
+<mi>X</mi>
+</munder>
+</math>
+</p>
+</body>
+</html>
diff --git a/LayoutTests/mathml/presentation/underover.xhtml b/LayoutTests/mathml/presentation/underover.xhtml
new file mode 100644
index 0000000..28fcd14
--- /dev/null
+++ b/LayoutTests/mathml/presentation/underover.xhtml
@@ -0,0 +1,43 @@
+<html xmlns='http://www.w3.org/1999/xhtml'>
+<head>
+<title>Under/Over</title>
+</head>
+<body>
+<p id='t1'>under &amp; over: 
+<math xmlns='http://www.w3.org/1998/Math/MathML'>
+<munderover>
+<mi>B</mi>
+<mi>x</mi>
+<mi>y</mi>
+</munderover>
+</math>
+</p>
+<p id='t2'>under &amp; over: 
+<math xmlns='http://www.w3.org/1998/Math/MathML'>
+<munderover>
+<mi>B</mi>
+<mi>X</mi>
+<mi>y</mi>
+</munderover>
+</math>
+</p>
+<p id='t3'>under &amp; over: 
+<math xmlns='http://www.w3.org/1998/Math/MathML'>
+<munderover>
+<mo mathsize='big'>&#x2211;</mo>
+<mrow><mi>i</mi><mo>=</mo><mi>0</mi></mrow>
+<mrow><mi>x</mi><mo>+</mo><mi>y</mi></mrow>
+</munderover>
+</math>
+</p>
+<p id='t4'>under &amp; over: 
+<math xmlns='http://www.w3.org/1998/Math/MathML'>
+<munderover>
+<mo mathsize='big'>&#x2211;</mo>
+<mrow><mi>I</mi><mo>=</mo><mi>0</mi></mrow>
+<mrow><mi>X</mi><mo>+</mo><mi>y</mi></mrow>
+</munderover>
+</math>
+</p>
+</body>
+</html>
diff --git a/LayoutTests/platform/mac/mathml/presentation/over-expected.checksum b/LayoutTests/platform/mac/mathml/presentation/over-expected.checksum
new file mode 100644
index 0000000..2bb0fc0
--- /dev/null
+++ b/LayoutTests/platform/mac/mathml/presentation/over-expected.checksum
@@ -0,0 +1 @@
+50c949213dabeae465a5e931bb0ae983
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/mathml/presentation/over-expected.png b/LayoutTests/platform/mac/mathml/presentation/over-expected.png
new file mode 100644
index 0000000..a195015
Binary files /dev/null and b/LayoutTests/platform/mac/mathml/presentation/over-expected.png differ
diff --git a/LayoutTests/platform/mac/mathml/presentation/over-expected.txt b/LayoutTests/platform/mac/mathml/presentation/over-expected.txt
new file mode 100644
index 0000000..dec94d2
--- /dev/null
+++ b/LayoutTests/platform/mac/mathml/presentation/over-expected.txt
@@ -0,0 +1,76 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x267
+  RenderBlock {html} at (0,0) size 800x267
+    RenderBody {body} at (8,16) size 784x235
+      RenderBlock {p} at (0,0) size 784x28
+        RenderText {#text} at (0,8) size 36x18
+          text run at (0,8) width 36: "over: "
+        RenderBlock {math} at (36,0) size 10x28
+          RenderBlock {mover} at (0,0) size 10x28
+            RenderBlock {mover} at (0,0) size 10x16
+              RenderInline {mi} at (0,0) size 5x12
+                RenderText {#text} at (2,3) size 5x12
+                  text run at (2,3) width 5: "x"
+            RenderBlock {mover} at (0,11) size 10x17
+              RenderInline {mi} at (0,0) size 10x16
+                RenderText {#text} at (0,1) size 10x16
+                  text run at (0,1) width 10: "B"
+        RenderText {#text} at (0,0) size 0x0
+      RenderBlock {p} at (0,44) size 784x28
+        RenderText {#text} at (0,8) size 36x18
+          text run at (0,8) width 36: "over: "
+        RenderBlock {math} at (36,0) size 10x28
+          RenderBlock {mover} at (0,0) size 10x28
+            RenderBlock {mover} at (0,0) size 10x16
+              RenderInline {mi} at (0,0) size 5x12
+                RenderText {#text} at (2,3) size 5x12
+                  text run at (2,3) width 5: "y"
+            RenderBlock {mover} at (0,11) size 10x17
+              RenderInline {mi} at (0,0) size 10x16
+                RenderText {#text} at (0,1) size 10x16
+                  text run at (0,1) width 10: "B"
+        RenderText {#text} at (0,0) size 0x0
+      RenderBlock {p} at (0,88) size 784x35
+        RenderText {#text} at (0,14) size 36x18
+          text run at (0,14) width 36: "over: "
+        RenderBlock {math} at (36,0) size 15x35
+          RenderBlock {mover} at (0,0) size 15x35
+            RenderBlock {mover} at (0,0) size 15x16
+              RenderInline {mi} at (0,0) size 5x12
+                RenderText {#text} at (5,3) size 5x12
+                  text run at (5,3) width 5: "y"
+            RenderBlock {mover} at (0,11) size 15x24
+              RenderInline {mi} at (0,0) size 15x24
+                RenderText {#text} at (0,0) size 15x24
+                  text run at (0,0) width 15: "B"
+        RenderText {#text} at (0,0) size 0x0
+      RenderBlock {p} at (0,139) size 784x35
+        RenderText {#text} at (0,14) size 36x18
+          text run at (0,14) width 36: "over: "
+        RenderBlock {math} at (36,0) size 19x35
+          RenderBlock {mover} at (0,0) size 19x35
+            RenderBlock {mover} at (0,0) size 19x16
+              RenderInline {mi} at (0,0) size 5x12
+                RenderText {#text} at (7,3) size 5x12
+                  text run at (7,3) width 5: "y"
+            RenderBlock {mover} at (0,11) size 19x24
+              RenderBlock {mo} at (0,0) size 19x24
+                RenderText {#text} at (1,0) size 17x24
+                  text run at (1,0) width 17: "\x{2211}"
+        RenderText {#text} at (0,0) size 0x0
+      RenderBlock {p} at (0,190) size 784x45
+        RenderText {#text} at (0,26) size 36x18
+          text run at (0,26) width 36: "over: "
+        RenderBlock {math} at (36,0) size 45x45
+          RenderBlock {mover} at (0,18) size 5x27
+            RenderBlock {mover} at (0,0) size 5x16
+              RenderInline {mi} at (0,0) size 5x12
+                RenderText {#text} at (0,3) size 5x12
+                  text run at (0,3) width 5: "y"
+            RenderBlock {mover} at (0,11) size 5x16
+              RenderBlock {mo} at (0,0) size 4x16
+                RenderText {#text} at (0,0) size 4x16
+                  text run at (0,0) width 4: "\x{222B}"
+          RenderBlock {div} at (5,0) size 40x40
+        RenderText {#text} at (0,0) size 0x0
diff --git a/LayoutTests/platform/mac/mathml/presentation/under-expected.checksum b/LayoutTests/platform/mac/mathml/presentation/under-expected.checksum
new file mode 100644
index 0000000..5febf48
--- /dev/null
+++ b/LayoutTests/platform/mac/mathml/presentation/under-expected.checksum
@@ -0,0 +1 @@
+e19e7be39c28d6a0699c1de8f5b589cc
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/mathml/presentation/under-expected.png b/LayoutTests/platform/mac/mathml/presentation/under-expected.png
new file mode 100644
index 0000000..40ef8f7
Binary files /dev/null and b/LayoutTests/platform/mac/mathml/presentation/under-expected.png differ
diff --git a/LayoutTests/platform/mac/mathml/presentation/under-expected.txt b/LayoutTests/platform/mac/mathml/presentation/under-expected.txt
new file mode 100644
index 0000000..69faab2
--- /dev/null
+++ b/LayoutTests/platform/mac/mathml/presentation/under-expected.txt
@@ -0,0 +1,33 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x108
+  RenderBlock {html} at (0,0) size 800x108
+    RenderBody {body} at (8,16) size 784x76
+      RenderBlock {p} at (0,0) size 784x30
+        RenderText {#text} at (0,0) size 44x18
+          text run at (0,0) width 44: "under: "
+        RenderBlock {math} at (44,3) size 10x27
+          RenderBlock {munder} at (0,0) size 10x27
+            RenderBlock {munder} at (0,0) size 10x17
+              RenderInline {mi} at (0,0) size 10x16
+                RenderText {#text} at (0,1) size 10x16
+                  text run at (0,1) width 10: "B"
+            RenderBlock {munder} at (0,11) size 10x16
+              RenderInline {mi} at (0,0) size 5x12
+                RenderText {#text} at (2,3) size 5x12
+                  text run at (2,3) width 5: "x"
+        RenderText {#text} at (0,0) size 0x0
+      RenderBlock {p} at (0,46) size 784x30
+        RenderText {#text} at (0,0) size 44x18
+          text run at (0,0) width 44: "under: "
+        RenderBlock {math} at (44,3) size 10x27
+          RenderBlock {munder} at (0,0) size 10x27
+            RenderBlock {munder} at (0,0) size 10x17
+              RenderInline {mi} at (0,0) size 10x16
+                RenderText {#text} at (0,1) size 10x16
+                  text run at (0,1) width 10: "B"
+            RenderBlock {munder} at (0,11) size 10x16
+              RenderInline {mi} at (0,0) size 7x12
+                RenderText {#text} at (1,3) size 7x12
+                  text run at (1,3) width 7: "X"
+        RenderText {#text} at (0,0) size 0x0
diff --git a/LayoutTests/platform/mac/mathml/presentation/underover-expected.checksum b/LayoutTests/platform/mac/mathml/presentation/underover-expected.checksum
new file mode 100644
index 0000000..2c64ae9
--- /dev/null
+++ b/LayoutTests/platform/mac/mathml/presentation/underover-expected.checksum
@@ -0,0 +1 @@
+de04f42cf0dc03f38330bd9b9c803660
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/mathml/presentation/underover-expected.png b/LayoutTests/platform/mac/mathml/presentation/underover-expected.png
new file mode 100644
index 0000000..501fd21
Binary files /dev/null and b/LayoutTests/platform/mac/mathml/presentation/underover-expected.png differ
diff --git a/LayoutTests/platform/mac/mathml/presentation/underover-expected.txt b/LayoutTests/platform/mac/mathml/presentation/underover-expected.txt
new file mode 100644
index 0000000..ec9de08
--- /dev/null
+++ b/LayoutTests/platform/mac/mathml/presentation/underover-expected.txt
@@ -0,0 +1,105 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x260
+  RenderBlock {html} at (0,0) size 800x260
+    RenderBody {body} at (8,16) size 784x228
+      RenderBlock {p} at (0,0) size 784x38
+        RenderText {#text} at (0,8) size 92x18
+          text run at (0,8) width 92: "under & over: "
+        RenderBlock {math} at (92,0) size 10x38
+          RenderBlock {munderover} at (0,0) size 10x38
+            RenderBlock {munderover} at (0,0) size 10x16
+              RenderInline {mi} at (0,0) size 5x12
+                RenderText {#text} at (2,3) size 5x12
+                  text run at (2,3) width 5: "y"
+            RenderBlock {munderover} at (0,11) size 10x17
+              RenderInline {mi} at (0,0) size 10x16
+                RenderText {#text} at (0,1) size 10x16
+                  text run at (0,1) width 10: "B"
+            RenderBlock {munderover} at (0,22) size 10x16
+              RenderInline {mi} at (0,0) size 5x12
+                RenderText {#text} at (2,3) size 5x12
+                  text run at (2,3) width 5: "x"
+        RenderText {#text} at (0,0) size 0x0
+      RenderBlock {p} at (0,54) size 784x38
+        RenderText {#text} at (0,8) size 92x18
+          text run at (0,8) width 92: "under & over: "
+        RenderBlock {math} at (92,0) size 10x38
+          RenderBlock {munderover} at (0,0) size 10x38
+            RenderBlock {munderover} at (0,0) size 10x16
+              RenderInline {mi} at (0,0) size 5x12
+                RenderText {#text} at (2,3) size 5x12
+                  text run at (2,3) width 5: "y"
+            RenderBlock {munderover} at (0,11) size 10x17
+              RenderInline {mi} at (0,0) size 10x16
+                RenderText {#text} at (0,1) size 10x16
+                  text run at (0,1) width 10: "B"
+            RenderBlock {munderover} at (0,22) size 10x16
+              RenderInline {mi} at (0,0) size 7x12
+                RenderText {#text} at (1,3) size 7x12
+                  text run at (1,3) width 7: "X"
+        RenderText {#text} at (0,0) size 0x0
+      RenderBlock {p} at (0,108) size 784x52
+        RenderText {#text} at (0,15) size 92x18
+          text run at (0,15) width 92: "under & over: "
+        RenderBlock {math} at (92,0) size 19x52
+          RenderBlock {munderover} at (0,0) size 19x52
+            RenderBlock {munderover} at (0,0) size 19x16
+              RenderBlock {mrow} at (1,2) size 17x13
+                RenderInline {mi} at (0,0) size 5x12
+                  RenderText {#text} at (0,1) size 5x12
+                    text run at (0,1) width 5: "x"
+                RenderBlock {mo} at (5,1) size 7x12
+                  RenderText {#text} at (0,0) size 7x12
+                    text run at (0,0) width 7: "+"
+                RenderInline {mi} at (0,0) size 5x12
+                  RenderText {#text} at (12,1) size 5x12
+                    text run at (12,1) width 5: "y"
+            RenderBlock {munderover} at (0,12) size 19x24
+              RenderBlock {mo} at (0,0) size 19x24
+                RenderText {#text} at (1,0) size 17x24
+                  text run at (1,0) width 17: "\x{2211}"
+            RenderBlock {munderover} at (0,36) size 19x16
+              RenderBlock {mrow} at (1,2) size 16x13
+                RenderInline {mi} at (0,0) size 3x12
+                  RenderText {#text} at (0,1) size 3x12
+                    text run at (0,1) width 3: "i"
+                RenderBlock {mo} at (3,1) size 7x12
+                  RenderText {#text} at (0,0) size 7x12
+                    text run at (0,0) width 7: "="
+                RenderInline {mi} at (0,0) size 6x12
+                  RenderText {#text} at (10,1) size 6x12
+                    text run at (10,1) width 6: "0"
+        RenderText {#text} at (0,0) size 0x0
+      RenderBlock {p} at (0,176) size 784x52
+        RenderText {#text} at (0,15) size 92x18
+          text run at (0,15) width 92: "under & over: "
+        RenderBlock {math} at (92,0) size 19x52
+          RenderBlock {munderover} at (0,0) size 19x52
+            RenderBlock {munderover} at (0,0) size 19x16
+              RenderBlock {mrow} at (0,2) size 19x13
+                RenderInline {mi} at (0,0) size 7x12
+                  RenderText {#text} at (0,1) size 7x12
+                    text run at (0,1) width 7: "X"
+                RenderBlock {mo} at (7,1) size 7x12
+                  RenderText {#text} at (0,0) size 7x12
+                    text run at (0,0) width 7: "+"
+                RenderInline {mi} at (0,0) size 5x12
+                  RenderText {#text} at (14,1) size 5x12
+                    text run at (14,1) width 5: "y"
+            RenderBlock {munderover} at (0,12) size 19x24
+              RenderBlock {mo} at (0,0) size 19x24
+                RenderText {#text} at (1,0) size 17x24
+                  text run at (1,0) width 17: "\x{2211}"
+            RenderBlock {munderover} at (0,36) size 19x16
+              RenderBlock {mrow} at (1,2) size 17x13
+                RenderInline {mi} at (0,0) size 4x12
+                  RenderText {#text} at (0,1) size 4x12
+                    text run at (0,1) width 4: "I"
+                RenderBlock {mo} at (4,1) size 7x12
+                  RenderText {#text} at (0,0) size 7x12
+                    text run at (0,0) width 7: "="
+                RenderInline {mi} at (0,0) size 6x12
+                  RenderText {#text} at (11,1) size 6x12
+                    text run at (11,1) width 6: "0"
+        RenderText {#text} at (0,0) size 0x0
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 7386492..81b7869 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,28 @@
+2010-02-26  Alex Milowski  <alex at milowski.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Added basic support for the munder, munderover, and mover elements.
+
+        Tests: mathml/presentation/over.xhtml
+               mathml/presentation/under.xhtml
+               mathml/presentation/underover.xhtml
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * mathml/MathMLInlineContainerElement.cpp:
+        (WebCore::MathMLInlineContainerElement::createRenderer):
+        * mathml/RenderMathMLUnderOver.cpp: Added.
+        (WebCore::RenderMathMLUnderOver::RenderMathMLUnderOver):
+        (WebCore::RenderMathMLUnderOver::addChild):
+        (WebCore::getOffsetHeight):
+        (WebCore::RenderMathMLUnderOver::stretchToHeight):
+        (WebCore::RenderMathMLUnderOver::layout):
+        (WebCore::RenderMathMLUnderOver::baselinePosition):
+        (WebCore::RenderMathMLUnderOver::nonOperatorHeight):
+        * mathml/RenderMathMLUnderOver.h: Added.
+        (WebCore::RenderMathMLUnderOver::hasBase):
+        (WebCore::RenderMathMLUnderOver::):
+
 2010-02-24  Stephen White  <senorblanco at chromium.org>
 
         Reviewed by Darin Adler.
diff --git a/WebCore/WebCore.xcodeproj/project.pbxproj b/WebCore/WebCore.xcodeproj/project.pbxproj
index 1960cd4..7424309 100644
--- a/WebCore/WebCore.xcodeproj/project.pbxproj
+++ b/WebCore/WebCore.xcodeproj/project.pbxproj
@@ -4856,6 +4856,8 @@
 		FA654A6C1108ABED002615E0 /* MathMLTextElement.h in Headers */ = {isa = PBXBuildFile; fileRef = FA654A6A1108ABED002615E0 /* MathMLTextElement.h */; };
 		FA654A6F1108ABFF002615E0 /* RenderMathMLBlock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FA654A6D1108ABFF002615E0 /* RenderMathMLBlock.cpp */; };
 		FA654A701108ABFF002615E0 /* RenderMathMLBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = FA654A6E1108ABFF002615E0 /* RenderMathMLBlock.h */; };
+		FA7EFB051120D25400CF79C7 /* RenderMathMLUnderOver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FA7EFB031120D25400CF79C7 /* RenderMathMLUnderOver.cpp */; };
+		FA7EFB061120D25400CF79C7 /* RenderMathMLUnderOver.h in Headers */ = {isa = PBXBuildFile; fileRef = FA7EFB041120D25400CF79C7 /* RenderMathMLUnderOver.h */; };
 		FABE72F41059C1EB00D999DD /* MathMLElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FABE72ED1059C1EB00D999DD /* MathMLElement.cpp */; };
 		FABE72F51059C1EB00D999DD /* MathMLElement.h in Headers */ = {isa = PBXBuildFile; fileRef = FABE72EE1059C1EB00D999DD /* MathMLElement.h */; };
 		FABE72F61059C1EB00D999DD /* MathMLInlineContainerElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FABE72EF1059C1EB00D999DD /* MathMLInlineContainerElement.cpp */; };
@@ -10189,6 +10191,8 @@
 		FA654A6A1108ABED002615E0 /* MathMLTextElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MathMLTextElement.h; sourceTree = "<group>"; };
 		FA654A6D1108ABFF002615E0 /* RenderMathMLBlock.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderMathMLBlock.cpp; sourceTree = "<group>"; };
 		FA654A6E1108ABFF002615E0 /* RenderMathMLBlock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderMathMLBlock.h; sourceTree = "<group>"; };
+		FA7EFB031120D25400CF79C7 /* RenderMathMLUnderOver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderMathMLUnderOver.cpp; sourceTree = "<group>"; };
+		FA7EFB041120D25400CF79C7 /* RenderMathMLUnderOver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderMathMLUnderOver.h; sourceTree = "<group>"; };
 		FABE72ED1059C1EB00D999DD /* MathMLElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MathMLElement.cpp; sourceTree = "<group>"; };
 		FABE72EE1059C1EB00D999DD /* MathMLElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MathMLElement.h; sourceTree = "<group>"; };
 		FABE72EF1059C1EB00D999DD /* MathMLInlineContainerElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MathMLInlineContainerElement.cpp; sourceTree = "<group>"; };
@@ -16092,6 +16096,8 @@
 				FABE72F31059C1EB00D999DD /* mathtags.in */,
 				FA654A6D1108ABFF002615E0 /* RenderMathMLBlock.cpp */,
 				FA654A6E1108ABFF002615E0 /* RenderMathMLBlock.h */,
+				FA7EFB031120D25400CF79C7 /* RenderMathMLUnderOver.cpp */,
+				FA7EFB041120D25400CF79C7 /* RenderMathMLUnderOver.h */,
 			);
 			path = mathml;
 			sourceTree = "<group>";
@@ -18562,6 +18568,7 @@
 				B71FE6DF11091CB300DAEF77 /* PrintContext.h in Headers */,
 				9F72304F11184B4100AD0126 /* ScriptProfile.h in Headers */,
 				9F72305111184B4100AD0126 /* ScriptProfiler.h in Headers */,
+				FA7EFB061120D25400CF79C7 /* RenderMathMLUnderOver.h in Headers */,
 				BCE789161120D6080060ECE5 /* InlineIterator.h in Headers */,
 				BCE789861120E7A60060ECE5 /* BidiRun.h in Headers */,
 				9F6FC1971122E82A00E80196 /* ScriptDebugServer.h in Headers */,
@@ -20751,6 +20758,7 @@
 				84D0C4041115F1D40018AA34 /* AffineTransform.cpp in Sources */,
 				B776D43D1104527500BEB0EC /* PrintContext.cpp in Sources */,
 				9F72305011184B4100AD0126 /* ScriptProfiler.cpp in Sources */,
+				FA7EFB051120D25400CF79C7 /* RenderMathMLUnderOver.cpp in Sources */,
 				BCE7898B1120E8020060ECE5 /* BidiRun.cpp in Sources */,
 				9F6FC1961122E82A00E80196 /* ScriptDebugServer.cpp in Sources */,
 				76FF17E311235673001D61B5 /* PluginViewNone.cpp in Sources */,
diff --git a/WebCore/mathml/MathMLInlineContainerElement.cpp b/WebCore/mathml/MathMLInlineContainerElement.cpp
index 019c4ce..b8dbe60 100644
--- a/WebCore/mathml/MathMLInlineContainerElement.cpp
+++ b/WebCore/mathml/MathMLInlineContainerElement.cpp
@@ -31,6 +31,7 @@
 
 #include "MathMLNames.h"
 #include "RenderMathMLBlock.h"
+#include "RenderMathMLUnderOver.h"
 
 namespace WebCore {
     
@@ -48,8 +49,16 @@ PassRefPtr<MathMLInlineContainerElement> MathMLInlineContainerElement::create(co
 
 RenderObject* MathMLInlineContainerElement::createRenderer(RenderArena *arena, RenderStyle* style)
 {
-    // FIXME: This method will contain the specialized renderers based on element name
-    RenderObject* object = new (arena) RenderMathMLBlock(this);
+
+    RenderObject* object = 0;
+    if (hasLocalName(MathMLNames::moverTag))
+        object = new (arena) RenderMathMLUnderOver(this);
+    else if (hasLocalName(MathMLNames::munderTag))
+        object = new (arena) RenderMathMLUnderOver(this);
+    else if (hasLocalName(MathMLNames::munderoverTag))
+        object = new (arena) RenderMathMLUnderOver(this);
+    else
+        object = new (arena) RenderMathMLBlock(this);
     object->setStyle(style);
     return object;
 }
diff --git a/WebCore/mathml/RenderMathMLUnderOver.cpp b/WebCore/mathml/RenderMathMLUnderOver.cpp
new file mode 100644
index 0000000..4992a08
--- /dev/null
+++ b/WebCore/mathml/RenderMathMLUnderOver.cpp
@@ -0,0 +1,279 @@
+/*
+ * Copyright (C) 2009 Alex Milowski (alex at milowski.com). All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#if ENABLE(MATHML)
+
+#include "RenderMathMLUnderOver.h"
+
+#include "FontSelector.h"
+#include "MathMLNames.h"
+
+namespace WebCore {
+
+using namespace MathMLNames;
+    
+/*
+static const double gUnderNormalAdjust = -0.4;
+static const double gFontAdjust = 0.75;
+*/
+
+static const double gOverSpacingAdjustment = 0.667;
+    
+RenderMathMLUnderOver::RenderMathMLUnderOver(Node* expression) 
+    : RenderMathMLBlock(expression) 
+{
+    Element* element = static_cast<Element*>(expression);
+    // Determine what kind of under/over expression we have by element name
+    
+    if (element->hasLocalName(MathMLNames::munderTag))
+        m_kind = Under;
+    else if (element->hasLocalName(MathMLNames::moverTag))
+        m_kind = Over;
+    else if (element->hasLocalName(MathMLNames::munderoverTag))
+        m_kind = UnderOver;
+    else 
+        m_kind = Under;
+    
+}
+
+void RenderMathMLUnderOver::addChild(RenderObject* child, RenderObject* beforeChild)
+{    
+    RenderMathMLBlock* row = new (renderArena()) RenderMathMLBlock(node());
+    RefPtr<RenderStyle> rowStyle = makeBlockStyle();
+    row->setStyle(rowStyle.release());
+    
+    // look through the children for rendered elements counting the blocks so we know what child
+    // we are adding
+    int blocks = 0;
+    RenderObject* current = this->firstChild();
+    while (current) {
+        blocks++;
+        current = current->nextSibling();
+    }
+    
+    switch (blocks) {
+    case 0:
+        // this is the base so just append it
+        RenderBlock::addChild(row, beforeChild);
+        break;
+    case 1:
+        // the under or over
+        // FIXME: text-align: center does not work
+        row->style()->setTextAlign(CENTER);
+        if (m_kind == Over) {
+            // add the over as first
+            RenderBlock::addChild(row, firstChild());
+        } else {
+            // add the under as last
+            RenderBlock::addChild(row, beforeChild);
+        }
+        break;
+    case 2:
+        // the under or over
+        // FIXME: text-align: center does not work
+        row->style()->setTextAlign(CENTER);
+        if (m_kind == UnderOver) {
+            // add the over as first
+            RenderBlock::addChild(row, firstChild());
+        } else {
+            // we really shouldn't get here as only munderover should have three children
+            RenderBlock::addChild(row, beforeChild);
+        }
+        break;
+    default:
+        // munderover shouldn't have more than three children.  In theory we shouldn't 
+        // get here if the MathML is correctly formed, but that isn't a guarantee.
+        // We will treat this as another under element and they'll get something funky.
+        RenderBlock::addChild(row, beforeChild);
+    }
+    row->addChild(child);    
+}
+
+inline int getOffsetHeight(RenderObject* obj) 
+{
+    if (obj->isBoxModelObject()) {
+        RenderBoxModelObject* box = toRenderBoxModelObject(obj);
+        return box->offsetHeight();
+    }
+   
+    return 0;
+}
+
+void  RenderMathMLUnderOver::stretchToHeight(int height)
+{
+
+    RenderObject* base = firstChild();
+    if (!base)
+        return;
+        
+    // For over or underover, the base is the sibling of the first child
+    if (m_kind != Under) 
+        base = base->nextSibling();
+        
+    if (!base)
+        return;
+        
+    // use the child of the row which is the actual base
+    base = base->firstChild();
+    
+    if (base && base->isRenderMathMLBlock()) {
+        RenderMathMLBlock* block = toRenderMathMLBlock(base);
+        block->stretchToHeight(height);
+        updateBoxModelInfoFromStyle();
+        setNeedsLayoutAndPrefWidthsRecalc();
+        markContainingBlocksForLayout();
+    }
+}
+
+void RenderMathMLUnderOver::layout() 
+{
+    RenderBlock::layout();
+    RenderObject* over = 0;
+    RenderObject* base = 0;
+    switch (m_kind) {
+    case Over:
+        // We need to calculate the baseline over the over versus the start of the base and 
+        // adjust the placement of the base.
+        over = firstChild();
+        if (over) {
+            // FIXME: descending glyphs intrude into base (e.g. lowercase y over base)
+            // FIXME: bases that ascend higher than the line box intrude into the over
+            int overSpacing = static_cast<int>(gOverSpacingAdjustment * (getOffsetHeight(over) - over->firstChild()->baselinePosition(true)));
+            
+            // base row wrapper
+            base = over->nextSibling();
+            if (base) {
+                if (overSpacing > 0) 
+                    base->style()->setMarginTop(Length(-overSpacing, Fixed));
+                else 
+                    base->style()->setMarginTop(Length(0, Fixed));
+            }
+            
+        }
+        break;
+    case Under:
+        // FIXME: Non-ascending glyphs in the under should be moved closer to the base
+
+        // We need to calculate the baseline of the base versus the start of the under block and
+        // adjust the placement of the under block.
+        
+        // base row wrapper
+        base = firstChild();
+        if (base) {
+            int baseHeight = getOffsetHeight(base);
+            // actual base
+            base = base->firstChild();
+            // FIXME: We need to look at the space between a single maximum height of
+            //        the line boxes and the baseline and squeeze them together
+            int underSpacing = baseHeight - base->baselinePosition(true);
+            
+            // adjust the base's intrusion into the under
+            RenderObject* under = lastChild();
+            if (under && underSpacing > 0)
+                under->style()->setMarginTop(Length(-underSpacing, Fixed));
+        }
+        break;
+    case UnderOver:
+        // FIXME: Non-descending glyphs in the over should be moved closer to the base
+        // FIXME: Non-ascending glyphs in the under should be moved closer to the base
+        
+        // We need to calculate the baseline of the over versus the start of the base and 
+        // adjust the placement of the base.
+        
+        over = firstChild();
+        if (over) {
+            // FIXME: descending glyphs intrude into base (e.g. lowercase y over base)
+            // FIXME: bases that ascend higher than the line box intrude into the over
+            int overSpacing = static_cast<int>(gOverSpacingAdjustment * (getOffsetHeight(over) - over->firstChild()->baselinePosition(true)));
+            
+            // base row wrapper
+            base = over->nextSibling();
+            
+            if (base) {
+                if (overSpacing > 0)
+                    base->style()->setMarginTop(Length(-overSpacing, Fixed));
+                
+                // We need to calculate the baseline of the base versus the start of the under block and
+                // adjust the placement of the under block.
+                
+                int baseHeight = getOffsetHeight(base);
+                // actual base
+                base = base->firstChild();
+                // FIXME: We need to look at the space between a single maximum height of
+                //        the line boxes and the baseline and squeeze them together
+                int underSpacing = baseHeight - base->baselinePosition(true);
+                
+                RenderObject* under = lastChild();
+                if (under && under->firstChild()->isRenderInline() && underSpacing > 0)
+                    under->style()->setMarginTop(Length(-underSpacing, Fixed));
+                
+            }
+        }
+        break;
+    }
+    setNeedsLayoutAndPrefWidthsRecalc();
+    RenderBlock::layout();
+}
+
+int RenderMathMLUnderOver::baselinePosition(bool, bool) const
+{
+    int baseline = 0;
+    RenderObject* current = 0;
+    switch (m_kind) {
+    case UnderOver:
+    case Over:
+        current = firstChild();
+        baseline += getOffsetHeight(current);
+        current = current->nextSibling();
+        if (current) {
+            // actual base
+            RenderObject* base = current->firstChild();
+            baseline += base->baselinePosition(true);
+            // added the negative top margin
+            baseline += current->style()->marginTop().value();
+        }
+        break;
+    case Under:
+        current = firstChild();
+        if (current) {
+            RenderObject* base = current->firstChild();
+            baseline += base->baselinePosition(true);
+        }
+    }
+    return baseline;
+}
+
+
+int RenderMathMLUnderOver::nonOperatorHeight() const 
+{
+    return 0;
+}
+
+}
+
+
+#endif // ENABLE(MATHML)
diff --git a/WebCore/mathml/RenderMathMLUnderOver.h b/WebCore/mathml/RenderMathMLUnderOver.h
new file mode 100644
index 0000000..5917126
--- /dev/null
+++ b/WebCore/mathml/RenderMathMLUnderOver.h
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2009 Alex Milowski (alex at milowski.com). All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+#ifndef RenderMathMLUnderOver_h
+#define RenderMathMLUnderOver_h
+
+#if ENABLE(MATHML)
+
+#include "RenderMathMLBlock.h"
+
+namespace WebCore {
+    
+class RenderMathMLUnderOver : public RenderMathMLBlock {
+public:
+    RenderMathMLUnderOver(Node* expression);
+    virtual void addChild(RenderObject* child, RenderObject* beforeChild = 0);
+    virtual void layout();
+    virtual bool hasBase() const { return true; }
+    virtual int nonOperatorHeight() const;
+    virtual int baselinePosition(bool , bool) const;    
+    virtual void stretchToHeight(int pixelHeight);
+private:
+    enum UnderOverType { Under, Over, UnderOver };
+    UnderOverType m_kind;
+};
+    
+}
+
+#endif // ENABLE(MATHML)
+
+#endif // RenderMathMLUnderOver_h

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list