New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Polymer components' CSS encapsulation is broken when run e.g. in Chrome when compiled by dart2js #17676
Comments
Added Area-Polymer, Triaged labels. |
Removed Area-Polymer label. |
Added this to the 1.6 milestone. |
Removed this from the 1.6 milestone. |
Removed Polymer-P-1 label. |
Added PolymerMilestone-Next label. |
Removed Polymer-Milestone-Next label. |
This issue has been moved to dart-archive/polymer-dart#143. |
This issue was originally filed by ant...@mixbook.com
What steps will reproduce the problem?
<polymer-element name="x-parent">
<template>
<style>
.title { color: blue; }
</style>
<div class="title">Parent title</div>
<x-child></x-child>
</template>
<script type="application/dart" src="parent.dart"></script>
</polymer-element>
<polymer-element name="x-child">
<template>
<style>
.title { background: yellow; }
</style>
<div class="title">Child title</div>
</template>
<script type="application/dart" src="child.dart"></script>
</polymer-element>
What is the expected output? What do you see instead?
Expected output - "Child title" should be a black text on yellow background
See instead - "Child title" is blue text on yellow background
What version of the product are you using? On what operating system?
Polymer 0.9.5, Dart 1.2.0 Stable, Mac OS X 10.9
Please provide any additional information below.
It works fine in Dartium, because it has the native Shadow DOM support.
But since it is not yet in Chrome, it creates two CSS rules, like:
x-parent .title { color: blue }
x-child .title { background: yellow }
and of course x-parent .title also applies to x-child's title, since x-child is inside x-parent.
But that actually breaks the main idea and the main feature of the polymer elements - their styles are not encapsulated.
The text was updated successfully, but these errors were encountered: