Log Message
[MathML] Implement <mtd> rowspan and columnspan attributes https://bugs.webkit.org/show_bug.cgi?id=97401
Reviewed by Eric Seidel. Source/WebCore: These should behave like rowspan and colspan for HTMLTableCell. As in that case, RenderTableCell accesses these attributes of its element as needed. Tested by modifications to LayoutTests/mathml/presentation/tables.xhtml. * mathml/MathMLElement.cpp: (WebCore::MathMLElement::colSpan): (WebCore::MathMLElement::rowSpan): (WebCore::MathMLElement::parseAttribute): * mathml/MathMLElement.h: (MathMLElement): (WebCore::toMathMLElement): * mathml/mathattrs.in: * mathml/mathtags.in: * rendering/RenderTableCell.cpp: (WebCore::RenderTableCell::RenderTableCell): (WebCore::isMathMLElement): (WebCore::RenderTableCell::colSpan): (WebCore::RenderTableCell::rowSpan): (WebCore::RenderTableCell::colSpanOrRowSpanChanged): * rendering/RenderTableCell.h: (RenderTableCell): - Changed m_hasAssociatedTableCellElement to m_hasHTMLTableCellElement. LayoutTests: * mathml/presentation/tables.xhtml: * platform/mac/mathml/presentation/tables-expected.png: * platform/mac/mathml/presentation/tables-expected.txt:
Modified Paths
- trunk/LayoutTests/ChangeLog
- trunk/LayoutTests/mathml/presentation/tables.xhtml
- trunk/LayoutTests/platform/efl/TestExpectations
- trunk/LayoutTests/platform/gtk/TestExpectations
- trunk/LayoutTests/platform/mac/mathml/presentation/tables-expected.png
- trunk/LayoutTests/platform/mac/mathml/presentation/tables-expected.txt
- trunk/Source/WebCore/ChangeLog
- trunk/Source/WebCore/mathml/MathMLElement.cpp
- trunk/Source/WebCore/mathml/MathMLElement.h
- trunk/Source/WebCore/mathml/mathattrs.in
- trunk/Source/WebCore/mathml/mathtags.in
- trunk/Source/WebCore/rendering/RenderTableCell.cpp
- trunk/Source/WebCore/rendering/RenderTableCell.h
Diff
Modified: trunk/LayoutTests/ChangeLog (129694 => 129695)
--- trunk/LayoutTests/ChangeLog 2012-09-26 20:25:55 UTC (rev 129694)
+++ trunk/LayoutTests/ChangeLog 2012-09-26 20:27:40 UTC (rev 129695)
@@ -1,3 +1,14 @@
+2012-09-26 David Barton <dbar...@mathscribe.com>
+
+ [MathML] Implement <mtd> rowspan and columnspan attributes
+ https://bugs.webkit.org/show_bug.cgi?id=97401
+
+ Reviewed by Eric Seidel.
+
+ * mathml/presentation/tables.xhtml:
+ * platform/mac/mathml/presentation/tables-expected.png:
+ * platform/mac/mathml/presentation/tables-expected.txt:
+
2012-09-26 Marcelo Lira <marcelo.l...@openbossa.org>
[Qt] load event fires on XMLHttpRequestUpload twice with Qt5
Modified: trunk/LayoutTests/mathml/presentation/tables.xhtml (129694 => 129695)
--- trunk/LayoutTests/mathml/presentation/tables.xhtml 2012-09-26 20:25:55 UTC (rev 129694)
+++ trunk/LayoutTests/mathml/presentation/tables.xhtml 2012-09-26 20:27:40 UTC (rev 129695)
@@ -7,19 +7,16 @@
<math xmlns='http://www.w3.org/1998/Math/MathML'>
<mtable>
<mtr>
-<mtd><msub><mi>a</mi><mn>11</mn></msub></mtd>
+<mtd rowspan="2"><msub><mi>a</mi><mn>11</mn></msub></mtd>
<mtd><msub><mi>a</mi><mn>12</mn></msub></mtd>
<mtd><msub><mi>a</mi><mn>13</mn></msub></mtd>
</mtr>
<mtr>
-<mtd><msub><mi>b</mi><mn>21</mn></msub></mtd>
<mtd><msub><mi>b</mi><mn>22</mn></msub></mtd>
<mtd><msub><mi>b</mi><mn>23</mn></msub></mtd>
</mtr>
<mtr>
-<mtd><msub><mi>c</mi><mn>31</mn></msub></mtd>
-<mtd><msub><mi>c</mi><mn>32</mn></msub></mtd>
-<mtd><msub><mi>c</mi><mn>33</mn></msub></mtd>
+<mtd columnspan="3"><msub><mi>c</mi><mn>31</mn></msub></mtd>
</mtr>
</mtable>
</math>
@@ -64,13 +61,10 @@
<mtext>, </mtext>
<mtable columnalign="right">
<mtr>
-<mtd><msub><mi>a</mi><mn>1</mn></msub></mtd>
-<mtd><msub><mi>a</mi><mn>12</mn></msub></mtd>
+<mtd id="mtd22"><msub><mi>a</mi><mn>1</mn></msub></mtd>
<mtd><msub><mi>a</mi><mn>13</mn></msub></mtd>
</mtr>
<mtr>
-<mtd><msub><mi>b</mi><mn>21</mn></msub></mtd>
-<mtd><msub><mi>b</mi><mn>2</mn></msub></mtd>
<mtd><msub><mi>b</mi><mn>23</mn></msub></mtd>
</mtr>
<mtr>
@@ -81,5 +75,16 @@
</mtable>
</math>
</p>
+
+<script>
+ window.addEventListener("load", function() {
+ document.body.offsetTop;
+
+ var mtd22 = document.getElementById("mtd22");
+ mtd22.setAttribute("rowspan", 2);
+ mtd22.setAttribute("columnspan", 2);
+ }, false);
+</script>
+
</body>
</html>
Modified: trunk/LayoutTests/platform/efl/TestExpectations (129694 => 129695)
--- trunk/LayoutTests/platform/efl/TestExpectations 2012-09-26 20:25:55 UTC (rev 129694)
+++ trunk/LayoutTests/platform/efl/TestExpectations 2012-09-26 20:27:40 UTC (rev 129695)
@@ -1085,3 +1085,6 @@
# Marking this as failing again, since r129592 was rolled out.
webkit.org/b/97529 http/tests/security/xss-eval.html [ Failure ]
+
+# Needs rebaseline.
+webkit.org/b/97401 mathml/presentation/tables.xhtml [ Failure ]
Modified: trunk/LayoutTests/platform/gtk/TestExpectations (129694 => 129695)
--- trunk/LayoutTests/platform/gtk/TestExpectations 2012-09-26 20:25:55 UTC (rev 129694)
+++ trunk/LayoutTests/platform/gtk/TestExpectations 2012-09-26 20:27:40 UTC (rev 129695)
@@ -1358,6 +1358,9 @@
webkit.org/b/97529 http/tests/security/xss-eval.html [ Failure ]
+# Needs rebaseline.
+webkit.org/b/97401 mathml/presentation/tables.xhtml [ Failure ]
+
#////////////////////////////////////////////////////////////////////////////////////////
# End of Tests failing
#////////////////////////////////////////////////////////////////////////////////////////
Modified: trunk/LayoutTests/platform/mac/mathml/presentation/tables-expected.png
(Binary files differ)
Modified: trunk/LayoutTests/platform/mac/mathml/presentation/tables-expected.txt (129694 => 129695)
--- trunk/LayoutTests/platform/mac/mathml/presentation/tables-expected.txt 2012-09-26 20:25:55 UTC (rev 129694)
+++ trunk/LayoutTests/platform/mac/mathml/presentation/tables-expected.txt 2012-09-26 20:27:40 UTC (rev 129695)
@@ -1,8 +1,8 @@
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
-layer at (0,0) size 800x176
- RenderBlock {html} at (0,0) size 800x176
- RenderBody {body} at (8,16) size 784x144
+layer at (0,0) size 800x177
+ RenderBlock {html} at (0,0) size 800x177
+ RenderBody {body} at (8,16) size 784x145
RenderBlock {p} at (0,0) size 784x64
RenderText {#text} at (0,21) size 49x18
text run at (0,21) width 49: "simple: "
@@ -10,7 +10,7 @@
RenderMathMLTable {mtable} at (1,0) size 78x64
RenderTableSection (anonymous) at (0,0) size 78x64
RenderTableRow {mtr} at (0,0) size 78x20
- RenderTableCell {mtd} at (0,0) size 26x20 [r=0 c=0 rs=1 cs=1]
+ RenderTableCell {mtd} at (0,0) size 26x20 [r=0 c=0 rs=2 cs=1]
RenderMathMLSubSup {msub} at (3,3) size 20x14
RenderMathMLBlock (anonymous, flex) at (0,0) size 8x14 [padding: 0 0 5 0]
RenderBlock {mi} at (0,0) size 8x9
@@ -41,16 +41,6 @@
RenderText {#text} at (0,-4) size 12x18
text run at (0,-4) width 12: "13"
RenderTableRow {mtr} at (0,20) size 78x24
- RenderTableCell {mtd} at (0,20) size 26x24 [r=1 c=0 rs=1 cs=1]
- RenderMathMLSubSup {msub} at (3,3) size 20x18
- RenderMathMLBlock (anonymous, flex) at (0,0) size 8x18 [padding: 0 0 6 0]
- RenderBlock {mi} at (0,0) size 8x12
- RenderText {#text} at (0,-6) size 8x24
- text run at (0,-6) width 8: "b"
- RenderMathMLBlock (anonymous, flex) at (8,0) size 12x18
- RenderBlock {mn} at (0,8) size 12x10
- RenderText {#text} at (0,-4) size 12x18
- text run at (0,-4) width 12: "21"
RenderTableCell {mtd} at (26,20) size 26x24 [r=1 c=1 rs=1 cs=1]
RenderMathMLSubSup {msub} at (3,3) size 20x18
RenderMathMLBlock (anonymous, flex) at (0,0) size 8x18 [padding: 0 0 6 0]
@@ -72,8 +62,8 @@
RenderText {#text} at (0,-4) size 12x18
text run at (0,-4) width 12: "23"
RenderTableRow {mtr} at (0,44) size 78x20
- RenderTableCell {mtd} at (0,44) size 26x20 [r=2 c=0 rs=1 cs=1]
- RenderMathMLSubSup {msub} at (4,3) size 19x14
+ RenderTableCell {mtd} at (0,44) size 78x20 [r=2 c=0 rs=1 cs=3]
+ RenderMathMLSubSup {msub} at (30,3) size 19x14
RenderMathMLBlock (anonymous, flex) at (0,0) size 7x14 [padding: 0 0 5 0]
RenderBlock {mi} at (0,0) size 7x9
RenderText {#text} at (0,-9) size 7x24
@@ -82,32 +72,12 @@
RenderBlock {mn} at (0,4) size 12x10
RenderText {#text} at (0,-4) size 12x18
text run at (0,-4) width 12: "31"
- RenderTableCell {mtd} at (26,44) size 26x20 [r=2 c=1 rs=1 cs=1]
- RenderMathMLSubSup {msub} at (4,3) size 19x14
- RenderMathMLBlock (anonymous, flex) at (0,0) size 7x14 [padding: 0 0 5 0]
- RenderBlock {mi} at (0,0) size 7x9
- RenderText {#text} at (0,-9) size 7x24
- text run at (0,-9) width 7: "c"
- RenderMathMLBlock (anonymous, flex) at (7,0) size 12x14
- RenderBlock {mn} at (0,4) size 12x10
- RenderText {#text} at (0,-4) size 12x18
- text run at (0,-4) width 12: "32"
- RenderTableCell {mtd} at (52,44) size 26x20 [r=2 c=2 rs=1 cs=1]
- RenderMathMLSubSup {msub} at (4,3) size 19x14
- RenderMathMLBlock (anonymous, flex) at (0,0) size 7x14 [padding: 0 0 5 0]
- RenderBlock {mi} at (0,0) size 7x9
- RenderText {#text} at (0,-9) size 7x24
- text run at (0,-9) width 7: "c"
- RenderMathMLBlock (anonymous, flex) at (7,0) size 12x14
- RenderBlock {mn} at (0,4) size 12x10
- RenderText {#text} at (0,-4) size 12x18
- text run at (0,-4) width 12: "33"
RenderText {#text} at (0,0) size 0x0
- RenderBlock {p} at (0,80) size 784x64
- RenderText {#text} at (0,21) size 308x18
- text run at (0,21) width 308: "left, default (center) and right column alignment: "
- RenderMathMLMath {math} at (308,0) size 244x64 [padding: 0 1 0 1]
- RenderMathMLTable {mtable} at (1,0) size 78x64
+ RenderBlock {p} at (0,80) size 784x65
+ RenderText {#text} at (0,22) size 308x18
+ text run at (0,22) width 308: "left, default (center) and right column alignment: "
+ RenderMathMLMath {math} at (308,0) size 242x65 [padding: 0 1 0 1]
+ RenderMathMLTable {mtable} at (1,1) size 78x64
RenderTableSection (anonymous) at (0,0) size 78x64
RenderTableRow {mtr} at (0,0) size 78x20
RenderTableCell {mtd} at (0,0) size 26x20 [r=0 c=0 rs=1 cs=1]
@@ -202,10 +172,10 @@
RenderBlock {mn} at (0,4) size 6x10
RenderText {#text} at (0,-4) size 6x18
text run at (0,-4) width 6: "3"
- RenderBlock {mtext} at (79,33) size 4x5
+ RenderBlock {mtext} at (79,34) size 4x5
RenderText {#text} at (0,-15) size 4x24
text run at (0,-15) width 4: ","
- RenderMathMLTable {mtable} at (83,0) size 78x64
+ RenderMathMLTable {mtable} at (83,1) size 78x64
RenderTableSection (anonymous) at (0,0) size 78x64
RenderTableRow {mtr} at (0,0) size 78x20
RenderTableCell {mtd} at (0,0) size 26x20 [r=0 c=0 rs=1 cs=1]
@@ -300,23 +270,23 @@
RenderBlock {mn} at (0,4) size 6x10
RenderText {#text} at (0,-4) size 6x18
text run at (0,-4) width 6: "3"
- RenderBlock {mtext} at (161,33) size 4x5
+ RenderBlock {mtext} at (161,34) size 4x5
RenderText {#text} at (0,-15) size 4x24
text run at (0,-15) width 4: ","
- RenderMathMLTable {mtable} at (165,0) size 78x64
- RenderTableSection (anonymous) at (0,0) size 78x64
- RenderTableRow {mtr} at (0,0) size 78x20
- RenderTableCell {mtd} at (0,0) size 26x20 [r=0 c=0 rs=1 cs=1]
- RenderMathMLSubSup {msub} at (9,3) size 14x14
- RenderMathMLBlock (anonymous, flex) at (0,0) size 8x14 [padding: 0 0 5 0]
+ RenderMathMLTable {mtable} at (165,0) size 76x65
+ RenderTableSection (anonymous) at (0,0) size 76x65
+ RenderTableRow {mtr} at (0,0) size 76x20
+ RenderTableCell {mtd} at (0,0) size 50x21 [r=0 c=0 rs=2 cs=2]
+ RenderMathMLSubSup {msub} at (33,3) size 14x15
+ RenderMathMLBlock (anonymous, flex) at (0,0) size 8x15 [padding: 0 0 6 0]
RenderBlock {mi} at (0,0) size 8x9
RenderText {#text} at (0,-9) size 8x24
text run at (0,-9) width 8: "a"
- RenderMathMLBlock (anonymous, flex) at (8,0) size 6x14
- RenderBlock {mn} at (0,4) size 6x10
+ RenderMathMLBlock (anonymous, flex) at (8,0) size 6x15
+ RenderBlock {mn} at (0,5) size 6x10
RenderText {#text} at (0,-4) size 6x18
text run at (0,-4) width 6: "1"
- RenderTableCell {mtd} at (26,0) size 26x20 [r=0 c=1 rs=1 cs=1]
+ RenderTableCell {mtd} at (50,0) size 26x20 [r=0 c=2 rs=1 cs=1]
RenderMathMLSubSup {msub} at (3,3) size 20x14
RenderMathMLBlock (anonymous, flex) at (0,0) size 8x14 [padding: 0 0 5 0]
RenderBlock {mi} at (0,0) size 8x9
@@ -325,19 +295,9 @@
RenderMathMLBlock (anonymous, flex) at (8,0) size 12x14
RenderBlock {mn} at (0,4) size 12x10
RenderText {#text} at (0,-4) size 12x18
- text run at (0,-4) width 12: "12"
- RenderTableCell {mtd} at (52,0) size 26x20 [r=0 c=2 rs=1 cs=1]
- RenderMathMLSubSup {msub} at (3,3) size 20x14
- RenderMathMLBlock (anonymous, flex) at (0,0) size 8x14 [padding: 0 0 5 0]
- RenderBlock {mi} at (0,0) size 8x9
- RenderText {#text} at (0,-9) size 8x24
- text run at (0,-9) width 8: "a"
- RenderMathMLBlock (anonymous, flex) at (8,0) size 12x14
- RenderBlock {mn} at (0,4) size 12x10
- RenderText {#text} at (0,-4) size 12x18
text run at (0,-4) width 12: "13"
- RenderTableRow {mtr} at (0,20) size 78x24
- RenderTableCell {mtd} at (0,20) size 26x24 [r=1 c=0 rs=1 cs=1]
+ RenderTableRow {mtr} at (0,20) size 76x24
+ RenderTableCell {mtd} at (50,20) size 26x24 [r=1 c=2 rs=1 cs=1]
RenderMathMLSubSup {msub} at (3,3) size 20x18
RenderMathMLBlock (anonymous, flex) at (0,0) size 8x18 [padding: 0 0 6 0]
RenderBlock {mi} at (0,0) size 8x12
@@ -346,56 +306,36 @@
RenderMathMLBlock (anonymous, flex) at (8,0) size 12x18
RenderBlock {mn} at (0,8) size 12x10
RenderText {#text} at (0,-4) size 12x18
- text run at (0,-4) width 12: "21"
- RenderTableCell {mtd} at (26,20) size 26x24 [r=1 c=1 rs=1 cs=1]
- RenderMathMLSubSup {msub} at (9,3) size 14x18
- RenderMathMLBlock (anonymous, flex) at (0,0) size 8x18 [padding: 0 0 6 0]
- RenderBlock {mi} at (0,0) size 8x12
- RenderText {#text} at (0,-6) size 8x24
- text run at (0,-6) width 8: "b"
- RenderMathMLBlock (anonymous, flex) at (8,0) size 6x18
- RenderBlock {mn} at (0,8) size 6x10
- RenderText {#text} at (0,-4) size 6x18
- text run at (0,-4) width 6: "2"
- RenderTableCell {mtd} at (52,20) size 26x24 [r=1 c=2 rs=1 cs=1]
- RenderMathMLSubSup {msub} at (3,3) size 20x18
- RenderMathMLBlock (anonymous, flex) at (0,0) size 8x18 [padding: 0 0 6 0]
- RenderBlock {mi} at (0,0) size 8x12
- RenderText {#text} at (0,-6) size 8x24
- text run at (0,-6) width 8: "b"
- RenderMathMLBlock (anonymous, flex) at (8,0) size 12x18
- RenderBlock {mn} at (0,8) size 12x10
- RenderText {#text} at (0,-4) size 12x18
text run at (0,-4) width 12: "23"
- RenderTableRow {mtr} at (0,44) size 78x20
- RenderTableCell {mtd} at (0,44) size 26x20 [r=2 c=0 rs=1 cs=1]
- RenderMathMLSubSup {msub} at (4,3) size 19x14
- RenderMathMLBlock (anonymous, flex) at (0,0) size 7x14 [padding: 0 0 5 0]
+ RenderTableRow {mtr} at (0,44) size 76x21
+ RenderTableCell {mtd} at (0,44) size 25x21 [r=2 c=0 rs=1 cs=1]
+ RenderMathMLSubSup {msub} at (3,3) size 19x15
+ RenderMathMLBlock (anonymous, flex) at (0,0) size 7x15 [padding: 0 0 6 0]
RenderBlock {mi} at (0,0) size 7x9
RenderText {#text} at (0,-9) size 7x24
text run at (0,-9) width 7: "c"
- RenderMathMLBlock (anonymous, flex) at (7,0) size 12x14
- RenderBlock {mn} at (0,4) size 12x10
+ RenderMathMLBlock (anonymous, flex) at (7,0) size 12x15
+ RenderBlock {mn} at (0,5) size 12x10
RenderText {#text} at (0,-4) size 12x18
text run at (0,-4) width 12: "31"
- RenderTableCell {mtd} at (26,44) size 26x20 [r=2 c=1 rs=1 cs=1]
- RenderMathMLSubSup {msub} at (4,3) size 19x14
- RenderMathMLBlock (anonymous, flex) at (0,0) size 7x14 [padding: 0 0 5 0]
+ RenderTableCell {mtd} at (25,44) size 25x21 [r=2 c=1 rs=1 cs=1]
+ RenderMathMLSubSup {msub} at (3,3) size 19x15
+ RenderMathMLBlock (anonymous, flex) at (0,0) size 7x15 [padding: 0 0 6 0]
RenderBlock {mi} at (0,0) size 7x9
RenderText {#text} at (0,-9) size 7x24
text run at (0,-9) width 7: "c"
- RenderMathMLBlock (anonymous, flex) at (7,0) size 12x14
- RenderBlock {mn} at (0,4) size 12x10
+ RenderMathMLBlock (anonymous, flex) at (7,0) size 12x15
+ RenderBlock {mn} at (0,5) size 12x10
RenderText {#text} at (0,-4) size 12x18
text run at (0,-4) width 12: "32"
- RenderTableCell {mtd} at (52,44) size 26x20 [r=2 c=2 rs=1 cs=1]
- RenderMathMLSubSup {msub} at (10,3) size 13x14
- RenderMathMLBlock (anonymous, flex) at (0,0) size 7x14 [padding: 0 0 5 0]
+ RenderTableCell {mtd} at (50,44) size 26x21 [r=2 c=2 rs=1 cs=1]
+ RenderMathMLSubSup {msub} at (10,3) size 13x15
+ RenderMathMLBlock (anonymous, flex) at (0,0) size 7x15 [padding: 0 0 6 0]
RenderBlock {mi} at (0,0) size 7x9
RenderText {#text} at (0,-9) size 7x24
text run at (0,-9) width 7: "c"
- RenderMathMLBlock (anonymous, flex) at (7,0) size 6x14
- RenderBlock {mn} at (0,4) size 6x10
+ RenderMathMLBlock (anonymous, flex) at (7,0) size 6x15
+ RenderBlock {mn} at (0,5) size 6x10
RenderText {#text} at (0,-4) size 6x18
text run at (0,-4) width 6: "3"
RenderText {#text} at (0,0) size 0x0
Modified: trunk/Source/WebCore/ChangeLog (129694 => 129695)
--- trunk/Source/WebCore/ChangeLog 2012-09-26 20:25:55 UTC (rev 129694)
+++ trunk/Source/WebCore/ChangeLog 2012-09-26 20:27:40 UTC (rev 129695)
@@ -1,3 +1,34 @@
+2012-09-26 David Barton <dbar...@mathscribe.com>
+
+ [MathML] Implement <mtd> rowspan and columnspan attributes
+ https://bugs.webkit.org/show_bug.cgi?id=97401
+
+ Reviewed by Eric Seidel.
+
+ These should behave like rowspan and colspan for HTMLTableCell. As in that case,
+ RenderTableCell accesses these attributes of its element as needed.
+
+ Tested by modifications to LayoutTests/mathml/presentation/tables.xhtml.
+
+ * mathml/MathMLElement.cpp:
+ (WebCore::MathMLElement::colSpan):
+ (WebCore::MathMLElement::rowSpan):
+ (WebCore::MathMLElement::parseAttribute):
+ * mathml/MathMLElement.h:
+ (MathMLElement):
+ (WebCore::toMathMLElement):
+ * mathml/mathattrs.in:
+ * mathml/mathtags.in:
+ * rendering/RenderTableCell.cpp:
+ (WebCore::RenderTableCell::RenderTableCell):
+ (WebCore::isMathMLElement):
+ (WebCore::RenderTableCell::colSpan):
+ (WebCore::RenderTableCell::rowSpan):
+ (WebCore::RenderTableCell::colSpanOrRowSpanChanged):
+ * rendering/RenderTableCell.h:
+ (RenderTableCell):
+ - Changed m_hasAssociatedTableCellElement to m_hasHTMLTableCellElement.
+
2012-09-26 Marcelo Lira <marcelo.l...@openbossa.org>
[Qt] load event fires on XMLHttpRequestUpload twice with Qt5
Modified: trunk/Source/WebCore/mathml/MathMLElement.cpp (129694 => 129695)
--- trunk/Source/WebCore/mathml/MathMLElement.cpp 2012-09-26 20:25:55 UTC (rev 129694)
+++ trunk/Source/WebCore/mathml/MathMLElement.cpp 2012-09-26 20:27:40 UTC (rev 129695)
@@ -33,6 +33,7 @@
#include "MathMLNames.h"
#include "RenderObject.h"
+#include "RenderTableCell.h"
namespace WebCore {
@@ -48,6 +49,34 @@
return adoptRef(new MathMLElement(tagName, document));
}
+int MathMLElement::colSpan() const
+{
+ if (!hasTagName(mtdTag))
+ return 1;
+ const AtomicString& colSpanValue = fastGetAttribute(columnspanAttr);
+ return std::max(1, colSpanValue.toInt());
+}
+
+int MathMLElement::rowSpan() const
+{
+ if (!hasTagName(mtdTag))
+ return 1;
+ const AtomicString& rowSpanValue = fastGetAttribute(rowspanAttr);
+ return std::max(1, rowSpanValue.toInt());
+}
+
+void MathMLElement::parseAttribute(const Attribute& attribute)
+{
+ if (attribute.name() == rowspanAttr) {
+ if (renderer() && renderer()->isTableCell() && hasTagName(mtdTag))
+ toRenderTableCell(renderer())->colSpanOrRowSpanChanged();
+ } else if (attribute.name() == columnspanAttr) {
+ if (renderer() && renderer()->isTableCell() && hasTagName(mtdTag))
+ toRenderTableCell(renderer())->colSpanOrRowSpanChanged();
+ } else
+ StyledElement::parseAttribute(attribute);
+}
+
bool MathMLElement::isPresentationAttribute(const QualifiedName& name) const
{
if (name == mathbackgroundAttr || name == mathsizeAttr || name == mathcolorAttr || name == fontsizeAttr || name == backgroundAttr || name == colorAttr || name == fontstyleAttr || name == fontweightAttr || name == fontfamilyAttr)
Modified: trunk/Source/WebCore/mathml/MathMLElement.h (129694 => 129695)
--- trunk/Source/WebCore/mathml/MathMLElement.h 2012-09-26 20:25:55 UTC (rev 129694)
+++ trunk/Source/WebCore/mathml/MathMLElement.h 2012-09-26 20:27:40 UTC (rev 129695)
@@ -37,19 +37,25 @@
public:
static PassRefPtr<MathMLElement> create(const QualifiedName& tagName, Document*);
+ int colSpan() const;
+ int rowSpan() const;
+
protected:
MathMLElement(const QualifiedName& tagName, Document*);
+ virtual void parseAttribute(const Attribute&) OVERRIDE;
+
private:
virtual bool isMathMLElement() const { return true; }
+
virtual bool isPresentationAttribute(const QualifiedName&) const OVERRIDE;
virtual void collectStyleForAttribute(const Attribute&, StylePropertySet*) OVERRIDE;
};
-inline MathMLElement* toMathMLElement(Element* element)
+inline MathMLElement* toMathMLElement(Node* node)
{
- ASSERT(!element || element->isMathMLElement());
- return static_cast<MathMLElement*>(element);
+ ASSERT(!node || node->isElementNode() && static_cast<Element*>(node)->isMathMLElement());
+ return static_cast<MathMLElement*>(node);
}
}
Modified: trunk/Source/WebCore/mathml/mathattrs.in (129694 => 129695)
--- trunk/Source/WebCore/mathml/mathattrs.in 2012-09-26 20:25:55 UTC (rev 129694)
+++ trunk/Source/WebCore/mathml/mathattrs.in 2012-09-26 20:27:40 UTC (rev 129695)
@@ -7,6 +7,7 @@
background
close
color
+columnspan
definitionURL
denomalign
encoding
@@ -21,5 +22,6 @@
mathvariant
numalign
open
+rowspan
separators
stretchy
Modified: trunk/Source/WebCore/mathml/mathtags.in (129694 => 129695)
--- trunk/Source/WebCore/mathml/mathtags.in 2012-09-26 20:25:55 UTC (rev 129694)
+++ trunk/Source/WebCore/mathml/mathtags.in 2012-09-26 20:27:40 UTC (rev 129695)
@@ -20,6 +20,8 @@
msub interfaceName=MathMLInlineContainerElement
msup interfaceName=MathMLInlineContainerElement
mtable interfaceName=MathMLInlineContainerElement
+mtr interfaceName=MathMLElement
+mtd interfaceName=MathMLElement
#if 0 // Curently only for MathMLNames used by HTMLTreeBuilder.
ms
Modified: trunk/Source/WebCore/rendering/RenderTableCell.cpp (129694 => 129695)
--- trunk/Source/WebCore/rendering/RenderTableCell.cpp 2012-09-26 20:25:55 UTC (rev 129694)
+++ trunk/Source/WebCore/rendering/RenderTableCell.cpp 2012-09-26 20:27:40 UTC (rev 129695)
@@ -36,6 +36,11 @@
#include "StyleInheritedData.h"
#include "TransformState.h"
+#if ENABLE(MATHML)
+#include "MathMLElement.h"
+#include "MathMLNames.h"
+#endif
+
using namespace std;
namespace WebCore {
@@ -46,7 +51,7 @@
: RenderBlock(node)
, m_column(unsetColumnIndex)
, m_cellWidthChanged(false)
- , m_hasAssociatedTableCellElement(node && (node->hasTagName(tdTag) || node->hasTagName(thTag)))
+ , m_hasHTMLTableCellElement(node && (node->hasTagName(tdTag) || node->hasTagName(thTag)))
, m_intrinsicPaddingBefore(0)
, m_intrinsicPaddingAfter(0)
{
@@ -60,27 +65,52 @@
section()->removeCachedCollapsedBorders(this);
}
+#if ENABLE(MATHML)
+inline bool isMathMLElement(Node* node)
+{
+ return node && node->isElementNode() && toElement(node)->isMathMLElement();
+}
+#endif
+
unsigned RenderTableCell::colSpan() const
{
- if (UNLIKELY(!m_hasAssociatedTableCellElement))
+ if (UNLIKELY(!m_hasHTMLTableCellElement)) {
+#if ENABLE(MATHML)
+ if (isMathMLElement(node()))
+ return toMathMLElement(node())->colSpan();
+#endif
return 1;
+ }
return toHTMLTableCellElement(node())->colSpan();
}
unsigned RenderTableCell::rowSpan() const
{
- if (UNLIKELY(!m_hasAssociatedTableCellElement))
+ if (UNLIKELY(!m_hasHTMLTableCellElement)) {
+#if ENABLE(MATHML)
+ if (isMathMLElement(node()))
+ return toMathMLElement(node())->rowSpan();
+#endif
return 1;
+ }
return toHTMLTableCellElement(node())->rowSpan();
}
void RenderTableCell::colSpanOrRowSpanChanged()
{
- ASSERT(m_hasAssociatedTableCellElement);
+ ASSERT(m_hasHTMLTableCellElement
+#if ENABLE(MATHML)
+ || isMathMLElement(node())
+#endif
+ );
ASSERT(node());
- ASSERT(node()->hasTagName(tdTag) || node()->hasTagName(thTag));
+ ASSERT(node()->hasTagName(tdTag) || node()->hasTagName(thTag)
+#if ENABLE(MATHML)
+ || node()->hasTagName(MathMLNames::mtdTag)
+#endif
+ );
setNeedsLayoutAndPrefWidthsRecalc();
if (parent() && section())
Modified: trunk/Source/WebCore/rendering/RenderTableCell.h (129694 => 129695)
--- trunk/Source/WebCore/rendering/RenderTableCell.h 2012-09-26 20:25:55 UTC (rev 129694)
+++ trunk/Source/WebCore/rendering/RenderTableCell.h 2012-09-26 20:27:40 UTC (rev 129695)
@@ -227,7 +227,7 @@
unsigned m_column : 30;
bool m_cellWidthChanged : 1;
- bool m_hasAssociatedTableCellElement : 1;
+ bool m_hasHTMLTableCellElement : 1;
int m_intrinsicPaddingBefore;
int m_intrinsicPaddingAfter;
};
_______________________________________________ webkit-changes mailing list webkit-changes@lists.webkit.org http://lists.webkit.org/mailman/listinfo/webkit-changes