| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. |
| 3 * Copyright (C) 2009 Joseph Pecoraro | 3 * Copyright (C) 2009 Joseph Pecoraro |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 | 48 |
| 49 this.element._section = this; | 49 this.element._section = this; |
| 50 this.registerRequiredCSS("components/objectValue.css"); | 50 this.registerRequiredCSS("components/objectValue.css"); |
| 51 this.registerRequiredCSS("components/objectPropertiesSection.css"); | 51 this.registerRequiredCSS("components/objectPropertiesSection.css"); |
| 52 this.rootElement().childrenListElement.classList.add("source-code", "object-
properties-section") | 52 this.rootElement().childrenListElement.classList.add("source-code", "object-
properties-section") |
| 53 } | 53 } |
| 54 | 54 |
| 55 /** @const */ | 55 /** @const */ |
| 56 WebInspector.ObjectPropertiesSection._arrayLoadThreshold = 100; | 56 WebInspector.ObjectPropertiesSection._arrayLoadThreshold = 100; |
| 57 | 57 |
| 58 /** |
| 59 * @param {!WebInspector.RemoteObject} object |
| 60 * @param {boolean=} skipProto |
| 61 * @return {!Element} |
| 62 */ |
| 63 WebInspector.ObjectPropertiesSection.defaultObjectPresentation = function(object
, skipProto) |
| 64 { |
| 65 var componentRoot = createElementWithClass("span", "source-code"); |
| 66 WebInspector.installComponentRootStyles(componentRoot); |
| 67 |
| 68 var shadowRoot = componentRoot.createShadowRoot(); |
| 69 shadowRoot.appendChild(WebInspector.Widget.createStyleElement("components/ob
jectValue.css")); |
| 70 shadowRoot.appendChild(WebInspector.ObjectPropertiesSection.createValueEleme
nt(object, false)); |
| 71 if (!object.hasChildren) |
| 72 return componentRoot; |
| 73 |
| 74 var objectPropertiesSection = new WebInspector.ObjectPropertiesSection(objec
t, componentRoot); |
| 75 objectPropertiesSection.editable = false; |
| 76 if (skipProto) |
| 77 objectPropertiesSection.skipProto(); |
| 78 |
| 79 return objectPropertiesSection.element; |
| 80 } |
| 81 |
| 58 WebInspector.ObjectPropertiesSection.prototype = { | 82 WebInspector.ObjectPropertiesSection.prototype = { |
| 59 skipProto: function() | 83 skipProto: function() |
| 60 { | 84 { |
| 61 this._skipProto = true; | 85 this._skipProto = true; |
| 62 }, | 86 }, |
| 63 | 87 |
| 64 expand: function() | 88 expand: function() |
| 65 { | 89 { |
| 66 this._objectTreeElement.expand(); | 90 this._objectTreeElement.expand(); |
| 67 }, | 91 }, |
| (...skipping 988 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1056 | 1080 |
| 1057 /** | 1081 /** |
| 1058 * @param {!WebInspector.RemoteObject} value | 1082 * @param {!WebInspector.RemoteObject} value |
| 1059 * @param {boolean} wasThrown | 1083 * @param {boolean} wasThrown |
| 1060 * @param {!Element=} parentElement | 1084 * @param {!Element=} parentElement |
| 1061 * @return {!Element} | 1085 * @return {!Element} |
| 1062 */ | 1086 */ |
| 1063 WebInspector.ObjectPropertiesSection.createValueElementWithCustomSupport = funct
ion(value, wasThrown, parentElement) | 1087 WebInspector.ObjectPropertiesSection.createValueElementWithCustomSupport = funct
ion(value, wasThrown, parentElement) |
| 1064 { | 1088 { |
| 1065 if (value.customPreview()) { | 1089 if (value.customPreview()) { |
| 1066 var result = WebInspector.CustomPreviewSection.createInShadow(value); | 1090 var result = (new WebInspector.CustomPreviewComponent(value)).element; |
| 1067 result.classList.add("object-properties-section-custom-section"); | 1091 result.classList.add("object-properties-section-custom-section"); |
| 1068 return result | 1092 return result |
| 1069 } | 1093 } |
| 1070 return WebInspector.ObjectPropertiesSection.createValueElement(value, wasThr
own, parentElement); | 1094 return WebInspector.ObjectPropertiesSection.createValueElement(value, wasThr
own, parentElement); |
| 1071 } | 1095 } |
| 1072 | 1096 |
| 1073 /** | 1097 /** |
| 1074 * @param {!WebInspector.RemoteObject} value | 1098 * @param {!WebInspector.RemoteObject} value |
| 1075 * @param {boolean} wasThrown | 1099 * @param {boolean} wasThrown |
| 1076 * @param {!Element=} parentElement | 1100 * @param {!Element=} parentElement |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1203 return; | 1227 return; |
| 1204 if (token === "(") { | 1228 if (token === "(") { |
| 1205 params = []; | 1229 params = []; |
| 1206 return; | 1230 return; |
| 1207 } | 1231 } |
| 1208 if (params && tokenType === "js-def") | 1232 if (params && tokenType === "js-def") |
| 1209 params.push(token); | 1233 params.push(token); |
| 1210 } | 1234 } |
| 1211 } | 1235 } |
| 1212 } | 1236 } |
| OLD | NEW |