[Bug 23625] [Shadow]: Consider removing apply-author-styles flag

https://www.w3.org/Bugs/Public/show_bug.cgi?id=23625

--- Comment #2 from Elliott Sprehn <esprehn@gmail.com> ---
@ericbidelman 

I think we might want some kind of similar feature eventually, but the current
version of it does surprising things like applying all styles from all ancestor
ShadowRoots down into you which is harmful to the concept of encapsulation and
also breaks composition.

ex.

Document (includes bootstrap.css)
|
| <app-panel>
   |
   |
   --> ShadowRoot
       |
       | <style> span { font-size: 2em; } </style>
       |
       | <bootstrap-button> with applyAuthorStyles = true.
          |
          |
          --> ShadowRoot
              |
              | <span><content></content></span>

In this example the <bootstrap-button> has applyAuthorStyles since it assumes
that you'll just put the bootstrap CSS at the top of your page. Unfortunately
setting that flag also makes the CSS of the containing ShadowRoot apply making
the text inside the button huge. This is not what the developer intended, they
just wanted bigger text for the spans inside the <app-panel>.

^ and ^^ are explicit about what they match and give the author of the
component control while applyAuthorStyles requires the author to worry about
the internal structure of every nested 3rd party component just in case one of
them uses applyAuthorStyles.

Having this flag is harmful to the ecosystem, it encourages brittle wrappers
around existing libraries that won't work with each other.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Monday, 25 November 2013 17:10:14 UTC