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

Side by Side Diff: sdk/lib/html/dart2js/html_dart2js.dart

Issue 18089011: Added named constructors to Element to construct common elements. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | sdk/lib/html/dartium/html_dartium.dart » ('j') | tools/dom/scripts/systemhtml.py » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /// The Dart HTML library. 1 /// The Dart HTML library.
2 /// 2 ///
3 /// For examples, see 3 /// For examples, see
4 /// [Dart HTML5 Samples](https://github.com/dart-lang/dart-html5-samples) 4 /// [Dart HTML5 Samples](https://github.com/dart-lang/dart-html5-samples)
5 /// on Github. 5 /// on Github.
6 library dart.dom.html; 6 library dart.dom.html;
7 7
8 import 'dart:async'; 8 import 'dart:async';
9 import 'dart:collection'; 9 import 'dart:collection';
10 import 'dart:_collection-dev' hide Symbol; 10 import 'dart:_collection-dev' hide Symbol;
(...skipping 8373 matching lines...) Expand 10 before | Expand all | Expand 10 after
8384 @Experimental 8384 @Experimental
8385 bool get isTemplate => tagName == 'TEMPLATE' || _isAttributeTemplate; 8385 bool get isTemplate => tagName == 'TEMPLATE' || _isAttributeTemplate;
8386 8386
8387 void _ensureTemplate() { 8387 void _ensureTemplate() {
8388 if (!isTemplate) { 8388 if (!isTemplate) {
8389 throw new UnsupportedError('$this is not a template.'); 8389 throw new UnsupportedError('$this is not a template.');
8390 } 8390 }
8391 TemplateElement.decorate(this); 8391 TemplateElement.decorate(this);
8392 } 8392 }
8393 8393
8394
8395 /// Creates a new `<a>` element.
8396 ///
8397 /// This is identical to calling `new Element.tag(a)`.
8398 factory Element.a() => new Element.tag(a);
8399
8400 /// Creates a new `<article>` element.
8401 ///
8402 /// This is identical to calling `new Element.tag(article)`.
8403 factory Element.article() => new Element.tag(article);
8404
8405 /// Creates a new `<aside>` element.
8406 ///
8407 /// This is identical to calling `new Element.tag(aside)`.
8408 factory Element.aside() => new Element.tag(aside);
8409
8410 /// Creates a new `<audio>` element.
8411 ///
8412 /// This is identical to calling `new Element.tag(audio)`.
8413 factory Element.audio() => new Element.tag(audio);
8414
8415 /// Creates a new `<br>` element.
8416 ///
8417 /// This is identical to calling `new Element.tag(br)`.
8418 factory Element.br() => new Element.tag(br);
8419
8420 /// Creates a new `<canvas>` element.
8421 ///
8422 /// This is identical to calling `new Element.tag(canvas)`.
8423 factory Element.canvas() => new Element.tag(canvas);
8424
8425 /// Creates a new `<div>` element.
8426 ///
8427 /// This is identical to calling `new Element.tag(div)`.
8428 factory Element.div() => new Element.tag(div);
8429
8430 /// Creates a new `<footer>` element.
8431 ///
8432 /// This is identical to calling `new Element.tag(footer)`.
8433 factory Element.footer() => new Element.tag(footer);
8434
8435 /// Creates a new `<header>` element.
8436 ///
8437 /// This is identical to calling `new Element.tag(header)`.
8438 factory Element.header() => new Element.tag(header);
8439
8440 /// Creates a new `<hr>` element.
8441 ///
8442 /// This is identical to calling `new Element.tag(hr)`.
8443 factory Element.hr() => new Element.tag(hr);
8444
8445 /// Creates a new `<iframe>` element.
8446 ///
8447 /// This is identical to calling `new Element.tag(iframe)`.
8448 factory Element.iframe() => new Element.tag(iframe);
8449
8450 /// Creates a new `<img>` element.
8451 ///
8452 /// This is identical to calling `new Element.tag(img)`.
8453 factory Element.img() => new Element.tag(img);
8454
8455 /// Creates a new `<li>` element.
8456 ///
8457 /// This is identical to calling `new Element.tag(li)`.
8458 factory Element.li() => new Element.tag(li);
8459
8460 /// Creates a new `<nav>` element.
8461 ///
8462 /// This is identical to calling `new Element.tag(nav)`.
8463 factory Element.nav() => new Element.tag(nav);
8464
8465 /// Creates a new `<ol>` element.
8466 ///
8467 /// This is identical to calling `new Element.tag(ol)`.
8468 factory Element.ol() => new Element.tag(ol);
8469
8470 /// Creates a new `<option>` element.
8471 ///
8472 /// This is identical to calling `new Element.tag(option)`.
8473 factory Element.option() => new Element.tag(option);
8474
8475 /// Creates a new `<p>` element.
8476 ///
8477 /// This is identical to calling `new Element.tag(p)`.
8478 factory Element.p() => new Element.tag(p);
8479
8480 /// Creates a new `<pre>` element.
8481 ///
8482 /// This is identical to calling `new Element.tag(pre)`.
8483 factory Element.pre() => new Element.tag(pre);
8484
8485 /// Creates a new `<section>` element.
8486 ///
8487 /// This is identical to calling `new Element.tag(section)`.
8488 factory Element.section() => new Element.tag(section);
8489
8490 /// Creates a new `<select>` element.
8491 ///
8492 /// This is identical to calling `new Element.tag(select)`.
8493 factory Element.select() => new Element.tag(select);
8494
8495 /// Creates a new `<span>` element.
8496 ///
8497 /// This is identical to calling `new Element.tag(span)`.
8498 factory Element.span() => new Element.tag(span);
8499
8500 /// Creates a new `<svg>` element.
8501 ///
8502 /// This is identical to calling `new Element.tag(svg)`.
8503 factory Element.svg() => new Element.tag(svg);
8504
8505 /// Creates a new `<table>` element.
8506 ///
8507 /// This is identical to calling `new Element.tag(table)`.
8508 factory Element.table() => new Element.tag(table);
8509
8510 /// Creates a new `<td>` element.
8511 ///
8512 /// This is identical to calling `new Element.tag(td)`.
8513 factory Element.td() => new Element.tag(td);
8514
8515 /// Creates a new `<textarea>` element.
8516 ///
8517 /// This is identical to calling `new Element.tag(textarea)`.
8518 factory Element.textarea() => new Element.tag(textarea);
8519
8520 /// Creates a new `<th>` element.
8521 ///
8522 /// This is identical to calling `new Element.tag(th)`.
8523 factory Element.th() => new Element.tag(th);
8524
8525 /// Creates a new `<tr>` element.
8526 ///
8527 /// This is identical to calling `new Element.tag(tr)`.
8528 factory Element.tr() => new Element.tag(tr);
8529
8530 /// Creates a new `<ul>` element.
8531 ///
8532 /// This is identical to calling `new Element.tag(ul)`.
8533 factory Element.ul() => new Element.tag(ul);
8534
8535 /// Creates a new `<video>` element.
8536 ///
8537 /// This is identical to calling `new Element.tag(video)`.
8538 factory Element.video() => new Element.tag(video);
8539
8540
8394 8541
8395 @DomName('Element.abortEvent') 8542 @DomName('Element.abortEvent')
8396 @DocsEditable 8543 @DocsEditable
8397 static const EventStreamProvider<Event> abortEvent = const EventStreamProvider <Event>('abort'); 8544 static const EventStreamProvider<Event> abortEvent = const EventStreamProvider <Event>('abort');
8398 8545
8399 @DomName('Element.beforecopyEvent') 8546 @DomName('Element.beforecopyEvent')
8400 @DocsEditable 8547 @DocsEditable
8401 static const EventStreamProvider<Event> beforeCopyEvent = const EventStreamPro vider<Event>('beforecopy'); 8548 static const EventStreamProvider<Event> beforeCopyEvent = const EventStreamPro vider<Event>('beforecopy');
8402 8549
8403 @DomName('Element.beforecutEvent') 8550 @DomName('Element.beforecutEvent')
(...skipping 20387 matching lines...) Expand 10 before | Expand all | Expand 10 after
28791 _position = nextPosition; 28938 _position = nextPosition;
28792 return true; 28939 return true;
28793 } 28940 }
28794 _current = null; 28941 _current = null;
28795 _position = _array.length; 28942 _position = _array.length;
28796 return false; 28943 return false;
28797 } 28944 }
28798 28945
28799 T get current => _current; 28946 T get current => _current;
28800 } 28947 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/html/dartium/html_dartium.dart » ('j') | tools/dom/scripts/systemhtml.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698