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

Unified Diff: sdk/lib/html/dart2js/html_dart2js.dart

Issue 11783017: Fixing SelectElement.options to return a read-only list. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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 | « no previous file | tests/html/html.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/html/dart2js/html_dart2js.dart
diff --git a/sdk/lib/html/dart2js/html_dart2js.dart b/sdk/lib/html/dart2js/html_dart2js.dart
index 2f296beed173c1c65a9d56f4d9dd3719923301de..ac0b4eab33fff2cabb8ff40a4f0eb90e9ce472dc 100644
--- a/sdk/lib/html/dart2js/html_dart2js.dart
+++ b/sdk/lib/html/dart2js/html_dart2js.dart
@@ -16548,13 +16548,15 @@ class SelectElement extends Element native "*HTMLSelectElement" {
// Override default options, since IE returns SelectElement itself and it
// does not operate as a List.
List<OptionElement> get options {
- return this.children.where((e) => e is OptionElement).toList();
+ var options = this.children.where((e) => e is OptionElement).toList();
+ return new ListView<OptionElement>(options, 0, options.length);
}
List<OptionElement> get selectedOptions {
// IE does not change the selected flag for single-selection items.
if (this.multiple) {
- return this.options.where((o) => o.selected).toList();
+ var options = this.options.where((o) => o.selected).toList();
+ return new ListView<OptionElement>(options, 0, options.length);
} else {
return [this.options[this.selectedIndex]];
}
« no previous file with comments | « no previous file | tests/html/html.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698