Create a MathMLLength struct to handle the parsing of MathML length.
authorfred.wang@free.fr <fred.wang@free.fr@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Jul 2016 04:47:02 +0000 (04:47 +0000)
committerfred.wang@free.fr <fred.wang@free.fr@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Jul 2016 04:47:02 +0000 (04:47 +0000)
commit882c08b5ae7146aa0db49a5632345ba317d79840
tree42b40c0e122edf23f238889cd9fabee6020f294c
parentad1a2dec08381d1b499b9c0ec6b31885d058bcde
Create a MathMLLength struct to handle the parsing of MathML length.
https://bugs.webkit.org/show_bug.cgi?id=156792

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

We introduce a structure for MathML lengths that will be used in the future to store the
parsed values in the MathElement class. We also rewrite the parsing function for MathML
lengths in order to improve efficiency and code reuse. This function is moved into the
MathElement class and only the conversion to LayoutUnit remains in the renderer classes.

No new tests, already covered by existing tests.

* mathml/MathMLElement.cpp:
(WebCore::parseNamedSpace): Helper function to parse a named space.
(WebCore::MathMLElement::parseMathMLLength): Parsing function for MathML lengths.
* mathml/MathMLElement.h: Declare new function and structure to handle MathML lengths.
* rendering/mathml/RenderMathMLBlock.cpp:
(WebCore::toUserUnits): Helper function to resolve a MathML length.
(WebCore::parseMathMLLength): Remove the old parsing code and just use MathMLElement::parseMathMLLength and toUserUnits instead.
(WebCore::parseMathMLNamedSpace): Deleted.
* rendering/mathml/RenderMathMLBlock.h: Remove unused function.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@203106 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/mathml/MathMLElement.cpp
Source/WebCore/mathml/MathMLElement.h
Source/WebCore/rendering/mathml/RenderMathMLBlock.cpp
Source/WebCore/rendering/mathml/RenderMathMLBlock.h