Title: [204809] trunk/Source/WebCore
Revision
204809
Author
[email protected]
Date
2016-08-23 04:36:28 -0700 (Tue, 23 Aug 2016)

Log Message

Rename MathMLInlineContainerElement to MathMLPresentationElement
https://bugs.webkit.org/show_bug.cgi?id=161053

Patch by Frederic Wang <[email protected]> on 2016-08-23
Reviewed by Manuel Rego Casasnovas.

MathMLInlineContainerElement sounds a bad name for something that is now going to produce
RenderMathMLBlocks. MathML has two kinds of markup (presentation MathML and content MathML).
We only implement presentation MathML and most of the MathML elements are currently
implemented as MathMLInlineContainerElement. Hence we rename MathMLInlineContainerElement
to MathMLPresentationElement and will move more code from MathMLElement into that new class
in follow-up bugs. Also, other elements in the MathML namespace could be handled by a
separate MathMLUnknownElement class for consistency with SVG and HTML classes.

No new tests, behavior is unchanged.

* CMakeLists.txt: Rename MathMLInlineContainerElement to MathMLPresentationElement.
* WebCore.xcodeproj/project.pbxproj: Ditto.
* mathml/MathMLAllInOne.cpp: Ditto.
* mathml/MathMLFractionElement.cpp: Ditto.
* mathml/MathMLFractionElement.h: Ditto.
* mathml/MathMLPresentationElement.cpp: Ditto.
* mathml/MathMLPresentationElement.h: Ditto.
* mathml/MathMLRowElement.cpp: Ditto.
* mathml/MathMLRowElement.h: Ditto.
* mathml/MathMLScriptsElement.cpp: Ditto.
* mathml/MathMLScriptsElement.h: Ditto.
* mathml/mathtags.in: Ditto.
* rendering/mathml/RenderMathMLFraction.h: Remove useless include.

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/Source/WebCore/CMakeLists.txt (204808 => 204809)


--- trunk/Source/WebCore/CMakeLists.txt	2016-08-23 11:35:57 UTC (rev 204808)
+++ trunk/Source/WebCore/CMakeLists.txt	2016-08-23 11:36:28 UTC (rev 204809)
@@ -2005,12 +2005,12 @@
     mathml/MathMLAnnotationElement.cpp
     mathml/MathMLElement.cpp
     mathml/MathMLFractionElement.cpp
-    mathml/MathMLInlineContainerElement.cpp
     mathml/MathMLMathElement.cpp
     mathml/MathMLMencloseElement.cpp
     mathml/MathMLOperatorDictionary.cpp
     mathml/MathMLOperatorElement.cpp
     mathml/MathMLPaddedElement.cpp
+    mathml/MathMLPresentationElement.cpp
     mathml/MathMLRowElement.cpp
     mathml/MathMLScriptsElement.cpp
     mathml/MathMLSelectElement.cpp

Modified: trunk/Source/WebCore/ChangeLog (204808 => 204809)


