nooyoo11 / epubcheck

Automatically exported from code.google.com/p/epubcheck
MIT License
1 stars 0 forks source link

Validator should allow <foreignObject> anywhere in an SVG document, not just inside a <switch> element #223

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
PROBLEM:

The validator appears to require the <foreignObject> to be inside a <switch> 
element, but the specification appears to say that it is allowed anywhere in an 
SVG document.

As far as I can tell, Adobe Digital Editions refuses to handle the <switch> 
element at all, and throws away everything inside it, resulting in a blank 
page.  This makes that element unusable for me.  However, the <foreignObject> 
element works correctly if you do not wrap it with a <switch> element.

METHOD:

<?xml version="1.0" encoding="utf-8"?>
<!-- version="-//W3C//DTD XHTML 1.1//EN" -->
<html version="-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN"
      xmlns="http://www.w3.org/1999/xhtml"
      xmlns:svg="http://www.w3.org/2000/svg">
<head>
<title>Part page</title>
<link rel="stylesheet" type="text/css" href="nookstyles.css" />
<link rel="stylesheet" type="text/css" href="nookstyles2.css" />
</head>
<body>
<div class="partpage">
<svg:svg version="1.1" width="6in" height="9in" baseProfile="tiny" viewBox="0 0 
4320 6480" preserveAspectRatio="xMidYMid">
  <svg:g transform="scale(10)">
      <svg:g fill="none" stroke="green" stroke-width="1"><svg:line x1="0" y1="0" x2="431" y2="0" /><svg:line x1="431" y1="0" x2="431" y2="647" /><svg:line x1="431" y1="647" x2="0" y2="647" /><svg:line x1="0" y1="647" x2="0" y2="0" /></svg:g>
      <svg:foreignObject x="0" y="148" width="432" height="300" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility">
          <body>
            <div class="pp_partnum" xmlns="http://www.w3.org/1999/xhtml">Part I:</div>
          </body>
        </svg:foreignObject>
  </svg:g>
</svg:svg>
</div> 
</body> 
</html>

RESULT:

The validator reported errors.

EXPECTED:

The validator should not have reported any errors.

PLATFORM:

3.0-RC-1
OS X 10.8.2

ADDITIONAL INFO:

This is related to issue 222.

Original issue reported on code.google.com by dgatwoo...@gmail.com on 22 Nov 2012 at 7:36

GoogleCodeExporter commented 9 years ago

Original comment by markus.g...@gmail.com on 25 Nov 2012 at 9:32

GoogleCodeExporter commented 9 years ago
Fixed in r378.

Original comment by markus.g...@gmail.com on 25 Nov 2012 at 11:17