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

Unified Diff: lib/custom_element.dart

Issue 19497002: Reducing the amount of code we generate in the compiler: We still continue (Closed) Base URL: git@github.com:dart-lang/web-ui.git@master
Patch Set: Created 7 years, 5 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
Index: lib/custom_element.dart
diff --git a/lib/custom_element.dart b/lib/custom_element.dart
index d493e4e09820854ebf0cffd2296bc2c45459d474..5d3dc9d3f2ae8fc489c45f3a0a5930048a3271c4 100644
--- a/lib/custom_element.dart
+++ b/lib/custom_element.dart
@@ -122,14 +122,6 @@ abstract class CustomElement implements Element {
getShadowRoot(String componentName) => _generatedRoots[componentName];
- /** Any CSS selector (class, id or element) defined name to mangled name. */
- ScopedCssMapper _mapper = new ScopedCssMapper({});
-
- // TODO(terry): Add a mapper per component in the type hierarchy.
- ScopedCssMapper getScopedCss(String componentName) => _mapper;
- void setScopedCss(String componentName, ScopedCssMapper mapper) {
- _mapper = mapper;
- }
/**
* *Warning*: This is an implementation helper for Custom Elements and
@@ -187,15 +179,6 @@ abstract class CustomElement implements Element {
/** Invoked when any attribute of the component is modified. */
void attributeChanged(String name, String oldValue, String newValue) {}
- /**
- * **Note**: This is an implementation helper and should not need to be calle
- * from your code.
- *
- * Initializes the contents of the ShadowRoot from template inside the
- * `<element>` element.
- */
- void initShadow() {}
-
get model => host.model;
void set model(newModel) {
@@ -624,29 +607,6 @@ abstract class CustomElement implements Element {
}
}
-/**
- * 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;
- }
-}
typedef DocumentFragmentCreated(DocumentFragment fragment);
@@ -659,8 +619,8 @@ void _createElements(Node node) {
if (node is Element) {
var ctor = _customElements[node.localName];
if (ctor == null) {
- var isAttr = node.attributes['is'];
- if (isAttr != null) ctor = _customElements[isAttr];
+ var attr = node.attributes['is'];
+ if (attr != null) ctor = _customElements[attr];
}
if (ctor != null) _initCustomElement(node, ctor);
}
@@ -671,7 +631,7 @@ void _initCustomElement(Element node, CustomElement ctor()) {
element.host = node;
// TODO(jmesserly): replace lifecycle stuff with a proper polyfill.
- element..initShadow()..created();
+ element.created();
_registerLifecycleInsert(element);
}
« no previous file with comments | « example/todomvc/web/todo_row.html ('k') | lib/polymer.dart » ('j') | lib/polymer_element.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698