downstream: http://code.google.com/p/chromium/issues/detail?id=158770 UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.94 Safari/537.4 Steps to reproduce the problem: 1. Open the Developer Tools 2. Select Console 3. type console.clear() What is the expected behavior? To clear the console's log area, through the script. What went wrong? Nothing happens Did this work before? No Chrome version: 22.0.1229.94 Channel: stable OS Version: OS X 10.7.5 I know I can erase it by tying CMD+K, but I like to have a debug for my code, like, show every event triggered when I click some element. What I'd like to do is to have the whole console cleared when I click. console.clear() works on Firebug, but doesn't in Developer Tools.
Created attachment 172003 [details] Patch
Comment on attachment 172003 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=172003&action=review > Source/WebCore/inspector/ConsoleMessage.cpp:115 > + case ClearConsoleMessageType: return TypeBuilder::Console::ConsoleMessage::Type::Clear; Drop "Console", it's cleaner. > Source/WebCore/inspector/front-end/ConsoleMessage.js:80 > + this._messageElement = document.createTextNode("console.clear()"); I would say "Console was cleared" with gray. You'll need to put it into WebCore/English.lproj/localizedStrings.js > LayoutTests/inspector/console/console-clear-function-expected.txt:11 > +console.clear() Sounds like the source location is missing. > LayoutTests/inspector/console/console-clear-function.html:22 > + RuntimeAgent.evaluate("console.clear();", function() { Use named functions (step1)
Created attachment 172064 [details] Patch
Comment on attachment 172064 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=172064&action=review > LayoutTests/inspector/console/console-clear-function.html:42 > +Tests that console is cleared via console.clear() method Please add a link to the bug.
Created attachment 172071 [details] Patch
Comment on attachment 172071 [details] Patch Attachment 172071 [details] did not pass mac-ews (mac): Output: http://queues.webkit.org/results/14703008
Created attachment 172517 [details] Patch
Comment on attachment 172517 [details] Patch Clearing flags on attachment: 172517 Committed r133614: <http://trac.webkit.org/changeset/133614>
All reviewed patches have been landed. Closing bug.
Seriously? It is fixed and closed because it now prints "Console was cleared"? Shouldn't it also, you know, clear the console too? That was the OP's expected behavior, and it does not do that currently.
(In reply to comment #10) > Seriously? It is fixed and closed because it now prints "Console was cleared"? Shouldn't it also, you know, clear the console too? That was the OP's expected behavior, and it does not do that currently. This option has no effect when "Preserve Log upon navigation" is toggled. You could use "clear()" in console to clean it up in such cases.