OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009, 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2009, 2010 Google 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 are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 1303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1314 * @param {!DOMAgent.NodeId} nodeId | 1314 * @param {!DOMAgent.NodeId} nodeId |
1315 */ | 1315 */ |
1316 highlightDOMNodeForTwoSeconds: function(nodeId) | 1316 highlightDOMNodeForTwoSeconds: function(nodeId) |
1317 { | 1317 { |
1318 this.highlightDOMNode(nodeId); | 1318 this.highlightDOMNode(nodeId); |
1319 this._hideDOMNodeHighlightTimeout = setTimeout(this.hideDOMNodeHighlight
.bind(this), 2000); | 1319 this._hideDOMNodeHighlightTimeout = setTimeout(this.hideDOMNodeHighlight
.bind(this), 2000); |
1320 }, | 1320 }, |
1321 | 1321 |
1322 /** | 1322 /** |
1323 * @param {boolean} enabled | 1323 * @param {boolean} enabled |
1324 * @param {boolean} inspectShadowDOM | 1324 * @param {boolean} inspectUAShadowDOM |
1325 * @param {function(?Protocol.Error)=} callback | 1325 * @param {function(?Protocol.Error)=} callback |
1326 */ | 1326 */ |
1327 setInspectModeEnabled: function(enabled, inspectShadowDOM, callback) | 1327 setInspectModeEnabled: function(enabled, inspectUAShadowDOM, callback) |
1328 { | 1328 { |
1329 /** | 1329 /** |
1330 * @this {WebInspector.DOMAgent} | 1330 * @this {WebInspector.DOMAgent} |
1331 */ | 1331 */ |
1332 function onDocumentAvailable() | 1332 function onDocumentAvailable() |
1333 { | 1333 { |
1334 this._highlighter.setInspectModeEnabled(enabled, inspectShadowDOM, t
his._buildHighlightConfig(), callback); | 1334 this._highlighter.setInspectModeEnabled(enabled, inspectUAShadowDOM,
this._buildHighlightConfig(), callback); |
1335 } | 1335 } |
1336 this.requestDocument(onDocumentAvailable.bind(this)); | 1336 this.requestDocument(onDocumentAvailable.bind(this)); |
1337 }, | 1337 }, |
1338 | 1338 |
1339 /** | 1339 /** |
1340 * @param {string=} mode | 1340 * @param {string=} mode |
1341 * @return {!DOMAgent.HighlightConfig} | 1341 * @return {!DOMAgent.HighlightConfig} |
1342 */ | 1342 */ |
1343 _buildHighlightConfig: function(mode) | 1343 _buildHighlightConfig: function(mode) |
1344 { | 1344 { |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1624 WebInspector.DOMNodeHighlighter.prototype = { | 1624 WebInspector.DOMNodeHighlighter.prototype = { |
1625 /** | 1625 /** |
1626 * @param {!DOMAgent.NodeId} nodeId | 1626 * @param {!DOMAgent.NodeId} nodeId |
1627 * @param {!DOMAgent.HighlightConfig} config | 1627 * @param {!DOMAgent.HighlightConfig} config |
1628 * @param {!RuntimeAgent.RemoteObjectId=} objectId | 1628 * @param {!RuntimeAgent.RemoteObjectId=} objectId |
1629 */ | 1629 */ |
1630 highlightDOMNode: function(nodeId, config, objectId) {}, | 1630 highlightDOMNode: function(nodeId, config, objectId) {}, |
1631 | 1631 |
1632 /** | 1632 /** |
1633 * @param {boolean} enabled | 1633 * @param {boolean} enabled |
1634 * @param {boolean} inspectShadowDOM | 1634 * @param {boolean} inspectUAShadowDOM |
1635 * @param {!DOMAgent.HighlightConfig} config | 1635 * @param {!DOMAgent.HighlightConfig} config |
1636 * @param {function(?Protocol.Error)=} callback | 1636 * @param {function(?Protocol.Error)=} callback |
1637 */ | 1637 */ |
1638 setInspectModeEnabled: function(enabled, inspectShadowDOM, config, callback)
{} | 1638 setInspectModeEnabled: function(enabled, inspectUAShadowDOM, config, callbac
k) {} |
1639 } | 1639 } |
1640 | 1640 |
1641 /** | 1641 /** |
1642 * @constructor | 1642 * @constructor |
1643 * @implements {WebInspector.DOMNodeHighlighter} | 1643 * @implements {WebInspector.DOMNodeHighlighter} |
1644 */ | 1644 */ |
1645 WebInspector.DefaultDOMNodeHighlighter = function() { | 1645 WebInspector.DefaultDOMNodeHighlighter = function() { |
1646 } | 1646 } |
1647 | 1647 |
1648 WebInspector.DefaultDOMNodeHighlighter.prototype = { | 1648 WebInspector.DefaultDOMNodeHighlighter.prototype = { |
1649 /** | 1649 /** |
1650 * @param {!DOMAgent.NodeId} nodeId | 1650 * @param {!DOMAgent.NodeId} nodeId |
1651 * @param {!DOMAgent.HighlightConfig} config | 1651 * @param {!DOMAgent.HighlightConfig} config |
1652 * @param {!RuntimeAgent.RemoteObjectId=} objectId | 1652 * @param {!RuntimeAgent.RemoteObjectId=} objectId |
1653 */ | 1653 */ |
1654 highlightDOMNode: function(nodeId, config, objectId) | 1654 highlightDOMNode: function(nodeId, config, objectId) |
1655 { | 1655 { |
1656 if (objectId || nodeId) | 1656 if (objectId || nodeId) |
1657 DOMAgent.highlightNode(config, objectId ? undefined : nodeId, object
Id); | 1657 DOMAgent.highlightNode(config, objectId ? undefined : nodeId, object
Id); |
1658 else | 1658 else |
1659 DOMAgent.hideHighlight(); | 1659 DOMAgent.hideHighlight(); |
1660 }, | 1660 }, |
1661 | 1661 |
1662 /** | 1662 /** |
1663 * @param {boolean} enabled | 1663 * @param {boolean} enabled |
1664 * @param {boolean} inspectShadowDOM | 1664 * @param {boolean} inspectUAShadowDOM |
1665 * @param {!DOMAgent.HighlightConfig} config | 1665 * @param {!DOMAgent.HighlightConfig} config |
1666 * @param {function(?Protocol.Error)=} callback | 1666 * @param {function(?Protocol.Error)=} callback |
1667 */ | 1667 */ |
1668 setInspectModeEnabled: function(enabled, inspectShadowDOM, config, callback) | 1668 setInspectModeEnabled: function(enabled, inspectUAShadowDOM, config, callbac
k) |
1669 { | 1669 { |
1670 DOMAgent.setInspectModeEnabled(enabled, inspectShadowDOM, config, callba
ck); | 1670 DOMAgent.setInspectModeEnabled(enabled, inspectUAShadowDOM, config, call
back); |
1671 } | 1671 } |
1672 } | 1672 } |
1673 | 1673 |
1674 /** | 1674 /** |
1675 * @type {!WebInspector.DOMAgent} | 1675 * @type {!WebInspector.DOMAgent} |
1676 */ | 1676 */ |
1677 WebInspector.domAgent; | 1677 WebInspector.domAgent; |
OLD | NEW |