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

Unified Diff: pkg/dev_compiler/lib/js/legacy/dart_library.js

Issue 2431443002: Use dart:html prefixes (e.g. webkitAudioNode) on other browsers (Closed)
Patch Set: Fix indent Created 4 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 | « pkg/dev_compiler/lib/js/es6/dart_sdk.js ('k') | pkg/dev_compiler/lib/js/legacy/dart_sdk.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/dev_compiler/lib/js/legacy/dart_library.js
diff --git a/pkg/dev_compiler/lib/js/legacy/dart_library.js b/pkg/dev_compiler/lib/js/legacy/dart_library.js
index 3b766c227f11ab39fb882afa5c599dd776025567..d8dfd96c9a5a55697178c5bf34c076dd7ccc1ffd 100644
--- a/pkg/dev_compiler/lib/js/legacy/dart_library.js
+++ b/pkg/dev_compiler/lib/js/legacy/dart_library.js
@@ -135,9 +135,16 @@ var dart_library =
// Expose constructors for DOM types dart:html needs to assume are
// available on window.
if (typeof PannerNode == "undefined") {
- let audioContext = new AudioContext();
+ let audioContext;
+ if (typeof AudioContext == "undefined" &&
+ (typeof webkitAudioContext != "undefined")) {
+ audioContext = new webkitAudioContext();
+ } else {
+ audioContext = new AudioContext();
+ window.StereoPannerNode =
+ audioContext.createStereoPanner().constructor;
+ }
window.PannerNode = audioContext.createPanner().constructor;
- window.StereoPannerNode = audioContext.createStereoPanner().constructor;
}
if (typeof AudioSourceNode == "undefined") {
window.AudioSourceNode = MediaElementAudioSourceNode.constructor;
@@ -146,14 +153,18 @@ var dart_library =
window.FontFaceSet = document.fonts.__proto__.constructor;
}
if (typeof MemoryInfo == "undefined") {
- window.MemoryInfo = window.performance.memory.constructor;
+ if (typeof window.performance.memory != "undefined") {
+ window.MemoryInfo = window.performance.memory.constructor;
+ }
}
if (typeof Geolocation == "undefined") {
navigator.geolocation.constructor;
}
if (typeof Animation == "undefined") {
let d = document.createElement('div');
- window.Animation = d.animate(d).constructor;
+ if (typeof d.animate != "undefined") {
+ window.Animation = d.animate(d).constructor;
+ }
}
if (typeof SourceBufferList == "undefined") {
window.SourceBufferList = new MediaSource().sourceBuffers.constructor;
« no previous file with comments | « pkg/dev_compiler/lib/js/es6/dart_sdk.js ('k') | pkg/dev_compiler/lib/js/legacy/dart_sdk.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698