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

Unified Diff: lib/html/templates/html/dart2js/impl_SelectElement.darttemplate

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:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/html/scripts/systemhtml.py ('k') | tests/html/selectelement_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/html/templates/html/dart2js/impl_SelectElement.darttemplate
diff --git a/lib/html/templates/html/dart2js/impl_SelectElement.darttemplate b/lib/html/templates/html/dart2js/impl_SelectElement.darttemplate
index 59635205dd7ce306ca1326e5ab8fa1a0a17f014f..dd4f05f81e0260f2cdd0cf72870fdbccda7928f0 100644
--- a/lib/html/templates/html/dart2js/impl_SelectElement.darttemplate
+++ b/lib/html/templates/html/dart2js/impl_SelectElement.darttemplate
@@ -5,7 +5,18 @@
class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
$!MEMBERS
+ // 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]];
+ }
}
}
« no previous file with comments | « lib/html/scripts/systemhtml.py ('k') | tests/html/selectelement_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698