summaryrefslogtreecommitdiff
path: root/Source/WebCore/mathml/MathMLMencloseElement.h
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
commit1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch)
tree46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WebCore/mathml/MathMLMencloseElement.h
parent32761a6cee1d0dee366b885b7b9c777e67885688 (diff)
downloadWebKitGtk-tarball-master.tar.gz
Diffstat (limited to 'Source/WebCore/mathml/MathMLMencloseElement.h')
-rw-r--r--[-rwxr-xr-x]Source/WebCore/mathml/MathMLMencloseElement.h54
1 files changed, 32 insertions, 22 deletions
diff --git a/Source/WebCore/mathml/MathMLMencloseElement.h b/Source/WebCore/mathml/MathMLMencloseElement.h
index 3c0ee9095..da1d2a746 100755..100644
--- a/Source/WebCore/mathml/MathMLMencloseElement.h
+++ b/Source/WebCore/mathml/MathMLMencloseElement.h
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2014 Gurpreet Kaur (k.gurpreet@samsung.com). 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
@@ -23,39 +24,48 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef MathMLMencloseElement_h
-#define MathMLMencloseElement_h
+#pragma once
#if ENABLE(MATHML)
-#include "MathMLInlineContainerElement.h"
+
+#include "Element.h"
+#include "MathMLRowElement.h"
namespace WebCore {
-class MathMLMencloseElement final: public MathMLInlineContainerElement {
+class MathMLMencloseElement final: public MathMLRowElement {
public:
- static PassRefPtr<MathMLMencloseElement> create(const QualifiedName& tagName, Document&);
- const Vector<String>& notationValues() const { return m_notationValues; }
- bool isRadical() const { return m_isRadicalValue; }
+ static Ref<MathMLMencloseElement> create(const QualifiedName& tagName, Document&);
+
+ enum MencloseNotationFlag {
+ LongDiv = 1 << 1,
+ RoundedBox = 1 << 2,
+ Circle = 1 << 3,
+ Left = 1 << 4,
+ Right = 1 << 5,
+ Top = 1 << 6,
+ Bottom = 1 << 7,
+ UpDiagonalStrike = 1 << 8,
+ DownDiagonalStrike = 1 << 9,
+ VerticalStrike = 1 << 10,
+ HorizontalStrike = 1 << 11,
+ UpDiagonalArrow = 1 << 12, // FIXME: updiagonalarrow is not implemented. See http://wkb.ug/127466
+ PhasorAngle = 1 << 13 // FIXME: phasorangle is not implemented. See http://wkb.ug/127466
+ // We do not implement the Radical notation. Authors should instead use the <msqrt> element.
+ };
+ bool hasNotation(MencloseNotationFlag);
private:
MathMLMencloseElement(const QualifiedName&, Document&);
- virtual RenderPtr<RenderElement> createElementRenderer(PassRef<RenderStyle>) override;
- virtual bool isPresentationAttribute(const QualifiedName&) const override;
- virtual void collectStyleForPresentationAttribute(const QualifiedName&, const AtomicString&, MutableStyleProperties&) override;
- virtual void finishParsingChildren() override;
- String longDivLeftPadding() const;
-
- Vector<String> m_notationValues;
- bool m_isRadicalValue;
+ RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) final;
+ void parseAttribute(const QualifiedName&, const AtomicString&) final;
+ void parseNotationAttribute();
+ void clearNotations() { m_notationFlags = 0; }
+ void addNotation(MencloseNotationFlag notationFlag) { m_notationFlags.value() |= notationFlag; }
+ void addNotationFlags(StringView notation);
+ std::optional<uint16_t> m_notationFlags;
};
-inline MathMLMencloseElement* toMathMLMencloseElement(Node* node)
-{
- ASSERT_WITH_SECURITY_IMPLICATION(!node || (node->isElementNode() && toElement(node)->hasTagName(MathMLNames::mencloseTag)));
- return static_cast<MathMLMencloseElement*>(node);
-}
-
}
#endif // ENABLE(MATHML)
-#endif // MathMLMencloseElement_h