Changeset 96485 in webkit
- Timestamp:
- Oct 3, 2011 2:16:12 AM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r96484 r96485 1 2011-10-03 Pavel Feldman <pfeldman@chromium.org> 2 3 Web Inspector: restore partial front-end compilability 4 https://bugs.webkit.org/show_bug.cgi?id=69221 5 6 Removed unused isWhitespace; introduced missing classes in Inspector.json; 7 generated externs for the protocol types along with the commands. 8 9 Reviewed by Yury Semikhatsky. 10 11 * inspector/Inspector.json: 12 * inspector/compile-front-end.sh: 13 * inspector/front-end/DOMAgent.js: 14 (WebInspector.DOMAgent): 15 (WebInspector.DOMAgent.prototype._dispatchWhenDocumentAvailable.onDocumentAvailable): 16 (WebInspector.DOMAgent.prototype._dispatchWhenDocumentAvailable): 17 * inspector/front-end/ElementsPanel.js: 18 (WebInspector.ElementsPanel.prototype.updateBreadcrumb): 19 * inspector/front-end/ElementsTreeOutline.js: 20 (): 21 * inspector/front-end/Object.js: 22 * inspector/front-end/Popover.js: 23 (WebInspector.PopoverHelper.prototype._mouseMove): 24 * inspector/front-end/View.js: 25 * inspector/front-end/externs.js: 26 (Array.prototype.remove): 27 * inspector/generate-protocol-externs: 28 1 29 2011-10-02 Kent Tamura <tkent@chromium.org> 2 30 -
trunk/Source/WebCore/inspector/Inspector.json
r96398 r96485 119 119 "description": "Search result for resource.", 120 120 "properties": [ 121 121 { "name": "url", "type": "string", "description": "Resource URL." }, 122 122 { "name": "frameId", "type": "string", "description": "Resource frame id." }, 123 123 { "name": "matchesCount", "type": "number", "description": "Number of matches in the resource content." } 124 124 ], 125 125 "hidden": true 126 } 126 }, 127 { 128 "id": "Cookie", 129 "type": "object", 130 "description": "Cookie object", 131 "properties": [ 132 { "name": "name", "type": "string", "description": "Cookie name." }, 133 { "name": "value", "type": "string", "description": "Cookie value." }, 134 { "name": "domain", "type": "string", "description": "Cookie domain." }, 135 { "name": "path", "type": "string", "description": "Cookie path." }, 136 { "name": "expires", "type": "integer", "description": "Cookie expires." }, 137 { "name": "size", "type": "integer", "description": "Cookie size." }, 138 { "name": "httpOnly", "type": "boolean", "description": "True if cookie is http-only." }, 139 { "name": "secure", "type": "boolean", "description": "True if cookie is secure." }, 140 { "name": "session", "type": "boolean", "description": "True in case of session cookie." } 141 ], 142 "hidden": true 143 }, 127 144 ], 128 145 "commands": [ … … 775 792 { "name": "transactionId", "type": "integer" }, 776 793 { "name": "columnNames", "type": "array", "items": { "type": "string" } }, 777 { "name": "values", "type": "array", "items": { "type": " string or number" }}794 { "name": "values", "type": "array", "items": { "type": "any" }} 778 795 ] 779 796 }, … … 790 807 "domain": "DOMStorage", 791 808 "hidden": true, 792 "types": [], 809 "types": [ 810 { 811 "id": "Entry", 812 "type": "object", 813 "description": "DOM Storage entry.", 814 "hidden": true, 815 "properties": [ 816 { "name": "host", "type": "string", "description": "Domain name." }, 817 { "name": "isLocalStorage", "type": "boolean", "description": "True for local storage." }, 818 { "name": "id", "type": "number", "description": "Entry id for further reference." } 819 ] 820 }, 821 ], 793 822 "commands": [ 794 823 { … … 806 835 ], 807 836 "returns": [ 808 { "name": "entries", "type": "array", "items": { "$ref": " DOMStorageEntry"} }837 { "name": "entries", "type": "array", "items": { "$ref": "Entry"} } 809 838 ] 810 839 }, -
trunk/Source/WebCore/inspector/compile-front-end.sh
r93769 r96485 35 35 --externs Source/WebCore/inspector/front-end/externs.js \ 36 36 --externs Source/WebCore/inspector/front-end/protocol-externs.js \ 37 --module jsmodule_ util:2 \37 --module jsmodule_core:2 \ 38 38 --js Source/WebCore/inspector/front-end/utilities.js \ 39 39 --js Source/WebCore/inspector/front-end/treeoutline.js \ 40 --module jsmodule_host:1 \ 41 --js Source/WebCore/inspector/front-end/InspectorFrontendHostStub.js \ 42 --module jsmodule_common:4:jsmodule_util,jsmodule_host \ 43 --js Source/WebCore/inspector/front-end/BinarySearch.js \ 44 --js Source/WebCore/inspector/front-end/Object.js \ 40 --module jsmodule_env:3 \ 45 41 --js Source/WebCore/inspector/front-end/Settings.js \ 46 42 --js Source/WebCore/inspector/front-end/UserMetrics.js \ 47 --module jsmodule_sdk:15:jsmodule_common,jsmodule_host \ 43 --js Source/WebCore/inspector/front-end/InspectorFrontendHostStub.js \ 44 --module jsmodule_sdk:7:jsmodule_core,jsmodule_env \ 45 --js Source/WebCore/inspector/front-end/BinarySearch.js \ 46 --js Source/WebCore/inspector/front-end/DOMAgent.js \ 48 47 --js Source/WebCore/inspector/front-end/DebuggerModel.js \ 49 --js Source/WebCore/inspector/front-end/BreakpointManager.js \ 50 --js Source/WebCore/inspector/front-end/ConsoleMessage.js \ 51 --js Source/WebCore/inspector/front-end/ConsoleModel.js \ 52 --js Source/WebCore/inspector/front-end/DebuggerPresentationModel.js \ 53 --js Source/WebCore/inspector/front-end/CookieParser.js \ 54 --js Source/WebCore/inspector/front-end/DOMAgent.js \ 55 --js Source/WebCore/inspector/front-end/NetworkManager.js \ 48 --js Source/WebCore/inspector/front-end/Object.js \ 56 49 --js Source/WebCore/inspector/front-end/Script.js \ 57 --js Source/WebCore/inspector/front-end/ScriptFormatter.js \58 --js Source/WebCore/inspector/front-end/SourceFile.js \59 50 --js Source/WebCore/inspector/front-end/RemoteObject.js \ 60 --js Source/WebCore/inspector/front-end/Resource.js \61 51 --js Source/WebCore/inspector/front-end/ResourceCategory.js \ 62 --js Source/WebCore/inspector/front-end/UISourceCode.js \63 52 --module jsmodule_misc:10:jsmodule_sdk \ 64 53 --js Source/WebCore/inspector/front-end/Checkbox.js \ -
trunk/Source/WebCore/inspector/front-end/DOMAgent.js
r96106 r96485 32 32 /** 33 33 * @constructor 34 * @param {DOMAgent.Node} payload. 34 35 */ 35 36 WebInspector.DOMNode = function(doc, payload) { … … 259 260 }, 260 261 261 isWhitespace: function()262 {263 if (this.nodeType !== Node.TEXT_NODE)264 return false;265 if (!this.nodeValue.length)266 return true;267 return this.nodeValue.match(/^[\s\xA0]+$/);268 },269 270 262 _setAttributesPayload: function(attrs) 271 263 { … … 276 268 }, 277 269 270 /** 271 * @param {DOMAgent.Node} payload. 272 */ 278 273 _insertChild: function(prev, payload) 279 274 { … … 376 371 * @extends {WebInspector.DOMNode} 377 372 * @constructor 373 * @param {DOMAgent.Node} payload. 378 374 */ 379 375 WebInspector.DOMDocument = function(domAgent, payload) … … 391 387 */ 392 388 WebInspector.DOMAgent = function() { 393 this._idToDOMNode = null; 389 /** @type {Object|undefined} */ 390 this._idToDOMNode = {}; 394 391 this._document = null; 395 392 this._attributeLoadNodeIds = {}; … … 410 407 411 408 WebInspector.DOMAgent.prototype = { 409 /** 410 * @param {function(WebInspector.DOMDocument)=} callback 411 */ 412 412 requestDocument: function(callback) 413 413 { … … 463 463 }, 464 464 465 _dispatchWhenDocumentAvailable: function(action) 466 { 467 var requestArguments = Array.prototype.slice.call(arguments, 1); 468 var callbackWrapper; 469 470 if (typeof requestArguments[requestArguments.length - 1] === "function") { 471 var callback = requestArguments.pop(); 472 callbackWrapper = this._wrapClientCallback(callback); 473 requestArguments.push(callbackWrapper); 474 } 465 _dispatchWhenDocumentAvailable: function(func, arg, callback) 466 { 467 if (callback) 468 callback = this._wrapClientCallback(callback); 469 475 470 function onDocumentAvailable() 476 471 { 477 472 if (this._document) 478 action.apply(null, requestArguments);473 func.call(null, arg, callback); 479 474 else { 480 if (callback Wrapper)481 callback Wrapper("No document");475 if (callback) 476 callback("No document"); 482 477 } 483 478 } … … 552 547 553 548 /** 554 * @param { *} payload549 * @param {DOMAgent.Node} payload. 555 550 */ 556 551 _setDocument: function(payload) … … 568 563 569 564 /** 570 * @param { *} payload565 * @param {DOMAgent.Node} payload. 571 566 */ 572 567 _setDetachedRoot: function(payload) -
trunk/Source/WebCore/inspector/front-end/ElementsPanel.js
r96106 r96485 632 632 633 633 case Node.TEXT_NODE: 634 if (current.isWhitespace()) 635 crumbTitle = WebInspector.UIString("(whitespace)"); 636 else 637 crumbTitle = WebInspector.UIString("(text)"); 634 crumbTitle = WebInspector.UIString("(text)"); 638 635 break 639 636 -
trunk/Source/WebCore/inspector/front-end/ElementsTreeOutline.js
r94754 r96485 1475 1475 1476 1476 case Node.TEXT_NODE: 1477 if (node.isWhitespace()) 1478 info.titleDOM.appendChild(document.createTextNode("(whitespace)")); 1479 else { 1480 if (node.parentNode && node.parentNode.nodeName().toLowerCase() === "script") { 1481 var newNode = info.titleDOM.createChild("span", "webkit-html-text-node webkit-html-js-node"); 1482 newNode.textContent = node.nodeValue(); 1483 1484 var javascriptSyntaxHighlighter = new WebInspector.DOMSyntaxHighlighter("text/javascript", true); 1485 javascriptSyntaxHighlighter.syntaxHighlightNode(newNode); 1486 } else if (node.parentNode && node.parentNode.nodeName().toLowerCase() === "style") { 1487 var newNode = info.titleDOM.createChild("span", "webkit-html-text-node webkit-html-css-node"); 1488 newNode.textContent = node.nodeValue(); 1489 1490 var cssSyntaxHighlighter = new WebInspector.DOMSyntaxHighlighter("text/css", true); 1491 cssSyntaxHighlighter.syntaxHighlightNode(newNode); 1492 } else { 1493 info.titleDOM.appendChild(document.createTextNode("\"")); 1494 var textNodeElement = info.titleDOM.createChild("span", "webkit-html-text-node"); 1495 textNodeElement.textContent = node.nodeValue(); 1496 info.titleDOM.appendChild(document.createTextNode("\"")); 1497 } 1477 if (node.parentNode && node.parentNode.nodeName().toLowerCase() === "script") { 1478 var newNode = info.titleDOM.createChild("span", "webkit-html-text-node webkit-html-js-node"); 1479 newNode.textContent = node.nodeValue(); 1480 1481 var javascriptSyntaxHighlighter = new WebInspector.DOMSyntaxHighlighter("text/javascript", true); 1482 javascriptSyntaxHighlighter.syntaxHighlightNode(newNode); 1483 } else if (node.parentNode && node.parentNode.nodeName().toLowerCase() === "style") { 1484 var newNode = info.titleDOM.createChild("span", "webkit-html-text-node webkit-html-css-node"); 1485 newNode.textContent = node.nodeValue(); 1486 1487 var cssSyntaxHighlighter = new WebInspector.DOMSyntaxHighlighter("text/css", true); 1488 cssSyntaxHighlighter.syntaxHighlightNode(newNode); 1489 } else { 1490 info.titleDOM.appendChild(document.createTextNode("\"")); 1491 var textNodeElement = info.titleDOM.createChild("span", "webkit-html-text-node"); 1492 textNodeElement.textContent = node.nodeValue(); 1493 info.titleDOM.appendChild(document.createTextNode("\"")); 1498 1494 } 1499 1495 break; -
trunk/Source/WebCore/inspector/front-end/Object.js
r93701 r96485 68 68 }, 69 69 70 /** 71 * @param {*=} eventData 72 */ 70 73 dispatchEventToListeners: function(eventType, eventData) 71 74 { -
trunk/Source/WebCore/inspector/front-end/Popover.js
r94665 r96485 227 227 } 228 228 229 this._handleMouseAction(event );229 this._handleMouseAction(event, false); 230 230 }, 231 231 -
trunk/Source/WebCore/inspector/front-end/View.js
r94754 r96485 27 27 /** 28 28 * @constructor 29 * @extends {WebInspector.Object} 29 30 * @param {Element=} element 30 31 */ … … 69 70 }, 70 71 72 /** 73 * @param {Element=} parentElement 74 */ 71 75 show: function(parentElement) 72 76 { -
trunk/Source/WebCore/inspector/front-end/externs.js
r93769 r96485 70 70 71 71 Element.prototype.scrollIntoViewIfNeeded = function() {} 72 73 Array.prototype.remove = function(obj) {} -
trunk/Source/WebCore/inspector/generate-protocol-externs
r96320 r96485 48 48 49 49 type_traits = { 50 "any": "*", 50 51 "string": "string", 51 52 "integer": "number", … … 66 67 def param_type(domain_name, param): 67 68 if "type" in param: 68 return type_traits[param["type"]] 69 if param["type"] == "array": 70 items = param["items"] 71 return "Array.<%s>" % param_type(domain_name, items) 72 else: 73 return type_traits[param["type"]] 69 74 if "$ref" in param: 70 75 type_id = full_qualified_type_id(domain_name, param["$ref"]) 71 76 if type_id in ref_types: 72 ref_type = ref_types[type_id] 73 return type_traits[ref_type["type"]] 77 return ref_types[type_id] 74 78 else: 75 79 print "Type not found: " + type_id … … 81 85 for type in domain["types"]: 82 86 type_id = full_qualified_type_id(domain_name, type["id"]) 83 ref_types[type_id] = type;87 ref_types[type_id] = "%sAgent.%s" % (domain_name, type["id"]) 84 88 85 89 for domain in json_api: 86 90 domain_name = domain["domain"] 87 91 output_file.write("\n\n\nvar %sAgent = {};\n" % domain_name) 92 if "types" in domain: 93 for type in domain["types"]: 94 if type["type"] == "object": 95 output_file.write("\n/** @constructor */\n") 96 output_file.write("%sAgent.%s = function()\n{\n" % (domain_name, type["id"])) 97 if "properties" in type: 98 for property in type["properties"]: 99 suffix = "" 100 if ("optional" in property): 101 suffix = "|undefined" 102 output_file.write("/** @type {%s%s} */ this.%s;\n" % (param_type(domain_name, property), suffix, property["name"])) 103 output_file.write("}\n") 104 else: 105 output_file.write("\n/** @typedef {%s} */\n%sAgent.%s;\n" % (type_traits[type["type"]], domain_name, type["id"])) 106 107 88 108 if "commands" in domain: 89 109 for command in domain["commands"]:
Note: See TracChangeset
for help on using the changeset viewer.