Chromium Code Reviews| Index: components/neterror/resources/offline.js |
| diff --git a/components/neterror/resources/offline.js b/components/neterror/resources/offline.js |
| index 005f4f3ae20dc570369df092d783a9e5bfec0e13..391a512aefa6e89b3045a3064eb3e55a027009cb 100644 |
| --- a/components/neterror/resources/offline.js |
| +++ b/components/neterror/resources/offline.js |
| @@ -292,7 +292,16 @@ Runner.prototype = { |
| this.spriteDef = Runner.spriteDefinition.LDPI; |
| } |
| - this.init(); |
| + if (!Runner.imageSprite.complete) { |
|
edwardjung
2016/07/18 10:37:11
Do a positive check for the 'complete' property.
kkhorimoto
2016/07/20 01:18:29
Done.
|
| + // If the images are not yet loaded, add a listener. |
| + Runner.imageSprite.runner = this; |
| + |
| + Runner.imageSprite.onload = function() { |
| + this.runner.init(); |
| + } |
|
edwardjung
2016/07/18 10:37:11
I would use the addEventListener style of attachin
kkhorimoto
2016/07/20 01:18:29
Done.
|
| + } else { |
| + this.init(); |
| + } |
| }, |
| /** |
| @@ -660,7 +669,9 @@ Runner.prototype = { |
| if (!this.activated) { |
| this.loadSounds(); |
| this.activated = true; |
| - errorPageController.trackEasterEgg(); |
| + if (errorPageController) { |
| + errorPageController.trackEasterEgg(); |
| + } |
|
edwardjung
2016/07/18 10:37:11
Will there ever be an instance where errorPageCont
kkhorimoto
2016/07/20 01:18:29
errorPageController is consistently nil on iOS. S
edwardjung
2016/07/20 21:37:57
errorPageController is exposed from NetErrorPageCo
|
| } |
| if (!this.tRex.jumping && !this.tRex.ducking) { |