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 16210 - Error in validaton of <style scoped>: It *is* allowed as child of <body>
Summary: Error in validaton of <style scoped>: It *is* allowed as child of <body>
Status: CLOSED FIXED
Alias: None
Product: HTML Checker
Classification: Unclassified
Component: General (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Michael[tm] Smith
QA Contact: qa-dev tracking
URL: http://tinyurl.com/7edrjms
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-03 01:02 UTC by Leif Halvard Silli
Modified: 2013-04-22 21:42 UTC (History)
2 users (show)

See Also:


Attachments

Description Leif Halvard Silli 2012-03-03 01:02:29 UTC
Why does the validator not OK the following? Example:

<!DOCTYPE html><html><head><title></title></head><body><style scoped>style+*{background:red}</style><p>abc

The error message explains that <style scoped> can be used:

]] where flow content is expected, but before any other flow content other than inter-element whitespace, and not as the child of an element whose content model is transparent.
Content model for element body:
Flow content.[[

But as the error message itself says: <body>'s content model is *not* transparent. Hence, the spec does permit <style scope> to be the direct child of <body>. 

Currently, the validator would OK the above example, if I had done <div><style scope>/*foo*/</style></div>
Comment 1 Michael[tm] Smith 2012-03-04 13:59:06 UTC
The validator doesn't fully support <style scoped> yet. I think there are bugzilla.validator.nu bugs open for it already. It's not been a big priority given that until very recently there was zero browser support for it.
Comment 2 Michael[tm] Smith 2013-04-22 03:14:20 UTC
Fixed. You can test at http://validator.w3.org/nu/