Move parsing of boolean operator properties into MathMLOperatorElement
authorfred.wang@free.fr <fred.wang@free.fr@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 2 Aug 2016 18:47:14 +0000 (18:47 +0000)
committerfred.wang@free.fr <fred.wang@free.fr@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 2 Aug 2016 18:47:14 +0000 (18:47 +0000)
commit2d7b34b5f619729bac89de8abd5b661303f026b5
tree38d1c1c59237f17c9604e9b158e481a8d23580c4
parentdcf97694e1e68f6e7de5d38b32d5ae201f6602f4
Move parsing of boolean operator properties into MathMLOperatorElement
https://bugs.webkit.org/show_bug.cgi?id=160190

Patch by Frederic Wang <fwang@igalia.com> on 2016-08-02
Reviewed by Darin Adler.

No new tests, already covered by existing tests.

* mathml/MathMLOperatorDictionary.h: Add a bit mask with all the property flags set.
* mathml/MathMLOperatorElement.cpp:
(WebCore::attributeNameToPropertyFlag): helper function to map from attribute name to flag.
(WebCore::MathMLOperatorElement::computeOperatorFlag): Helper function to update one
bit of m_properties.flags from the corresponding boolean attribute. The default value is
taken from the operator dictionary data stored in m_dictionaryProperty.flags.
(WebCore::MathMLOperatorElement::hasProperty): Returns whether the operator has a property,
parsing it again if the corresponding attribute is dirty.
(WebCore::MathMLOperatorElement::childrenChanged): Make all properties dirty.
(WebCore::propertyFlagToAttributeName): helper function to map from flag to attribute name.
(WebCore::MathMLOperatorElement::parseAttribute): Make all properties dirty if the form
attribute changed. Make each property dirty when the corresponding attribute changed.
(WebCore::MathMLOperatorElement::flags): Deleted. Replaced with the finer hasProperty function.
* mathml/MathMLOperatorElement.h: Define new structure, member and functions to handle
operator properties.
* rendering/mathml/RenderMathMLFencedOperator.cpp:
(WebCore::RenderMathMLFencedOperator::RenderMathMLFencedOperator): Move m_operatorFlags from
the base class to the derived class.
* rendering/mathml/RenderMathMLFencedOperator.h: Ditto.
* rendering/mathml/RenderMathMLOperator.cpp:
(WebCore::RenderMathMLOperator::RenderMathMLOperator): Ditto.
(WebCore::RenderMathMLOperator::hasOperatorFlag): Just call hasOperatorFlag from the
MathMLOperatorElement class.
(WebCore::RenderMathMLOperator::setOperatorProperties): We do not initialize m_operatorFlags
since it has been removed from the base class. We also do not parse attributes since this
has been moved to the MathMLOperatorElement class.
(WebCore::RenderMathMLOperator::setOperatorFlagFromAttribute): Deleted.
(WebCore::RenderMathMLOperator::setOperatorFlagFromAttributeValue): Deleted.
* rendering/mathml/RenderMathMLOperator.h: Move m_operatorFlags from the base class to the
derived class, remove some parsing helper functions and update hasOperatorFlag to make it
overridable.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204032 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/mathml/MathMLOperatorDictionary.h
Source/WebCore/mathml/MathMLOperatorElement.cpp
Source/WebCore/mathml/MathMLOperatorElement.h
Source/WebCore/rendering/mathml/RenderMathMLFencedOperator.cpp
Source/WebCore/rendering/mathml/RenderMathMLFencedOperator.h
Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp
Source/WebCore/rendering/mathml/RenderMathMLOperator.h