Bug 44103 - Web Inspector: [CRASH] Console formatting crashes after cross-domain navigation.
Summary: Web Inspector: [CRASH] Console formatting crashes after cross-domain navigation.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Pavel Feldman
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-17 05:48 PDT by Pavel Feldman
Modified: 2010-08-17 11:54 PDT (History)
8 users (show)

See Also:


Attachments
[PATCH] Proposed fix. (6.28 KB, patch)
2010-08-17 06:22 PDT, Pavel Feldman
yurys: review+
Details | Formatted Diff | Diff
[PATCH] Review comments addressed. (7.93 KB, patch)
2010-08-17 08:49 PDT, Pavel Feldman
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pavel Feldman 2010-08-17 05:48:15 PDT
- Go to a page with console.log(document) call
- Navigate to a different domain
- Open inspector
Comment 1 Pavel Feldman 2010-08-17 06:22:10 PDT
Created attachment 64583 [details]
[PATCH] Proposed fix.

I wonder if we should try saving the first string entry. I'll think about doing it while you are reviewing the crash fix.
Comment 2 Yury Semikhatsky 2010-08-17 07:26:47 PDT
Comment on attachment 64583 [details]
[PATCH] Proposed fix.

WebCore/inspector/ConsoleMessage.cpp:142
 +                  inspectorValue = InspectorString::create("(frame collected)");
This string should be localized and live in the front-end. And I think it should be frame navigated.
Comment 3 Pavel Feldman 2010-08-17 08:49:25 PDT
Created attachment 64596 [details]
[PATCH] Review comments addressed.
Comment 4 Pavel Feldman 2010-08-17 08:56:25 PDT
Comment on attachment 64596 [details]
[PATCH] Review comments addressed.

Clearing flags on attachment: 64596

Committed r65506: <http://trac.webkit.org/changeset/65506>
Comment 5 Pavel Feldman 2010-08-17 08:56:38 PDT
All reviewed patches have been landed.  Closing bug.
Comment 6 Joseph Pecoraro 2010-08-17 10:08:52 PDT
Comment on attachment 64596 [details]
[PATCH] Review comments addressed.

> diff --git LayoutTests/http/tests/inspector-enabled/resources/console-log-frame-before-navigation.html
> +  console.log("Console message (C) %d with element", 2010, document.documentElement);

The way this console.log would work (one %d, but two arguments) would be to
print the string, then print the element afterwards. The patch's expected
results were as follows:

> -Message: 2010 HTMLHtmlElement
> +Message: Console message (C) %d with element
>  TEST COMPLETE.

So the desired output for the element was the empty string? I'm fine with
that, but what I saw something else in the bugzilla comments.


> +    // Note that localhost is different from the 127.0.0.1 that tests are runnung against. So this navigation
> +    // is in fact cross-domain.

NIT: Typo. "runnung" => "running".
Comment 7 Pavel Feldman 2010-08-17 11:54:24 PDT
(In reply to comment #6)
> (From update of attachment 64596 [details])
> > diff --git LayoutTests/http/tests/inspector-enabled/resources/console-log-frame-before-navigation.html
> > +  console.log("Console message (C) %d with element", 2010, document.documentElement);
> 
> The way this console.log would work (one %d, but two arguments) would be to
> print the string, then print the element afterwards. The patch's expected
> results were as follows:
> 
> > -Message: 2010 HTMLHtmlElement
> > +Message: Console message (C) %d with element
> >  TEST COMPLETE.
> 
> So the desired output for the element was the empty string? I'm fine with
> that, but what I saw something else in the bugzilla comments.
> 
> 

Desired output is only the first string argument. Rationale: we can't format parameters due to missing global object after the navigation. So we ignore all the parameters: in this case both  - integer and element.

> > +    // Note that localhost is different from the 127.0.0.1 that tests are runnung against. So this navigation
> > +    // is in fact cross-domain.
> 
> NIT: Typo. "runnung" => "running".

Thanks. Will fix later.