Commit 8af95f36 authored by eric@webkit.org's avatar eric@webkit.org

2009-09-19 Alex Milowski <alex@milowski.com>

        Reviewed by Maciej Stachowiak.

        Basic tests for msub, msup, and mtable/mtr/mtd

        * mathml: Added.
        * mathml/presentation: Added.
        * mathml/presentation/sub.xhtml: Added.
        * mathml/presentation/sup.xhtml: Added.
        * mathml/presentation/tables.xhtml: Added.
        * platform/mac/mathml: Added.
        * platform/mac/mathml/presentation: Added.
        * platform/mac/mathml/presentation/sub-expected.txt: Added.
        * platform/mac/mathml/presentation/sup-expected.txt: Added.
        * platform/mac/mathml/presentation/tables-expected.txt: Added.
2009-09-19  Alex Milowski  <alex@milowski.com>

        Reviewed by Maciej Stachowiak.

        Adds CSS styling and basic DOM element support for MathML

        * DerivedSources.make:
          Added user stylesheet and tag factory generation

        * WebCore.xcodeproj/project.pbxproj:
          Added new DOM element code

        * css/CSSParser.cpp:
        (WebCore::CSSParser::parseAttr):
          Added check for document since stylesheet can be added before there is a document

        * css/CSSStyleSelector.cpp:
        (WebCore::CSSStyleSelector::styleForElement):
          Added check to add MathML user agent stylesheet

        * css/mathml.css: Added.
          MathML user agent stylesheet

        * dom/Document.cpp:
        (WebCore::Document::createElement):
          Added support for creation of MathML DOM objects

        * dom/Node.h:
        (WebCore::Node::isMathMLElement):
          Added check method for whether the node is a MathML node

        * mathml: Added.
        * mathml/MathMLElement.cpp: Added.
        (WebCore::MathMLElement::MathMLElement):
        (WebCore::MathMLElement::create):
        (WebCore::MathMLElement::createRenderer):
        * mathml/MathMLElement.h: Added.
        (WebCore::MathMLElement::isMathMLElement):
          MathML DOM base class

        * mathml/MathMLInlineContainerElement.cpp: Added.
        (WebCore::MathMLInlineContainerElement::MathMLInlineContainerElement):
        (WebCore::MathMLInlineContainerElement::create):
        (WebCore::MathMLInlineContainerElement::createRenderer):
        * mathml/MathMLInlineContainerElement.h: Added.
          Base class for non-text containers

        * mathml/MathMLMathElement.cpp: Added.
        (WebCore::MathMLMathElement::MathMLMathElement):
        (WebCore::MathMLMathElement::create):
        * mathml/MathMLMathElement.h: Added.
          Root Math element

        * mathml/mathtags.in: Added.
          Element list mappings

        * page/Frame.cpp:
        (WebCore::Frame::Frame):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48559 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 07dabc63
