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

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

Issue 11031076: Fixes to get SelectElement working properly on IE. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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:
Download patch
« no previous file with comments | « no previous file | lib/html/scripts/systemhtml.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/html/dart2js/html_dart2js.dart
diff --git a/lib/html/dart2js/html_dart2js.dart b/lib/html/dart2js/html_dart2js.dart
index a45552121903f98df7f7ca96a28a95ed5e91da7e..b6d8a84e35c9b8d5665379c29fe65b39ea79c064 100644
--- a/lib/html/dart2js/html_dart2js.dart
+++ b/lib/html/dart2js/html_dart2js.dart
@@ -31235,8 +31235,6 @@ class _SelectElementImpl extends _ElementImpl implements SelectElement native "*
String name;
- final _HTMLOptionsCollectionImpl options;
-
bool required;
int selectedIndex;
@@ -31262,8 +31260,19 @@ class _SelectElementImpl extends _ElementImpl implements SelectElement native "*
void setCustomValidity(String error) native;
+ // Override default options, since IE returns SelectElement itself and it
+ // does not operate as a List.
+ List<OptionElement> get options() {
+ return this.elements.filter((e) => e is OptionElement);
+ }
+
List<OptionElement> get selectedOptions() {
- return this.options.filter((o) => o.selected);
+ // IE does not change the selected flag for single-selection items.
+ if (this.multiple) {
+ return this.options.filter((o) => o.selected);
+ } else {
+ return [this.options[this.selectedIndex]];
+ }
}
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
« no previous file with comments | « no previous file | lib/html/scripts/systemhtml.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698