OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /* eslint-disable indent */ | 5 /* eslint-disable indent */ |
6 (function(window) { | 6 (function(window) { |
7 | 7 |
8 // DevToolsAPI ---------------------------------------------------------------- | 8 // DevToolsAPI ---------------------------------------------------------------- |
9 | 9 |
10 /** | 10 /** |
(...skipping 1059 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1070 result = "U+"; | 1070 result = "U+"; |
1071 var hexString = keyCode.toString(16).toUpperCase(); | 1071 var hexString = keyCode.toString(16).toUpperCase(); |
1072 for (var i = hexString.length; i < 4; ++i) | 1072 for (var i = hexString.length; i < 4; ++i) |
1073 result += "0"; | 1073 result += "0"; |
1074 result += hexString; | 1074 result += hexString; |
1075 return result; | 1075 return result; |
1076 } | 1076 } |
1077 | 1077 |
1078 /** | 1078 /** |
1079 * @suppressGlobalPropertiesCheck | 1079 * @suppressGlobalPropertiesCheck |
| 1080 * @suppress {checkTypes} |
1080 */ | 1081 */ |
1081 function installBackwardsCompatibility() | 1082 function installBackwardsCompatibility() |
1082 { | 1083 { |
1083 sanitizeRemoteFrontendUrl(); | 1084 sanitizeRemoteFrontendUrl(); |
1084 | 1085 |
1085 if (window.location.search.indexOf("remoteFrontend") === -1) | 1086 if (window.location.search.indexOf("remoteFrontend") === -1) |
1086 return; | 1087 return; |
1087 | 1088 |
1088 // Support for legacy (<M53) frontends. | 1089 // Support for legacy (<M53) frontends. |
1089 if (!window.KeyboardEvent.prototype.hasOwnProperty("keyIdentifier")) { | 1090 if (!window.KeyboardEvent.prototype.hasOwnProperty("keyIdentifier")) { |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1133 styleElement.textContent = "html /deep/ * { min-width: 0; min-height: 0; }"; | 1134 styleElement.textContent = "html /deep/ * { min-width: 0; min-height: 0; }"; |
1134 | 1135 |
1135 // Support for quirky border-image behavior (<M51), see: | 1136 // Support for quirky border-image behavior (<M51), see: |
1136 // https://bugs.chromium.org/p/chromium/issues/detail?id=559258 | 1137 // https://bugs.chromium.org/p/chromium/issues/detail?id=559258 |
1137 styleElement.textContent += "\nhtml /deep/ .cm-breakpoint .CodeMirror-linenu
mber { border-style: solid !important; }"; | 1138 styleElement.textContent += "\nhtml /deep/ .cm-breakpoint .CodeMirror-linenu
mber { border-style: solid !important; }"; |
1138 styleElement.textContent += "\nhtml /deep/ .cm-breakpoint.cm-breakpoint-cond
itional .CodeMirror-linenumber { border-style: solid !important; }"; | 1139 styleElement.textContent += "\nhtml /deep/ .cm-breakpoint.cm-breakpoint-cond
itional .CodeMirror-linenumber { border-style: solid !important; }"; |
1139 window.document.head.appendChild(styleElement); | 1140 window.document.head.appendChild(styleElement); |
1140 | 1141 |
1141 // Support for legacy (<M49) frontends. | 1142 // Support for legacy (<M49) frontends. |
1142 Event.prototype.deepPath = undefined; | 1143 Event.prototype.deepPath = undefined; |
| 1144 |
| 1145 // Support for legacy (<53) frontends. |
| 1146 window.FileError = { |
| 1147 NOT_FOUND_ERR: DOMException.NOT_FOUND_ERR, |
| 1148 ABORT_ERR: DOMException.ABORT_ERR, |
| 1149 INVALID_MODIFICATION_ERR: DOMException.INVALID_MODIFICATION_ERR, |
| 1150 NOT_READABLE_ERR: 0 // No matching DOMException, so code will be 0. |
| 1151 }; |
1143 } | 1152 } |
1144 | 1153 |
1145 function windowLoaded() | 1154 function windowLoaded() |
1146 { | 1155 { |
1147 window.removeEventListener("DOMContentLoaded", windowLoaded, false); | 1156 window.removeEventListener("DOMContentLoaded", windowLoaded, false); |
1148 installBackwardsCompatibility(); | 1157 installBackwardsCompatibility(); |
1149 } | 1158 } |
1150 | 1159 |
1151 sanitizeRemoteFrontendUrl(); | 1160 sanitizeRemoteFrontendUrl(); |
1152 if (window.document.head && (window.document.readyState === "complete" || window
.document.readyState === "interactive")) | 1161 if (window.document.head && (window.document.readyState === "complete" || window
.document.readyState === "interactive")) |
1153 installBackwardsCompatibility(); | 1162 installBackwardsCompatibility(); |
1154 else | 1163 else |
1155 window.addEventListener("DOMContentLoaded", windowLoaded, false); | 1164 window.addEventListener("DOMContentLoaded", windowLoaded, false); |
1156 | 1165 |
1157 })(window); | 1166 })(window); |
1158 | 1167 |
1159 if (!DOMTokenList.prototype.__originalDOMTokenListToggle) { | 1168 if (!DOMTokenList.prototype.__originalDOMTokenListToggle) { |
1160 DOMTokenList.prototype.__originalDOMTokenListToggle = DOMTokenList.prototype
.toggle; | 1169 DOMTokenList.prototype.__originalDOMTokenListToggle = DOMTokenList.prototype
.toggle; |
1161 DOMTokenList.prototype.toggle = function(token, force) | 1170 DOMTokenList.prototype.toggle = function(token, force) |
1162 { | 1171 { |
1163 if (arguments.length === 1) | 1172 if (arguments.length === 1) |
1164 force = !this.contains(token); | 1173 force = !this.contains(token); |
1165 return this.__originalDOMTokenListToggle(token, !!force); | 1174 return this.__originalDOMTokenListToggle(token, !!force); |
1166 } | 1175 } |
1167 } | 1176 } |
OLD | NEW |