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

Unified Diff: sdk/lib/html/dartium/html_dartium.dart

Issue 11606021: Fixing selectoptions test. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years 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 | sdk/lib/html/scripts/htmlrenamer.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/html/dartium/html_dartium.dart
diff --git a/sdk/lib/html/dartium/html_dartium.dart b/sdk/lib/html/dartium/html_dartium.dart
index 7cfa8ba0e311c77a6994c48490e61ba574be95e8..bdf2b4bfbda2e5e286e9249862e03d122f61ec4a 100644
--- a/sdk/lib/html/dartium/html_dartium.dart
+++ b/sdk/lib/html/dartium/html_dartium.dart
@@ -19808,8 +19808,6 @@ class ScriptProfileNode extends NativeFieldWrapperClass1 {
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// WARNING: Do not edit - generated code.
-
/// @domName HTMLSelectElement
class SelectElement extends _Element_Merged {
@@ -19867,10 +19865,6 @@ class SelectElement extends _Element_Merged {
void set name(String value) native "HTMLSelectElement_name_Setter";
- /** @domName HTMLSelectElement.options */
- HtmlOptionsCollection get options native "HTMLSelectElement_options_Getter";
-
-
/** @domName HTMLSelectElement.required */
bool get required native "HTMLSelectElement_required_Getter";
@@ -19887,10 +19881,6 @@ class SelectElement extends _Element_Merged {
void set selectedIndex(int value) native "HTMLSelectElement_selectedIndex_Setter";
- /** @domName HTMLSelectElement.selectedOptions */
- HtmlCollection get selectedOptions native "HTMLSelectElement_selectedOptions_Getter";
-
-
/** @domName HTMLSelectElement.size */
int get size native "HTMLSelectElement_size_Getter";
@@ -19938,6 +19928,21 @@ class SelectElement extends _Element_Merged {
/** @domName HTMLSelectElement.setCustomValidity */
void setCustomValidity(String error) native "HTMLSelectElement_setCustomValidity_Callback";
+
+ // 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 {
+ // 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
// for details. All rights reserved. Use of this source code is governed by a
« no previous file with comments | « no previous file | sdk/lib/html/scripts/htmlrenamer.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698