Skip to content
  • joepeck@webkit.org's avatar
    Web Inspector: ConsoleMessage should include line and column number where possible · 379c8a1f
    joepeck@webkit.org authored
    https://bugs.webkit.org/show_bug.cgi?id=114929
    
    Source/WebCore:
    
      - adds "m_column" to WebCore::ConsoleMessage
      - adds "column" to Console.ConsoleMessage in the inspector protocol
      - set the column number for console.* functions (Console.cpp)
      - set the column number for XSLT errors (XSLTProcessor)
      - plumb columnNumber everywhere else it is needed, set it to 0 and file
        bugs for all cases missing columnNumber that could provide it.
    
    Reviewed by Timothy Hatcher.
    
    Test: inspector/console/console-url-line-column.html
          inspector/console/console-messages-stack-traces.html
    
    * inspector/ConsoleMessage.h:
    * inspector/ConsoleMessage.cpp:
    (WebCore::ConsoleMessage::ConsoleMessage):
    (WebCore::ConsoleMessage::autogenerateMetadata):
    (WebCore::ConsoleMessage::addToFrontend):
    (WebCore::ConsoleMessage::isEqual):
    Add m_column and set it where appropriate.
    
    * inspector/Inspector.json:
    Add column property to Console.ConsoleMessage.
    
    * page/Console.cpp:
    (WebCore::internalAddMessage):
    (WebCore::Console::profile):
    Set columnNumber like lineNumber from the last stack frame.
    (WebCore::Console::groupEnd):
    Line and column are unused in this message type, set both to 0.
    
    * xml/XSLTProcessorLibxslt.cpp:
    (WebCore::XSLTProcessor::parseErrorFunc):
    * xml/XSLTProcessorQt.cpp:
    (WebCore::XSLTMessageHandler::handleMessage):
    Add real column numbers, the XSLT handlers already had it available.
    
    * bindings/js/JSCustomXPathNSResolver.cpp:
    (WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
    * css/CSSParser.cpp:
    (WebCore::CSSParser::logError):
    * dom/ScriptExecutionContext.h:
    * dom/ScriptExecutionContext.cpp:
    (WebCore::ScriptExecutionContext::addConsoleMessage):
    * dom/Document.cpp:
    (WebCore::Document::logExceptionToConsole):
    (WebCore::Document::addMessage):
    * dom/Document.h:
    * inspector/InspectorConsoleAgent.cpp:
    (WebCore::InspectorConsoleAgent::addMessageToConsole):
    (WebCore::InspectorConsoleAgent::stopTiming):
    (WebCore::InspectorConsoleAgent::didFinishXHRLoading):
    (WebCore::InspectorConsoleAgent::didReceiveResponse):
    (WebCore::InspectorConsoleAgent::didFailLoading):
    * inspector/InspectorConsoleAgent.h:
    * inspector/InspectorConsoleInstrumentation.h:
    (WebCore::InspectorInstrumentation::addMessageToConsole):
    (WebCore::InspectorInstrumentation::addStartProfilingMessageToConsole):
    * inspector/InspectorInstrumentation.cpp:
    (WebCore::InspectorInstrumentation::addMessageToConsoleImpl):
    (WebCore::InspectorInstrumentation::addStartProfilingMessageToConsoleImpl):
    (WebCore::InspectorInstrumentation::addProfileImpl):
    * inspector/InspectorInstrumentation.h:
    (InspectorInstrumentation):
    * inspector/InspectorProfilerAgent.cpp:
    (WebCore::InspectorProfilerAgent::addProfile):
    (WebCore::InspectorProfilerAgent::addProfileFinishedMessageToConsole):
    (WebCore::InspectorProfilerAgent::addStartProfilingMessageToConsole):
    (WebCore::InspectorProfilerAgent::start):
    (WebCore::InspectorProfilerAgent::stop):
    * inspector/InspectorProfilerAgent.h:
    (InspectorProfilerAgent):
    * loader/EmptyClients.h:
    (WebCore::EmptyChromeClient::addMessageToConsole):
    * page/ChromeClient.h:
    (WebCore::ChromeClient::addMessageToConsole):
    * page/ContentSecurityPolicy.cpp:
    (WebCore::ContentSecurityPolicy::logToConsole):
    * page/PageConsole.cpp:
    (WebCore::PageConsole::addMessage):
    * page/PageConsole.h:
    * workers/DefaultSharedWorkerRepository.cpp:
    (SharedWorkerProxy):
    (WebCore::postExceptionTask):
    (WebCore::SharedWorkerProxy::postExceptionToWorkerObject):
    (WebCore::postConsoleMessageTask):
    (WebCore::SharedWorkerProxy::postConsoleMessageToWorkerObject):
    * workers/SharedWorkerContext.cpp:
    (WebCore::SharedWorkerContext::logExceptionToConsole):
    * workers/WorkerContext.cpp:
    (WebCore::WorkerContext::logExceptionToConsole):
    (WebCore::WorkerContext::addConsoleMessage):
    (WebCore::WorkerContext::addMessage):
    (WebCore::WorkerContext::addMessageToWorkerConsole):
    * workers/WorkerContext.h:
    * workers/WorkerMessagingProxy.cpp:
    (WebCore::WorkerExceptionTask::create):
    (WebCore::WorkerExceptionTask::WorkerExceptionTask):
    (WebCore::WorkerExceptionTask::performTask):
    (WorkerExceptionTask):
    (WebCore::WorkerMessagingProxy::postExceptionToWorkerObject):
    (WebCore::postConsoleMessageTask):
    (WebCore::WorkerMessagingProxy::postConsoleMessageToWorkerObject):
    * workers/WorkerMessagingProxy.h:
    (WorkerMessagingProxy):
    * workers/WorkerReportingProxy.h:
    (WorkerReportingProxy):
    Plumb columnNumber through where appropriate. File bugs where missing.
    
    Source/WebKit/blackberry:
    
    Reviewed by Timothy Hatcher.
    
    * Api/DumpRenderTreeClient.h:
    * Api/WebPageClient.h:
    * WebCoreSupport/ChromeClientBlackBerry.cpp:
    (WebCore::ChromeClientBlackBerry::addMessageToConsole):
    * WebCoreSupport/ChromeClientBlackBerry.h:
    (ChromeClientBlackBerry):
    
    Source/WebKit/efl:
    
    Reviewed by Timothy Hatcher.
    
    * WebCoreSupport/ChromeClientEfl.cpp:
    (WebCore::ChromeClientEfl::addMessageToConsole):
    * WebCoreSupport/ChromeClientEfl.h:
    (ChromeClientEfl):
    
    Source/WebKit/gtk:
    
    Reviewed by Timothy Hatcher.
    
    * WebCoreSupport/ChromeClientGtk.cpp:
    (WebKit::ChromeClient::addMessageToConsole):
    * WebCoreSupport/ChromeClientGtk.h:
    (ChromeClient):
    
    Source/WebKit/mac:
    
    Reviewed by Timothy Hatcher.
    
    * WebCoreSupport/WebChromeClient.h:
    * WebCoreSupport/WebChromeClient.mm:
    (WebChromeClient::addMessageToConsole):
    
    Source/WebKit/qt:
    
    Reviewed by Timothy Hatcher.
    
    * WebCoreSupport/ChromeClientQt.cpp:
    (WebCore::ChromeClientQt::addMessageToConsole):
    * WebCoreSupport/ChromeClientQt.h:
    
    Source/WebKit/win:
    
    Reviewed by Timothy Hatcher.
    
    * WebCoreSupport/WebChromeClient.cpp:
    (WebChromeClient::addMessageToConsole):
    * WebCoreSupport/WebChromeClient.h:
    
    Source/WebKit/wince:
    
    Reviewed by Timothy Hatcher.
    
    * WebCoreSupport/ChromeClientWinCE.cpp:
    (WebKit::ChromeClientWinCE::addMessageToConsole):
    * WebCoreSupport/ChromeClientWinCE.h:
    
    Source/WebKit2:
    
    Reviewed by Timothy Hatcher.
    
    * WebProcess/WebCoreSupport/WebChromeClient.cpp:
    (WebKit::WebChromeClient::addMessageToConsole):
    * WebProcess/WebCoreSupport/WebChromeClient.h:
    
    LayoutTests:
    
    Update a test that was outputting the url and line number of console
    method calls, to output the column number as well. Added a test that
    verifies that console API messages have stack traces if appropriate.
    
    Reviewed by Timothy Hatcher.
    
    * inspector/console/console-url-and-line-expected.txt: Removed.
    * inspector/console/console-url-line-column-expected.txt: Added.
    * inspector/console/console-url-line-column.html: Renamed from LayoutTests/inspector/console/console-url-and-line.html.
    * inspector/console/console-messages-stack-traces-expected.txt: Added.
    * inspector/console/console-messages-stack-traces.html: Added.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@149125 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    379c8a1f