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

Unified Diff: client/dom/scripts/template_wrapping_dom.js

Issue 8277016: IE9 dom fixes: Add check for __proto__ before using it and add some name workarounds. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 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 | « client/dom/generated/wrapping_dom.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/dom/scripts/template_wrapping_dom.js
diff --git a/client/dom/scripts/template_wrapping_dom.js b/client/dom/scripts/template_wrapping_dom.js
index 1634ff35b583a180128f77b53d33065702e8b214..adee42977b7ce565093bc61cda3f11f965c6ed4d 100644
--- a/client/dom/scripts/template_wrapping_dom.js
+++ b/client/dom/scripts/template_wrapping_dom.js
@@ -174,7 +174,10 @@ var __dom_type_map = {
$!MAP
// Patches for non-WebKit browsers
'Window': native__DOMWindowWrappingImplementation_create__DOMWindowWrappingImplementation,
- 'global': native__DOMWindowWrappingImplementation_create__DOMWindowWrappingImplementation
+ 'global': native__DOMWindowWrappingImplementation_create__DOMWindowWrappingImplementation,
+ 'KeyEvent': native__KeyboardEventWrappingImplementation_create__KeyboardEventWrappingImplementation, // Opera
+ 'HTMLPhraseElement': native__HTMLElementWrappingImplementation_create__HTMLElementWrappingImplementation, // IE9
+ 'MSStyleCSSProperties': native__CSSStyleDeclarationWrappingImplementation_create__CSSStyleDeclarationWrappingImplementation // IE9
};
function __dom_get_class_chrome(ptr) {
@@ -182,18 +185,27 @@ function __dom_get_class_chrome(ptr) {
}
function __dom_get_class_generic(ptr) {
- var isolatetoken = __dom_isolate_token();
- var result = __dom_get_cached('dart_class', ptr.__proto__, isolatetoken);
- if (result) {
- return result;
- }
var str = Object.prototype.toString.call(ptr);
var name = str.substring(8, str.length - 1);
var cls = __dom_type_map[name];
- __dom_set_cached('dart_class', ptr.__proto__, isolatetoken, cls);
return cls;
}
+if (Object.__proto__) {
+ __dom_get_class_generic = function(ptr) {
+ var isolatetoken = __dom_isolate_token();
+ var result = __dom_get_cached('dart_class', ptr.__proto__, isolatetoken);
+ if (result) {
+ return result;
+ }
+ var str = Object.prototype.toString.call(ptr);
+ var name = str.substring(8, str.length - 1);
+ var cls = __dom_type_map[name];
+ __dom_set_cached('dart_class', ptr.__proto__, isolatetoken, cls);
+ return cls;
+ }
+}
+
var __dom_get_class = __dom_get_class_generic;
if (typeof window !== 'undefined' && // webworkers don't have a window
window.constructor.name == "DOMWindow") {
« no previous file with comments | « client/dom/generated/wrapping_dom.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698