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 14153 - This defeats the entire purpose of separating style and content. Style scoping works quite well using the CSS cascade
Summary: This defeats the entire purpose of separating style and content. Style scopin...
Status: RESOLVED WONTFIX
Alias: None
Product: HTML WG
Classification: Unclassified
Component: HTML5 spec (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: ---
Assignee: contributor
QA Contact: HTML WG Bugzilla archive list
URL: http://www.whatwg.org/specs/web-apps/...
Whiteboard:
Keywords:
: 14154 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-09-15 06:59 UTC by contributor
Modified: 2011-12-09 23:36 UTC (History)
6 users (show)

See Also:


Attachments

Description contributor 2011-09-15 06:59:38 UTC
Specification: http://www.whatwg.org/specs/web-apps/current-work/multipage/semantics.html
Multipage: http://www.whatwg.org/C#style-default-media
Complete: http://www.whatwg.org/c#style-default-media

Comment:
This defeats the entire purpose of separating style and content. Style scoping
works quite well using the CSS cascade

Posted from: 165.69.2.2
User agent: Mozilla/5.0 (Windows NT 5.1) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.220 Safari/535.1
Comment 1 John Foliot 2011-09-16 00:45:16 UTC
Likely duplication at Bug 14154 

Problem:
Styling should be reserved for CSS, and not embedded into the HTML layer with the <style> element. 

Summary:
John Allsopp has written a good post at http://www.webdirections.org/blog/on-the-abominable-proposed-html5-scoped-attribute-for-style-elements/ which details the problems.

Proposed Solution:
Remove the style element from the HTML specification. As Eric Meyer notes in a response to John's article:
     "...Of course, Id prefer to do the same thing in the style attribute, as in style="@import url(blah.css);"  and I pushed to get that capability added to CSS, which it eventually was in the style attribute module" - which suggests that the problem the style element was trying to solve has been solved via CSS already.
Comment 2 John Foliot 2011-09-16 00:47:28 UTC
*** Bug 14154 has been marked as a duplicate of this bug. ***
Comment 3 Peter Winnberg 2011-09-22 10:56:34 UTC
I am not sure if this bug is about removing the style element completely (I can see both advantages and disadvantages if that is done) or just the scoped attribute on the style element so that it can be used inside the body element and only apply to a certain part of a document.

What I am arguing for is removing the scoped attribute from the style element because this does not degrade gracefully in the sense that it will be ignored by older browsers that doesn't understand the scoped attribute ( or the style element ). A web browser that supports the style element but not the scoped attribute will most likely apply the CSS to the whole document and not just a part of it. And a web browser that doesn't support the style element could display the CSS as content in the document ( because it isn't hidden inside the head element ).

If this feature really is needed something like an externalcss attribute that can be used on block only elements inside the body would work better. 

<div externalcss="scoped-style.css">
<!-- CSS from scoped-style.css only applied here -->
</div>

This would be completely ignored by older browsers, however something like this doesn't make much sense anyway because it would only be supported in the latest versions of the web browsers and the same thing can already be achieved using other techniques.

So I think the scoped attribute on the style element should be removed or at the very least be replaced with a better solution.
Comment 4 Ian 'Hixie' Hickson 2011-12-09 23:36:07 UTC
EDITOR'S RESPONSE: This is an Editor's Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document:
   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Rejected
Change Description: no spec change
Rationale: 

While having embedded styles is indeed not ideal from a style/content separation point of view, it's nonetheless something a lot of people want and can actually use without compromising the actual goal of device independence, so in this case I think this is the right balance to strike.

Re comment 3: It actually degrades really quite well. Just make sure to prefix your selectors with a unique ID.