From 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c Mon Sep 17 00:00:00 2001 From: Lorry Tar Creator Date: Tue, 27 Jun 2017 06:07:23 +0000 Subject: webkitgtk-2.16.5 --- Source/WebCore/mathml/MathMLMencloseElement.h | 54 ++++++++++++++++----------- 1 file changed, 32 insertions(+), 22 deletions(-) mode change 100755 => 100644 Source/WebCore/mathml/MathMLMencloseElement.h (limited to 'Source/WebCore/mathml/MathMLMencloseElement.h') diff --git a/Source/WebCore/mathml/MathMLMencloseElement.h b/Source/WebCore/mathml/MathMLMencloseElement.h old mode 100755 new mode 100644 index 3c0ee9095..da1d2a746 --- 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 create(const QualifiedName& tagName, Document&); - const Vector& notationValues() const { return m_notationValues; } - bool isRadical() const { return m_isRadicalValue; } + static Ref 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 element. + }; + bool hasNotation(MencloseNotationFlag); private: MathMLMencloseElement(const QualifiedName&, Document&); - virtual RenderPtr createElementRenderer(PassRef) 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 m_notationValues; - bool m_isRadicalValue; + RenderPtr 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 m_notationFlags; }; -inline MathMLMencloseElement* toMathMLMencloseElement(Node* node) -{ - ASSERT_WITH_SECURITY_IMPLICATION(!node || (node->isElementNode() && toElement(node)->hasTagName(MathMLNames::mencloseTag))); - return static_cast(node); -} - } #endif // ENABLE(MATHML) -#endif // MathMLMencloseElement_h -- cgit v1.2.1