Share and improve extraction of character for operator and token elements
authorfred.wang@free.fr <fred.wang@free.fr@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 23 Aug 2016 13:36:26 +0000 (13:36 +0000)
committerfred.wang@free.fr <fred.wang@free.fr@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 23 Aug 2016 13:36:26 +0000 (13:36 +0000)
commitbe3f134d6b031bf51872e2b670d0a46eab647b10
tree6a976b2c006d421edd401bb598b0836c54866d90
parentb6583fb6b7fb31f360dccd3b03547eaa9d9d2ff0
Share and improve extraction of character for operator and token elements
https://bugs.webkit.org/show_bug.cgi?id=160462

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

No new tests, already covered by existing tests.

* mathml/MathMLElement.cpp:
(WebCore::MathMLElement::stripLeadingAndTrailingWhitespace): Make this a protected member of
MathMLElement so that it can be used in MathMLTokenElement.
(WebCore::skipLeadingAndTrailingWhitespace): Deleted.
* mathml/MathMLElement.h: Declare stripLeadingAndTrailingWhitespace.
* mathml/MathMLOperatorElement.cpp:
(WebCore::MathMLOperatorElement::parseOperatorChar): Use convertToSingleCodePoint to extract
a code point more efficiently. For now, we continue to only handle BMP characters.
* mathml/MathMLTokenElement.cpp:
(WebCore::MathMLTokenElement::convertToSingleCodePoint): Helper function to try and convert a
string to a single code point after having removed leading and trailing space.
* mathml/MathMLTokenElement.h: Declare convertToSingleCodePoint.
* rendering/mathml/RenderMathMLToken.cpp:
(WebCore::RenderMathMLToken::updateMathVariantGlyph): Use convertToSingleCodePoint to extract
a code point more efficiently.

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