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

Unified Diff: sky/specs/elements.md

Issue 946513006: Specs: pass the current <script> to the module library init() (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 10 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 | sky/specs/frameworks.md » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/specs/elements.md
diff --git a/sky/specs/elements.md b/sky/specs/elements.md
index 07b3633a16c92142094708d4424cf809dc1eab98..f219ad0d4c792af1acbf2dbc762d1bfd00e386cd 100644
--- a/sky/specs/elements.md
+++ b/sky/specs/elements.md
@@ -184,19 +184,6 @@ class Attr {
final String value; // O(1)
}
-// @tagname annotation for registering elements
-// only useful when placed on classes that inherit from Element
-class tagname extends AutomaticMetadata {
- const tagname(this.name);
- final String name;
- void init(DeclarationMirror target, Module module) {
- assert(target is ClassMirror);
- if (!(target as ClassMirror).isSubclassOf(reflectClass(Element)))
- throw new UnsupportedError('@tagname can only be used on descendants of Element');
- module.registerElement(name, (target as ClassMirror).reflectedType);
- }
-}
-
// @hasShadow annotation for registering elements
class _HasShadow {
const _HasShadow();
@@ -222,12 +209,6 @@ abstract class Element extends ParentNode {
// children must be Text or Element
// if needsShadow is true, creates a shadow tree
- String get tagName { // O(N) in number of annotations on the class
- // throws a StateError if the class doesn't have an @tagname annotation
- var tagnameClass = reflectClass(tagname);
- return (reflectClass(this.runtimeType).metadata.singleWhere((mirror) => mirror.type == tagnameClass).reflectee as tagname).name;
- }
-
external bool hasAttribute(String name); // O(N) in number of attributes
external String getAttribute(String name); // O(N) in number of attributes
external void setAttribute(String name, [String value = '']); // O(N) in number of attributes
« no previous file with comments | « no previous file | sky/specs/frameworks.md » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698