Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com). | 3 * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com). |
| 4 * Copyright (C) 2009 Joseph Pecoraro | 4 * Copyright (C) 2009 Joseph Pecoraro |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 8 * are met: | 8 * are met: |
| 9 * | 9 * |
| 10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
| (...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 377 function messageAdded(event) | 377 function messageAdded(event) |
| 378 { | 378 { |
| 379 var message = /** @type {!WebInspector.Console.Message} */ (event.da ta); | 379 var message = /** @type {!WebInspector.Console.Message} */ (event.da ta); |
| 380 if (message.show) | 380 if (message.show) |
| 381 WebInspector.console.show(); | 381 WebInspector.console.show(); |
| 382 } | 382 } |
| 383 }, | 383 }, |
| 384 | 384 |
| 385 _documentClick: function(event) | 385 _documentClick: function(event) |
| 386 { | 386 { |
| 387 var target = event.deepElementFromPoint(); | 387 var target = event.target; |
| 388 if (target.shadowRoot) | |
| 389 target = event.deepElementFromPoint(); | |
| 390 if (!target) | |
| 391 return; | |
| 392 | |
| 388 var anchor = target.enclosingNodeOrSelfWithNodeName("a"); | 393 var anchor = target.enclosingNodeOrSelfWithNodeName("a"); |
| 389 if (!anchor || !anchor.href) | 394 if (!anchor || !anchor.href) |
| 390 return; | 395 return; |
| 391 | 396 |
| 392 // Prevent the link from navigating, since we don't do any navigation by following links normally. | 397 // Prevent the link from navigating, since we don't do any navigation by following links normally. |
| 393 event.consume(true); | 398 event.consume(true); |
| 394 | 399 |
| 395 if (anchor.preventFollow) | 400 if (anchor.preventFollow) |
| 396 return; | 401 return; |
| 397 | 402 |
| 398 if (anchor.target === "_blank") { | 403 if (anchor.target === "_blank") { |
| 399 InspectorFrontendHost.openInNewTab(anchor.href); | 404 InspectorFrontendHost.openInNewTab(anchor.href); |
| 400 return; | 405 return; |
| 401 } | 406 } |
| 402 | 407 |
| 403 function followLink() | 408 function followLink() |
| 404 { | 409 { |
| 405 if (WebInspector.isBeingEdited(target)) | 410 if (WebInspector.isEditing()) |
|
vsevik
2014/10/21 12:59:56
This won't work (probably)
pfeldman
2014/10/21 13:01:55
Done.
| |
| 406 return; | 411 return; |
| 407 if (WebInspector.openAnchorLocationRegistry.dispatch({ url: anchor.h ref, lineNumber: anchor.lineNumber})) | 412 if (WebInspector.openAnchorLocationRegistry.dispatch({ url: anchor.h ref, lineNumber: anchor.lineNumber})) |
| 408 return; | 413 return; |
| 409 | 414 |
| 410 var uiSourceCode = WebInspector.workspace.uiSourceCodeForURL(anchor. href); | 415 var uiSourceCode = WebInspector.workspace.uiSourceCodeForURL(anchor. href); |
| 411 if (uiSourceCode) { | 416 if (uiSourceCode) { |
| 412 WebInspector.Revealer.reveal(uiSourceCode.uiLocation(anchor.line Number || 0, anchor.columnNumber || 0)); | 417 WebInspector.Revealer.reveal(uiSourceCode.uiLocation(anchor.line Number || 0, anchor.columnNumber || 0)); |
| 413 return; | 418 return; |
| 414 } | 419 } |
| 415 | 420 |
| (...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 878 /** | 883 /** |
| 879 * @param {!WebInspector.Event} event | 884 * @param {!WebInspector.Event} event |
| 880 */ | 885 */ |
| 881 _inspectNode: function(event) | 886 _inspectNode: function(event) |
| 882 { | 887 { |
| 883 WebInspector.Revealer.reveal(/** @type {!WebInspector.DOMNode} */ (event .data)); | 888 WebInspector.Revealer.reveal(/** @type {!WebInspector.DOMNode} */ (event .data)); |
| 884 } | 889 } |
| 885 } | 890 } |
| 886 | 891 |
| 887 new WebInspector.Main(); | 892 new WebInspector.Main(); |
| OLD | NEW |