W3C home > Mailing lists > Public > www-style@w3.org > July 2015

Re: [blink][edge][webkit] steps toward <style scoped> : first do no harm

From: François REMY <francois.remy.dev@outlook.com>
Date: Fri, 10 Jul 2015 22:04:32 +0000
Message-ID: <DUB405-EAS673BF7693ED22EDB19848EA59F0@phx.gbl>
To: Tantek Çelik <tantek@cs.stanford.edu>, CSS WG <www-style@w3.org>
This is a breaking change that I think we should not pursue.

I remember using <style scoped> in my code knowing that it would apply to the outer space as well, and making sure it doesn’t happen by setting some attribute to a one-shot value and making sure all matched elements have my root as a parent by using this attribute selector. 

It’s a form of progressive enhancement: browser which know the style only apply to children don’t have to match the rules against other element and have a better performance.

Your proposal would break this pattern. I don’t know how many people did like me, but potentially a fair number.

Best regards,


De : Tantek Çelik
Envoyé : ‎vendredi‎ ‎10‎ ‎juillet‎ ‎2015 ‎20‎:‎18

I recently found a nice use-case for <style scoped> : per post custom
styling, that would work not only on a post's permalink page, but also
on a post when display in a stream, like on a home page.

I had just created a bit of CSS for the recent "pride weekend" in San Francisco:


And decided I wanted to keep that custom rainbow bg styling on that
post, while reverting other posts to their "normal" styling.

I implemented this using <style scoped> and it worked exactly as expected:


On both the post by itself and when it was present in a list of posts
like on my homepage.

At least in Gecko.

When I tried it other browsers, the rules from the <style scoped> leak
out to the rest of the document, affecting all posts.

E.g. this is a relatively recent Edge screenshot (via a friend)


Thus this is a request - short of fully implementing <style scoped>:

** Could Blink, Edge, and Webkit at least *not* apply <style scoped>? **

I looked for such "first do no harm" bugs for each and couldn't find
any, so I'm sending this message here to broaden awareness and
hopefully get someone from each engine to file a bug and report back a
publicly viewable URL for it so we can track it.

That being said, if any other engine can share an intent to actually
get <style scoped> working in some reasonable timeframe, that would be
appreciated as well!


Received on Friday, 10 July 2015 22:08:24 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:52:18 UTC