Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(32)

Unified Diff: pkg/polymer/lib/src/declaration.dart

Issue 31423002: fix Polymer to work with latest JS interop (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/pkg.status ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/polymer/lib/src/declaration.dart
diff --git a/pkg/polymer/lib/src/declaration.dart b/pkg/polymer/lib/src/declaration.dart
index ef74b0106e385fd258ef78f8b5dc88ce21a7c9d0..f776fb5fadee36d81750bd40c8f37987e942c46d 100644
--- a/pkg/polymer/lib/src/declaration.dart
+++ b/pkg/polymer/lib/src/declaration.dart
@@ -603,8 +603,8 @@ void _shimShadowDomStyling(DocumentFragment template, String localName) {
var shimShadowDOMStyling2 = shadowCss['shimShadowDOMStyling2'];
if (shimShadowDOMStyling2 == null) return;
- var scopedCSS = shimShadowDOMStyling2.apply(shadowCss,
- [style.text, localName]);
+ var scopedCSS = shimShadowDOMStyling2.apply([style.text, localName],
+ thisArg: shadowCss);
// TODO(terry): Remove when shimShadowDOMStyling is called we don't need to
// replace original CSS with scoped CSS shimShadowDOMStyling
@@ -638,21 +638,7 @@ void _applyStyleToScope(StyleElement style, Node scope) {
String _cssTextFromSheet(Element sheet) {
if (sheet == null || js.context == null) return '';
-
- // TODO(jmesserly): this is a hacky way to communcate with HTMLImports...
-
- // Remove rel=stylesheet, href to keep this inert.
- var href = sheet.attributes.remove('href');
- var rel = sheet.attributes.remove('rel');
- document.body.append(sheet);
- String resource;
- try {
- resource = js.context['document']['body']['lastChild']['__resource'];
- } finally {
- sheet.remove();
- if (href != null) sheet.attributes['href'] = href;
- if (rel != null) sheet.attributes['rel'] = rel;
- }
+ var resource = new JsObject.fromBrowserObject(sheet)['__resource'];
return resource != null ? resource : '';
}
« no previous file with comments | « pkg/pkg.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698