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

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

Issue 34873005: use ShadowCSS directly (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 | « no previous file | pkg/shadow_dom/lib/shadow_dom.debug.js » ('j') | 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 07c0dc4074e7d72c3ea424f4193585c3611ae143..8c3efc4cc67c45865be36c2c3b5d66e81fd6a295 100644
--- a/pkg/polymer/lib/src/declaration.dart
+++ b/pkg/polymer/lib/src/declaration.dart
@@ -169,7 +169,7 @@ class PolymerDeclaration extends HtmlElement {
// TODO(jmesserly): resolvePath not ported, see first comment in this class.
// under ShadowDOMPolyfill, transforms to approximate missing CSS features
- _shimShadowDomStyling(templateContent, name);
+ _shimShadowDomStyling(templateContent, name, extendee);
// register our custom element
registerType(name);
@@ -588,31 +588,16 @@ String _removeEventPrefix(String name) => name.substring(_EVENT_PREFIX.length);
/**
* Using Polymer's platform/src/ShadowCSS.js passing the style tag's content.
*/
-void _shimShadowDomStyling(DocumentFragment template, String localName) {
+void _shimShadowDomStyling(DocumentFragment template, String name,
+ String extendee) {
if (js.context == null || template == null) return;
+ if (js.context.hasProperty('ShadowDOMPolyfill')) return;
var platform = js.context['Platform'];
if (platform == null) return;
-
- var style = template.query('style');
- if (style == null) return;
-
var shadowCss = platform['ShadowCSS'];
if (shadowCss == null) return;
-
- // TODO(terry): Remove calls to shimShadowDOMStyling2 and replace with
- // shimShadowDOMStyling when we support unwrapping dart:html
- // Element to a JS DOM node.
- var shimShadowDOMStyling2 = shadowCss['shimShadowDOMStyling2'];
- if (shimShadowDOMStyling2 == null) return;
-
- 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
- // does that.
- style.text = scopedCSS;
+ shadowCss.callMethod('shimStyling', [template, name, extendee]);
}
const _STYLE_SELECTOR = 'style';
« no previous file with comments | « no previous file | pkg/shadow_dom/lib/shadow_dom.debug.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698