2009-09-19 Alex Milowski <alex@milowski.com>
Reviewed by Maciej Stachowiak.
Basic tests for msub, msup, and mtable/mtr/mtd
* mathml: Added.
* mathml/presentation: Added.
* mathml/presentation/sub.xhtml: Added.
* mathml/presentation/sup.xhtml: Added.
* mathml/presentation/tables.xhtml: Added.
* platform/mac/mathml: Added.
* platform/mac/mathml/presentation: Added.
* platform/mac/mathml/presentation/sub-expected.txt: Added.
* platform/mac/mathml/presentation/sup-expected.txt: Added.
* platform/mac/mathml/presentation/tables-expected.txt: Added.
2009-09-19 Adam Barth <abarth@webkit.org>
Reviewed by Oliver Hunt.
......
<html xmlns='http://www.w3.org/1999/xhtml'>
<head>
<title>Subscripts</title>
</head>
<body>
<p id='t1'>subscript:
<math xmlns='http://www.w3.org/1998/Math/MathML'>
<msub><mi>x</mi><mn>1</mn></msub>
</math>
</p>
</body>
</html>
<html xmlns='http://www.w3.org/1999/xhtml'>
<head>
<title>Superscripts</title>
</head>
<body>
<p id='t1'>superscript:
<math xmlns='http://www.w3.org/1998/Math/MathML'>
<msup><mi>x</mi><mn>2</mn></msup>
</math>
</p>
</body>
</html>
<html xmlns='http://www.w3.org/1999/xhtml'>
<head>
<title>tables</title>
</head>
<body>
<p id='t1'>simple:
<math xmlns='http://www.w3.org/1998/Math/MathML'>
<mtable>
<mtr>
<mtd><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>
</mtr>
</mtable>
</math>
</p>
</body>
</html>
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x52
RenderBlock {html} at (0,0) size 800x52
RenderBody {body} at (8,16) size 784x20
RenderBlock {p} at (0,0) size 784x20
RenderText {#text} at (0,0) size 64x18
text run at (0,0) width 64: "subscript: "
RenderBlock {math} at (64,1) size 16x19
RenderBlock {msub} at (0,0) size 16x19
RenderInline {mi} at (0,0) size 9x18
RenderText {#text} at (0,0) size 9x18
text run at (0,0) width 9: "x"
RenderInline {mn} at (0,0) size 7x13
RenderText {#text} at (9,8) size 7x13
text run at (9,8) width 7: "1"
RenderText {#text} at (0,0) size 0x0
RenderText {#text} at (0,0) size 0x0
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x51
RenderBlock {html} at (0,0) size 800x51
RenderBody {body} at (8,16) size 784x19
RenderBlock {p} at (0,0) size 784x19
RenderText {#text} at (0,0) size 76x18
text run at (0,0) width 76: "superscript: "
RenderBlock {math} at (76,0) size 16x19
RenderBlock {msup} at (0,0) size 16x19
RenderInline {mi} at (0,0) size 9x18
RenderText {#text} at (0,1) size 9x18
text run at (0,1) width 9: "x"
RenderInline {mn} at (0,0) size 7x13
RenderText {#text} at (9,-2) size 7x13
text run at (9,-2) width 7: "2"
RenderText {#text} at (0,0) size 0x0
RenderText {#text} at (0,0) size 0x0
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x110
RenderBlock {html} at (0,0) size 800x110
RenderBody {body} at (8,16) size 784x78
RenderBlock {p} at (0,0) size 784x78
RenderText {#text} at (0,29) size 49x18
text run at (0,29) width 49: "simple: "
RenderBlock {math} at (49,0) size 93x78
RenderTable {mtable} at (0,0) size 93x78
RenderTableSection (anonymous) at (0,0) size 93x78
RenderTableRow {mtr} at (0,0) size 93x26
RenderTableCell {mtd} at (0,0) size 31x26 [r=0 c=0 rs=1 cs=1]
RenderBlock {msub} at (4,0) size 22x26
RenderInline {mi} at (0,0) size 8x18
RenderText {#text} at (0,4) size 8x18
text run at (0,4) width 8: "a"
RenderInline {mn} at (0,0) size 14x13
RenderText {#text} at (8,12) size 14x13
text run at (8,12) width 14: "11"
RenderTableCell {mtd} at (31,0) size 31x26 [r=0 c=1 rs=1 cs=1]
RenderBlock {msub} at (4,0) size 22x26
RenderInline {mi} at (0,0) size 8x18
RenderText {#text} at (0,4) size 8x18
text run at (0,4) width 8: "a"
RenderInline {mn} at (0,0) size 14x13
RenderText {#text} at (8,12) size 14x13
text run at (8,12) width 14: "12"
RenderTableCell {mtd} at (62,0) size 31x26 [r=0 c=2 rs=1 cs=1]
RenderBlock {msub} at (4,0) size 22x26
RenderInline {mi} at (0,0) size 8x18
RenderText {#text} at (0,4) size 8x18
text run at (0,4) width 8: "a"
RenderInline {mn} at (0,0) size 14x13
RenderText {#text} at (8,12) size 14x13
text run at (8,12) width 14: "13"
RenderTableRow {mtr} at (0,26) size 93x26
RenderTableCell {mtd} at (0,26) size 31x26 [r=1 c=0 rs=1 cs=1]
RenderBlock {msub} at (4,0) size 23x26
RenderInline {mi} at (0,0) size 9x18
RenderText {#text} at (0,4) size 9x18
text run at (0,4) width 9: "b"
RenderInline {mn} at (0,0) size 14x13
RenderText {#text} at (9,12) size 14x13
text run at (9,12) width 14: "21"
RenderTableCell {mtd} at (31,26) size 31x26 [r=1 c=1 rs=1 cs=1]
RenderBlock {msub} at (4,0) size 23x26
RenderInline {mi} at (0,0) size 9x18
RenderText {#text} at (0,4) size 9x18
text run at (0,4) width 9: "b"
RenderInline {mn} at (0,0) size 14x13
RenderText {#text} at (9,12) size 14x13
text run at (9,12) width 14: "22"
RenderTableCell {mtd} at (62,26) size 31x26 [r=1 c=2 rs=1 cs=1]
RenderBlock {msub} at (4,0) size 23x26
RenderInline {mi} at (0,0) size 9x18
RenderText {#text} at (0,4) size 9x18
text run at (0,4) width 9: "b"
RenderInline {mn} at (0,0) size 14x13
RenderText {#text} at (9,12) size 14x13
text run at (9,12) width 14: "23"
RenderTableRow {mtr} at (0,52) size 93x26
RenderTableCell {mtd} at (0,52) size 31x26 [r=2 c=0 rs=1 cs=1]
RenderBlock {msub} at (4,0) size 22x26
RenderInline {mi} at (0,0) size 8x18
RenderText {#text} at (0,4) size 8x18
text run at (0,4) width 8: "c"
RenderInline {mn} at (0,0) size 14x13
RenderText {#text} at (8,12) size 14x13
text run at (8,12) width 14: "31"
RenderTableCell {mtd} at (31,52) size 31x26 [r=2 c=1 rs=1 cs=1]
RenderBlock {msub} at (4,0) size 22x26
RenderInline {mi} at (0,0) size 8x18
RenderText {#text} at (0,4) size 8x18
text run at (0,4) width 8: "c"
RenderInline {mn} at (0,0) size 14x13
RenderText {#text} at (8,12) size 14x13
text run at (8,12) width 14: "32"
RenderTableCell {mtd} at (62,52) size 31x26 [r=2 c=2 rs=1 cs=1]
RenderBlock {msub} at (4,0) size 22x26
RenderInline {mi} at (0,0) size 8x18
RenderText {#text} at (0,4) size 8x18
text run at (0,4) width 8: "c"
RenderInline {mn} at (0,0) size 14x13
RenderText {#text} at (8,12) size 14x13
text run at (8,12) width 14: "33"
RenderText {#text} at (0,0) size 0x0
RenderText {#text} at (0,0) size 0x0
2009-09-19 Alex Milowski <alex@milowski.com>
Reviewed by Maciej Stachowiak.
Adds CSS styling and basic DOM element support for MathML
* DerivedSources.make:
Added user stylesheet and tag factory generation
* WebCore.xcodeproj/project.pbxproj:
Added new DOM element code
* css/CSSParser.cpp:
(WebCore::CSSParser::parseAttr):
Added check for document since stylesheet can be added before there is a document
* css/CSSStyleSelector.cpp:
(WebCore::CSSStyleSelector::styleForElement):
Added check to add MathML user agent stylesheet
* css/mathml.css: Added.
MathML user agent stylesheet
* dom/Document.cpp:
(WebCore::Document::createElement):
Added support for creation of MathML DOM objects
* dom/Node.h:
(WebCore::Node::isMathMLElement):
Added check method for whether the node is a MathML node
* mathml: Added.
* mathml/MathMLElement.cpp: Added.
(WebCore::MathMLElement::MathMLElement):
(WebCore::MathMLElement::create):
(WebCore::MathMLElement::createRenderer):
* mathml/MathMLElement.h: Added.
(WebCore::MathMLElement::isMathMLElement):
MathML DOM base class
* mathml/MathMLInlineContainerElement.cpp: Added.
(WebCore::MathMLInlineContainerElement::MathMLInlineContainerElement):
(WebCore::MathMLInlineContainerElement::create):
(WebCore::MathMLInlineContainerElement::createRenderer):
* mathml/MathMLInlineContainerElement.h: Added.
Base class for non-text containers
* mathml/MathMLMathElement.cpp: Added.
(WebCore::MathMLMathElement::MathMLMathElement):
(WebCore::MathMLMathElement::create):
* mathml/MathMLMathElement.h: Added.
Root Math element
* mathml/mathtags.in: Added.
Element list mappings
* page/Frame.cpp:
(WebCore::Frame::Frame):
Added MathML name initialization
2009-09-19 Adam Barth <abarth@webkit.org>
Reviewed by Oliver Hunt.
......@@ -441,6 +441,8 @@ all : \
UserAgentStyleSheets.h \
XLinkNames.cpp \
XMLNames.cpp \
MathMLElementFactory.cpp \
MathMLNames.cpp \
XPathGrammar.cpp \
tokenizer.cpp \
#
......@@ -582,6 +584,10 @@ ifeq ($(findstring ENABLE_WML,$(FEATURE_DEFINES)), ENABLE_WML)
USER_AGENT_STYLE_SHEETS := $(USER_AGENT_STYLE_SHEETS) $(WebCore)/css/wml.css
endif
ifeq ($(findstring ENABLE_MATHML,$(FEATURE_DEFINES)), ENABLE_MATHML)
USER_AGENT_STYLE_SHEETS := $(USER_AGENT_STYLE_SHEETS) $(WebCore)/css/mathml.css
endif
ifeq ($(findstring ENABLE_VIDEO,$(FEATURE_DEFINES)), ENABLE_VIDEO)
USER_AGENT_STYLE_SHEETS := $(USER_AGENT_STYLE_SHEETS) $(WebCore)/css/mediaControls.css
ifeq ($(OS),MACOS)
......@@ -723,6 +729,26 @@ WMLNames.cpp :
endif
# --------
# MathML tag and attribute names, and element factory
ifeq ($(findstring ENABLE_MATHML,$(FEATURE_DEFINES)), ENABLE_MATHML)
MathMLElementFactory.cpp MathMLNames.cpp : dom/make_names.pl mathml/mathtags.in
perl -I $(WebCore)/bindings/scripts $< --tags $(WebCore)/mathml/mathtags.in --factory --wrapperFactory
else
MathMLElementFactory.cpp :
echo > $@
MathMLNames.cpp :
echo > $@
endif
# --------
......
......@@ -4679,6 +4679,14 @@
F916C48D0DB510F80076CD83 /* JSXMLHttpRequestProgressEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F916C48B0DB510F80076CD83 /* JSXMLHttpRequestProgressEvent.cpp */; };
F916C48E0DB510F80076CD83 /* JSXMLHttpRequestProgressEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = F916C48C0DB510F80076CD83 /* JSXMLHttpRequestProgressEvent.h */; };
F9F0ED7A0DB50CA200D16DB9 /* XMLHttpRequestProgressEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = F9F0ED770DB50CA200D16DB9 /* XMLHttpRequestProgressEvent.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 */; };
FABE72F71059C1EB00D999DD /* MathMLInlineContainerElement.h in Headers */ = {isa = PBXBuildFile; fileRef = FABE72F01059C1EB00D999DD /* MathMLInlineContainerElement.h */; };
FABE72F81059C1EB00D999DD /* MathMLMathElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FABE72F11059C1EB00D999DD /* MathMLMathElement.cpp */; };
FABE72F91059C1EB00D999DD /* MathMLMathElement.h in Headers */ = {isa = PBXBuildFile; fileRef = FABE72F21059C1EB00D999DD /* MathMLMathElement.h */; };
FABE72FD1059C21100D999DD /* MathMLElementFactory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FABE72FB1059C21100D999DD /* MathMLElementFactory.cpp */; };
FABE72FE1059C21100D999DD /* MathMLNames.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FABE72FC1059C21100D999DD /* MathMLNames.cpp */; };
FE6FD4880F676E5700092873 /* Coordinates.h in Headers */ = {isa = PBXBuildFile; fileRef = FE6FD4850F676E5700092873 /* Coordinates.h */; settings = {ATTRIBUTES = (Private, ); }; };
FE6FD48D0F676E9300092873 /* JSCoordinates.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FE6FD48B0F676E9300092873 /* JSCoordinates.cpp */; };
FE6FD48E0F676E9300092873 /* JSCoordinates.h in Headers */ = {isa = PBXBuildFile; fileRef = FE6FD48C0F676E9300092873 /* JSCoordinates.h */; };
......@@ -9813,6 +9821,15 @@
F916C48C0DB510F80076CD83 /* JSXMLHttpRequestProgressEvent.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSXMLHttpRequestProgressEvent.h; sourceTree = "<group>"; };
F9F0ED770DB50CA200D16DB9 /* XMLHttpRequestProgressEvent.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = XMLHttpRequestProgressEvent.h; sourceTree = "<group>"; };
F9F0ED780DB50CA200D16DB9 /* XMLHttpRequestProgressEvent.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = XMLHttpRequestProgressEvent.idl; 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>"; };
FABE72F01059C1EB00D999DD /* MathMLInlineContainerElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MathMLInlineContainerElement.h; sourceTree = "<group>"; };
FABE72F11059C1EB00D999DD /* MathMLMathElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MathMLMathElement.cpp; sourceTree = "<group>"; };
FABE72F21059C1EB00D999DD /* MathMLMathElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MathMLMathElement.h; sourceTree = "<group>"; };
FABE72F31059C1EB00D999DD /* mathtags.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = mathtags.in; sourceTree = "<group>"; };
FABE72FB1059C21100D999DD /* MathMLElementFactory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MathMLElementFactory.cpp; sourceTree = "<group>"; };
FABE72FC1059C21100D999DD /* MathMLNames.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MathMLNames.cpp; sourceTree = "<group>"; };
FE49BD301061719100D0E1AE /* WebCore.Inspector.exp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.exports; path = WebCore.Inspector.exp; sourceTree = "<group>"; };
FE49EF970DC51462004266E1 /* DashboardSupportCSSPropertyNames.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DashboardSupportCSSPropertyNames.in; sourceTree = "<group>"; };
FE6FD4850F676E5700092873 /* Coordinates.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Coordinates.h; sourceTree = "<group>"; };
......@@ -9895,6 +9912,7 @@
93EEC1EC09C2877700C515D1 /* html */,
1C81B94D0E9732D900266E07 /* inspector */,
BCB16BFB0979C38700467741 /* loader */,
FABE72EC1059C1EB00D999DD /* mathml */,
333F703D0FB49C16008E12A6 /* notifications */,
65BF02180974806300C43196 /* page */,
BCF1A5BA097832090061A123 /* platform */,
......@@ -10817,6 +10835,8 @@
938E65F009F09840008A48EC /* JSHTMLElementWrapperFactory.h */,
8574D1F10ADE6122004CBA11 /* JSSVGElementWrapperFactory.cpp */,
8574D1F20ADE6122004CBA11 /* JSSVGElementWrapperFactory.h */,
FABE72FB1059C21100D999DD /* MathMLElementFactory.cpp */,
FABE72FC1059C21100D999DD /* MathMLNames.cpp */,
656581E609D1508D000E61D7 /* SVGElementFactory.cpp */,
656581E709D1508D000E61D7 /* SVGElementFactory.h */,
656581E809D1508D000E61D7 /* SVGNames.cpp */,
......@@ -15449,6 +15469,20 @@
tabWidth = 4;
usesTabs = 0;
};
FABE72EC1059C1EB00D999DD /* mathml */ = {
isa = PBXGroup;
children = (
FABE72ED1059C1EB00D999DD /* MathMLElement.cpp */,
FABE72EE1059C1EB00D999DD /* MathMLElement.h */,
FABE72EF1059C1EB00D999DD /* MathMLInlineContainerElement.cpp */,
FABE72F01059C1EB00D999DD /* MathMLInlineContainerElement.h */,
FABE72F11059C1EB00D999DD /* MathMLMathElement.cpp */,
FABE72F21059C1EB00D999DD /* MathMLMathElement.h */,
FABE72F31059C1EB00D999DD /* mathtags.in */,
);
path = mathml;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXHeadersBuildPhase section */
......@@ -17826,6 +17860,9 @@
510D4A4F103177A20049EA54 /* WebSocketChannel.h in Headers */,
510D4A50103177A20049EA54 /* WebSocketChannelClient.h in Headers */,
51ABAE451043AB4A008C5260 /* WebSocketHandshake.h in Headers */,
FABE72F51059C1EB00D999DD /* MathMLElement.h in Headers */,
FABE72F71059C1EB00D999DD /* MathMLInlineContainerElement.h in Headers */,
FABE72F91059C1EB00D999DD /* MathMLMathElement.h in Headers */,
37202199106213C600F25C4B /* FontSmoothingMode.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
......@@ -19951,6 +19988,11 @@
51A052341058774F00CC9E95 /* CredentialStorage.cpp in Sources */,
510D4A4E103177A20049EA54 /* WebSocketChannel.cpp in Sources */,
51ABAE441043AB4A008C5260 /* WebSocketHandshake.cpp in Sources */,
FABE72F41059C1EB00D999DD /* MathMLElement.cpp in Sources */,
FABE72F61059C1EB00D999DD /* MathMLInlineContainerElement.cpp in Sources */,
FABE72F81059C1EB00D999DD /* MathMLMathElement.cpp in Sources */,
FABE72FD1059C21100D999DD /* MathMLElementFactory.cpp in Sources */,
FABE72FE1059C21100D999DD /* MathMLNames.cpp in Sources */,
BCCE58AC1061E8CF008FB35A /* JSDatabaseCustom.cpp in Sources */,
BCCE58AF1061E90C008FB35A /* JSDocumentFragmentCustom.cpp in Sources */,
);
......@@ -2150,7 +2150,7 @@ PassRefPtr<CSSValue> CSSParser::parseAttr(CSSParserValueList* args)
if (attrName[0] == '-')
return 0;
if (document()->isHTMLDocument())
if (document() && document()->isHTMLDocument())
attrName = attrName.lower();
return CSSPrimitiveValue::create(attrName, CSSPrimitiveValue::CSS_ATTR);
......
......@@ -1139,6 +1139,17 @@ PassRefPtr<RenderStyle> CSSStyleSelector::styleForElement(Element* e, RenderStyl
}
#endif
#if ENABLE(MATHML)
static bool loadedMathMLUserAgentSheet;
if (e->isMathMLElement() && !loadedMathMLUserAgentSheet) {
// MathML rules.
loadedMathMLUserAgentSheet = true;
CSSStyleSheet* mathMLSheet = parseUASheet(mathmlUserAgentStyleSheet, sizeof(mathmlUserAgentStyleSheet));
defaultStyle->addRulesFromSheet(mathMLSheet, screenEval());
defaultPrintStyle->addRulesFromSheet(mathMLSheet, printEval());
}
#endif
#if ENABLE(WML)
static bool loadedWMLUserAgentSheet;
if (e->isWMLElement() && !loadedWMLUserAgentSheet) {
......
@namespace "http://www.w3.org/1998/Math/MathML";
/* approved */
math {
font-family: Symbol, STIXGeneral, "Times New Roman";
display: inline-block;
padding: 0px;
margin: 0px;
text-indent: 0;
font-size: 1.1em;
vertical-align: baseline;
}
math[display="block"] {
font-family: "New Times Roman"
display: block;
text-align: center;
page-break-inside: avoid;
}
mfrac {
vertical-align: middle;
}
msub, msup {
display: inline-block;
}
msub > * + * {
vertical-align: sub;
font-size: 0.75em;
line-height: 0.75em;
}
msup > * + * {
vertical-align: super;
font-size: 0.75em;
line-height: 0.75em;
}
msubsup > * {
margin: 0px;
padding: 0px;
vertical-align: middle;
}
msubsup > * + * {
font-size: 0.75em;
line-height: 0.75em;
}
munderover {
vertical-align: middle;
}
munderover > * + *, mover > * + *, munder > * + * {
font-size: 0.75em;
line-height: 0.5625em;
}
mrow {
line-height: 1em;
white-space: nowrap;
vertical-align: middle;
}
mfenced > * {
vertical-align: middle;
}
mo, mn, mi {
line-height: 0.75em;
padding: 0px;
margin: 0px;
}
mo[mathsize="small"], mn[mathsize="small"], mi[mathsize="small"] {
font-size: 0.75em;
line-height: 0.5625em;
}
mo[mathsize="normal"],mn[mathsize="normal"],mi[mathsize="normal"] {
font-size: 1em;
line-height: 0.75em;
}
mo[mathsize="big"], mn[mathsize="big"], mi[mathsize="big"] {
line-height: 1.2em;
font-size: 1.5em;
}
annotation, annotation-xml {
display:none;
}
mphantom {
visibility: hidden;
}
merror {
outline: solid thin red;
}
msqrt {
padding-top: 0.2em;
padding-left: 0.75em;
}
mroot {
padding-top: 0.2em;
padding-left: 0.2em;
}
mroot > * + * {
font-size: 0.75em;
line-height: 0.75em;
vertical-align: top;
padding-right: 0.3em;
}
mtable {
display: inline-table;
line-height: 1.5em;
text-align: center;
vertical-align: middle;
}
mtr {
display: table-row;
}
mtd {
display: table-cell;
padding: 0 0.5ex;
}
mtable[columnalign="left"], mtr[columnalign="left"], mtd[columnalign="left"] {
text-align: left;
}
mtable[columnalign="right"], mtr[columnalign="right"], mtd[columnalign="right"] {
text-align: right;
}
mtable[rowalign="top"] mtd, mtable mtr[rowalign="top"] mtd, mtable mtr mtd[rowalign="top"] {
vertical-align: top;
}
mtable[rowalign="bottom"] mtd, mtable mtr[rowalign="bottom"] mtd, mtable mtr mtd[rowalign="bottom"] {
vertical-align: bottom;
}
mtable[rowalign="center"] mtd, mtable mtr[rowalign="center"] mtd, mtable mtr mtd[rowalign="center"] {
vertical-align: middle;
}
mtable[frame="solid"] {
border: solid thin;
}
mtable[frame="dashed"] {
border: dashed thin;
}
mtable[rowlines="solid"], mtable[rowlines="dashed"], mtable[columnlines="solid"], mtable[columnlines="dashed"] {
border-collapse: collapse;
}
mtable[rowlines="solid"] > mtr + mtr {
border-top: solid thin;
}
mtable[rowlines="dashed"] > mtr + mtr {
border-top: dashed thin;
}
mtable[columnlines="solid"] > mtr > mtd + mtd {
border-left: solid thin;
}
mtable[columnlines="dashed"] > mtr > mtd + mtd {
border-left: dashed thin;
}
......@@ -174,6 +174,12 @@
#include "WMLNames.h"
#endif
#if ENABLE(MATHML)
#include "MathMLElement.h"
#include "MathMLElementFactory.h"
#include "MathMLNames.h"
#endif
#if ENABLE(XHTMLMP)
#include "HTMLNoScriptElement.h"
#endif
......@@ -803,6 +809,10 @@ PassRefPtr<Element> Document::createElement(const QualifiedName& qName, bool cre
else if (isWMLDocument())
e = WMLElementFactory::createWMLElement(QualifiedName(nullAtom, qName.localName(), WMLNames::wmlNamespaceURI), this, createdByParser);
#endif
#if ENABLE(MATHML)
else if (qName.namespaceURI() == MathMLNames::mathmlNamespaceURI)
e = MathMLElementFactory::createMathMLElement(qName, this, createdByParser);
#endif
if (!e)
e = Element::create(qName, document());
......
......@@ -183,6 +183,13 @@ public:
static bool isWMLElement() { return false; }
#endif
#if ENABLE(MATHML)
virtual bool isMathMLElement() const { return false; }
#else
static bool isMathMLElement() { return false; }
#endif
virtual bool isMediaControlElement() const { return false; }
virtual bool isStyledElement() const { return false; }
virtual bool isFrameOwnerElement() const { return false; }
......