| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library trydart.run; | 5 library trydart.run; |
| 6 | 6 |
| 7 import 'dart:html' show | 7 import 'dart:html' show |
| 8 Blob, | 8 Blob, |
| 9 IFrameElement, | 9 IFrameElement, |
| 10 Url; | 10 Url; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 } | 44 } |
| 45 | 45 |
| 46 window.onerror = function (message, url, lineNumber) { | 46 window.onerror = function (message, url, lineNumber) { |
| 47 window.parent.postMessage( | 47 window.parent.postMessage( |
| 48 ["error", {message: message, url: url, lineNumber: lineNumber}], "*"); | 48 ["error", {message: message, url: url, lineNumber: lineNumber}], "*"); |
| 49 }; | 49 }; |
| 50 | 50 |
| 51 (function () { | 51 (function () { |
| 52 | 52 |
| 53 function postScrollHeight() { | 53 function postScrollHeight() { |
| 54 window.parent.postMessage(["scrollHeight", document.documentElement.scrollHeig
ht], "*"); | 54 window.parent.postMessage( |
| 55 ["scrollHeight", document.documentElement.scrollHeight], "*"); |
| 55 } | 56 } |
| 56 | 57 |
| 57 var observer = new (window.MutationObserver||window.WebKitMutationObserver||wind
ow.MozMutationObserver)(function(mutations) { | 58 var observer = new (window.MutationObserver || |
| 59 window.WebKitMutationObserver || |
| 60 window.MozMutationObserver)(function(mutations) { |
| 58 postScrollHeight() | 61 postScrollHeight() |
| 59 window.setTimeout(postScrollHeight, 500); | 62 window.setTimeout(postScrollHeight, 500); |
| 60 }); | 63 }); |
| 61 | 64 |
| 62 observer.observe( | 65 observer.observe( |
| 63 document.body, | 66 document.body, |
| 64 { attributes: true, | 67 { attributes: true, |
| 65 childList: true, | 68 childList: true, |
| 66 characterData: true, | 69 characterData: true, |
| 67 subtree: true }); | 70 subtree: true }); |
| 68 })(); | 71 })(); |
| 69 '''; | 72 '''; |
| OLD | NEW |