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

Side by Side Diff: lib/src/treebuilder.dart

Issue 2390773002: Fix strong mode error 'Could not infer type parameter' (Closed)
Patch Set: Created 4 years, 2 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /// Internals to the tree builders. 1 /// Internals to the tree builders.
2 library treebuilder; 2 library treebuilder;
3 3
4 import 'dart:collection'; 4 import 'dart:collection';
5 import 'package:html/dom.dart'; 5 import 'package:html/dom.dart';
6 import 'package:html/parser.dart' show getElementNameTuple; 6 import 'package:html/parser.dart' show getElementNameTuple;
7 import 'package:source_span/source_span.dart'; 7 import 'package:source_span/source_span.dart';
8 import 'constants.dart'; 8 import 'constants.dart';
9 import 'list_proxy.dart'; 9 import 'list_proxy.dart';
10 import 'token.dart'; 10 import 'token.dart';
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 } 345 }
346 346
347 /// Get the foster parent element, and sibling to insert before 347 /// Get the foster parent element, and sibling to insert before
348 /// (or null) when inserting a misnested table node 348 /// (or null) when inserting a misnested table node
349 List<Node> getTableMisnestedNodePosition() { 349 List<Node> getTableMisnestedNodePosition() {
350 // The foster parent element is the one which comes before the most 350 // The foster parent element is the one which comes before the most
351 // recently opened table element 351 // recently opened table element
352 // XXX - this is really inelegant 352 // XXX - this is really inelegant
353 Node lastTable = null; 353 Node lastTable = null;
354 Node fosterParent = null; 354 Node fosterParent = null;
355 var insertBefore = null; 355 Node insertBefore = null;
356 for (var elm in openElements.reversed) { 356 for (var elm in openElements.reversed) {
357 if (elm.localName == "table") { 357 if (elm.localName == "table") {
358 lastTable = elm; 358 lastTable = elm;
359 break; 359 break;
360 } 360 }
361 } 361 }
362 if (lastTable != null) { 362 if (lastTable != null) {
363 // XXX - we should really check that this parent is actually a 363 // XXX - we should really check that this parent is actually a
364 // node here 364 // node here
365 if (lastTable.parentNode != null) { 365 if (lastTable.parentNode != null) {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 Document getDocument() => document; 399 Document getDocument() => document;
400 400
401 /// Return the final fragment. 401 /// Return the final fragment.
402 DocumentFragment getFragment() { 402 DocumentFragment getFragment() {
403 //XXX assert innerHTML 403 //XXX assert innerHTML
404 var fragment = new DocumentFragment(); 404 var fragment = new DocumentFragment();
405 openElements[0].reparentChildren(fragment); 405 openElements[0].reparentChildren(fragment);
406 return fragment; 406 return fragment;
407 } 407 }
408 } 408 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698