Summary: | Implement window.console in WebCore | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | David Kilzer (:ddkilzer) <ddkilzer> | ||||||||||
Component: | DOM | Assignee: | Nobody <webkit-unassigned> | ||||||||||
Status: | RESOLVED FIXED | ||||||||||||
Severity: | Normal | CC: | aroben, info, sam | ||||||||||
Priority: | P2 | Keywords: | InRadar | ||||||||||
Version: | 523.x (Safari 3) | ||||||||||||
Hardware: | Mac | ||||||||||||
OS: | OS X 10.4 | ||||||||||||
Bug Depends on: | |||||||||||||
Bug Blocks: | 14354 | ||||||||||||
Attachments: |
|
Description
David Kilzer (:ddkilzer)
2007-08-12 16:28:07 PDT
Created attachment 15943 [details]
Patch v1
Initial implementation of window.console in WebCore.
Comment on attachment 15943 [details]
Patch v1
Maciej says:
We've used shadow/shadowing to refer specifically to overriding a built-in Window property with a var declaration, I think a better name for this concept would be "Replaceable".
Comment on attachment 15943 [details]
Patch v1
Wrong license applied to source files as well. Should be BSD-style, not LGPL.
Created attachment 15944 [details]
Updated patch [WIP]
Adding an updated patch that is not quite ready for review. This moves Console.{h,cpp,idl} to WebCore/page/ with the rest of the window objects, fixes the licenses, fixes some style issues and changes the extended attribute to Replaceable.
(In reply to comment #4) > Created an attachment (id=15944) [edit] > Updated patch [WIP] WebCore.pro and WebCore.vcproj changes were lost from previous patch. Created attachment 15946 [details]
Even more updated [Still WIP]
Adds WebCore.pro and WebCore.vcproj back
+ // FIXME: this should use LogMessageLevel, but must use ErrorMessageLevel for now to forward message to the console. etc. We should pass the right message level to Crome and let Crome's addMessageToConsole do the right thing when calling the client. Passing the wrong message level is gimping the new Web Inspector console. If you make this change: Index: page/Chrome.cpp =================================================================== --- page/Chrome.cpp (revision 27149) +++ page/Chrome.cpp (working copy) @@ -197,7 +197,7 @@ void Chrome::addMessageToConsole(MessageSource source, MessageLevel level, const String& message, unsigned lineNumber, const String& sourceID) { - if (source == JSMessageSource && level == ErrorMessageLevel) + if (source == JSMessageSource) m_client->addMessageToConsole(message, lineNumber, sourceID); if (InspectorController* inspector = m_page->inspectorController()) Then you can pass all the correct message levels. (In reply to comment #8) > + // FIXME: this should use LogMessageLevel, but must use ErrorMessageLevel > for now to forward message to the console. > > etc. > > We should pass the right message level to Crome and let Crome's > addMessageToConsole do the right thing when calling the client. Passing the > wrong message level is gimping the new Web Inspector console. When I added the message level/source stuff I was being pretty paranoid about not changing the set of messages passed up to the ChromeClient. I think we can be less paranoid now and do as you suggest. Created attachment 16904 [details]
patch
Comment on attachment 16904 [details]
patch
It might be nice to add a test that actually called methods on the Console object.
r=me
Landed in r27161 *** Bug 14263 has been marked as a duplicate of this bug. *** |