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

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

Issue 12295039: Fixing CssStyleDeclaration to not throw exceptions for unsupported values. (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:
Download patch
« no previous file with comments | « no previous file | tests/html/cssstyledeclaration_test.dart » ('j') | tests/html/element_classes_test.dart » ('J')
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 043abe0f23a7c7c0dd8de294a0c4a37a15d862da..3e72c7174db016c9d7acce11f5456bba8c6938a3 100644
--- a/sdk/lib/html/dart2js/html_dart2js.dart
+++ b/sdk/lib/html/dart2js/html_dart2js.dart
@@ -2374,11 +2374,14 @@ class CssStyleDeclaration native "*CSSStyleDeclaration" {
}
void setProperty(String propertyName, String value, [String priority]) {
- JS('void', '#.setProperty(#, #, #)', this, propertyName, value, priority);
- // Bug #2772, IE9 requires a poke to actually apply the value.
- if (JS('bool', '!!#.setAttribute', this)) {
- JS('void', '#.setAttribute(#, #)', this, propertyName, value);
- }
+ // try/catch for IE9 which throws on unsupported values.
+ try {
+ JS('void', '#.setProperty(#, #, #)', this, propertyName, value, priority);
+ // Bug #2772, IE9 requires a poke to actually apply the value.
+ if (JS('bool', '!!#.setAttribute', this)) {
+ JS('void', '#.setAttribute(#, #)', this, propertyName, value);
+ }
+ } catch (e) {}
}
/**
« no previous file with comments | « no previous file | tests/html/cssstyledeclaration_test.dart » ('j') | tests/html/element_classes_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698