Improve renderer classes for MathML Token elements.
authorfred.wang@free.fr <fred.wang@free.fr@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 11 Mar 2014 07:51:27 +0000 (07:51 +0000)
committerfred.wang@free.fr <fred.wang@free.fr@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 11 Mar 2014 07:51:27 +0000 (07:51 +0000)
commitf948c8490301d73a04d0e46bd6dee981d53ff9a1
treec731bc501de3d2b48e7b137efc6d7f30c5426424
parent6e6e0ecb98d613f7219e46519a86e753feb881b2
Improve renderer classes for MathML Token elements.
https://bugs.webkit.org/show_bug.cgi?id=124838

Reviewed by Chris Fleizach.

Source/WebCore:

This patch continues the refactoring of token elements that has been
started in bug 44208. The <mo> element now derives from the
RenderMathMLToken class, which was already used for the <mi> element.
The behavior of anonymous <mo> elements created by the <mfenced> element
is now more consistent with the one of "standard" <mo> elements and the
spacing around them is now handled in RenderMathMLOperator. This is a
first step towards fixing bugs 115787 and 118843. The only visible
rendering change is how <mfenced> open/close attributes handle
whitespace and multiple characters and some tests are added for that.
Other features are already covered by other tests. Finally, this also
removes some code from AccessibilityRenderObject that was used to
workaround issues with <mo> elements.

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::startOfContinuations):
(WebCore::AccessibilityRenderObject::textUnderElement):
(WebCore::AccessibilityRenderObject::isMathOperator):
(WebCore::AccessibilityRenderObject::isIgnoredElementWithinMathTree):
* mathml/MathMLTextElement.cpp:
(WebCore::MathMLTextElement::didAttachRenderers):
(WebCore::MathMLTextElement::childrenChanged):
* rendering/mathml/RenderMathMLBlock.cpp:
(WebCore::RenderMathMLBlock::RenderMathMLBlock):
* rendering/mathml/RenderMathMLBlock.h:
* rendering/mathml/RenderMathMLFenced.cpp:
(WebCore::RenderMathMLFenced::RenderMathMLFenced):
(WebCore::RenderMathMLFenced::updateFromElement):
(WebCore::RenderMathMLFenced::createMathMLOperator):
(WebCore::RenderMathMLFenced::makeFences):
(WebCore::RenderMathMLFenced::addChild):
* rendering/mathml/RenderMathMLFenced.h:
* rendering/mathml/RenderMathMLOperator.cpp:
(WebCore::RenderMathMLOperator::RenderMathMLOperator):
(WebCore::RenderMathMLOperator::setOperatorFlagFromAttribute):
(WebCore::RenderMathMLOperator::setOperatorPropertiesFromOpDictEntry):
(WebCore::RenderMathMLOperator::SetOperatorProperties):
(WebCore::RenderMathMLOperator::computePreferredLogicalWidths):
(WebCore::RenderMathMLOperator::rebuildTokenContent):
(WebCore::RenderMathMLOperator::updateTokenContent):
(WebCore::RenderMathMLOperator::updateStyle):
(WebCore::RenderMathMLOperator::firstLineBaseline):
(WebCore::RenderMathMLOperator::paint):
(WebCore::RenderMathMLOperator::paintChildren):
* rendering/mathml/RenderMathMLOperator.h:
* rendering/mathml/RenderMathMLToken.cpp:
(WebCore::RenderMathMLToken::createWrapperIfNeeded):

LayoutTests:

Two tests are added to fenced-mi in order to verify that the open/close
attributes of the mfenced element collapse whitespace and accept values
with multiple characters.

* mathml/presentation/fenced-mi-expected.html:
* mathml/presentation/fenced-mi.html:
* platform/mac/accessibility/mathml-elements.html: fix bad closing tag and disable the test for now.
* platform/mac/mathml/presentation/mo-stretch-expected.txt: update text reference.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@165436 268f45cc-cd09-0410-ab3c-d52691b4dbfc
16 files changed:
LayoutTests/ChangeLog
LayoutTests/mathml/presentation/fenced-mi-expected.html
LayoutTests/mathml/presentation/fenced-mi.html
LayoutTests/platform/mac/TestExpectations
LayoutTests/platform/mac/accessibility/mathml-elements.html
LayoutTests/platform/mac/mathml/presentation/mo-stretch-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AccessibilityRenderObject.cpp
Source/WebCore/mathml/MathMLTextElement.cpp
Source/WebCore/rendering/mathml/RenderMathMLBlock.cpp
Source/WebCore/rendering/mathml/RenderMathMLBlock.h
Source/WebCore/rendering/mathml/RenderMathMLFenced.cpp
Source/WebCore/rendering/mathml/RenderMathMLFenced.h
Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp
Source/WebCore/rendering/mathml/RenderMathMLOperator.h
Source/WebCore/rendering/mathml/RenderMathMLToken.cpp