| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 3 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. |
| 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 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 */ | 321 */ |
| 322 function expandStackTrace(expand) { | 322 function expandStackTrace(expand) { |
| 323 stackTraceElement.classList.toggle('hidden', !expand); | 323 stackTraceElement.classList.toggle('hidden', !expand); |
| 324 toggleElement.classList.toggle('expanded', expand); | 324 toggleElement.classList.toggle('expanded', expand); |
| 325 } | 325 } |
| 326 | 326 |
| 327 /** | 327 /** |
| 328 * @param {?Event} event | 328 * @param {?Event} event |
| 329 */ | 329 */ |
| 330 function toggleStackTrace(event) { | 330 function toggleStackTrace(event) { |
| 331 if (event.target.hasSelection()) | 331 var linkClicked = event.target && event.target.enclosingNodeOrSelfWithNode
Name('a'); |
| 332 if (event.target.hasSelection() || linkClicked) |
| 332 return; | 333 return; |
| 333 expandStackTrace(stackTraceElement.classList.contains('hidden')); | 334 expandStackTrace(stackTraceElement.classList.contains('hidden')); |
| 334 event.consume(); | 335 event.consume(); |
| 335 } | 336 } |
| 336 | 337 |
| 337 clickableElement.addEventListener('click', toggleStackTrace, false); | 338 clickableElement.addEventListener('click', toggleStackTrace, false); |
| 338 if (consoleMessage.type === WebInspector.ConsoleMessage.MessageType.Trace) | 339 if (consoleMessage.type === WebInspector.ConsoleMessage.MessageType.Trace) |
| 339 expandStackTrace(true); | 340 expandStackTrace(true); |
| 340 | 341 |
| 341 toggleElement._expandStackTraceForTest = expandStackTrace.bind(null, true); | 342 toggleElement._expandStackTraceForTest = expandStackTrace.bind(null, true); |
| (...skipping 888 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1230 * @return {!Element} | 1231 * @return {!Element} |
| 1231 */ | 1232 */ |
| 1232 toMessageElement() { | 1233 toMessageElement() { |
| 1233 if (!this._element) { | 1234 if (!this._element) { |
| 1234 super.toMessageElement(); | 1235 super.toMessageElement(); |
| 1235 this._element.classList.toggle('collapsed', this._collapsed); | 1236 this._element.classList.toggle('collapsed', this._collapsed); |
| 1236 } | 1237 } |
| 1237 return this._element; | 1238 return this._element; |
| 1238 } | 1239 } |
| 1239 }; | 1240 }; |
| OLD | NEW |