Changeset 80061 in webkit


Ignore:
Timestamp:
Mar 1, 2011 4:21:37 PM (13 years ago)
Author:
Joseph Pecoraro
Message:

2011-02-23 Joseph Pecoraro <Joseph Pecoraro>

Reviewed by Timothy Hatcher.

LayoutTests:

2011-02-23 Joseph Pecoraro <Joseph Pecoraro>

All Console Messages should be passed to ChromeClients.
https://bugs.webkit.org/show_bug.cgi?id=54926

Passing more message types to the ChromeClient allows
some more messages to get output during tests. Specifically
HTML, XML, and Other message types.

  • inspector/audits/audits-panel-functional.html: correct a legitimate HTML parse error.
  • http/tests/security/cross-origin-xsl-BLOCKED-expected.txt:
  • http/tests/security/mixedContent/insecure-css-in-main-frame-expected.txt:
  • http/tests/security/mixedContent/insecure-iframe-in-main-frame-expected.txt:
  • http/tests/security/mixedContent/insecure-image-in-main-frame-expected.txt:
  • http/tests/security/mixedContent/insecure-plugin-in-iframe-expected.txt:
  • http/tests/security/mixedContent/insecure-script-in-iframe-expected.txt:
  • http/tests/security/mixedContent/redirect-http-to-https-iframe-in-main-frame-expected.txt:
  • http/tests/security/mixedContent/redirect-http-to-https-script-in-iframe-expected.txt:
  • http/tests/security/mixedContent/redirect-https-to-http-iframe-in-main-frame-expected.txt:
  • http/tests/security/xss-DENIED-xml-external-entity-expected.txt:
  • http/tests/security/xss-DENIED-xsl-document-expected.txt:
  • http/tests/security/xss-DENIED-xsl-external-entity-expected.txt:
  • platform/mac/fast/xsl/xslt-mismatched-tags-in-xslt-expected.txt:
  • platform/mac/fast/xsl/xslt-missing-namespace-in-xslt-expected.txt:
  • platform/mac/http/tests/inspector/console-websocket-error-expected.txt:

Source/WebCore:

2011-02-23 Joseph Pecoraro <Joseph Pecoraro>

All Console Messages should be passed to ChromeClients.
https://bugs.webkit.org/show_bug.cgi?id=54926

Do not filter the message type here, allow clients
to filter and deal with the different message types.

  • page/Console.cpp: (WebCore::Console::addMessage):

Source/WebKit/mac:

2011-02-23 Joseph Pecoraro <Joseph Pecoraro>

All Console Messages should be passed to ChromeClients.
https://bugs.webkit.org/show_bug.cgi?id=54926

Add a new private UIDelegate method, -webView:addMessageToConsole:withSource:,
which supersedes -webView:addMessageToConsole if it exists. The new delegate
does not filter to only JavaScript originated console messages. The old
delegate is left around for clients that expect filtered messages, like
DashCode and older versions of Safari.

The dictionary message passed to the delegate now includes more information
about the message source, type, and level.

  • WebCoreSupport/WebChromeClient.mm: (stringForMessageSource): (stringForMessageType): (stringForMessageLevel): (WebChromeClient::addMessageToConsole):
  • WebView/WebUIDelegatePrivate.h:

Tools:

2011-02-23 Joseph Pecoraro <Joseph Pecoraro>

All Console Messages should be passed to ChromeClients.
https://bugs.webkit.org/show_bug.cgi?id=54926

Update DumpRenderTree's UIDelegate to use the new console message delegate.

  • DumpRenderTree/mac/UIDelegate.mm: (-[UIDelegate webView:addMessageToConsole:withSource:]):
