Chromium Code Reviews| 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 // These are in place to allow jsDoc to know about types that are not known unti l runtime. | |
| 11 /** @type {(!{ | |
| 12 Setting: ?{ | |
|
dgozman
2016/10/26 22:03:15
I feel uneasy about this - we are tricking ourselv
allada
2016/10/27 16:32:38
Closure complains about these references in other
| |
| 13 prototype: { | |
| 14 remove: ?function() | |
| 15 } | |
| 16 }, | |
| 17 addExtensions: ?function(!Array.<!ExtensionDescriptor>), | |
| 18 setInspectedTabId: ?function(string) | |
| 19 }|undefined)} */ | |
| 20 window.WebInspector; | |
|
lushnikov
2016/10/26 22:10:43
this should go to extenrs.js
allada
2016/10/26 22:46:46
If it goes in externs it will override all of it..
lushnikov
2016/10/27 02:56:21
What do you mean by "always compiled by itself"?
allada
2016/10/27 16:32:37
According to dgozman this file may interact with o
| |
| 21 | |
| 22 /** @type {!Object<string, (function(!Array<*>)|undefined)>} */ | |
| 23 window.InspectorFrontendAPI; | |
| 24 | |
| 10 /** | 25 /** |
| 11 * @constructor | 26 * @constructor |
| 12 */ | 27 */ |
| 13 function DevToolsAPIImpl() | 28 function DevToolsAPIImpl() |
| 14 { | 29 { |
| 15 /** | 30 /** |
| 16 * @type {number} | 31 * @type {number} |
| 17 */ | 32 */ |
| 18 this._lastCallId = 0; | 33 this._lastCallId = 0; |
| 19 | 34 |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 47 if (callback) | 62 if (callback) |
| 48 this._callbacks[callId] = callback; | 63 this._callbacks[callId] = callback; |
| 49 var message = { "id": callId, "method": method }; | 64 var message = { "id": callId, "method": method }; |
| 50 if (args.length) | 65 if (args.length) |
| 51 message.params = args; | 66 message.params = args; |
| 52 DevToolsHost.sendMessageToEmbedder(JSON.stringify(message)); | 67 DevToolsHost.sendMessageToEmbedder(JSON.stringify(message)); |
| 53 }, | 68 }, |
| 54 | 69 |
| 55 /** | 70 /** |
| 56 * @param {string} method | 71 * @param {string} method |
| 57 * @param {!Array.<*>} args | 72 * @param {!Array<*>} args |
| 58 */ | 73 */ |
| 59 _dispatchOnInspectorFrontendAPI: function(method, args) | 74 _dispatchOnInspectorFrontendAPI: function(method, args) |
| 60 { | 75 { |
| 61 var api = window["InspectorFrontendAPI"]; | 76 window.InspectorFrontendAPI[method].apply(window.InspectorFrontendAPI, a rgs); |
| 62 api[method].apply(api, args); | |
| 63 }, | 77 }, |
| 64 | 78 |
| 65 // API methods below this line -------------------------------------------- | 79 // API methods below this line -------------------------------------------- |
| 66 | 80 |
| 67 /** | 81 /** |
| 68 * @param {!Array.<!ExtensionDescriptor>} extensions | 82 * @param {!Array.<!ExtensionDescriptor>} extensions |
| 69 */ | 83 */ |
| 70 addExtensions: function(extensions) | 84 addExtensions: function(extensions) |
| 71 { | 85 { |
| 72 // Support for legacy front-ends (<M41). | 86 // Support for legacy front-ends (<M41). |
| 73 if (window["WebInspector"].addExtensions) | 87 if (window.WebInspector.addExtensions) |
| 74 window["WebInspector"].addExtensions(extensions); | 88 window.WebInspector.addExtensions(extensions); |
| 75 else | 89 else |
| 76 this._dispatchOnInspectorFrontendAPI("addExtensions", [extensions]); | 90 this._dispatchOnInspectorFrontendAPI("addExtensions", [extensions]); |
| 77 }, | 91 }, |
| 78 | 92 |
| 79 /** | 93 /** |
| 80 * @param {string} url | 94 * @param {string} url |
| 81 */ | 95 */ |
| 82 appendedToURL: function(url) | 96 appendedToURL: function(url) |
| 83 { | 97 { |
| 84 this._dispatchOnInspectorFrontendAPI("appendedToURL", [url]); | 98 this._dispatchOnInspectorFrontendAPI("appendedToURL", [url]); |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 275 { | 289 { |
| 276 this._dispatchOnInspectorFrontendAPI("searchCompleted", [requestId, file SystemPath, files]); | 290 this._dispatchOnInspectorFrontendAPI("searchCompleted", [requestId, file SystemPath, files]); |
| 277 }, | 291 }, |
| 278 | 292 |
| 279 /** | 293 /** |
| 280 * @param {string} tabId | 294 * @param {string} tabId |
| 281 */ | 295 */ |
| 282 setInspectedTabId: function(tabId) | 296 setInspectedTabId: function(tabId) |
| 283 { | 297 { |
| 284 // Support for legacy front-ends (<M41). | 298 // Support for legacy front-ends (<M41). |
| 285 if (window["WebInspector"].setInspectedTabId) | 299 if (window.WebInspector.setInspectedTabId) |
| 286 window["WebInspector"].setInspectedTabId(tabId); | 300 window.WebInspector.setInspectedTabId(tabId); |
| 287 else | 301 else |
| 288 this._dispatchOnInspectorFrontendAPI("setInspectedTabId", [tabId]); | 302 this._dispatchOnInspectorFrontendAPI("setInspectedTabId", [tabId]); |
| 289 }, | 303 }, |
| 290 | 304 |
| 291 /** | 305 /** |
| 292 * @param {boolean} useSoftMenu | 306 * @param {boolean} useSoftMenu |
| 293 */ | 307 */ |
| 294 setUseSoftMenu: function(useSoftMenu) | 308 setUseSoftMenu: function(useSoftMenu) |
| 295 { | 309 { |
| 296 this._dispatchOnInspectorFrontendAPI("setUseSoftMenu", [useSoftMenu]); | 310 this._dispatchOnInspectorFrontendAPI("setUseSoftMenu", [useSoftMenu]); |
| (...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 897 this.recordEnumeratedHistogram("DevTools.PanelShown", panelCode, 20); | 911 this.recordEnumeratedHistogram("DevTools.PanelShown", panelCode, 20); |
| 898 } | 912 } |
| 899 }; | 913 }; |
| 900 | 914 |
| 901 window.InspectorFrontendHost = new InspectorFrontendHostImpl(); | 915 window.InspectorFrontendHost = new InspectorFrontendHostImpl(); |
| 902 | 916 |
| 903 // DevToolsApp --------------------------------------------------------------- | 917 // DevToolsApp --------------------------------------------------------------- |
| 904 | 918 |
| 905 function installObjectObserve() | 919 function installObjectObserve() |
| 906 { | 920 { |
| 921 /** @type {!Array<string>} */ | |
| 907 var properties = [ | 922 var properties = [ |
| 908 "advancedSearchConfig", "auditsPanelSplitViewState", "auditsSidebarWidth ", "blockedURLs", "breakpoints", "cacheDisabled", "colorFormat", "consoleHistory ", | 923 "advancedSearchConfig", "auditsPanelSplitViewState", "auditsSidebarWidth ", "blockedURLs", "breakpoints", "cacheDisabled", "colorFormat", "consoleHistory ", |
| 909 "consoleTimestampsEnabled", "cpuProfilerView", "cssSourceMapsEnabled", " currentDockState", "customColorPalette", "customDevicePresets", "customEmulatedD eviceList", | 924 "consoleTimestampsEnabled", "cpuProfilerView", "cssSourceMapsEnabled", " currentDockState", "customColorPalette", "customDevicePresets", "customEmulatedD eviceList", |
| 910 "customFormatters", "customUserAgent", "databaseTableViewVisibleColumns" , "dataGrid-cookiesTable", "dataGrid-DOMStorageItemsView", "debuggerSidebarHidde n", "disableDataSaverInfobar", | 925 "customFormatters", "customUserAgent", "databaseTableViewVisibleColumns" , "dataGrid-cookiesTable", "dataGrid-DOMStorageItemsView", "debuggerSidebarHidde n", "disableDataSaverInfobar", |
| 911 "disablePausedStateOverlay", "domBreakpoints", "domWordWrap", "elementsP anelSplitViewState", "elementsSidebarWidth", "emulation.deviceHeight", "emulatio n.deviceModeValue", | 926 "disablePausedStateOverlay", "domBreakpoints", "domWordWrap", "elementsP anelSplitViewState", "elementsSidebarWidth", "emulation.deviceHeight", "emulatio n.deviceModeValue", |
| 912 "emulation.deviceOrientationOverride", "emulation.deviceScale", "emulati on.deviceScaleFactor", "emulation.deviceUA", "emulation.deviceWidth", "emulation .geolocationOverride", | 927 "emulation.deviceOrientationOverride", "emulation.deviceScale", "emulati on.deviceScaleFactor", "emulation.deviceUA", "emulation.deviceWidth", "emulation .geolocationOverride", |
| 913 "emulation.showDeviceMode", "emulation.showRulers", "enableAsyncStackTra ces", "eventListenerBreakpoints", "fileMappingEntries", "fileSystemMapping", "Fi leSystemViewSidebarWidth", | 928 "emulation.showDeviceMode", "emulation.showRulers", "enableAsyncStackTra ces", "eventListenerBreakpoints", "fileMappingEntries", "fileSystemMapping", "Fi leSystemViewSidebarWidth", |
| 914 "fileSystemViewSplitViewState", "filterBar-consoleView", "filterBar-netw orkPanel", "filterBar-promisePane", "filterBar-timelinePanel", "frameViewerHideC hromeWindow", | 929 "fileSystemViewSplitViewState", "filterBar-consoleView", "filterBar-netw orkPanel", "filterBar-promisePane", "filterBar-timelinePanel", "frameViewerHideC hromeWindow", |
| 915 "heapSnapshotRetainersViewSize", "heapSnapshotSplitViewState", "hideColl ectedPromises", "hideNetworkMessages", "highlightNodeOnHoverInOverlay", "highRes olutionCpuProfiling", | 930 "heapSnapshotRetainersViewSize", "heapSnapshotSplitViewState", "hideColl ectedPromises", "hideNetworkMessages", "highlightNodeOnHoverInOverlay", "highRes olutionCpuProfiling", |
| 916 "inlineVariableValues", "Inspector.drawerSplitView", "Inspector.drawerSp litViewState", "InspectorView.panelOrder", "InspectorView.screencastSplitView", | 931 "inlineVariableValues", "Inspector.drawerSplitView", "Inspector.drawerSp litViewState", "InspectorView.panelOrder", "InspectorView.screencastSplitView", |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 935 "workspaceExcludedFolders", "workspaceFolderExcludePattern", "workspaceI nfobarDisabled", "workspaceMappingInfobarDisabled", "xhrBreakpoints"]; | 950 "workspaceExcludedFolders", "workspaceFolderExcludePattern", "workspaceI nfobarDisabled", "workspaceMappingInfobarDisabled", "xhrBreakpoints"]; |
| 936 | 951 |
| 937 /** | 952 /** |
| 938 * @this {!{_storage: Object, _name: string}} | 953 * @this {!{_storage: Object, _name: string}} |
| 939 */ | 954 */ |
| 940 function settingRemove() | 955 function settingRemove() |
| 941 { | 956 { |
| 942 this._storage[this._name] = undefined; | 957 this._storage[this._name] = undefined; |
| 943 } | 958 } |
| 944 | 959 |
| 960 /** | |
| 961 * @param {!Object} object | |
| 962 * @param {function(!Array<!{name: string}>)} observer | |
| 963 */ | |
| 945 function objectObserve(object, observer) | 964 function objectObserve(object, observer) |
| 946 { | 965 { |
| 947 if (window["WebInspector"]) { | 966 if (window.WebInspector) { |
| 948 var settingPrototype = window["WebInspector"]["Setting"]["prototype" ]; | 967 var settingPrototype = window.WebInspector.Setting.prototype; |
| 949 if (typeof settingPrototype["remove"] === "function") | 968 if (typeof settingPrototype.remove === "function") |
| 950 settingPrototype["remove"] = settingRemove; | 969 settingPrototype.remove = settingRemove; |
| 951 } | 970 } |
| 952 | 971 /** @type {!Set<string>} */ |
| 953 var changedProperties = new Set(); | 972 var changedProperties = new Set(); |
| 954 var scheduled = false; | 973 var scheduled = false; |
| 955 | 974 |
| 956 function scheduleObserver() | 975 function scheduleObserver() |
| 957 { | 976 { |
| 958 if (!scheduled) { | 977 if (scheduled) |
| 959 scheduled = true; | 978 return; |
| 960 setImmediate(callObserver); | 979 scheduled = true; |
| 961 } | 980 setImmediate(callObserver); |
| 962 } | 981 } |
| 963 | 982 |
| 964 function callObserver() | 983 function callObserver() |
| 965 { | 984 { |
| 966 scheduled = false; | 985 scheduled = false; |
| 967 var changes = []; | 986 var changes = /** @type {!Array<!{name: string}>} */ ([]); |
| 968 changedProperties.forEach(function(name) { changes.push({name: name} ); }); | 987 changedProperties.forEach(function(name) { changes.push({name: name} ); }); |
| 969 changedProperties.clear(); | 988 changedProperties.clear(); |
| 970 observer.call(null, changes); | 989 observer.call(null, changes); |
| 971 } | 990 } |
| 972 | 991 |
| 992 /** @type {!Map<string, *>} */ | |
| 973 var storage = new Map(); | 993 var storage = new Map(); |
| 974 | 994 |
| 995 /** | |
| 996 * @param {string} property | |
| 997 */ | |
| 975 function defineProperty(property) | 998 function defineProperty(property) |
| 976 { | 999 { |
| 977 if (property in object) { | 1000 if (property in object) { |
| 978 storage.set(property, object[property]); | 1001 storage.set(property, object[property]); |
| 979 delete object[property]; | 1002 delete object[property]; |
| 980 } | 1003 } |
| 981 | 1004 |
| 982 Object.defineProperty(object, property, { | 1005 Object.defineProperty(object, property, { |
| 1006 /** | |
| 1007 * @return {*} | |
|
lushnikov
2016/10/26 22:10:43
does typing something with "*" make sense?
allada
2016/10/26 22:46:46
We are overriding something that we do not know wh
lushnikov
2016/10/27 02:56:21
AFAIU the * is the default type in closure's type
allada
2016/10/27 16:32:38
Because my goals it get closure 100% typed.
| |
| 1008 */ | |
| 983 get: function() | 1009 get: function() |
| 984 { | 1010 { |
| 985 return storage.get(property); | 1011 return storage.get(property); |
| 986 }, | 1012 }, |
| 987 | 1013 |
| 1014 /** | |
| 1015 * @param {*} value | |
| 1016 */ | |
| 988 set: function(value) | 1017 set: function(value) |
| 989 { | 1018 { |
| 990 storage.set(property, value); | 1019 storage.set(property, value); |
| 991 changedProperties.add(property); | 1020 changedProperties.add(property); |
| 992 scheduleObserver(); | 1021 scheduleObserver(); |
| 993 } | 1022 } |
| 994 }); | 1023 }); |
| 995 } | 1024 } |
| 996 | 1025 |
| 997 for (var i = 0; i < properties.length; ++i) | 1026 for (var i = 0; i < properties.length; ++i) |
| 998 defineProperty(properties[i]); | 1027 defineProperty(properties[i]); |
| 999 } | 1028 } |
| 1000 | 1029 |
| 1001 window.Object.observe = objectObserve; | 1030 window.Object.observe = objectObserve; |
| 1002 } | 1031 } |
| 1003 | 1032 |
| 1033 /** @type {!Map<number, string>} */ | |
| 1004 var staticKeyIdentifiers = new Map([ | 1034 var staticKeyIdentifiers = new Map([ |
| 1005 [0x12, "Alt"], | 1035 [0x12, "Alt"], |
| 1006 [0x11, "Control"], | 1036 [0x11, "Control"], |
| 1007 [0x10, "Shift"], | 1037 [0x10, "Shift"], |
| 1008 [0x14, "CapsLock"], | 1038 [0x14, "CapsLock"], |
| 1009 [0x5b, "Win"], | 1039 [0x5b, "Win"], |
| 1010 [0x5c, "Win"], | 1040 [0x5c, "Win"], |
| 1011 [0x0c, "Clear"], | 1041 [0x0c, "Clear"], |
| 1012 [0x28, "Down"], | 1042 [0x28, "Down"], |
| 1013 [0x23, "End"], | 1043 [0x23, "End"], |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1053 [0x2e, "U+007F"], // Standard says that DEL becomes U+007F. | 1083 [0x2e, "U+007F"], // Standard says that DEL becomes U+007F. |
| 1054 [0xb0, "MediaNextTrack"], | 1084 [0xb0, "MediaNextTrack"], |
| 1055 [0xb1, "MediaPreviousTrack"], | 1085 [0xb1, "MediaPreviousTrack"], |
| 1056 [0xb2, "MediaStop"], | 1086 [0xb2, "MediaStop"], |
| 1057 [0xb3, "MediaPlayPause"], | 1087 [0xb3, "MediaPlayPause"], |
| 1058 [0xad, "VolumeMute"], | 1088 [0xad, "VolumeMute"], |
| 1059 [0xae, "VolumeDown"], | 1089 [0xae, "VolumeDown"], |
| 1060 [0xaf, "VolumeUp"], | 1090 [0xaf, "VolumeUp"], |
| 1061 ]); | 1091 ]); |
| 1062 | 1092 |
| 1093 /** | |
| 1094 * @param {number} keyCode | |
| 1095 * @return {string} | |
| 1096 */ | |
| 1063 function keyCodeToKeyIdentifier(keyCode) | 1097 function keyCodeToKeyIdentifier(keyCode) |
| 1064 { | 1098 { |
| 1065 var result = staticKeyIdentifiers.get(keyCode); | 1099 var result = staticKeyIdentifiers.get(keyCode); |
| 1066 if (result !== undefined) | 1100 if (result !== undefined) |
| 1067 return result; | 1101 return result; |
| 1068 result = "U+"; | 1102 result = "U+"; |
| 1069 var hexString = keyCode.toString(16).toUpperCase(); | 1103 var hexString = keyCode.toString(16).toUpperCase(); |
| 1070 for (var i = hexString.length; i < 4; ++i) | 1104 for (var i = hexString.length; i < 4; ++i) |
| 1071 result += "0"; | 1105 result += "0"; |
| 1072 result += hexString; | 1106 result += hexString; |
| 1073 return result; | 1107 return result; |
| 1074 } | 1108 } |
| 1075 | 1109 |
| 1076 /** | |
| 1077 * @suppressGlobalPropertiesCheck | |
| 1078 * @suppress {checkTypes} | |
| 1079 */ | |
| 1080 function installBackwardsCompatibility() | 1110 function installBackwardsCompatibility() |
| 1081 { | 1111 { |
| 1082 if (window.location.search.indexOf("remoteFrontend") === -1) | 1112 if (window.location.search.indexOf("remoteFrontend") === -1) |
| 1083 return; | 1113 return; |
| 1084 | 1114 |
| 1085 // Support for legacy (<M53) frontends. | 1115 // Support for legacy (<M53) frontends. |
| 1086 if (!window.KeyboardEvent.prototype.hasOwnProperty("keyIdentifier")) { | 1116 if (!window.KeyboardEvent.prototype.hasOwnProperty("keyIdentifier")) { |
| 1087 Object.defineProperty(window.KeyboardEvent.prototype, "keyIdentifier", { | 1117 Object.defineProperty(window.KeyboardEvent.prototype, "keyIdentifier", { |
| 1118 /** | |
| 1119 * @return {string} | |
| 1120 * @this {KeyboardEvent} | |
| 1121 */ | |
| 1088 get: function() | 1122 get: function() |
| 1089 { | 1123 { |
| 1090 return keyCodeToKeyIdentifier(this.keyCode); | 1124 return keyCodeToKeyIdentifier(this.keyCode); |
| 1091 } | 1125 } |
| 1092 }); | 1126 }); |
| 1093 } | 1127 } |
| 1094 | 1128 |
| 1095 // Support for legacy (<M50) frontends. | 1129 // Support for legacy (<M50) frontends. |
| 1096 installObjectObserve(); | 1130 installObjectObserve(); |
| 1097 | 1131 |
| 1098 /** | 1132 /** |
| 1133 * @param {string} property | |
| 1134 * @return {!CSSValue|null} | |
| 1099 * @this {CSSStyleDeclaration} | 1135 * @this {CSSStyleDeclaration} |
| 1100 */ | 1136 */ |
| 1101 function getValue(property) | 1137 function getValue(property) |
| 1102 { | 1138 { |
| 1103 // Note that |property| comes from another context, so we can't use === here. | 1139 // Note that |property| comes from another context, so we can't use === here. |
| 1104 // eslint-disable-next-line eqeqeq | 1140 // eslint-disable-next-line eqeqeq |
| 1105 if (property == "padding-left") { | 1141 if (property == "padding-left") { |
| 1106 return { | 1142 return /** @type {!CSSValue} */ ({ |
| 1107 /** | 1143 /** |
| 1108 * @suppressReceiverCheck | 1144 * @return {number} |
| 1109 * @this {Object} | 1145 * @this {!{__paddingLeft: number}} |
| 1110 */ | 1146 */ |
| 1111 getFloatValue: function() { return this.__paddingLeft; }, | 1147 getFloatValue: function() { return /** @type {number} */ (this._ _paddingLeft); }, |
|
dgozman
2016/10/26 22:03:15
These annotations looks strange: why do we have to
allada
2016/10/26 22:46:47
Done.
| |
| 1112 __paddingLeft: parseFloat(this.paddingLeft) | 1148 __paddingLeft: parseFloat(this.paddingLeft) |
| 1113 }; | 1149 }); |
| 1114 } | 1150 } |
| 1115 throw new Error("getPropertyCSSValue is undefined"); | 1151 throw new Error("getPropertyCSSValue is undefined"); |
| 1116 } | 1152 } |
| 1117 | 1153 |
| 1118 // Support for legacy (<M41) frontends. | 1154 // Support for legacy (<M41) frontends. |
| 1119 window.CSSStyleDeclaration.prototype.getPropertyCSSValue = getValue; | 1155 window.CSSStyleDeclaration.prototype.getPropertyCSSValue = getValue; |
| 1120 | 1156 |
| 1121 function CSSPrimitiveValue() | 1157 function CSSPrimitiveValue() |
| 1122 { | 1158 { |
| 1123 } | 1159 } |
| 1124 CSSPrimitiveValue.CSS_PX = 5; | 1160 CSSPrimitiveValue.CSS_PX = 5; |
| 1125 window.CSSPrimitiveValue = CSSPrimitiveValue; | 1161 window.CSSPrimitiveValue = CSSPrimitiveValue; |
| 1126 | 1162 |
| 1127 // Support for legacy (<M44) frontends. | 1163 // Support for legacy (<M44) frontends. |
| 1128 var styleElement = window.document.createElement("style"); | 1164 var styleElement = window.document.createElement("style"); |
| 1129 styleElement.type = "text/css"; | 1165 styleElement.type = "text/css"; |
| 1130 styleElement.textContent = "html /deep/ * { min-width: 0; min-height: 0; }"; | 1166 styleElement.textContent = "html /deep/ * { min-width: 0; min-height: 0; }"; |
| 1131 | 1167 |
| 1132 // Support for quirky border-image behavior (<M51), see: | 1168 // Support for quirky border-image behavior (<M51), see: |
| 1133 // https://bugs.chromium.org/p/chromium/issues/detail?id=559258 | 1169 // https://bugs.chromium.org/p/chromium/issues/detail?id=559258 |
| 1134 styleElement.textContent += "\nhtml /deep/ .cm-breakpoint .CodeMirror-linenu mber { border-style: solid !important; }"; | 1170 styleElement.textContent += "\nhtml /deep/ .cm-breakpoint .CodeMirror-linenu mber { border-style: solid !important; }"; |
| 1135 styleElement.textContent += "\nhtml /deep/ .cm-breakpoint.cm-breakpoint-cond itional .CodeMirror-linenumber { border-style: solid !important; }"; | 1171 styleElement.textContent += "\nhtml /deep/ .cm-breakpoint.cm-breakpoint-cond itional .CodeMirror-linenumber { border-style: solid !important; }"; |
| 1136 window.document.head.appendChild(styleElement); | 1172 window.document.head.appendChild(styleElement); |
| 1137 | 1173 |
| 1138 // Support for legacy (<M49) frontends. | 1174 // Support for legacy (<M49) frontends. |
| 1139 Event.prototype.deepPath = undefined; | 1175 Event.prototype.deepPath = undefined; |
| 1140 | 1176 |
| 1141 // Support for legacy (<53) frontends. | 1177 // Support for legacy (<53) frontends. |
| 1142 window.FileError = { | 1178 window.FileError = /** @type {!function (new: FileError) : ?} */ ({ |
|
dgozman
2016/10/26 22:03:15
Why this?
allada
2016/10/26 22:46:47
Yes, I was surprised too, but this is how JSDoc ha
| |
| 1143 NOT_FOUND_ERR: DOMException.NOT_FOUND_ERR, | 1179 NOT_FOUND_ERR: DOMException.NOT_FOUND_ERR, |
| 1144 ABORT_ERR: DOMException.ABORT_ERR, | 1180 ABORT_ERR: DOMException.ABORT_ERR, |
| 1145 INVALID_MODIFICATION_ERR: DOMException.INVALID_MODIFICATION_ERR, | 1181 INVALID_MODIFICATION_ERR: DOMException.INVALID_MODIFICATION_ERR, |
| 1146 NOT_READABLE_ERR: 0 // No matching DOMException, so code will be 0. | 1182 NOT_READABLE_ERR: 0 // No matching DOMException, so code will be 0. |
| 1147 }; | 1183 }); |
| 1148 } | 1184 } |
| 1149 | 1185 |
| 1150 function windowLoaded() | 1186 function windowLoaded() |
| 1151 { | 1187 { |
| 1152 window.removeEventListener("DOMContentLoaded", windowLoaded, false); | 1188 window.removeEventListener("DOMContentLoaded", windowLoaded, false); |
| 1153 installBackwardsCompatibility(); | 1189 installBackwardsCompatibility(); |
| 1154 } | 1190 } |
| 1155 | 1191 |
| 1156 if (window.document.head && (window.document.readyState === "complete" || window .document.readyState === "interactive")) | 1192 if (window.document.head && (window.document.readyState === "complete" || window .document.readyState === "interactive")) |
| 1157 installBackwardsCompatibility(); | 1193 installBackwardsCompatibility(); |
| 1158 else | 1194 else |
| 1159 window.addEventListener("DOMContentLoaded", windowLoaded, false); | 1195 window.addEventListener("DOMContentLoaded", windowLoaded, false); |
| 1160 | 1196 |
| 1197 /** @type {(!function(string, boolean=):boolean)|undefined} */ | |
| 1198 DOMTokenList.prototype.__originalDOMTokenListToggle; | |
| 1199 | |
| 1161 if (!DOMTokenList.prototype.__originalDOMTokenListToggle) { | 1200 if (!DOMTokenList.prototype.__originalDOMTokenListToggle) { |
| 1162 DOMTokenList.prototype.__originalDOMTokenListToggle = DOMTokenList.prototype .toggle; | 1201 DOMTokenList.prototype.__originalDOMTokenListToggle = DOMTokenList.prototype .toggle; |
| 1202 /** | |
| 1203 * @param {string} token | |
| 1204 * @param {boolean=} force | |
| 1205 * @return {boolean} | |
| 1206 */ | |
| 1163 DOMTokenList.prototype.toggle = function(token, force) | 1207 DOMTokenList.prototype.toggle = function(token, force) |
| 1164 { | 1208 { |
| 1165 if (arguments.length === 1) | 1209 if (arguments.length === 1) |
| 1166 force = !this.contains(token); | 1210 force = !this.contains(token); |
| 1167 return this.__originalDOMTokenListToggle(token, !!force); | 1211 return this.__originalDOMTokenListToggle(token, !!force); |
| 1168 }; | 1212 }; |
| 1169 } | 1213 } |
| 1170 | 1214 |
| 1171 })(window); | 1215 })(window); |
| OLD | NEW |