--- trunk/Source/WebCore/ChangeLog	2016-08-23 11:35:57 UTC (rev 204808)
+++ trunk/Source/WebCore/ChangeLog	2016-08-23 11:36:28 UTC (rev 204809)
@@ -1,3 +1,34 @@
+2016-08-23  Frederic Wang  <[email protected]>
+
+        Rename MathMLInlineContainerElement to MathMLPresentationElement
+        https://bugs.webkit.org/show_bug.cgi?id=161053
+
+        Reviewed by Manuel Rego Casasnovas.
+
+        MathMLInlineContainerElement sounds a bad name for something that is now going to produce
+        RenderMathMLBlocks. MathML has two kinds of markup (presentation MathML and content MathML).
+        We only implement presentation MathML and most of the MathML elements are currently
+        implemented as MathMLInlineContainerElement. Hence we rename MathMLInlineContainerElement
+        to MathMLPresentationElement and will move more code from MathMLElement into that new class
+        in follow-up bugs. Also, other elements in the MathML namespace could be handled by a
+        separate MathMLUnknownElement class for consistency with SVG and HTML classes.
+
+        No new tests, behavior is unchanged.
+
+        * CMakeLists.txt: Rename MathMLInlineContainerElement to MathMLPresentationElement.
+        * WebCore.xcodeproj/project.pbxproj: Ditto.
+        * mathml/MathMLAllInOne.cpp: Ditto.
+        * mathml/MathMLFractionElement.cpp: Ditto.
+        * mathml/MathMLFractionElement.h: Ditto.
+        * mathml/MathMLPresentationElement.cpp: Ditto.
+        * mathml/MathMLPresentationElement.h: Ditto.
+        * mathml/MathMLRowElement.cpp: Ditto.
+        * mathml/MathMLRowElement.h: Ditto.
+        * mathml/MathMLScriptsElement.cpp: Ditto.
+        * mathml/MathMLScriptsElement.h: Ditto.
+        * mathml/mathtags.in: Ditto.
+        * rendering/mathml/RenderMathMLFraction.h: Remove useless include.
+
 2016-08-23  Youenn Fablet  <[email protected]>
 
         Implement redirect support post CORS-preflight

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (204808 => 204809)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2016-08-23 11:35:57 UTC (rev 204808)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2016-08-23 11:36:28 UTC (rev 204809)
@@ -6323,8 +6323,8 @@
 		FABE72F41059C1EB00D999DD /* MathMLElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FABE72ED1059C1EB00D999DD /* MathMLElement.cpp */; };
 		FABE72F51059C1EB00D888CC /* MathMLAnnotationElement.h in Headers */ = {isa = PBXBuildFile; fileRef = FABE72EE1059C1EB00D888CC /* MathMLAnnotationElement.h */; };
 		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 */; };
+		FABE72F61059C1EB00D999DD /* MathMLPresentationElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FABE72EF1059C1EB00D999DD /* MathMLPresentationElement.cpp */; };
+		FABE72F71059C1EB00D999DD /* MathMLPresentationElement.h in Headers */ = {isa = PBXBuildFile; fileRef = FABE72F01059C1EB00D999DD /* MathMLPresentationElement.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 */; };
@@ -13898,8 +13898,8 @@
 		FABE72ED1059C1EB00D999DD /* MathMLElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MathMLElement.cpp; sourceTree = "<group>"; };
 		FABE72EE1059C1EB00D888CC /* MathMLAnnotationElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MathMLAnnotationElement.h; 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>"; };
+		FABE72EF1059C1EB00D999DD /* MathMLPresentationElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MathMLPresentationElement.cpp; sourceTree = "<group>"; };
+		FABE72F01059C1EB00D999DD /* MathMLPresentationElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MathMLPresentationElement.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>"; };
@@ -23126,8 +23126,8 @@
 				FABE72EE1059C1EB00D999DD /* MathMLElement.h */,
 				0BCF83EF1059C1EB00D999DD /* MathMLFractionElement.cpp */,
 				0BCF83F01059C1EB00D999DD /* MathMLFractionElement.h */,
-				FABE72EF1059C1EB00D999DD /* MathMLInlineContainerElement.cpp */,
-				FABE72F01059C1EB00D999DD /* MathMLInlineContainerElement.h */,
+				FABE72EF1059C1EB00D999DD /* MathMLPresentationElement.cpp */,
+				FABE72F01059C1EB00D999DD /* MathMLPresentationElement.h */,
 				FABE72F11059C1EB00D999DD /* MathMLMathElement.cpp */,
 				FABE72F21059C1EB00D999DD /* MathMLMathElement.h */,
 				C3E61C653A64807A83E76FB8 /* MathMLMencloseElement.cpp */,
@@ -25374,7 +25374,7 @@
 				FABE72F51059C1EB00D999DD /* MathMLElement.h in Headers */,
 				44A28AAC12DFB8AC00AE923B /* MathMLElementFactory.h in Headers */,
 				0BCF83F71059C1EB00D999DD /* MathMLFractionElement.h in Headers */,
-				FABE72F71059C1EB00D999DD /* MathMLInlineContainerElement.h in Headers */,
+				FABE72F71059C1EB00D999DD /* MathMLPresentationElement.h in Headers */,
 				FABE72F91059C1EB00D999DD /* MathMLMathElement.h in Headers */,
 				44A28AAF12DFB8BF00AE923B /* MathMLNames.h in Headers */,
 				FA654A6C1108ABED002616F1 /* MathMLOperatorElement.h in Headers */,
