WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
0002-Bug-160542-Rename-MathMLTextElement-to-MathMLTokenEl.patch (text/plain), 26.12 KB, created by
Frédéric Wang Nélar
on 2016-08-04 03:18:07 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Frédéric Wang Nélar
Created:
2016-08-04 03:18:07 PDT
Size:
26.12 KB
patch
obsolete
>From f69040360609fd3917e67a2ae3634da5e82445e8 Mon Sep 17 00:00:00 2001 >From: Frederic Wang <fred.wang@free.fr> >Date: Thu, 4 Aug 2016 12:16:10 +0200 >Subject: [PATCH 2/2] Bug 160542 - Rename MathMLTextElement to > MathMLTokenElement > >--- > Source/WebCore/CMakeLists.txt | 2 +- > Source/WebCore/ChangeLog | 23 ++++++ > Source/WebCore/WebCore.xcodeproj/project.pbxproj | 16 ++-- > Source/WebCore/mathml/MathMLOperatorElement.cpp | 6 +- > Source/WebCore/mathml/MathMLOperatorElement.h | 4 +- > Source/WebCore/mathml/MathMLTextElement.cpp | 94 ---------------------- > Source/WebCore/mathml/MathMLTextElement.h | 57 ------------- > Source/WebCore/mathml/MathMLTokenElement.cpp | 90 +++++++++++++++++++++ > Source/WebCore/mathml/MathMLTokenElement.h | 57 +++++++++++++ > Source/WebCore/mathml/mathtags.in | 8 +- > .../WebCore/rendering/mathml/RenderMathMLToken.cpp | 6 ++ > .../WebCore/rendering/mathml/RenderMathMLToken.h | 5 +- > 12 files changed, 197 insertions(+), 171 deletions(-) > delete mode 100644 Source/WebCore/mathml/MathMLTextElement.cpp > delete mode 100644 Source/WebCore/mathml/MathMLTextElement.h > create mode 100644 Source/WebCore/mathml/MathMLTokenElement.cpp > create mode 100644 Source/WebCore/mathml/MathMLTokenElement.h > >diff --git a/Source/WebCore/CMakeLists.txt b/Source/WebCore/CMakeLists.txt >index bdcfd57..ab5c719 100644 >--- a/Source/WebCore/CMakeLists.txt >+++ b/Source/WebCore/CMakeLists.txt >@@ -1999,7 +1999,7 @@ set(WebCore_SOURCES > mathml/MathMLScriptsElement.cpp > mathml/MathMLSelectElement.cpp > mathml/MathMLSpaceElement.cpp >- mathml/MathMLTextElement.cpp >+ mathml/MathMLTokenElement.cpp > mathml/MathMLUnderOverElement.cpp > > page/AutoscrollController.cpp >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 218b44c..53b0283 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,5 +1,28 @@ > 2016-08-04 Frederic Wang <fwang@igalia.com> > >+ Rename MathMLTextElement to MathMLTokenElement >+ https://bugs.webkit.org/show_bug.cgi?id=160542 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ No new tests, behavior is unchanged. >+ >+ * CMakeLists.txt: Rename MathMLTextElement to MathMLTokenElement. >+ * WebCore.xcodeproj/project.pbxproj: Ditto. >+ * mathml/MathMLOperatorElement.cpp: Ditto. >+ * mathml/MathMLOperatorElement.h: Ditto. >+ * mathml/MathMLTokenElement.cpp: Ditto. Also remove dead code in childShouldCreateRenderer >+ to handle the case of mspace since that element uses its own class and forbids child creation >+ in RenderMathMLSpace::isChildAllowed. >+ * mathml/MathMLTokenElement.h: Rename MathMLTextElement to MathMLTokenElement. >+ * mathml/mathtags.in: Ditto. >+ * rendering/mathml/RenderMathMLToken.cpp: Move inclusion of MathMLTokenElement.h and >+ implementation of element() here. >+ * rendering/mathml/RenderMathMLToken.h: Do not implement element() in the header so that >+ we only need need to predeclare MathMLTokenElement instead of including its header. >+ >+2016-08-04 Frederic Wang <fwang@igalia.com> >+ > Introduce a MathMLAnnotationElement class for the annotation/annotation-xml elements > https://bugs.webkit.org/show_bug.cgi?id=160540 > >diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >index ac93a58..b4de650 100644 >--- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj >+++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >@@ -6698,10 +6698,10 @@ > F98FFF4411A2676200F548E8 /* CSSOMUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F98FFF4211A2676200F548E8 /* CSSOMUtils.cpp */; }; > F98FFF4511A2676200F548E8 /* CSSOMUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = F98FFF4311A2676200F548E8 /* CSSOMUtils.h */; }; > F9F0ED7A0DB50CA200D16DB9 /* XMLHttpRequestProgressEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = F9F0ED770DB50CA200D16DB9 /* XMLHttpRequestProgressEvent.h */; }; >- FA654A6B1108ABED002615E0 /* MathMLTextElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FA654A691108ABED002615E0 /* MathMLTextElement.cpp */; }; >+ FA654A6B1108ABED002615E0 /* MathMLTokenElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FA654A691108ABED002615E0 /* MathMLTokenElement.cpp */; }; > FA654A6B1108ABED002616F1 /* MathMLOperatorElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FA654A691108ABED002616F1 /* MathMLOperatorElement.cpp */; }; > FA654A6B1108ABED002626F1 /* MathMLUnderOverElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FA654A691108ABED002626F1 /* MathMLUnderOverElement.cpp */; }; >- FA654A6C1108ABED002615E0 /* MathMLTextElement.h in Headers */ = {isa = PBXBuildFile; fileRef = FA654A6A1108ABED002615E0 /* MathMLTextElement.h */; }; >+ FA654A6C1108ABED002615E0 /* MathMLTokenElement.h in Headers */ = {isa = PBXBuildFile; fileRef = FA654A6A1108ABED002615E0 /* MathMLTokenElement.h */; }; > FA654A6C1108ABED002616F1 /* MathMLOperatorElement.h in Headers */ = {isa = PBXBuildFile; fileRef = FA654A6A1108ABED002616F1 /* MathMLOperatorElement.h */; }; > FA654A6C1108ABED002626F1 /* MathMLUnderOverElement.h in Headers */ = {isa = PBXBuildFile; fileRef = FA654A6A1108ABED002626F1 /* MathMLUnderOverElement.h */; }; > FABE72F41059C1EB00D888CC /* MathMLAnnotationElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FABE72ED1059C1EB00D888CC /* MathMLAnnotationElement.cpp */; }; >@@ -14664,10 +14664,10 @@ > F9F0ED780DB50CA200D16DB9 /* XMLHttpRequestProgressEvent.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = XMLHttpRequestProgressEvent.idl; sourceTree = "<group>"; }; > FA654A631108ABB7002615E0 /* mathml.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = mathml.css; sourceTree = "<group>"; }; > FA654A671108ABE2002615E0 /* mathattrs.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = mathattrs.in; sourceTree = "<group>"; }; >- FA654A691108ABED002615E0 /* MathMLTextElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MathMLTextElement.cpp; sourceTree = "<group>"; }; >+ FA654A691108ABED002615E0 /* MathMLTokenElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MathMLTokenElement.cpp; sourceTree = "<group>"; }; > FA654A691108ABED002616F1 /* MathMLOperatorElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MathMLOperatorElement.cpp; sourceTree = "<group>"; }; > FA654A691108ABED002626F1 /* MathMLUnderOverElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MathMLUnderOverElement.cpp; sourceTree = "<group>"; }; >- FA654A6A1108ABED002615E0 /* MathMLTextElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MathMLTextElement.h; sourceTree = "<group>"; }; >+ FA654A6A1108ABED002615E0 /* MathMLTokenElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MathMLTokenElement.h; sourceTree = "<group>"; }; > FA654A6A1108ABED002616F1 /* MathMLOperatorElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MathMLOperatorElement.h; sourceTree = "<group>"; }; > FA654A6A1108ABED002626F1 /* MathMLUnderOverElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MathMLUnderOverElement.h; sourceTree = "<group>"; }; > FA6E466FCD0418A9966A5B60 /* DNSResolveQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DNSResolveQueue.h; sourceTree = "<group>"; }; >@@ -24323,8 +24323,8 @@ > 59780849D41E6F65D81198BC /* MathMLSelectElement.h */, > 4FA65A691108ABED002615E0 /* MathMLSpaceElement.cpp */, > 4FA65A6A1108ABED002615E0 /* MathMLSpaceElement.h */, >- FA654A691108ABED002615E0 /* MathMLTextElement.cpp */, >- FA654A6A1108ABED002615E0 /* MathMLTextElement.h */, >+ FA654A691108ABED002615E0 /* MathMLTokenElement.cpp */, >+ FA654A6A1108ABED002615E0 /* MathMLTokenElement.h */, > FA654A691108ABED002626F1 /* MathMLUnderOverElement.cpp */, > FA654A6A1108ABED002626F1 /* MathMLUnderOverElement.h */, > FABE72F31059C1EB00D999DD /* mathtags.in */, >@@ -26729,7 +26729,7 @@ > FA654A6C1108ABED002616F1 /* MathMLOperatorElement.h in Headers */, > 4FA65A6C1108ABED002615E0 /* MathMLSpaceElement.h in Headers */, > 439176E012DA25E17BAF80A2 /* MathMLStyle.h in Headers */, >- FA654A6C1108ABED002615E0 /* MathMLTextElement.h in Headers */, >+ FA654A6C1108ABED002615E0 /* MathMLTokenElement.h in Headers */, > FA654A6C1108ABED002626F1 /* MathMLUnderOverElement.h in Headers */, > 439046EA12DA25E812AF80AC /* MathOperator.h in Headers */, > 49D5DC2C0F423A73008F20FD /* Matrix3DTransformOperation.h in Headers */, >@@ -30560,7 +30560,7 @@ > FED48390CED66C3255F72C59 /* MathMLSelectElement.cpp in Sources */, > 4FA65A6B1108ABED002615E0 /* MathMLSpaceElement.cpp in Sources */, > 439176DF12DA25E17BAF80A2 /* MathMLStyle.cpp in Sources */, >- FA654A6B1108ABED002615E0 /* MathMLTextElement.cpp in Sources */, >+ FA654A6B1108ABED002615E0 /* MathMLTokenElement.cpp in Sources */, > FA654A6B1108ABED002626F1 /* MathMLUnderOverElement.cpp in Sources */, > 439046E912DA25E812AF80AC /* MathOperator.cpp in Sources */, > 49D5DC2B0F423A73008F20FD /* Matrix3DTransformOperation.cpp in Sources */, >diff --git a/Source/WebCore/mathml/MathMLOperatorElement.cpp b/Source/WebCore/mathml/MathMLOperatorElement.cpp >index 64621f6..45fc783 100644 >--- a/Source/WebCore/mathml/MathMLOperatorElement.cpp >+++ b/Source/WebCore/mathml/MathMLOperatorElement.cpp >@@ -38,7 +38,7 @@ using namespace MathMLNames; > using namespace MathMLOperatorDictionary; > > MathMLOperatorElement::MathMLOperatorElement(const QualifiedName& tagName, Document& document) >- : MathMLTextElement(tagName, document) >+ : MathMLTokenElement(tagName, document) > { > } > >@@ -219,7 +219,7 @@ void MathMLOperatorElement::childrenChanged(const ChildChange& change) > m_operatorChar = Nullopt; > m_dictionaryProperty = Nullopt; > m_properties.dirtyFlags = MathMLOperatorDictionary::allFlags; >- MathMLTextElement::childrenChanged(change); >+ MathMLTokenElement::childrenChanged(change); > } > > static Optional<MathMLOperatorDictionary::Flag> attributeNameToPropertyFlag(const QualifiedName& name) >@@ -262,7 +262,7 @@ void MathMLOperatorElement::parseAttribute(const QualifiedName& name, const Atom > return; > } > >- MathMLTextElement::parseAttribute(name, value); >+ MathMLTokenElement::parseAttribute(name, value); > } > > RenderPtr<RenderElement> MathMLOperatorElement::createElementRenderer(RenderStyle&& style, const RenderTreePosition&) >diff --git a/Source/WebCore/mathml/MathMLOperatorElement.h b/Source/WebCore/mathml/MathMLOperatorElement.h >index cf9e728..940f42f 100644 >--- a/Source/WebCore/mathml/MathMLOperatorElement.h >+++ b/Source/WebCore/mathml/MathMLOperatorElement.h >@@ -27,11 +27,11 @@ > > #if ENABLE(MATHML) > #include "MathMLOperatorDictionary.h" >-#include "MathMLTextElement.h" >+#include "MathMLTokenElement.h" > > namespace WebCore { > >-class MathMLOperatorElement final : public MathMLTextElement { >+class MathMLOperatorElement final : public MathMLTokenElement { > public: > static Ref<MathMLOperatorElement> create(const QualifiedName& tagName, Document&); > struct OperatorChar { >diff --git a/Source/WebCore/mathml/MathMLTextElement.cpp b/Source/WebCore/mathml/MathMLTextElement.cpp >deleted file mode 100644 >index 4f4dcf8..0000000 >--- a/Source/WebCore/mathml/MathMLTextElement.cpp >+++ /dev/null >@@ -1,94 +0,0 @@ >-/* >- * Copyright (C) 2009 Alex Milowski (alex@milowski.com). All rights reserved. >- * Copyright (C) 2010 Apple Inc. 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 "MathMLTextElement.h" >- >-#include "MathMLNames.h" >-#include "RenderMathMLToken.h" >- >-namespace WebCore { >- >-using namespace MathMLNames; >- >-MathMLTextElement::MathMLTextElement(const QualifiedName& tagName, Document& document) >- : MathMLElement(tagName, document) >-{ >- setHasCustomStyleResolveCallbacks(); >-} >- >-Ref<MathMLTextElement> MathMLTextElement::create(const QualifiedName& tagName, Document& document) >-{ >- return adoptRef(*new MathMLTextElement(tagName, document)); >-} >- >-void MathMLTextElement::didAttachRenderers() >-{ >- MathMLElement::didAttachRenderers(); >- if (is<RenderMathMLToken>(renderer())) >- downcast<RenderMathMLToken>(*renderer()).updateTokenContent(); >-} >- >-void MathMLTextElement::childrenChanged(const ChildChange& change) >-{ >- MathMLElement::childrenChanged(change); >- if (is<RenderMathMLToken>(renderer())) >- downcast<RenderMathMLToken>(*renderer()).updateTokenContent(); >-} >- >-void MathMLTextElement::parseAttribute(const QualifiedName& name, const AtomicString& value) >-{ >- if (name == mathvariantAttr) { >- m_mathVariant = Nullopt; >- if (renderer()) >- MathMLStyle::resolveMathMLStyleTree(renderer()); >- } >- >- MathMLElement::parseAttribute(name, value); >-} >- >-RenderPtr<RenderElement> MathMLTextElement::createElementRenderer(RenderStyle&& style, const RenderTreePosition&) >-{ >- ASSERT(hasTagName(MathMLNames::miTag) || hasTagName(MathMLNames::mnTag) || hasTagName(MathMLNames::msTag) || hasTagName(MathMLNames::mtextTag)); >- >- return createRenderer<RenderMathMLToken>(*this, WTFMove(style)); >-} >- >-bool MathMLTextElement::childShouldCreateRenderer(const Node& child) const >-{ >- if (hasTagName(MathMLNames::mspaceTag)) >- return false; >- >- // The HTML specification defines <mi>, <mo>, <mn>, <ms> and <mtext> as insertion points. >- return isPhrasingContent(child) && StyledElement::childShouldCreateRenderer(child); >-} >- >-} >- >-#endif // ENABLE(MATHML) >diff --git a/Source/WebCore/mathml/MathMLTextElement.h b/Source/WebCore/mathml/MathMLTextElement.h >deleted file mode 100644 >index 421ff9e..0000000 >--- a/Source/WebCore/mathml/MathMLTextElement.h >+++ /dev/null >@@ -1,57 +0,0 @@ >-/* >- * Copyright (C) 2009 Alex Milowski (alex@milowski.com). 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 MathMLTextElement : public MathMLElement { >-public: >- static Ref<MathMLTextElement> create(const QualifiedName& tagName, Document&); >- bool acceptsMathVariantAttribute() final { return true; } >- >-protected: >- MathMLTextElement(const QualifiedName& tagName, Document&); >- void childrenChanged(const ChildChange&) override; >- void parseAttribute(const QualifiedName&, const AtomicString&) override; >- >-private: >- RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) override; >- bool childShouldCreateRenderer(const Node&) const final; >- >- void didAttachRenderers() final; >- >- bool isMathMLToken() const final { return true; } >- bool isPresentationMathML() const final { return true; } >-}; >- >-} >- >-#endif // ENABLE(MATHML) >diff --git a/Source/WebCore/mathml/MathMLTokenElement.cpp b/Source/WebCore/mathml/MathMLTokenElement.cpp >new file mode 100644 >index 0000000..5766a48 >--- /dev/null >+++ b/Source/WebCore/mathml/MathMLTokenElement.cpp >@@ -0,0 +1,90 @@ >+/* >+ * Copyright (C) 2009 Alex Milowski (alex@milowski.com). All rights reserved. >+ * Copyright (C) 2010 Apple Inc. 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 "MathMLTokenElement.h" >+ >+#include "MathMLNames.h" >+#include "RenderMathMLToken.h" >+ >+namespace WebCore { >+ >+using namespace MathMLNames; >+ >+MathMLTokenElement::MathMLTokenElement(const QualifiedName& tagName, Document& document) >+ : MathMLElement(tagName, document) >+{ >+ setHasCustomStyleResolveCallbacks(); >+} >+ >+Ref<MathMLTokenElement> MathMLTokenElement::create(const QualifiedName& tagName, Document& document) >+{ >+ return adoptRef(*new MathMLTokenElement(tagName, document)); >+} >+ >+void MathMLTokenElement::didAttachRenderers() >+{ >+ MathMLElement::didAttachRenderers(); >+ if (is<RenderMathMLToken>(renderer())) >+ downcast<RenderMathMLToken>(*renderer()).updateTokenContent(); >+} >+ >+void MathMLTokenElement::childrenChanged(const ChildChange& change) >+{ >+ MathMLElement::childrenChanged(change); >+ if (is<RenderMathMLToken>(renderer())) >+ downcast<RenderMathMLToken>(*renderer()).updateTokenContent(); >+} >+ >+void MathMLTokenElement::parseAttribute(const QualifiedName& name, const AtomicString& value) >+{ >+ if (name == mathvariantAttr) { >+ m_mathVariant = Nullopt; >+ if (renderer()) >+ MathMLStyle::resolveMathMLStyleTree(renderer()); >+ } >+ >+ MathMLElement::parseAttribute(name, value); >+} >+ >+RenderPtr<RenderElement> MathMLTokenElement::createElementRenderer(RenderStyle&& style, const RenderTreePosition&) >+{ >+ ASSERT(hasTagName(MathMLNames::miTag) || hasTagName(MathMLNames::mnTag) || hasTagName(MathMLNames::msTag) || hasTagName(MathMLNames::mtextTag)); >+ >+ return createRenderer<RenderMathMLToken>(*this, WTFMove(style)); >+} >+ >+bool MathMLTokenElement::childShouldCreateRenderer(const Node& child) const >+{ >+ // The HTML specification defines <mi>, <mo>, <mn>, <ms> and <mtext> as insertion points. >+ return isPhrasingContent(child) && StyledElement::childShouldCreateRenderer(child); >+} >+ >+} >+ >+#endif // ENABLE(MATHML) >diff --git a/Source/WebCore/mathml/MathMLTokenElement.h b/Source/WebCore/mathml/MathMLTokenElement.h >new file mode 100644 >index 0000000..c9ce84d >--- /dev/null >+++ b/Source/WebCore/mathml/MathMLTokenElement.h >@@ -0,0 +1,57 @@ >+/* >+ * Copyright (C) 2009 Alex Milowski (alex@milowski.com). 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 MathMLTokenElement : public MathMLElement { >+public: >+ static Ref<MathMLTokenElement> create(const QualifiedName& tagName, Document&); >+ bool acceptsMathVariantAttribute() final { return true; } >+ >+protected: >+ MathMLTokenElement(const QualifiedName& tagName, Document&); >+ void childrenChanged(const ChildChange&) override; >+ void parseAttribute(const QualifiedName&, const AtomicString&) override; >+ >+private: >+ RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) override; >+ bool childShouldCreateRenderer(const Node&) const final; >+ >+ void didAttachRenderers() final; >+ >+ bool isMathMLToken() const final { return true; } >+ bool isPresentationMathML() const final { return true; } >+}; >+ >+} >+ >+#endif // ENABLE(MATHML) >diff --git a/Source/WebCore/mathml/mathtags.in b/Source/WebCore/mathml/mathtags.in >index 0937e4d..2a2f5ab 100644 >--- a/Source/WebCore/mathml/mathtags.in >+++ b/Source/WebCore/mathml/mathtags.in >@@ -20,11 +20,11 @@ munder interfaceName=MathMLUnderOverElement > munderover interfaceName=MathMLUnderOverElement > msqrt interfaceName=MathMLInlineContainerElement > mroot interfaceName=MathMLInlineContainerElement >-mi interfaceName=MathMLTextElement >-mn interfaceName=MathMLTextElement >+mi interfaceName=MathMLTokenElement >+mn interfaceName=MathMLTokenElement > mo interfaceName=MathMLOperatorElement >-mtext interfaceName=MathMLTextElement >-ms interfaceName=MathMLTextElement >+mtext interfaceName=MathMLTokenElement >+ms interfaceName=MathMLTokenElement > mspace interfaceName=MathMLSpaceElement > msub interfaceName=MathMLScriptsElement > msup interfaceName=MathMLScriptsElement >diff --git a/Source/WebCore/rendering/mathml/RenderMathMLToken.cpp b/Source/WebCore/rendering/mathml/RenderMathMLToken.cpp >index 0398898..bfed295 100644 >--- a/Source/WebCore/rendering/mathml/RenderMathMLToken.cpp >+++ b/Source/WebCore/rendering/mathml/RenderMathMLToken.cpp >@@ -31,6 +31,7 @@ > > #include "MathMLElement.h" > #include "MathMLNames.h" >+#include "MathMLTokenElement.h" > #include "PaintInfo.h" > #include "RenderElement.h" > #include "RenderIterator.h" >@@ -53,6 +54,11 @@ RenderMathMLToken::RenderMathMLToken(Document& document, RenderStyle&& style) > { > } > >+MathMLTokenElement& RenderMathMLToken::element() >+{ >+ return static_cast<MathMLTokenElement&>(nodeForNonAnonymous()); >+} >+ > void RenderMathMLToken::updateTokenContent() > { > RenderMathMLBlock::updateFromElement(); >diff --git a/Source/WebCore/rendering/mathml/RenderMathMLToken.h b/Source/WebCore/rendering/mathml/RenderMathMLToken.h >index 9caf48c..9a71b66 100644 >--- a/Source/WebCore/rendering/mathml/RenderMathMLToken.h >+++ b/Source/WebCore/rendering/mathml/RenderMathMLToken.h >@@ -28,17 +28,18 @@ > > #if ENABLE(MATHML) > >-#include "MathMLTextElement.h" > #include "RenderMathMLBlock.h" > > namespace WebCore { > >+class MathMLTokenElement; >+ > class RenderMathMLToken : public RenderMathMLBlock { > public: > RenderMathMLToken(Element&, RenderStyle&&); > RenderMathMLToken(Document&, RenderStyle&&); > >- MathMLTextElement& element() { return static_cast<MathMLTextElement&>(nodeForNonAnonymous()); } >+ MathMLTokenElement& element(); > > virtual void updateTokenContent(); > void updateFromElement() override; >-- >2.8.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 160542
:
285310
|
286564