Implement the MathML Operator Dictionary.
authorfred.wang@free.fr <fred.wang@free.fr@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 20 Feb 2014 08:28:42 +0000 (08:28 +0000)
committerfred.wang@free.fr <fred.wang@free.fr@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 20 Feb 2014 08:28:42 +0000 (08:28 +0000)
commit02db87fc1d5dc9f9e2b6f156019a6b8706359cec
tree6b7b1ccf171d6cf0aa89f3e7e2594e6be1fe51ef
parenta39fe00f1696b7a9df43f1587068ced9dbb6c395
Implement the MathML Operator Dictionary.
https://bugs.webkit.org/show_bug.cgi?id=99620

Reviewed by Chris Fleizach.

Source/WebCore:

The MathML Operator Dictionary is implemented and the corresponding mo
attributes are parsed. Currently, only the stretchy property is used for
the visual rendering and the fence/separators properties are used by the
accessibility code. Very basic heuristics to determine the form are also
added.

Tests: mathml/presentation/mo-form-fallback.html
       mathml/presentation/mo-form-stretchy.html
       mathml/presentation/mo-invalid-attributes.html

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::isMathFenceOperator):
(WebCore::AccessibilityRenderObject::isMathSeparatorOperator):
* mathml/mathattrs.in:
* rendering/mathml/RenderMathMLFenced.cpp:
(WebCore::RenderMathMLFenced::createMathMLOperator):
(WebCore::RenderMathMLFenced::makeFences):
(WebCore::RenderMathMLFenced::addChild):
* rendering/mathml/RenderMathMLFenced.h:
* rendering/mathml/RenderMathMLOperator.cpp:
(WebCore::MathMLOperatorDictionary::ExtractKey):
(WebCore::MathMLOperatorDictionary::ExtractChar):
(WebCore::RenderMathMLOperator::RenderMathMLOperator):
(WebCore::RenderMathMLOperator::setOperatorFlagFromAttribute):
(WebCore::RenderMathMLOperator::setOperatorPropertiesFromOpDictEntry):
(WebCore::RenderMathMLOperator::SetOperatorProperties):
(WebCore::RenderMathMLOperator::advanceForCharacter):
(WebCore::RenderMathMLOperator::computePreferredLogicalWidths):
(WebCore::RenderMathMLOperator::updateFromElement):
(WebCore::RenderMathMLOperator::shouldAllowStretching):
(WebCore::RenderMathMLOperator::updateStyle):
* rendering/mathml/RenderMathMLOperator.h:

LayoutTests:

* mathml/presentation/mo-form-fallback-expected.html: Added.
* mathml/presentation/mo-form-fallback.html: Added.
* mathml/presentation/mo-form-stretchy-expected.html: Added.
* mathml/presentation/mo-form-stretchy.html: Added.
* mathml/presentation/mo-invalid-attributes-expected.html: Added.
* mathml/presentation/mo-invalid-attributes.html: Added.
* mathml/presentation/mo-stretch.html: add an explicit stretchy attribute on the &DoubleVerticalBar; which is actually not a delimiter.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@164418 268f45cc-cd09-0410-ab3c-d52691b4dbfc
15 files changed:
LayoutTests/ChangeLog
LayoutTests/mathml/presentation/mo-form-fallback-expected.html [new file with mode: 0644]
LayoutTests/mathml/presentation/mo-form-fallback.html [new file with mode: 0644]
LayoutTests/mathml/presentation/mo-form-stretchy-expected.html [new file with mode: 0644]
LayoutTests/mathml/presentation/mo-form-stretchy.html [new file with mode: 0644]
LayoutTests/mathml/presentation/mo-invalid-attributes-expected.html [new file with mode: 0644]
LayoutTests/mathml/presentation/mo-invalid-attributes.html [new file with mode: 0644]
LayoutTests/mathml/presentation/mo-stretch.html
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AccessibilityRenderObject.cpp
Source/WebCore/mathml/mathattrs.in
Source/WebCore/rendering/mathml/RenderMathMLFenced.cpp
Source/WebCore/rendering/mathml/RenderMathMLFenced.h
Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp
Source/WebCore/rendering/mathml/RenderMathMLOperator.h