@@ -29054,7 +29054,7 @@
 				FABE72F41059C1EB00D999DD /* MathMLElement.cpp in Sources */,
 				FABE72FD1059C21100D999DD /* MathMLElementFactory.cpp in Sources */,
 				0BCF83F61059C1EB00D999DD /* MathMLFractionElement.cpp in Sources */,
-				FABE72F61059C1EB00D999DD /* MathMLInlineContainerElement.cpp in Sources */,
+				FABE72F61059C1EB00D999DD /* MathMLPresentationElement.cpp in Sources */,
 				FABE72F81059C1EB00D999DD /* MathMLMathElement.cpp in Sources */,
 				05D913CEEAB2A60534218ACF /* MathMLMencloseElement.cpp in Sources */,
 				FABE72FE1059C21100D999DD /* MathMLNames.cpp in Sources */,

Modified: trunk/Source/WebCore/mathml/MathMLAllInOne.cpp (204808 => 204809)


--- trunk/Source/WebCore/mathml/MathMLAllInOne.cpp	2016-08-23 11:35:57 UTC (rev 204808)
+++ trunk/Source/WebCore/mathml/MathMLAllInOne.cpp	2016-08-23 11:36:28 UTC (rev 204809)
@@ -28,12 +28,12 @@
 #include "MathMLAnnotationElement.cpp"
 #include "MathMLElement.cpp"
 #include "MathMLFractionElement.cpp"
-#include "MathMLInlineContainerElement.cpp"
 #include "MathMLMathElement.cpp"
 #include "MathMLMencloseElement.cpp"
 #include "MathMLOperatorDictionary.cpp"
 #include "MathMLOperatorElement.cpp"
 #include "MathMLPaddedElement.cpp"
+#include "MathMLPresentationElement.cpp"
 #include "MathMLRowElement.cpp"
 #include "MathMLScriptsElement.cpp"
 #include "MathMLSelectElement.cpp"

Modified: trunk/Source/WebCore/mathml/MathMLFractionElement.cpp (204808 => 204809)


--- trunk/Source/WebCore/mathml/MathMLFractionElement.cpp	2016-08-23 11:35:57 UTC (rev 204808)
+++ trunk/Source/WebCore/mathml/MathMLFractionElement.cpp	2016-08-23 11:36:28 UTC (rev 204809)
@@ -36,7 +36,7 @@
 using namespace MathMLNames;
 
 inline MathMLFractionElement::MathMLFractionElement(const QualifiedName& tagName, Document& document)
-    : MathMLInlineContainerElement(tagName, document)
+    : MathMLPresentationElement(tagName, document)
 {
 }
 

Modified: trunk/Source/WebCore/mathml/MathMLFractionElement.h (204808 => 204809)


--- trunk/Source/WebCore/mathml/MathMLFractionElement.h	2016-08-23 11:35:57 UTC (rev 204808)
+++ trunk/Source/WebCore/mathml/MathMLFractionElement.h	2016-08-23 11:36:28 UTC (rev 204809)
@@ -26,11 +26,11 @@
 #pragma once
 
 #if ENABLE(MATHML)
