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

Unified Diff: lib/scoped_css.dart

Issue 22962005: Merge pull request #581 from kevmoo/polymer (Closed) Base URL: https://github.com/dart-lang/web-ui.git@polymer
Patch Set: Created 7 years, 4 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 | « lib/safe_html.dart ('k') | lib/shadowdom.debug.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/scoped_css.dart
diff --git a/lib/scoped_css.dart b/lib/scoped_css.dart
deleted file mode 100644
index 577dca7388f59f07d06780d8be436356825b39e5..0000000000000000000000000000000000000000
--- a/lib/scoped_css.dart
+++ /dev/null
@@ -1,43 +0,0 @@
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-/**
- * This library contains support for scoped CSS that uses the compilation
- * strategy of WebUI. This will likely become deprecated as we migrate over to
- * use runtime mechanisms to enforce scoped css rules.
- */
-library scoped_css;
-
-/**
- * Maps CSS selectors (class and) to a mangled name and maps x-component name
- * to [is='x-component'].
- */
-class ScopedCssMapper {
- final Map<String, String> _mapping;
-
- ScopedCssMapper(this._mapping);
-
- /** Returns mangled name of selector sans . or # character. */
- String operator [](String selector) => _mapping[selector];
-
- /** Returns mangled name of selector w/ . or # character. */
- String getSelector(String selector) {
- var prefixedName = this[selector];
- var selectorType = selector[0];
- if (selectorType == '.' || selectorType == '#') {
- return '$selectorType${prefixedName}';
- }
-
- return prefixedName;
- }
-}
-
-/** Any CSS selector (class, id or element) defined name to mangled name. */
-Map<String, ScopedCssMapper> _mappers = {};
-
-ScopedCssMapper getScopedCss(String componentName) => _mappers[componentName];
-
-void setScopedCss(String componentName, Map<String, String> mapping) {
- _mappers.putIfAbsent(componentName, () => new ScopedCssMapper(mapping));
-}
« no previous file with comments | « lib/safe_html.dart ('k') | lib/shadowdom.debug.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698