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

Unified Diff: tools/dom/templates/html/impl/impl_HTMLSelectElement.darttemplate

Issue 12259045: Add unmodifiable list view. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 | « sdk/lib/html/dartium/html_dartium.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/dom/templates/html/impl/impl_HTMLSelectElement.darttemplate
diff --git a/tools/dom/templates/html/impl/impl_HTMLSelectElement.darttemplate b/tools/dom/templates/html/impl/impl_HTMLSelectElement.darttemplate
index 0f378abaf9a3e62a6d2f3e1365d69b92e8580859..3417187933995eaca92acb939b1f458e5381c352 100644
--- a/tools/dom/templates/html/impl/impl_HTMLSelectElement.darttemplate
+++ b/tools/dom/templates/html/impl/impl_HTMLSelectElement.darttemplate
@@ -11,16 +11,14 @@ $!MEMBERS
// does not operate as a List.
List<OptionElement> get options {
var options = this.children.where((e) => e is OptionElement).toList();
- // TODO(floitsch): find better way to create a read-only list view.
- return options.take(options.length);
+ return new UnmodifiableListView<OptionElement>(options);
}
List<OptionElement> get selectedOptions {
// IE does not change the selected flag for single-selection items.
if (this.multiple) {
var options = this.options.where((o) => o.selected).toList();
- // TODO(floitsch): find better way to create a read-only list view.
- return options.take(options.length);
+ return new UnmodifiableListView<OptionElement>(options);
} else {
return [this.options[this.selectedIndex]];
}
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698