-#include "MathMLInlineContainerElement.h"
+#include "MathMLPresentationElement.h"
 
 namespace WebCore {
 
-class MathMLFractionElement final : public MathMLInlineContainerElement {
+class MathMLFractionElement final : public MathMLPresentationElement {
 public:
     static Ref<MathMLFractionElement> create(const QualifiedName& tagName, Document&);
     const Length& lineThickness();

Deleted: trunk/Source/WebCore/mathml/MathMLInlineContainerElement.cpp (204808 => 204809)


--- trunk/Source/WebCore/mathml/MathMLInlineContainerElement.cpp	2016-08-23 11:35:57 UTC (rev 204808)
+++ trunk/Source/WebCore/mathml/MathMLInlineContainerElement.cpp	2016-08-23 11:36:28 UTC (rev 204809)
@@ -1,80 +0,0 @@
-/*
- * Copyright (C) 2009 Alex Milowski ([email protected]). All rights reserved.
- * Copyright (C) 2010 Apple Inc. All rights reserved.
- * Copyright (C) 2016 Igalia S.L.
- *
- * 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 "MathMLInlineContainerElement.h"
-
-#include "MathMLNames.h"
-#include "RenderMathMLBlock.h"
-
-namespace WebCore {
-
-using namespace MathMLNames;
-
-MathMLInlineContainerElement::MathMLInlineContainerElement(const QualifiedName& tagName, Document& document)
-    : MathMLElement(tagName, document)
-{
-}
-
-Ref<MathMLInlineContainerElement> MathMLInlineContainerElement::create(const QualifiedName& tagName, Document& document)
-{
-    return adoptRef(*new MathMLInlineContainerElement(tagName, document));
-}
-
-RenderPtr<RenderElement> MathMLInlineContainerElement::createElementRenderer(RenderStyle&& style, const RenderTreePosition&)
-{
-    if (hasTagName(mtableTag))
-        return createRenderer<RenderMathMLTable>(*this, WTFMove(style));
-
-    return createRenderer<RenderMathMLBlock>(*this, WTFMove(style));
-}
-
-bool MathMLInlineContainerElement::acceptsDisplayStyleAttribute()
-{
-    return hasTagName(mtableTag);
-}
-
-void MathMLInlineContainerElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
-{
-    bool displayStyleAttribute = name == displaystyleAttr && acceptsDisplayStyleAttribute();
-    bool mathVariantAttribute = name == mathvariantAttr && acceptsMathVariantAttribute();
-    if (displayStyleAttribute)
-        m_displayStyle = Nullopt;
-    if (mathVariantAttribute)
-        m_mathVariant = Nullopt;
-    if ((displayStyleAttribute || mathVariantAttribute) && renderer())
-        MathMLStyle::resolveMathMLStyleTree(renderer());
-
-    MathMLElement::parseAttribute(name, value);
-}
-
-}
-
-#endif // ENABLE(MATHML)

Deleted: trunk/Source/WebCore/mathml/MathMLInlineContainerElement.h (204808 => 204809)


--- trunk/Source/WebCore/mathml/MathMLInlineContainerElement.h	2016-08-23 11:35:57 UTC (rev 204808)
+++ trunk/Source/WebCore/mathml/MathMLInlineContainerElement.h	2016-08-23 11:36:28 UTC (rev 204809)
@@ -1,52 +0,0 @@
-/*
- * Copyright (C) 2009 Alex Milowski ([email protected]). All rights reserved.
- * Copyright (C) 2010 Apple Inc. All rights reserved.
- * Copyright (C) 2016 Igalia S.L.
- *
- * 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.
- */
-
-#pragma once
-
-#if ENABLE(MATHML)
-#include "MathMLElement.h"
-
-namespace WebCore {
-
-class MathMLInlineContainerElement : public MathMLElement {
-public:
-    static Ref<MathMLInlineContainerElement> create(const QualifiedName& tagName, Document&);
-
-protected:
-    MathMLInlineContainerElement(const QualifiedName& tagName, Document&);
-    void parseAttribute(const QualifiedName&, const AtomicString&) override;
-
-    bool acceptsDisplayStyleAttribute() override;
-
-private:
-    RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) override;
-    bool isPresentationMathML() const final { return true; }
-};
-
-}
-
-#endif // ENABLE(MATHML)

Copied: trunk/Source/WebCore/mathml/MathMLPresentationElement.cpp (from rev 204795, trunk/Source/WebCore/mathml/MathMLInlineContainerElement.cpp) (0 => 204809)


--- trunk/Source/WebCore/mathml/MathMLPresentationElement.cpp	                        (rev 0)
+++ trunk/Source/WebCore/mathml/MathMLPresentationElement.cpp	2016-08-23 11:36:28 UTC (rev 204809)
@@ -0,0 +1,79 @@
+/*
+ * Copyright (C) 2009 Alex Milowski ([email protected]). All rights reserved.
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2016 Igalia S.L.
+ *
+ * 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 "MathMLPresentationElement.h"
+
+#include "MathMLNames.h"
+#include "RenderMathMLBlock.h"
+
+namespace WebCore {
+
+using namespace MathMLNames;
+
+MathMLPresentationElement::MathMLPresentationElement(const QualifiedName& tagName, Document& document)
+    : MathMLElement(tagName, document)
+{
+}
+
+Ref<MathMLPresentationElement> MathMLPresentationElement::create(const QualifiedName& tagName, Document& document)
+{
+    return adoptRef(*new MathMLPresentationElement(tagName, document));
+}
+
+RenderPtr<RenderElement> MathMLPresentationElement::createElementRenderer(RenderStyle&& style, const RenderTreePosition&)
+{
+    if (hasTagName(mtableTag))
+        return createRenderer<RenderMathMLTable>(*this, WTFMove(style));
+
+    return createRenderer<RenderMathMLBlock>(*this, WTFMove(style));
+}
+
+bool MathMLPresentationElement::acceptsDisplayStyleAttribute()
+{
+    return hasTagName(mtableTag);
+}
+
+void MathMLPresentationElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
+{
+    bool displayStyleAttribute = name == displaystyleAttr && acceptsDisplayStyleAttribute();
+    bool mathVariantAttribute = name == mathvariantAttr && acceptsMathVariantAttribute();
+    if (displayStyleAttribute)
+        m_displayStyle = Nullopt;
+    if (mathVariantAttribute)
+        m_mathVariant = Nullopt;
+    if ((displayStyleAttribute || mathVariantAttribute) && renderer())
+        MathMLStyle::resolveMathMLStyleTree(renderer());
+
+    MathMLElement::parseAttribute(name, value);
+}
+
+}
+
+#endif // ENABLE(MATHML)

Property changes: trunk/Source/WebCore/mathml/MathMLPresentationElement.cpp


Added: svn:eol-style

+LF \ No newline at end of property

Copied: trunk/Source/WebCore/mathml/MathMLPresentationElement.h (from rev 204795, trunk/Source/WebCore/mathml/MathMLInlineContainerElement.h) (0 => 204809)


--- trunk/Source/WebCore/mathml/MathMLPresentationElement.h	                        (rev 0)
+++ trunk/Source/WebCore/mathml/MathMLPresentationElement.h	2016-08-23 11:36:28 UTC (rev 204809)
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2009 Alex Milowski ([email protected]). All rights reserved.
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2016 Igalia S.L.
+ *
+ * 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.
+ */
+
+#pragma once
+
+#if ENABLE(MATHML)
+#include "MathMLElement.h"
+
+namespace WebCore {
+
+class MathMLPresentationElement : public MathMLElement {
+public:
+    static Ref<MathMLPresentationElement> create(const QualifiedName& tagName, Document&);
+
+protected:
+    MathMLPresentationElement(const QualifiedName& tagName, Document&);
+    void parseAttribute(const QualifiedName&, const AtomicString&) override;
+
+    bool acceptsDisplayStyleAttribute() override;
+
+private:
+    RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) override;
+    bool isPresentationMathML() const final { return true; }
+};
+
+}
+
+#endif // ENABLE(MATHML)

Property changes: trunk/Source/WebCore/mathml/MathMLPresentationElement.h


Added: svn:eol-style

+LF \ No newline at end of property

Modified: trunk/Source/WebCore/mathml/MathMLRowElement.cpp (204808 => 204809)


--- trunk/Source/WebCore/mathml/MathMLRowElement.cpp	2016-08-23 11:35:57 UTC (rev 204808)
+++ trunk/Source/WebCore/mathml/MathMLRowElement.cpp	2016-08-23 11:36:28 UTC (rev 204809)
@@ -40,7 +40,7 @@
 using namespace MathMLNames;
 
 MathMLRowElement::MathMLRowElement(const QualifiedName& tagName, Document& document)
-    : MathMLInlineContainerElement(tagName, document)
+    : MathMLPresentationElement(tagName, document)
 {
 }
 
@@ -56,7 +56,7 @@
             static_cast<MathMLOperatorElement*>(child)->setOperatorFormDirty();
     }
 
