OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 import "dart:collection"; |
1 import 'dart:html'; | 6 import 'dart:html'; |
2 import 'dart:json' as json; | 7 import 'dart:json' as json; |
3 | 8 |
4 // Workaround for HTML lib missing feature. | 9 // Workaround for HTML lib missing feature. |
5 Range newRange() { | 10 Range newRange() { |
6 return document.createRange(); | 11 return document.createRange(); |
7 } | 12 } |
8 | 13 |
9 // Temporary range object to optimize performance computing client rects | 14 // Temporary range object to optimize performance computing client rects |
10 // from text nodes. | 15 // from text nodes. |
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
470 } | 475 } |
471 | 476 |
472 static Node _leftMostDescendent(Node n) { | 477 static Node _leftMostDescendent(Node n) { |
473 while (n.nodes.length > 0) { | 478 while (n.nodes.length > 0) { |
474 n = n.nodes.first; | 479 n = n.nodes.first; |
475 } | 480 } |
476 return n; | 481 return n; |
477 } | 482 } |
478 } | 483 } |
479 | 484 |
480 class PostOrderTraversal extends Iterable<Node> { | 485 class PostOrderTraversal extends IterableBase<Node> { |
481 final Node _node; | 486 final Node _node; |
482 PostOrderTraversal(this._node); | 487 PostOrderTraversal(this._node); |
483 | 488 |
484 Iterator<Node> get iterator => new PostOrderTraversalIterator(_node); | 489 Iterator<Node> get iterator => new PostOrderTraversalIterator(_node); |
485 } | 490 } |
486 | 491 |
487 /** | 492 /** |
488 * Estimate what content represents the first line of text within the [section] | 493 * Estimate what content represents the first line of text within the [section] |
489 * range returning null if there isn't a plausible first line of text that | 494 * range returning null if there isn't a plausible first line of text that |
490 * contains the string [prop]. We measure the actual rendered client rectangle | 495 * contains the string [prop]. We measure the actual rendered client rectangle |
(...skipping 816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1307 } | 1312 } |
1308 | 1313 |
1309 void documentLoaded(event) { | 1314 void documentLoaded(event) { |
1310 // Load the database of expected methods and properties with an HttpRequest. | 1315 // Load the database of expected methods and properties with an HttpRequest. |
1311 new HttpRequest.get('${window.location}.json', (req) { | 1316 new HttpRequest.get('${window.location}.json', (req) { |
1312 data = json.parse(req.responseText); | 1317 data = json.parse(req.responseText); |
1313 dbEntry = {'members': [], 'srcUrl': pageUrl}; | 1318 dbEntry = {'members': [], 'srcUrl': pageUrl}; |
1314 run(); | 1319 run(); |
1315 }); | 1320 }); |
1316 } | 1321 } |
OLD | NEW |