Add support for menclose element
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Jan 2014 16:34:52 +0000 (16:34 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Jan 2014 16:34:52 +0000 (16:34 +0000)
commit04564c0098495c25b35ae9f9601072b5bf36490f
tree6272b107f40c7c6127fbb0bf3f56a84e26621e3b
parent983d1ca6bc228b8026d368a97376138fabb4a147
Add support for menclose element
https://bugs.webkit.org/show_bug.cgi?id=85729

Patch by Gurpreet Kaur <k.gurpreet@samsung.com> on 2014-01-28
Reviewed by Chris Fleizach.

Source/WebCore:

Added support for menclose element. MathML <menclose> element renders
its content inside an enclosing notation specified by the notation
attribute. The notation attribute can have values longdiv, box, left,
right, top, bottom , radical, madruwb, actuarial, roundedbox, circle,
updiagonalstrike, downdiagonalstrike, verticalstrike and
horizontalstrike.

Tests: mathml/presentation/menclose-add-children.html
       mathml/presentation/menclose-notation-attribute-add.html
       mathml/presentation/menclose-notation-attribute-change-value.html
       mathml/presentation/menclose-notation-attribute-remove.html
       mathml/presentation/menclose-notation-attribute-set1.html
       mathml/presentation/menclose-notation-attribute-set2.html
       mathml/presentation/menclose-notation-no-overlap.html
       mathml/presentation/menclose-notation-radical.html
       mathml/presentation/menclose-remove-children.html

* CMakeLists.txt:
* GNUmakefile.list.am:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* css/mathml.css:
(mo, mrow, mfenced, mfrac, msub, msup, msubsup, mmultiscripts, mprescripts, none, munder, mover, munderover, msqrt, mroot, merror, mphantom, mstyle, menclose):
(math, mrow, mfenced, msqrt, mroot, merror, mphantom, mstyle, menclose):
* mathml/MathMLAllInOne.cpp:
* mathml/MathMLElement.h:
* mathml/MathMLInlineContainerElement.cpp:
* mathml/MathMLMencloseElement.cpp: Added.
(WebCore::MathMLMencloseElement::MathMLMencloseElement):
(WebCore::MathMLMencloseElement::create):
(WebCore::MathMLMencloseElement::createElementRenderer):
(WebCore::MathMLMencloseElement::isPresentationAttribute):
(WebCore::MathMLMencloseElement::finishParsingChildren):
(WebCore::MathMLMencloseElement::collectStyleForPresentationAttribute):
(WebCore::MathMLMencloseElement::longDivLeftPadding):
* mathml/MathMLMencloseElement.h: Added.
(WebCore::toMathMLMencloseElement):
* mathml/mathattrs.in:
* mathml/mathtags.in:
* rendering/mathml/RenderMathMLMenclose.cpp: Added.
(WebCore::RenderMathMLMenclose::RenderMathMLMenclose):
(WebCore::RenderMathMLMenclose::addChild):
(WebCore::RenderMathMLMenclose::computePreferredLogicalWidths):
(WebCore::RenderMathMLMenclose::updateLogicalHeight):
(WebCore::RenderMathMLMenclose::paint):
(WebCore::RenderMathMLMenclose::checkNotationalValuesValidity):
* rendering/mathml/RenderMathMLMenclose.h: Added.
* rendering/mathml/RenderMathMLRoot.cpp:
(WebCore::RenderMathMLRoot::RenderMathMLRoot):
* rendering/mathml/RenderMathMLRoot.h:
* rendering/mathml/RenderMathMLSquareRoot.cpp:
(WebCore::RenderMathMLSquareRoot::RenderMathMLSquareRoot):
(WebCore::RenderMathMLSquareRoot::createAnonymousWithParentRenderer):
* rendering/mathml/RenderMathMLSquareRoot.h:
Added new file related to menclose element implementation. Menclose
element is created and while parsing its notation attribute based on
its values like top, left CSSBorder properties are applied and for
values like circle, verticalstrike, longidv its taken care in paint.
For radical value an anonymous RenderMathMLSquareRoot is created as
a child of menclose.

LayoutTests:

* mathml/presentation/inferred-mrow-baseline-expected.txt:
* mathml/presentation/inferred-mrow-baseline.html:
* mathml/presentation/inferred-mrow-stretchy-expected.txt:
* mathml/presentation/inferred-mrow-stretchy.html:
Rebaselining existing tests as per the new behavior.

* mathml/presentation/menclose-add-children-expected.html: Added.
* mathml/presentation/menclose-add-children.html: Added.
* mathml/presentation/menclose-notation-attribute-add-expected.html: Added.
* mathml/presentation/menclose-notation-attribute-add.html: Added.
* mathml/presentation/menclose-notation-attribute-change-value-expected.html: Added.
* mathml/presentation/menclose-notation-attribute-change-value.html: Added.
* mathml/presentation/menclose-notation-attribute-remove-expected.html: Added.
* mathml/presentation/menclose-notation-attribute-remove.html: Added.
* mathml/presentation/menclose-notation-attribute-set1-expected.txt: Added.
* mathml/presentation/menclose-notation-attribute-set1.html: Added.
* mathml/presentation/menclose-notation-attribute-set2-expected-mismatch.html: Added.
* mathml/presentation/menclose-notation-attribute-set2.html: Added.
* mathml/presentation/menclose-notation-no-overlap-expected.txt: Added.
* mathml/presentation/menclose-notation-no-overlap.html: Added.
* mathml/presentation/menclose-notation-radical-expected.html: Added.
* mathml/presentation/menclose-notation-radical.html: Added.
* mathml/presentation/menclose-remove-children-expected.html: Added.
* mathml/presentation/menclose-remove-children.html: Added.
Added new test cases for verifying the behaviour of menclose element
with different values of notation attribute and removing/changing/adding
notation attribute.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@162933 268f45cc-cd09-0410-ab3c-d52691b4dbfc
43 files changed:
LayoutTests/ChangeLog
LayoutTests/mathml/presentation/inferred-mrow-baseline-expected.txt
LayoutTests/mathml/presentation/inferred-mrow-baseline.html
LayoutTests/mathml/presentation/inferred-mrow-stretchy-expected.txt
LayoutTests/mathml/presentation/inferred-mrow-stretchy.html
LayoutTests/mathml/presentation/menclose-add-children-expected.html [new file with mode: 0755]
LayoutTests/mathml/presentation/menclose-add-children.html [new file with mode: 0755]
LayoutTests/mathml/presentation/menclose-notation-attribute-add-expected.html [new file with mode: 0755]
LayoutTests/mathml/presentation/menclose-notation-attribute-add.html [new file with mode: 0755]
LayoutTests/mathml/presentation/menclose-notation-attribute-change-value-expected.html [new file with mode: 0755]
LayoutTests/mathml/presentation/menclose-notation-attribute-change-value.html [new file with mode: 0755]
LayoutTests/mathml/presentation/menclose-notation-attribute-remove-expected.html [new file with mode: 0755]
LayoutTests/mathml/presentation/menclose-notation-attribute-remove.html [new file with mode: 0755]
LayoutTests/mathml/presentation/menclose-notation-attribute-set1-expected.txt [new file with mode: 0755]
LayoutTests/mathml/presentation/menclose-notation-attribute-set1.html [new file with mode: 0755]
LayoutTests/mathml/presentation/menclose-notation-attribute-set2-expected-mismatch.html [new file with mode: 0755]
LayoutTests/mathml/presentation/menclose-notation-attribute-set2.html [new file with mode: 0755]
LayoutTests/mathml/presentation/menclose-notation-no-overlap-expected.txt [new file with mode: 0755]
LayoutTests/mathml/presentation/menclose-notation-no-overlap.html [new file with mode: 0755]
LayoutTests/mathml/presentation/menclose-notation-radical-expected.html [new file with mode: 0755]
LayoutTests/mathml/presentation/menclose-notation-radical.html [new file with mode: 0755]
LayoutTests/mathml/presentation/menclose-remove-children-expected.html [new file with mode: 0755]
LayoutTests/mathml/presentation/menclose-remove-children.html [new file with mode: 0755]
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/GNUmakefile.list.am
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/css/mathml.css
Source/WebCore/mathml/MathMLAllInOne.cpp
Source/WebCore/mathml/MathMLElement.h
Source/WebCore/mathml/MathMLInlineContainerElement.cpp
Source/WebCore/mathml/MathMLMencloseElement.cpp [new file with mode: 0755]
Source/WebCore/mathml/MathMLMencloseElement.h [new file with mode: 0755]
Source/WebCore/mathml/mathattrs.in
Source/WebCore/mathml/mathtags.in
Source/WebCore/rendering/mathml/RenderMathMLMenclose.cpp [new file with mode: 0755]
Source/WebCore/rendering/mathml/RenderMathMLMenclose.h [new file with mode: 0755]
Source/WebCore/rendering/mathml/RenderMathMLRoot.cpp
Source/WebCore/rendering/mathml/RenderMathMLRoot.h
Source/WebCore/rendering/mathml/RenderMathMLSquareRoot.cpp
Source/WebCore/rendering/mathml/RenderMathMLSquareRoot.h