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 17197 - svg style validating should not treat type as required attribute
Summary: svg style validating should not treat type as required attribute
Status: CLOSED FIXED
Alias: None
Product: HTML Checker
Classification: Unclassified
Component: General (show other bugs)
Version: unspecified
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: Michael[tm] Smith
QA Contact: qa-dev tracking
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-25 21:12 UTC by xinyang_qiu
Modified: 2012-10-24 16:29 UTC (History)
1 user (show)

See Also:


Attachments

Description xinyang_qiu 2012-05-25 21:12:48 UTC
svg style validating should not treat type as required attribute

Validate the following:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>SVG 1.1, 2nd Edition</title>
  </head>
  <body>
    <svg version="1.1" baseProfile="full" 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">
      <g id="test-body-content">
        <style id="test"></style>
      </g>
    </svg>
  </body>
</html>


Actual:
3.Error: Element style is missing required attribute type.

From line 9, column 9; to line 9, column 25

>?        <style id="test"></styl

Expected:
No error

As stated in 
http://www.w3.org/TR/SVG/styling.html#StyleElement

type = content-type
This attribute specifies the style sheet language of the element's contents. The style sheet language is specified as a content type (e.g., "text/css"), as per MIME Part Two: Media Types [RFC2046]. If a ‘type’ is not provided, the value of ‘contentStyleType’ on the ‘svg’ element shall be used, which in turn defaults to "text/css" [RFC2046]. If a ‘style’ element falls outside of the outermost svg element and the ‘type’ is not provided, the ‘type’ must default to "text/css" [RFC2046]. 
Animatable: no.

It implies that type can be missing from style tag, should be optional.
Comment 1 Michael[tm] Smith 2012-05-29 07:58:17 UTC
(In reply to comment #0)
> svg style validating should not treat type as required attribute
> [...]
> As stated in 
> http://www.w3.org/TR/SVG/styling.html#StyleElement
> [...]
> It implies that type can be missing from style tag, should be optional.

Actually, the spec language you cite there does not imply the style element is optional; it just says what UAs should do if it's omitted.

The prose of the SVG spec is unfortunately completely useless for determining what the actual document-conformance requirements are. The only way you can determine what's supposed to be required and what's not is to read the DTD. In this case, you need to read the following section:

  http://www.w3.org/TR/SVG/svgdtd.html#DTD.1.21

...where you'll find this:

  type %ContentType.datatype; #REQUIRED

If you think it should not be required and/or you think the SVG Working Group should try to do a better job of actually making the requirements clear in the prose of the spec itself, please file a bug against the SVG spec instead:

  https://www.w3.org/Bugs/Public/enter_bug.cgi?product=SVG
Comment 2 xinyang_qiu 2012-10-24 16:29:17 UTC
I see. thanks.