Location:
trunk
Files:
24 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r80060 r80061  
    335335        * platform/gtk/fast/block/positioning/auto/vertical-lr/: 7 tests.
    336336        * platform/gtk/fast/block/positioning/auto/vertical-rl/: 7 tests.
     337
     3382011-02-23  Joseph Pecoraro  <joepeck@webkit.org>
     339
     340        Reviewed by Timothy Hatcher.
     341
     342        All Console Messages should be passed to ChromeClients.
     343        https://bugs.webkit.org/show_bug.cgi?id=54926
     344
     345        Passing more message types to the ChromeClient allows
     346        some more messages to get output during tests. Specifically
     347        HTML, XML, and Other message types.
     348
     349        * inspector/audits/audits-panel-functional.html: correct a legitimate HTML parse error.
     350        * http/tests/security/cross-origin-xsl-BLOCKED-expected.txt:
     351        * http/tests/security/mixedContent/insecure-css-in-main-frame-expected.txt:
     352        * http/tests/security/mixedContent/insecure-iframe-in-main-frame-expected.txt:
     353        * http/tests/security/mixedContent/insecure-image-in-main-frame-expected.txt:
     354        * http/tests/security/mixedContent/insecure-plugin-in-iframe-expected.txt:
     355        * http/tests/security/mixedContent/insecure-script-in-iframe-expected.txt:
     356        * http/tests/security/mixedContent/redirect-http-to-https-iframe-in-main-frame-expected.txt:
     357        * http/tests/security/mixedContent/redirect-http-to-https-script-in-iframe-expected.txt:
     358        * http/tests/security/mixedContent/redirect-https-to-http-iframe-in-main-frame-expected.txt:
     359        * http/tests/security/xss-DENIED-xml-external-entity-expected.txt:
     360        * http/tests/security/xss-DENIED-xsl-document-expected.txt:
     361        * http/tests/security/xss-DENIED-xsl-external-entity-expected.txt:
     362        * platform/mac/fast/xsl/xslt-mismatched-tags-in-xslt-expected.txt:
     363        * platform/mac/fast/xsl/xslt-missing-namespace-in-xslt-expected.txt:
     364        * platform/mac/http/tests/inspector/console-websocket-error-expected.txt:
    337365
    3383662011-02-23  Joseph Pecoraro  <joepeck@webkit.org>
  • trunk/LayoutTests/http/tests/security/cross-origin-xsl-BLOCKED-expected.txt

    r34719 r80061  
     1CONSOLE MESSAGE: line 1: Unsafe attempt to load URL http://localhost:8000/security/resources/forbidden-stylesheet.xsl from frame with URL http://127.0.0.1:8000/security/resources/cross-origin-xsl.xml. Domains, protocols and ports must match.
     2
    13This test loads the XML document in an iframe so that it can call dumpAsText(). This test passes if the iframe below is blank.
    24
  • trunk/LayoutTests/http/tests/security/mixedContent/insecure-css-in-main-frame-expected.txt

    r74995 r80061  
    44main frame - didFinishLoadForFrame
    55main frame - didCommitLoadForFrame
     6CONSOLE MESSAGE: line 1: The page at https://127.0.0.1:8443/security/mixedContent/resources/frame-with-insecure-css.html displayed insecure content from http://127.0.0.1:8080/security/mixedContent/resources/style.css%22.
     7
    68didDisplayInsecureContent
    79main frame - didFinishDocumentLoadForFrame
  • trunk/LayoutTests/http/tests/security/mixedContent/insecure-iframe-in-main-frame-expected.txt

    r48284 r80061  
    55main frame - didCommitLoadForFrame
    66frame "<!--framePath //<!--frame0-->-->" - didStartProvisionalLoadForFrame
     7CONSOLE MESSAGE: line 1: The page at about:blank displayed insecure content from http://127.0.0.1:8080/security/mixedContent/resources/boring.html.
     8
    79didDisplayInsecureContent
    810main frame - didFinishDocumentLoadForFrame
  • trunk/LayoutTests/http/tests/security/mixedContent/insecure-image-in-main-frame-expected.txt

    r48284 r80061  
    44main frame - didFinishLoadForFrame
    55main frame - didCommitLoadForFrame
     6CONSOLE MESSAGE: line 1: The page at https://127.0.0.1:8443/security/mixedContent/resources/frame-with-insecure-image.html displayed insecure content from http://127.0.0.1:8080/security/resources/compass.jpg.
     7
    68didDisplayInsecureContent
    79main frame - didFinishDocumentLoadForFrame
  • trunk/LayoutTests/http/tests/security/mixedContent/insecure-plugin-in-iframe-expected.txt

    r49700 r80061  
    55frame "<!--framePath //<!--frame0-->-->" - didHandleOnloadEventsForFrame
    66main frame - didHandleOnloadEventsForFrame
     7CONSOLE MESSAGE: line 1: The page at https://127.0.0.1:8443/security/mixedContent/resources/frame-with-insecure-plugin.html ran insecure content from http://127.0.0.1:8000/security/mixedContent/resources/dummy.swf.
     8
    79didRunInsecureContent
    810frame "<!--framePath //<!--frame0-->-->" - didFinishLoadForFrame
  • trunk/LayoutTests/http/tests/security/mixedContent/insecure-script-in-iframe-expected.txt

    r48284 r80061  
    22main frame - didFinishDocumentLoadForFrame
    33frame "<!--framePath //<!--frame0-->-->" - didCommitLoadForFrame
     4CONSOLE MESSAGE: line 1: The page at https://127.0.0.1:8443/security/mixedContent/resources/frame-with-insecure-script.html ran insecure content from http://127.0.0.1:8080/security/mixedContent/resources/script.js.
     5
    46didRunInsecureContent
    57frame "<!--framePath //<!--frame0-->-->" - didFinishDocumentLoadForFrame
  • trunk/LayoutTests/http/tests/security/mixedContent/redirect-http-to-https-iframe-in-main-frame-expected.txt

    r48284 r80061  
    55main frame - didCommitLoadForFrame
    66frame "<!--framePath //<!--frame0-->-->" - didStartProvisionalLoadForFrame
     7CONSOLE MESSAGE: line 1: The page at about:blank displayed insecure content from http://127.0.0.1:8080/security/resources/redir.php?url=https://127.0.0.1:8443/security/mixedContent/resources/boring.html.
     8
    79didDisplayInsecureContent
    810main frame - didFinishDocumentLoadForFrame
  • trunk/LayoutTests/http/tests/security/mixedContent/redirect-http-to-https-script-in-iframe-expected.txt

    r48284 r80061  
    22main frame - didFinishDocumentLoadForFrame
    33frame "<!--framePath //<!--frame0-->-->" - didCommitLoadForFrame
     4CONSOLE MESSAGE: line 1: The page at https://127.0.0.1:8443/security/mixedContent/resources/frame-with-redirect-http-to-https-script.html ran insecure content from http://127.0.0.1:8080/security/resources/redir.php?url=https://127.0.0.1:8443/security/mixedContent/resources/script.js.
     5
    46didRunInsecureContent
    57frame "<!--framePath //<!--frame0-->-->" - didFinishDocumentLoadForFrame
  • trunk/LayoutTests/http/tests/security/mixedContent/redirect-https-to-http-iframe-in-main-frame-expected.txt

    r48284 r80061  
    55main frame - didCommitLoadForFrame
    66frame "<!--framePath //<!--frame0-->-->" - didStartProvisionalLoadForFrame
     7CONSOLE MESSAGE: line 1: The page at about:blank displayed insecure content from http://127.0.0.1:8080/security/resources/redir.php?url=https://127.0.0.1:8443/security/mixedContent/resources/boring.html.
     8
    79didDisplayInsecureContent
    810main frame - didFinishDocumentLoadForFrame
  • trunk/LayoutTests/http/tests/security/xss-DENIED-xml-external-entity-expected.txt

    r42738 r80061  
     1CONSOLE MESSAGE: line 1: Unsafe attempt to load URL http://localhost:8000/security/resources/target.xml from frame with URL http://127.0.0.1:8000/security/xss-DENIED-xml-external-entity.xhtml. Domains, protocols and ports must match.
     2
    13This test includes a cross-origin external entity. It passes if the load fails and thus there is no text below this line.
    24
  • trunk/LayoutTests/http/tests/security/xss-DENIED-xsl-document-expected.txt

    r34533 r80061  
     1CONSOLE MESSAGE: line 1: Unsafe attempt to load URL http://localhost:8000/security/resources/target.xml from frame with URL http://127.0.0.1:8000/security/xss-DENIED-xsl-document.xml. Domains, protocols and ports must match.
     2
    13This test includes content via a cross-origin document() command. It passes if the load fails and thus there is no text below this line.
  • trunk/LayoutTests/http/tests/security/xss-DENIED-xsl-external-entity-expected.txt

    r34534 r80061  
     1CONSOLE MESSAGE: line 1: Unsafe attempt to load URL http://localhost:8000/security/resources/target.xml from frame with URL http://127.0.0.1:8000/security/xss-DENIED-xsl-external-entity.xml. Domains, protocols and ports must match.
     2
     3CONSOLE MESSAGE: line 1: Unsafe attempt to load URL http://localhost:8000/security/resources/target.xml from frame with URL http://127.0.0.1:8000/security/xss-DENIED-xsl-external-entity.xml. Domains, protocols and ports must match.
     4
    15This test includes a cross-origin external entity. It passes if the load fails and thus there is no text below this line.
    26
  • trunk/LayoutTests/inspector/audits/audits-panel-functional.html

    r79218 r80061  
    4040}
    4141</script>
    42 </script>
    4342</head>
    4443
  • trunk/LayoutTests/platform/mac/fast/xsl/xslt-mismatched-tags-in-xslt-expected.txt

    r25970 r80061  
     1CONSOLE MESSAGE: line 9: Opening and ending tag mismatch: p line 8 and body
     2
     3CONSOLE MESSAGE: line 10: Opening and ending tag mismatch: body line 6 and html
     4
     5CONSOLE MESSAGE: line 11: Opening and ending tag mismatch: html line 5 and xsl:template
     6
     7CONSOLE MESSAGE: line 12: Opening and ending tag mismatch: template line 4 and stylesheet
     8
     9CONSOLE MESSAGE: line 12: Premature end of data in tag stylesheet line 2
     10
    111layer at (0,0) size 800x600
    212  RenderView at (0,0) size 800x600
  • trunk/LayoutTests/platform/mac/fast/xsl/xslt-missing-namespace-in-xslt-expected.txt

    r25970 r80061  
     1CONSOLE MESSAGE: line 8: Namespace prefix foo on bar is not defined
     2
    13layer at (0,0) size 800x600
    24  RenderView at (0,0) size 800x600
  • trunk/LayoutTests/platform/mac/http/tests/inspector/console-websocket-error-expected.txt

    r78463 r80061  
    11CONSOLE MESSAGE: line 32: testDNSLookup: Test started.
     2CONSOLE MESSAGE: line 0: WebSocket network error: The operation couldn’t be completed. (kCFErrorDomainCFNetwork error 2.)
    23CONSOLE MESSAGE: line 43: testDNSLookup: onclose is called.
    34CONSOLE MESSAGE: line 50: testSSLCertificate: Test started.
     5CONSOLE MESSAGE: line 0: WebSocket network error: OSStatus Error -9812: valid cert chain, untrusted root
    46CONSOLE MESSAGE: line 64: testSSLCertificate: onclose is called.
    57WebSocket's network errors should be logged to console.
  • trunk/Source/WebCore/ChangeLog

    r80060 r80061  
    743743
    7447442011-03-01  Joseph Pecoraro  <joepeck@webkit.org>
     745
     746        Reviewed by Timothy Hatcher.
     747
     748        All Console Messages should be passed to ChromeClients.
     749        https://bugs.webkit.org/show_bug.cgi?id=54926
     750
     751        Do not filter the message type here, allow clients
     752        to filter and deal with the different message types.
     753
     754        * page/Console.cpp:
     755        (WebCore::Console::addMessage):
     756
     7572011-02-23  Joseph Pecoraro  <joepeck@webkit.org>
    745758
    746759        Reviewed by Kenneth Rohde Christiansen.
  • trunk/Source/WebCore/page/Console.cpp

    r76493 r80061  
    144144        return;
    145145
    146     if (source == JSMessageSource)
    147         page->chrome()->client()->addMessageToConsole(source, type, level, message, lineNumber, sourceURL);
     146    page->chrome()->client()->addMessageToConsole(source, type, level, message, lineNumber, sourceURL);
    148147
    149148    if (callStack)
  • trunk/Source/WebKit/mac/ChangeLog

    r80059 r80061  
     12011-02-23  Joseph Pecoraro  <joepeck@webkit.org>
     2
     3        Reviewed by Timothy Hatcher.
     4
     5        All Console Messages should be passed to ChromeClients.
     6        https://bugs.webkit.org/show_bug.cgi?id=54926
     7
     8        Add a new private UIDelegate method, -webView:addMessageToConsole:withSource:,
     9        which supersedes -webView:addMessageToConsole if it exists. The new delegate
     10        does not filter to only JavaScript originated console messages. The old
     11        delegate is left around for clients that expect filtered messages, like
     12        DashCode and older versions of Safari.
     13
     14        The dictionary message passed to the delegate now includes more information
     15        about the message source, type, and level.
     16
     17        * WebCoreSupport/WebChromeClient.mm:
     18        (stringForMessageSource):
     19        (stringForMessageType):
     20        (stringForMessageLevel):
     21        (WebChromeClient::addMessageToConsole):
     22        * WebView/WebUIDelegatePrivate.h:
     23
    1242011-03-01  Levi Weintraub  <leviw@chromium.org>
    225
  • trunk/Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm

    r76983 r80061  
    8080#import "NetscapePluginHostManager.h"
    8181#endif
     82
     83NSString *WebConsoleMessageHTMLMessageSource = @"HTMLMessageSource";
     84NSString *WebConsoleMessageWMLMessageSource = @"WMLMessageSource";
     85NSString *WebConsoleMessageXMLMessageSource = @"XMLMessageSource";
     86NSString *WebConsoleMessageJSMessageSource = @"JSMessageSource";
     87NSString *WebConsoleMessageCSSMessageSource = @"CSSMessageSource";
     88NSString *WebConsoleMessageOtherMessageSource = @"OtherMessageSource";
     89
     90NSString *WebConsoleMessageLogMessageType = @"LogMessageType";
     91NSString *WebConsoleMessageObjectMessageType = @"ObjectMessageType";
     92NSString *WebConsoleMessageTraceMessageType = @"TraceMessageType";
     93NSString *WebConsoleMessageStartGroupMessageType = @"StartGroupMessageType";
     94NSString *WebConsoleMessageStartGroupCollapsedMessageType = @"StartGroupCollapsedMessageType";
     95NSString *WebConsoleMessageEndGroupMessageType = @"EndGroupMessageType";
     96NSString *WebConsoleMessageAssertMessageType = @"AssertMessageType";
     97NSString *WebConsoleMessageUncaughtExceptionMessageType = @"UncaughtExceptionMessageType";
     98NSString *WebConsoleMessageNetworkErrorMessageType = @"NetworkErrorMessageType";
     99
     100NSString *WebConsoleMessageTipMessageLevel = @"TipMessageLevel";
     101NSString *WebConsoleMessageLogMessageLevel = @"LogMessageLevel";
     102NSString *WebConsoleMessageWarningMessageLevel = @"WarningMessageLevel";
     103NSString *WebConsoleMessageErrorMessageLevel = @"ErrorMessageLevel";
     104NSString *WebConsoleMessageDebugMessageLevel = @"DebugMessageLevel";
    82105
    83106@interface NSApplication (WebNSApplicationDetails)
     
    329352}
    330353
     354inline static NSString *stringForMessageSource(MessageSource source)
     355{
     356    switch (source) {
     357    case HTMLMessageSource:
     358        return WebConsoleMessageHTMLMessageSource;
     359    case WMLMessageSource:
     360        return WebConsoleMessageWMLMessageSource;
     361    case XMLMessageSource:
     362        return WebConsoleMessageXMLMessageSource;
     363    case JSMessageSource:
     364        return WebConsoleMessageJSMessageSource;
     365    case CSSMessageSource:
     366        return WebConsoleMessageCSSMessageSource;
     367    case OtherMessageSource:
     368        return WebConsoleMessageOtherMessageSource;
     369    }
     370    ASSERT_NOT_REACHED();
     371    return @"";
     372}
     373
     374inline static NSString *stringForMessageType(MessageType type)
     375{
     376    switch (type) {
     377    case LogMessageType:
     378        return WebConsoleMessageLogMessageType;
     379    case ObjectMessageType:
     380        return WebConsoleMessageObjectMessageType;
     381    case TraceMessageType:
     382        return WebConsoleMessageTraceMessageType;
     383    case StartGroupMessageType:
     384        return WebConsoleMessageStartGroupMessageType;
     385    case StartGroupCollapsedMessageType:
     386        return WebConsoleMessageStartGroupCollapsedMessageType;
     387    case EndGroupMessageType:
     388        return WebConsoleMessageEndGroupMessageType;
     389    case AssertMessageType:
     390        return WebConsoleMessageAssertMessageType;
     391    case UncaughtExceptionMessageType:
     392        return WebConsoleMessageUncaughtExceptionMessageType;
     393    case NetworkErrorMessageType:
     394        return WebConsoleMessageNetworkErrorMessageType;
     395    }
     396    ASSERT_NOT_REACHED();
     397    return @"";
     398}
     399
     400inline static NSString *stringForMessageLevel(MessageLevel level)
     401{
     402    switch (level) {
     403    case TipMessageLevel:
     404        return WebConsoleMessageTipMessageLevel;
     405    case LogMessageLevel:
     406        return WebConsoleMessageLogMessageLevel;
     407    case WarningMessageLevel:
     408        return WebConsoleMessageWarningMessageLevel;
     409    case ErrorMessageLevel:
     410        return WebConsoleMessageErrorMessageLevel;
     411    case DebugMessageLevel:
     412        return WebConsoleMessageDebugMessageLevel;
     413    }
     414    ASSERT_NOT_REACHED();
     415    return @"";
     416}
     417
    331418void WebChromeClient::addMessageToConsole(MessageSource source, MessageType type, MessageLevel level, const String& message, unsigned int lineNumber, const String& sourceURL)
    332419{
    333420    id delegate = [m_webView UIDelegate];
    334     SEL selector = @selector(webView:addMessageToConsole:);
    335     if (![delegate respondsToSelector:selector])
    336         return;
    337 
     421    BOOL respondsToNewSelector = NO;
     422
     423    SEL selector = @selector(webView:addMessageToConsole:withSource:);
     424    if ([delegate respondsToSelector:selector])
     425        respondsToNewSelector = YES;
     426    else {
     427        // The old selector only takes JSMessageSource messages.
     428        if (source != JSMessageSource)
     429            return;
     430        selector = @selector(webView:addMessageToConsole:);
     431        if (![delegate respondsToSelector:selector])
     432            return;
     433    }
     434
     435    NSString *messageSource = stringForMessageSource(source);
    338436    NSDictionary *dictionary = [[NSDictionary alloc] initWithObjectsAndKeys:
    339         (NSString *)message, @"message", [NSNumber numberWithUnsignedInt:lineNumber], @"lineNumber",
    340         (NSString *)sourceURL, @"sourceURL", NULL];
    341 
    342     CallUIDelegate(m_webView, selector, dictionary);
     437        (NSString *)message, @"message",
     438        [NSNumber numberWithUnsignedInt:lineNumber], @"lineNumber",
     439        (NSString *)sourceURL, @"sourceURL",
     440        messageSource, @"MessageSource",
     441        stringForMessageType(type), @"MessageType",
     442        stringForMessageLevel(level), @"MessageLevel",
     443        NULL];
     444
     445    if (respondsToNewSelector)
     446        CallUIDelegate(m_webView, selector, dictionary, messageSource);
     447    else
     448        CallUIDelegate(m_webView, selector, dictionary);
    343449
    344450    [dictionary release];
  • trunk/Source/WebKit/mac/WebView/WebUIDelegatePrivate.h

    r69600 r80061  
    9393};
    9494
     95// Message Sources.
     96extern NSString *WebConsoleMessageHTMLMessageSource;
     97extern NSString *WebConsoleMessageWMLMessageSource;
     98extern NSString *WebConsoleMessageXMLMessageSource;
     99extern NSString *WebConsoleMessageJSMessageSource;
     100extern NSString *WebConsoleMessageCSSMessageSource;
     101extern NSString *WebConsoleMessageOtherMessageSource;
     102
     103// Message Types.
     104extern NSString *WebConsoleMessageLogMessageType;
     105extern NSString *WebConsoleMessageObjectMessageType;
     106extern NSString *WebConsoleMessageTraceMessageType;
     107extern NSString *WebConsoleMessageStartGroupMessageType;
     108extern NSString *WebConsoleMessageStartGroupCollapsedMessageType;
     109extern NSString *WebConsoleMessageEndGroupMessageType;
     110extern NSString *WebConsoleMessageAssertMessageType;
     111extern NSString *WebConsoleMessageUncaughtExceptionMessageType;
     112extern NSString *WebConsoleMessageNetworkErrorMessageType;
     113
     114// Message Levels.
     115extern NSString *WebConsoleMessageTipMessageLevel;
     116extern NSString *WebConsoleMessageLogMessageLevel;
     117extern NSString *WebConsoleMessageWarningMessageLevel;
     118extern NSString *WebConsoleMessageErrorMessageLevel;
     119extern NSString *WebConsoleMessageDebugMessageLevel;
     120
    95121@class WebSecurityOrigin;
    96122
     
    112138
    113139- (void)webView:(WebView *)webView addMessageToConsole:(NSDictionary *)message;
     140
     141/*!
     142    @method webView:addMessageToConsole:withSource:
     143    @param webView The WebView sending the delegate method.
     144    @param message A dictionary representation of the console message.
     145    @param source Where the message came from. See WebConsoleMessageHTMLMessageSource and other source types.
     146    @discussion The dictionary contains the following keys:
     147
     148    <dl>
     149        <dt>message</dt>
     150        <dd>The message itself.</dd>
     151        <dt>lineNumber</dt>
     152        <dd>If this came from a file, this is the line number in the file this message originates from.</dd>
     153        <dt>sourceURL</dt>
     154        <dd>If this came from a file, this is the URL to the file this message originates from.</dd>
     155        <dt>MessageSource</dt>
     156        <dd>
     157            Where the message came from. HTML, XML, JavaScript, CSS, etc.
     158            See WebConsoleMessageHTMLMessageSource and similar constants.
     159        </dd>
     160        <dt>MessageType</dt>
     161        <dd>
     162            Class of message. Start / End of a Group, a Log, Network related, etc.
     163            See WebConsoleMessageLogMessageType and similar constants.
     164        </dd>
     165        <dt>MessageLevel</dt>
     166        <dd>
     167            Severity level of the message. Tip, Log, Warning, etc.
     168            See WebConsoleMessageTipMessageLevel and similar constants.
     169        </dd>
     170    </dl>
     171*/
     172- (void)webView:(WebView *)webView addMessageToConsole:(NSDictionary *)message withSource:(NSString *)source;
    114173
    115174- (NSView *)webView:(WebView *)webView plugInViewWithArguments:(NSDictionary *)arguments;
  • trunk/Tools/ChangeLog

    r80057 r80061  
     12011-02-23  Joseph Pecoraro  <joepeck@webkit.org>
     2
     3        Reviewed by Timothy Hatcher.
     4
     5        All Console Messages should be passed to ChromeClients.
     6        https://bugs.webkit.org/show_bug.cgi?id=54926
     7
     8        Update DumpRenderTree's UIDelegate to use the new console message delegate.
     9
     10        * DumpRenderTree/mac/UIDelegate.mm:
     11        (-[UIDelegate webView:addMessageToConsole:withSource:]):
     12
    1132011-03-01  Dirk Pranke  <dpranke@chromium.org>
    214
  • trunk/Tools/DumpRenderTree/mac/UIDelegate.mm

    r66251 r80061  
    5858}
    5959
    60 - (void)webView:(WebView *)sender addMessageToConsole:(NSDictionary *)dictionary
     60- (void)webView:(WebView *)sender addMessageToConsole:(NSDictionary *)dictionary withSource:(NSString *)source
    6161{
    6262    NSString *message = [dictionary objectForKey:@"message"];
Note: See TracChangeset for help on using the changeset viewer.