Changeset 203688 in webkit
- Timestamp:
- Jul 25, 2016 10:13:04 AM (8 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 9 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/CMakeLists.txt
r203675 r203688 1990 1990 mathml/MathMLMencloseElement.cpp 1991 1991 mathml/MathMLOperatorDictionary.cpp 1992 mathml/MathMLOperatorElement.cpp 1992 1993 mathml/MathMLPaddedElement.cpp 1993 1994 mathml/MathMLScriptsElement.cpp -
trunk/Source/WebCore/ChangeLog
r203686 r203688 1 2016-07-25 Frederic Wang <fwang@igalia.com> 2 3 Introduce a MathMLOperatorElement class 4 https://bugs.webkit.org/show_bug.cgi?id=160034 5 6 Reviewed by Darin Adler. 7 8 No new tests, rendering is unchaned. 9 10 * CMakeLists.txt: Add MathMLOperatorElement to the build file. 11 * WebCore.xcodeproj/project.pbxproj: Ditto. 12 * mathml/MathMLAllInOne.cpp: Ditto. 13 * mathml/MathMLOperatorElement.cpp: New DOM class for <mo> element. 14 (WebCore::MathMLOperatorElement::MathMLOperatorElement): 15 (WebCore::MathMLOperatorElement::create): 16 (WebCore::MathMLOperatorElement::parseAttribute): Handle mo attributes. 17 (WebCore::MathMLOperatorElement::createElementRenderer): Create RenderMathMLOperator. 18 * mathml/MathMLOperatorElement.h: Declare a class deriving from MathMLTextElement. 19 * mathml/MathMLTextElement.cpp: Remove all the RenderMathMLOperator parts. 20 (WebCore::MathMLTextElement::MathMLTextElement): Remove inline keyword so that the class can 21 be overriden. 22 (WebCore::MathMLTextElement::parseAttribute): Remove code handled in MathMLOperatorElement. 23 (WebCore::MathMLTextElement::createElementRenderer): Ditto. 24 * mathml/MathMLTextElement.h: Make class and members overridable. 25 * mathml/mathtags.in: Map mo to MathMLOperatorElement. 26 * rendering/mathml/RenderMathMLOperator.cpp: 27 (WebCore::RenderMathMLOperator::RenderMathMLOperator): Make the constructor take a 28 MathMLOperatorElement. 29 * rendering/mathml/RenderMathMLOperator.h: Ditto. 30 1 31 2016-07-25 Darin Adler <darin@apple.com> 2 32 -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r203632 r203688 6906 6906 F98FFF4511A2676200F548E8 /* CSSOMUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = F98FFF4311A2676200F548E8 /* CSSOMUtils.h */; }; 6907 6907 F9F0ED7A0DB50CA200D16DB9 /* XMLHttpRequestProgressEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = F9F0ED770DB50CA200D16DB9 /* XMLHttpRequestProgressEvent.h */; }; 6908 FA654A6B1108ABED002616F1 /* MathMLOperatorElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FA654A691108ABED002616F1 /* MathMLOperatorElement.cpp */; }; 6909 FA654A6C1108ABED002616F1 /* MathMLOperatorElement.h in Headers */ = {isa = PBXBuildFile; fileRef = FA654A6A1108ABED002616F1 /* MathMLOperatorElement.h */; }; 6908 6910 FA654A6B1108ABED002615E0 /* MathMLTextElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FA654A691108ABED002615E0 /* MathMLTextElement.cpp */; }; 6909 6911 FA654A6C1108ABED002615E0 /* MathMLTextElement.h in Headers */ = {isa = PBXBuildFile; fileRef = FA654A6A1108ABED002615E0 /* MathMLTextElement.h */; }; … … 15086 15088 FA654A631108ABB7002615E0 /* mathml.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = mathml.css; sourceTree = "<group>"; }; 15087 15089 FA654A671108ABE2002615E0 /* mathattrs.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = mathattrs.in; sourceTree = "<group>"; }; 15090 FA654A691108ABED002616F1 /* MathMLOperatorElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MathMLOperatorElement.cpp; sourceTree = "<group>"; }; 15091 FA654A6A1108ABED002616F1 /* MathMLOperatorElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MathMLOperatorElement.h; sourceTree = "<group>"; }; 15088 15092 FA654A691108ABED002615E0 /* MathMLTextElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MathMLTextElement.cpp; sourceTree = "<group>"; }; 15089 15093 FA654A6A1108ABED002615E0 /* MathMLTextElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MathMLTextElement.h; sourceTree = "<group>"; }; … … 24911 24915 4FA65A691108ABED002615E0 /* MathMLSpaceElement.cpp */, 24912 24916 4FA65A6A1108ABED002615E0 /* MathMLSpaceElement.h */, 24917 FA654A691108ABED002616F1 /* MathMLOperatorElement.cpp */, 24918 FA654A6A1108ABED002616F1 /* MathMLOperatorElement.h */, 24913 24919 FA654A691108ABED002615E0 /* MathMLTextElement.cpp */, 24914 24920 FA654A6A1108ABED002615E0 /* MathMLTextElement.h */, … … 27452 27458 439176E012DA25E17BAF80A2 /* MathMLStyle.h in Headers */, 27453 27459 4FA65A6C1108ABED002615E0 /* MathMLSpaceElement.h in Headers */, 27460 FA654A6C1108ABED002616F1 /* MathMLOperatorElement.h in Headers */, 27454 27461 FA654A6C1108ABED002615E0 /* MathMLTextElement.h in Headers */, 27455 27462 FA654A6C1108ABED002626F1 /* MathMLUnderOverElement.h in Headers */, … … 31285 31292 FED48390CED66C3255F72C59 /* MathMLSelectElement.cpp in Sources */, 31286 31293 4FA65A6B1108ABED002615E0 /* MathMLSpaceElement.cpp in Sources */, 31294 FA654A6B1108ABED002616F1 /* MathMLOperatorElement.cpp in Sources */, 31287 31295 FA654A6B1108ABED002615E0 /* MathMLTextElement.cpp in Sources */, 31288 31296 FA654A6B1108ABED002626F1 /* MathMLUnderOverElement.cpp in Sources */, -
trunk/Source/WebCore/mathml/MathMLAllInOne.cpp
r203553 r203688 32 32 #include "MathMLMencloseElement.cpp" 33 33 #include "MathMLOperatorDictionary.cpp" 34 #include "MathMLOperatorElement.cpp" 34 35 #include "MathMLPaddedElement.cpp" 35 36 #include "MathMLScriptsElement.cpp" -
trunk/Source/WebCore/mathml/MathMLOperatorElement.cpp
r203687 r203688 1 1 /* 2 * Copyright (C) 2009 Alex Milowski (alex@milowski.com). All rights reserved. 3 * Copyright (C) 2010 Apple Inc. All rights reserved. 4 * Copyright (C) 2016 Igalia S.L. 2 * Copyright (C) 2016 Igalia S.L. All rights reserved. 5 3 * 6 4 * Redistribution and use in source and binary forms, with or without … … 24 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 * 26 25 */ 27 26 28 # pragma once27 #include "config.h" 29 28 30 29 #if ENABLE(MATHML) 31 #include "MathMLElement.h" 30 #include "MathMLOperatorElement.h" 31 32 #include "RenderMathMLOperator.h" 32 33 33 34 namespace WebCore { 34 35 35 class MathMLTextElement final : public MathMLElement { 36 public: 37 static Ref<MathMLTextElement> create(const QualifiedName& tagName, Document&); 38 bool acceptsMathVariantAttribute() final { return true; } 36 using namespace MathMLNames; 39 37 40 private: 41 MathMLTextElement(const QualifiedName& tagName, Document&); 38 MathMLOperatorElement::MathMLOperatorElement(const QualifiedName& tagName, Document& document) 39 : MathMLTextElement(tagName, document) 40 { 41 } 42 42 43 RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) final; 44 bool childShouldCreateRenderer(const Node&) const final; 43 Ref<MathMLOperatorElement> MathMLOperatorElement::create(const QualifiedName& tagName, Document& document) 44 { 45 return adoptRef(*new MathMLOperatorElement(tagName, document)); 46 } 45 47 46 void childrenChanged(const ChildChange&) final; 47 void parseAttribute(const QualifiedName&, const AtomicString&) final; 48 void didAttachRenderers() final; 48 void MathMLOperatorElement::parseAttribute(const QualifiedName& name, const AtomicString& value) 49 { 50 if ((name == stretchyAttr || name == lspaceAttr || name == rspaceAttr || name == movablelimitsAttr) && renderer()) { 51 downcast<RenderMathMLOperator>(*renderer()).updateFromElement(); 52 return; 53 } 49 54 50 bool isPresentationMathML() const final { return true; } 51 }; 55 MathMLTextElement::parseAttribute(name, value); 56 } 57 58 RenderPtr<RenderElement> MathMLOperatorElement::createElementRenderer(RenderStyle&& style, const RenderTreePosition&) 59 { 60 ASSERT(hasTagName(MathMLNames::moTag)); 61 return createRenderer<RenderMathMLOperator>(*this, WTFMove(style)); 62 } 52 63 53 64 } -
trunk/Source/WebCore/mathml/MathMLOperatorElement.h
r203687 r203688 1 1 /* 2 * Copyright (C) 2009 Alex Milowski (alex@milowski.com). All rights reserved. 3 * Copyright (C) 2010 Apple Inc. All rights reserved. 4 * Copyright (C) 2016 Igalia S.L. 2 * Copyright (C) 2016 Igalia S.L. All rights reserved. 5 3 * 6 4 * Redistribution and use in source and binary forms, with or without … … 29 27 30 28 #if ENABLE(MATHML) 31 #include "MathML Element.h"29 #include "MathMLTextElement.h" 32 30 33 31 namespace WebCore { 34 32 35 class MathML TextElement final : public MathMLElement {33 class MathMLOperatorElement final : public MathMLTextElement { 36 34 public: 37 static Ref<MathMLTextElement> create(const QualifiedName& tagName, Document&); 38 bool acceptsMathVariantAttribute() final { return true; } 39 35 static Ref<MathMLOperatorElement> create(const QualifiedName& tagName, Document&); 40 36 private: 41 MathMLTextElement(const QualifiedName& tagName, Document&); 42 37 MathMLOperatorElement(const QualifiedName& tagName, Document&); 43 38 RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) final; 44 bool childShouldCreateRenderer(const Node&) const final;45 46 void childrenChanged(const ChildChange&) final;47 39 void parseAttribute(const QualifiedName&, const AtomicString&) final; 48 void didAttachRenderers() final;49 50 bool isPresentationMathML() const final { return true; }51 40 }; 52 41 -
trunk/Source/WebCore/mathml/MathMLTextElement.cpp
r203679 r203688 32 32 33 33 #include "MathMLNames.h" 34 #include "RenderMathMLOperator.h"35 34 #include "RenderMathMLToken.h" 36 35 … … 39 38 using namespace MathMLNames; 40 39 41 inlineMathMLTextElement::MathMLTextElement(const QualifiedName& tagName, Document& document)40 MathMLTextElement::MathMLTextElement(const QualifiedName& tagName, Document& document) 42 41 : MathMLElement(tagName, document) 43 42 { … … 66 65 void MathMLTextElement::parseAttribute(const QualifiedName& name, const AtomicString& value) 67 66 { 68 if (name == stretchyAttr || name == lspaceAttr || name == rspaceAttr || name == movablelimitsAttr) {69 if (is<RenderMathMLOperator>(renderer()))70 downcast<RenderMathMLOperator>(*renderer()).updateFromElement();71 return;72 }73 74 67 if (name == mathvariantAttr) { 75 68 m_mathVariant.dirty = true; … … 83 76 RenderPtr<RenderElement> MathMLTextElement::createElementRenderer(RenderStyle&& style, const RenderTreePosition& insertionPosition) 84 77 { 85 if (hasTagName(MathMLNames::moTag))86 return createRenderer<RenderMathMLOperator>(*this, WTFMove(style));87 78 if (hasTagName(MathMLNames::annotationTag)) 88 79 return MathMLElement::createElementRenderer(WTFMove(style), insertionPosition); -
trunk/Source/WebCore/mathml/MathMLTextElement.h
r203679 r203688 33 33 namespace WebCore { 34 34 35 class MathMLTextElement final: public MathMLElement {35 class MathMLTextElement : public MathMLElement { 36 36 public: 37 37 static Ref<MathMLTextElement> create(const QualifiedName& tagName, Document&); 38 38 bool acceptsMathVariantAttribute() final { return true; } 39 39 40 protected: 41 MathMLTextElement(const QualifiedName& tagName, Document&); 42 void parseAttribute(const QualifiedName&, const AtomicString&) override; 43 40 44 private: 41 MathMLTextElement(const QualifiedName& tagName, Document&); 42 43 RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) final; 45 RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) override; 44 46 bool childShouldCreateRenderer(const Node&) const final; 45 47 46 48 void childrenChanged(const ChildChange&) final; 47 void parseAttribute(const QualifiedName&, const AtomicString&) final;48 49 void didAttachRenderers() final; 49 50 -
trunk/Source/WebCore/mathml/mathtags.in
r203553 r203688 23 23 mi interfaceName=MathMLTextElement 24 24 mn interfaceName=MathMLTextElement 25 mo interfaceName=MathML TextElement25 mo interfaceName=MathMLOperatorElement 26 26 mtext interfaceName=MathMLTextElement 27 27 ms interfaceName=MathMLTextElement -
trunk/Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp
r203324 r203688 34 34 #include "FontSelector.h" 35 35 #include "MathMLNames.h" 36 #include "MathMLOperatorElement.h" 36 37 #include "PaintInfo.h" 37 38 #include "RenderBlockFlow.h" … … 47 48 using namespace MathMLNames; 48 49 49 RenderMathMLOperator::RenderMathMLOperator(MathML Element& element, RenderStyle&& style)50 RenderMathMLOperator::RenderMathMLOperator(MathMLOperatorElement& element, RenderStyle&& style) 50 51 : RenderMathMLToken(element, WTFMove(style)) 51 52 , m_stretchHeightAboveBaseline(0) -
trunk/Source/WebCore/rendering/mathml/RenderMathMLOperator.h
r203289 r203688 35 35 namespace WebCore { 36 36 37 class MathMLOperatorElement; 38 37 39 class RenderMathMLOperator final : public RenderMathMLToken { 38 40 public: 39 RenderMathMLOperator(MathML Element&, RenderStyle&&);41 RenderMathMLOperator(MathMLOperatorElement&, RenderStyle&&); 40 42 RenderMathMLOperator(Document&, RenderStyle&&, const String& operatorString, MathMLOperatorDictionary::Form, unsigned short flags = 0); 41 43
Note: See TracChangeset
for help on using the changeset viewer.