Skip to content
  • commit-queue@webkit.org's avatar
    [SVG] Accept HTML and MathML namespaces as valid requiredExtensions · 13974d01
    commit-queue@webkit.org authored
    https://bugs.webkit.org/show_bug.cgi?id=88188
    
    Patch by Frédéric Wang <fred.wang@free.fr> on 2014-01-15
    Reviewed by Chris Fleizach.
    
    Source/WebCore:
    
    When HTML and MathML are used as foreign objects of an SVG image, it is
    important for Web authors to be able to specify a fallback content for
    SVG-only readers or browsers without MathML support. We rely on the
    requiredExtensions for that purpose and we use the XHTML/MathML
    namespaces as suggested in SVG Tiny 1.2 and implemented in Gecko.
    
    Tests: svg/custom/conditional-processing-1.svg
           svg/custom/conditional-processing-2.html
           svg/dom/SVGTests.html
    
    * svg/SVGSwitchElement.cpp: Remove an incorrect FIXME comment and replace it with a reference to bug 74749.
    (WebCore::SVGSwitchElement::childShouldCreateRenderer):
    * svg/SVGTests.cpp: Check if the list of required extensions contains only the XHTML/MathML namespaces.
    (WebCore::SVGTests::hasExtension):
    (WebCore::SVGTests::isValid):
    
    LayoutTests:
    
    conditional-processing-1 verifies that indeed a renderer object is only
    created for the first "valid" SVG element of a <switch>, contrary to
    what an incorrect FIXME comment said. conditional-processing-2 verifies
    that the <switch> takes into account XHTML and MathML namespaces in the
    requiredExtensions attribute to decide which SVG element is "valid".
    SVGTests.html verifies the SVGTests interface of SVG DOM: three
    SVGStringList attributes (already tested in svg/dom/SVGStringList.html)
    and the hasExtension() function.
    
    * svg/custom/conditional-processing-1-expected.svg: Added.
    * svg/custom/conditional-processing-1.svg: Added.
    * svg/custom/conditional-processing-2-expected.html: Added.
    * svg/custom/conditional-processing-2.html: Added.
    * svg/dom/SVGTests-expected.txt: Added.
    * svg/dom/SVGTests.html: Added.
    * svg/dom/script-tests/SVGTests.js: Added.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@162083 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    13974d01