Add an MathMLSelectElement class to implement <maction> and <semantics>.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Dec 2013 17:12:38 +0000 (17:12 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Dec 2013 17:12:38 +0000 (17:12 +0000)
commit0284356bd9d26eaf75d1e2db28420166aaca7c3f
tree450723515b86b80c3c5ae98bcf8e18f5f23c9dc8
parent9e9cf698f197a522a25100b6f90ea20ac3481cfe
Add an MathMLSelectElement class to implement <maction> and <semantics>.
<https://webkit.org/b/120058>

Patch by Frédéric Wang <fred.wang@free.fr> on 2013-12-03
Reviewed by Chris Fleizach.

Source/WebCore:

Tests: mathml/presentation/maction-dynamic.html
       mathml/presentation/maction.html
       mathml/presentation/semantics.html

This adds a new MathMLSelectElement class to prepare the implementation
of the <maction> and <semantics> elements, for which only one "selected"
child is visible. We now simply display the first child of the
<semantics> element instead of hiding the annotations and this allows to
handle the use case of SVG-in-MathML as generated by Instiki when
bug 124128 is fixed ; Gecko's selection algorithm will be implemented
later (bug 100626). We now also rely on the @actiontype and @selection
attributes to select the visible <maction> child ; It remains to deal
with the user interaction (bug 85734).

* CMakeLists.txt: add the new files.
* GNUmakefile.list.am: ditto
* Target.pri: ditto
* WebCore.vcxproj/WebCore.vcxproj: ditto
* WebCore.vcxproj/WebCore.vcxproj.filters: ditto
* WebCore.xcodeproj/project.pbxproj: ditto
* css/mathml.css: remove the CSS rule for annotation/annotation-xml.
* mathml/MathMLAllInOne.cpp: add the new cpp file.
* mathml/MathMLSelectElement.cpp: Added.
(WebCore::MathMLSelectElement::MathMLSelectElement):
(WebCore::MathMLSelectElement::create):
(WebCore::MathMLSelectElement::createRenderer):
(WebCore::MathMLSelectElement::childShouldCreateRenderer):
(WebCore::MathMLSelectElement::finishParsingChildren):
(WebCore::MathMLSelectElement::childrenChanged):
(WebCore::MathMLSelectElement::attributeChanged):
(WebCore::MathMLSelectElement::updateSelectedChild): basic implementation for maction, semantics, maction@actiontype and maction@selection.
* mathml/MathMLSelectElement.h: Added.
* mathml/mathattrs.in: add actiontype and selection attributes.
* mathml/mathtags.in: set element classes for maction, semantics, annotation and annotation-xml.

LayoutTests:

New tests for the selection of the visible child in the <maction> and <semantics> elements.

* mathml/presentation/maction-dynamic-expected.html: Added.
* mathml/presentation/maction-dynamic.html: Added.
* mathml/presentation/maction-expected.html: Added.
* mathml/presentation/maction.html: Added.
* mathml/presentation/semantics-expected.html: Added.
* mathml/presentation/semantics.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@160005 268f45cc-cd09-0410-ab3c-d52691b4dbfc
22 files changed:
LayoutTests/ChangeLog
LayoutTests/TestExpectations
LayoutTests/mathml/presentation/maction-dynamic-expected.html [new file with mode: 0644]
LayoutTests/mathml/presentation/maction-dynamic.html [new file with mode: 0644]
LayoutTests/mathml/presentation/maction-expected.html [new file with mode: 0644]
LayoutTests/mathml/presentation/maction.html [new file with mode: 0644]
LayoutTests/mathml/presentation/semantics-expected.html [new file with mode: 0644]
LayoutTests/mathml/presentation/semantics.html [new file with mode: 0644]
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/MathMLSelectElement.cpp [new file with mode: 0644]
Source/WebCore/mathml/MathMLSelectElement.h [new file with mode: 0644]
Source/WebCore/mathml/mathattrs.in
Source/WebCore/mathml/mathtags.in