Bug 12406 - addMessageToConsole should work without a Page
Summary: addMessageToConsole should work without a Page
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P2 Enhancement
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-25 10:30 PST by Alexey Proskuryakov
Modified: 2022-07-13 18:17 PDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Proskuryakov 2007-01-25 10:30:16 PST
In many cases, error messages may not get logged, because there is no frame or page to call addMessageToConsole() on, e.g.:

void SVGDocumentExtensions::reportWarning(const String& message)
{
    if (Page* page = m_doc->frame()->page())
        page->chrome()->addMessageToConsole("Warning: " + message, m_doc->tokenizer() ? m_doc->tokenizer()->lineNumber() : 1, String());
}

It would be good to find a way not to lose these messages.
Comment 1 Ahmad Saleem 2022-07-13 00:33:46 PDT
This line is changed now:

https://github.com/WebKit/WebKit/blob/0393f2f7c7a1e97a7a4c63441b50703cc11d493f/Source/WebCore/svg/SVGDocumentExtensions.cpp#L134

ap@webkit.org - is it something still need to be fixed?
Comment 2 Alexey Proskuryakov 2022-07-13 18:17:08 PDT
I'm not sure. But if it hasn't been done in 15 years, keeping this bug open won't get it done.