This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 25143 - SVG 1.1 validation: Don't foreignObject tag contents
Summary: SVG 1.1 validation: Don't foreignObject tag contents
Status: NEW
Alias: None
Product: Validator
Classification: Unclassified
Component: Parser (show other bugs)
Version: HEAD
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: This bug has no owner yet - up for the taking
QA Contact: qa-dev tracking
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-24 22:23 UTC by trlkly
Modified: 2014-03-24 23:10 UTC (History)
0 users

See Also:


Attachments

Description trlkly 2014-03-24 22:23:51 UTC
DESCRIPTION:

Per http://www.w3.org/TR/SVG11/extend.html, the contents of a foreignObject element are "assumed to be from a different namespace." They thus should not be checked against the SVG DTD. Yet, if you attempt to validate a file of the following structure, every tag inside the foreignObject returns errors, one for the tag itself and one for each included attribute.


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" height="1" width="1" version="1.1">
  <foreignObject width="0" height="0">
    <newtag1 options="options">
      <newtag2 options="options" />
    </newtag1>
  </foreignObject>
</svg>


CURRENT BEHAVIOR:
Four errors.

DESIRED BEHAVIOR:
No errors. Anything inside a foreignObject block should only be tested for being valid XML, if at all. 

ADDITIONAL INFORMATION:

I tried to put this on the mailing list before filing a bug, to make sure I'm not misunderstanding something, but it kept saying it was coming from my private personal email address instead of this public one.
Comment 1 trlkly 2014-03-24 23:10:23 UTC
Changing the structure to use switch statements as follows does not help, although it does limit the errors to one, refusing to continue parsing after encountering the newtag1 branch.

<svg xmlns="http://www.w3.org/2000/svg" height="1" width="1" version="1.1">
<switch>
  <foreignObject width="0" height="0"
               requiredExtensions="http://www.google.com">
    <newtag1 options="options">
      <newtag2 options="options" />
    </newtag1>
  </foreignObject>

</switch>
</svg>