Move parsing of accentunder and accent attributes from renderer to element classes
authorfred.wang@free.fr <fred.wang@free.fr@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 22 Jul 2016 05:33:01 +0000 (05:33 +0000)
committerfred.wang@free.fr <fred.wang@free.fr@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 22 Jul 2016 05:33:01 +0000 (05:33 +0000)
commit562ff615690773647d1d93d1f01d5d46cfd60db9
tree751dcfe47880508d63d1af13e96d673361ce03b9
parentae2333de782836b413657e8eb6097a0a1a67a9d5
Move parsing of accentunder and accent attributes from renderer to element classes
https://bugs.webkit.org/show_bug.cgi?id=159625

Patch by Frederic Wang <fwang@igalia.com> on 2016-07-21
Reviewed by Brent Fulgham.

We introduce a new MathMLUnderOverElement that is used for elements munder, mover and
munderover in order to create RenderMathMLUnderOver and parse and expose the values of the
accent and accentunder attributes. This is one more step toward moving MathML attribute
parsing to the DOM (bug 156536). We also do minor clean-up for this and previous renderer
classes that no longer do attribute parsing: the MathMLNames namespace is no longer necessary
and constructors can take a more accurate element type.

No new tests, already covered by existing test.

* CMakeLists.txt: Add MathMLUnderOverElement files.
* WebCore.xcodeproj/project.pbxproj: Ditto.
* mathml/MathMLAllInOne.cpp: Ditto.
* mathml/MathMLElement.cpp:
(WebCore::MathMLElement::cachedBooleanAttribute): Add parsing of boolean attributes.
* mathml/MathMLElement.h: New type and helper functions for boolean attributes.
* mathml/MathMLInlineContainerElement.cpp:
(WebCore::MathMLInlineContainerElement::createElementRenderer): Remove handling of
under/over/underover elements.
* mathml/MathMLScriptsElement.cpp:
(WebCore::MathMLScriptsElement::MathMLScriptsElement): Remove inline keyword to avoid link
errors now that MathMLUnderOverElement overrides that class.
* mathml/MathMLScriptsElement.h: Allow MathMLUnderOverElement to override this class.
* mathml/MathMLUnderOverElement.cpp:
(WebCore::MathMLUnderOverElement::MathMLUnderOverElement):
(WebCore::MathMLUnderOverElement::create):
(WebCore::MathMLUnderOverElement::accent): Helper function to access the accent value.
(WebCore::MathMLUnderOverElement::accentUnder): Helper function to access the accentunder value.
(WebCore::MathMLUnderOverElement::parseAttribute): Make accent and accentunder dirty.
(WebCore::MathMLUnderOverElement::createElementRenderer): Create RenderMathMLUnderOver
* mathml/MathMLUnderOverElement.h:
* mathml/mathtags.in: Map under/over/underover to MathMLUnderOverElement.
* rendering/mathml/RenderMathMLFraction.cpp: Remove MathMLNames and make the constructor
take a MathMLFractionElement.
(WebCore::RenderMathMLFraction::RenderMathMLFraction):
* rendering/mathml/RenderMathMLFraction.h:
* rendering/mathml/RenderMathMLPadded.cpp: Remove MathMLNames and make the constructor
take a MathMLPaddedElement.
(WebCore::RenderMathMLPadded::RenderMathMLPadded):
* rendering/mathml/RenderMathMLPadded.h:
* rendering/mathml/RenderMathMLScripts.cpp: Remove MathMLNames and make the constructor
take a MathMLScriptsElement. Also rename scriptsElement() to element().
(WebCore::RenderMathMLScripts::RenderMathMLScripts):
(WebCore::RenderMathMLScripts::element):
(WebCore::RenderMathMLScripts::getScriptMetricsAndLayoutIfNeeded):
(WebCore::RenderMathMLScripts::scriptsElement): Deleted.
* rendering/mathml/RenderMathMLScripts.h:
* rendering/mathml/RenderMathMLUnderOver.cpp: Remove MathMLNames and make the constructor
take a RenderMathMLUnderOver.
(WebCore::RenderMathMLUnderOver::RenderMathMLUnderOver):
(WebCore::RenderMathMLUnderOver::element):
(WebCore::RenderMathMLUnderOver::hasAccent): Use the helper functions for accent and accentunder.
* rendering/mathml/RenderMathMLUnderOver.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@203553 268f45cc-cd09-0410-ab3c-d52691b4dbfc
21 files changed:
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/mathml/MathMLAllInOne.cpp
Source/WebCore/mathml/MathMLElement.cpp
Source/WebCore/mathml/MathMLElement.h
Source/WebCore/mathml/MathMLInlineContainerElement.cpp
Source/WebCore/mathml/MathMLScriptsElement.cpp
Source/WebCore/mathml/MathMLScriptsElement.h
Source/WebCore/mathml/MathMLUnderOverElement.cpp [new file with mode: 0644]
Source/WebCore/mathml/MathMLUnderOverElement.h [new file with mode: 0644]
Source/WebCore/mathml/mathtags.in
Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp
Source/WebCore/rendering/mathml/RenderMathMLFraction.h
Source/WebCore/rendering/mathml/RenderMathMLPadded.cpp
Source/WebCore/rendering/mathml/RenderMathMLPadded.h
Source/WebCore/rendering/mathml/RenderMathMLScripts.cpp
Source/WebCore/rendering/mathml/RenderMathMLScripts.h
Source/WebCore/rendering/mathml/RenderMathMLSpace.cpp
Source/WebCore/rendering/mathml/RenderMathMLUnderOver.cpp
Source/WebCore/rendering/mathml/RenderMathMLUnderOver.h