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

Unified Diff: third_party/pkg/angular/lib/core_dom/node_cursor.dart

Issue 1058283006: Update pubspecs and dependencies to get pkgbuild tests working. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 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: third_party/pkg/angular/lib/core_dom/node_cursor.dart
diff --git a/third_party/pkg/angular/lib/core_dom/node_cursor.dart b/third_party/pkg/angular/lib/core_dom/node_cursor.dart
deleted file mode 100644
index 2405fe0a4f40940e2984700d9b019dfb16ad0f0f..0000000000000000000000000000000000000000
--- a/third_party/pkg/angular/lib/core_dom/node_cursor.dart
+++ /dev/null
@@ -1,90 +0,0 @@
-part of angular.core.dom;
-
-class NodeCursor {
- List<dynamic> stack = [];
- List<dom.Node> elements;
- int index;
-
- NodeCursor(this.elements) : index = 0;
-
- isValid() => index < elements.length;
-
- cursorSize() => 1;
-
- macroNext() {
- for (var i = 0, ii = cursorSize(); i < ii; i++, index++){}
-
- return this.isValid();
- }
-
- microNext() {
- var length = elements.length;
-
- if (index < length) {
- index++;
- }
-
- return index < length;
- }
-
- nodeList() {
- if (!isValid()) return []; // or should we return null?
-
- return elements.sublist(index, index + cursorSize());
- }
-
- descend() {
- var childNodes = elements[index].nodes;
- var hasChildren = childNodes != null && childNodes.length > 0;
-
- if (hasChildren) {
- stack.add(index);
- stack.add(elements);
- elements = new List.from(childNodes);
- index = 0;
- }
-
- return hasChildren;
- }
-
- ascend() {
- elements = stack.removeLast();
- index = stack.removeLast();
- }
-
- insertAnchorBefore(String name) {
- var current = elements[index];
- var parent = current.parentNode;
-
- var anchor = new dom.Comment('ANCHOR: $name');
-
- elements.insert(index++, anchor);
-
- if (parent != null) {
- parent.insertBefore(anchor, current);
- }
- }
-
- replaceWithAnchor(String name) {
- insertAnchorBefore(name);
- var childCursor = remove();
- this.index--;
- return childCursor;
- }
-
- remove() {
- var nodes = nodeList();
-
- for (var i = 0; i < nodes.length; i++) {
- // NOTE(deboer): If elements is a list of child nodes on a node, then
- // calling Node.remove() may also remove it from the list. Thus, we
- // call elements.removeAt first so only one node is removed.
- elements.removeAt(index);
- nodes[i].remove();
- }
-
- return new NodeCursor(nodes);
- }
-
- isInstance() => false;
-}
« no previous file with comments | « third_party/pkg/angular/lib/core_dom/ng_mustache.dart ('k') | third_party/pkg/angular/lib/core_dom/selector.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698