Page MenuHomePhabricator

This SVG file contains an illegal namespace "http://www.w3.org/2000/02/svg/testsuite/description/".
Closed, ResolvedPublicBUG REPORT

Description

Steps to Reproduce:

Upload any file from https://www.w3.org/Graphics/SVG/Test/20110816/archives/W3C_SVG_11_TestSuite.tar.gz

e.g.

xml
<svg version="1.1" baseProfile="tiny" id="svg-root"
  width="100%" height="100%" viewBox="0 0 480 360"
  xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
  <!--======================================================================-->
  <!--=  SVG 1.1 2nd Edition Test Case                                     =-->
  <!--======================================================================-->
  <!--=  Copyright 2009 World Wide Web Consortium, (Massachusetts          =-->
  <!--=  Institute of Technology, European Research Consortium for         =-->
  <!--=  Informatics and Mathematics (ERCIM), Keio University).            =-->
  <!--=  All Rights Reserved.                                              =-->
  <!--=  See http://www.w3.org/Consortium/Legal/.                          =-->
  <!--======================================================================-->
  <d:SVGTestCase xmlns:d="http://www.w3.org/2000/02/svg/testsuite/description/"
    template-version="1.4" reviewer="CL" author="CN" status="accepted"
    version="$Revision: 1.8 $" testname="$RCSfile: color-prop-05-t.svg,v $">
    <d:testDescription xmlns="http://www.w3.org/1999/xhtml" href="http://www.w3.org/TR/SVG11/color.html#ColorProperty">
      <p>
        Tests the color that is used for the currentColor value in the fill
        attribute when more than one color is specified.
      </p>
      <p>
        This is illustrated using a single rectangle that is a child of a group
        element. A fill is specified for the group element but not the
        rectangle. Colour is specifed for the rectangle and the group element.
      </p>
    </d:testDescription>
    <d:operatorScript xmlns="http://www.w3.org/1999/xhtml">
      <p>Run the test. No interaction required.</p>
    </d:operatorScript>
    <d:passCriteria xmlns="http://www.w3.org/1999/xhtml">
      <p>
        The test is passed if the user agent renders the rectangle with a green
        fill.
      </p>
    </d:passCriteria>
  </d:SVGTestCase>
  <title id="test-title">$RCSfile: color-prop-05-t.svg,v $</title>
  <defs>
    <font-face font-family="SVGFreeSansASCII" unicode-range="U 0-7F">
      <font-face-src>
        <font-face-uri xlink:href="../resources/SVGFreeSans.svg#ascii"/>
      </font-face-src>
    </font-face>
  </defs>
  <g id="test-body-content" font-family="SVGFreeSansASCII,sans-serif" font-size="18">
    <g fill="currentColor" color="lime">
      <rect x="120" y="60" width="150" height="150" color="red"/>
    </g>
  </g>
  <g font-family="SVGFreeSansASCII,sans-serif" font-size="32">
    <text id="revision" x="10" y="340" stroke="none" fill="black">$Revision: 1.8 $</text>
  </g>
  <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/>
  <!-- comment out this watermark once the test is approved -->
  <!--<g id="draft-watermark">
    <rect x="1" y="1" width="478" height="20" fill="red" stroke="black" stroke-width="1"/>
    <text font-family="SVGFreeSansASCII,sans-serif" font-weight="bold" font-size="20" x="240"
      text-anchor="middle" y="18" stroke-width="0.5" stroke="black" fill="white">DRAFT</text>
  </g>-->
</svg>

License:

Distributed under both the W3C Test Suite License and the W3C 3-clause BSD License. To contribute to a W3C Test Suite, see the policies and contribution forms.

see https://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html

BSD is allowed license on commons: https://commons.wikimedia.org/wiki/Template:BSD

Actual Results:

UploadProblem.png (263×535 px, 43 KB)

PS: since it is a test suite I want to upload it unmodified.

Event Timeline

No SVG rendering involved; unrelated to UploadWizard and IA_Upload (both not mentioned in steps, why were they added?).
This comes from uploadscriptednamespace in https://phabricator.wikimedia.org/diffusion/MW/browse/master/includes/upload/UploadBase.php

Generally I would just remove the description, however it is a testsuite and should be kept unmodified, for more infos check: https://commons.wikimedia.org/wiki/User:JoKalliauer/SVG_test_suites#W3C_SVG_1.1_test_suite

If you just remove the namespace-definition, it will lead to an error.

<d:SVGTestCase does not influence the rendering result, however some viewer might support showing description for testsuites. Anyhow this info is essential to identify which render renders correct.

I expected that there is a namespace-whitelist for security reasons. I consinder namespaces from https://www.w3.org/ as save, since they publish the official svg-standard (doc-type-defintion) .

So my request is to whitelist the namespace http://www.w3.org/2000/02/svg/testsuite/description/

Change 676143 had a related patch set uploaded (by JoKalliauer; author: JoKalliauer):

[mediawiki/core@master] UploadBase.php: added namespace for w3c-test-suite

https://gerrit.wikimedia.org/r/676143

Change 676143 abandoned by JoKalliauer:

[mediawiki/core@master] UploadBase.php: added namespace for w3c-test-suite

Reason:

chaged tabs in spaces, sorry

https://gerrit.wikimedia.org/r/676143

Change 676146 had a related patch set uploaded (by JoKalliauer; author: JoKalliauer):

[mediawiki/core@master] UploadBase.php: added namespace for w3c-test-suite

https://gerrit.wikimedia.org/r/676146

The files of the test-suite are already uploaded for the SVG_test_suites . Since the namespace does not change rendering, this is not such a big issue, to replace it, even all W3C-files had to get changed. Some other IllegalPatterns which effect rendering are more relevant, some of them are blocked purposely, others like T279239 T279240 are imho blocked by error. => So editing the test-suite is anyhow necessary (at least for some files), which reduces the priority of this task.

Maybe those features which get blocked, are not relevant for WikimediaCommons, and should anyhow not be in a test-suite for T40010 .

Change 676146 merged by jenkins-bot:

[mediawiki/core@master] UploadBase.php: added namespace for w3c-test-suite

https://gerrit.wikimedia.org/r/676146