-    MathMLInlineContainerElement::childrenChanged(change);
+    MathMLPresentationElement::childrenChanged(change);
 }
 
 RenderPtr<RenderElement> MathMLRowElement::createElementRenderer(RenderStyle&& style, const RenderTreePosition&)

Modified: trunk/Source/WebCore/mathml/MathMLRowElement.h (204808 => 204809)


--- trunk/Source/WebCore/mathml/MathMLRowElement.h	2016-08-23 11:35:57 UTC (rev 204808)
+++ trunk/Source/WebCore/mathml/MathMLRowElement.h	2016-08-23 11:36:28 UTC (rev 204809)
@@ -26,11 +26,11 @@
 #pragma once
 
 #if ENABLE(MATHML)
-#include "MathMLInlineContainerElement.h"
+#include "MathMLPresentationElement.h"
 
 namespace WebCore {
 
-class MathMLRowElement : public MathMLInlineContainerElement {
+class MathMLRowElement : public MathMLPresentationElement {
 public:
     static Ref<MathMLRowElement> create(const QualifiedName& tagName, Document&);
 

Modified: trunk/Source/WebCore/mathml/MathMLScriptsElement.cpp (204808 => 204809)


--- trunk/Source/WebCore/mathml/MathMLScriptsElement.cpp	2016-08-23 11:35:57 UTC (rev 204808)
+++ trunk/Source/WebCore/mathml/MathMLScriptsElement.cpp	2016-08-23 11:36:28 UTC (rev 204809)
@@ -36,7 +36,7 @@
 using namespace MathMLNames;
 
 MathMLScriptsElement::MathMLScriptsElement(const QualifiedName& tagName, Document& document)
-    : MathMLInlineContainerElement(tagName, document)
+    : MathMLPresentationElement(tagName, document)
 {
 }
 

Modified: trunk/Source/WebCore/mathml/MathMLScriptsElement.h (204808 => 204809)


--- trunk/Source/WebCore/mathml/MathMLScriptsElement.h	2016-08-23 11:35:57 UTC (rev 204808)
+++ trunk/Source/WebCore/mathml/MathMLScriptsElement.h	2016-08-23 11:36:28 UTC (rev 204809)
@@ -26,11 +26,11 @@
 #pragma once
 
 #if ENABLE(MATHML)
-#include "MathMLInlineContainerElement.h"
+#include "MathMLPresentationElement.h"
 
 namespace WebCore {
 
-class MathMLScriptsElement : public MathMLInlineContainerElement {
+class MathMLScriptsElement : public MathMLPresentationElement {
 public:
     static Ref<MathMLScriptsElement> create(const QualifiedName& tagName, Document&);
     const Length& subscriptShift();

Modified: trunk/Source/WebCore/mathml/mathtags.in (204808 => 204809)


--- trunk/Source/WebCore/mathml/mathtags.in	2016-08-23 11:35:57 UTC (rev 204808)
+++ trunk/Source/WebCore/mathml/mathtags.in	2016-08-23 11:36:28 UTC (rev 204809)
@@ -28,13 +28,13 @@
 mspace interfaceName=MathMLSpaceElement
 msub interfaceName=MathMLScriptsElement
 msup interfaceName=MathMLScriptsElement
-mtable interfaceName=MathMLInlineContainerElement
+mtable interfaceName=MathMLPresentationElement
 mtr interfaceName=MathMLElement
 mtd interfaceName=MathMLElement
 mmultiscripts interfaceName=MathMLScriptsElement
-mprescripts interfaceName=MathMLInlineContainerElement
+mprescripts interfaceName=MathMLPresentationElement
 menclose interfaceName=MathMLMencloseElement
-none interfaceName=MathMLInlineContainerElement
+none interfaceName=MathMLPresentationElement
 semantics interfaceName=MathMLSelectElement
 
 maligngroup interfaceName=MathMLElement

Modified: trunk/Source/WebCore/rendering/mathml/RenderMathMLFraction.h (204808 => 204809)


--- trunk/Source/WebCore/rendering/mathml/RenderMathMLFraction.h	2016-08-23 11:35:57 UTC (rev 204808)
+++ trunk/Source/WebCore/rendering/mathml/RenderMathMLFraction.h	2016-08-23 11:36:28 UTC (rev 204809)
@@ -30,7 +30,6 @@
 #if ENABLE(MATHML)
 
 #include "MathMLFractionElement.h"
-#include "MathMLInlineContainerElement.h"
 #include "RenderMathMLBlock.h"
 
 namespace WebCore {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to