Bug 86741

Summary: Web Inspector: error when expanding an HTMLAllCollection object in the console
Product: WebKit Reporter: Yury Semikhatsky <yurys>
Component: Web Inspector (Deprecated)Assignee: Yury Semikhatsky <yurys>
Status: RESOLVED FIXED    
Severity: Normal CC: apavlov, bweinstein, joepeck, keishi, loislo, pfeldman, pmuellr, rik, timothy, yurys
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch
none
Patch pfeldman: review+

Description Yury Semikhatsky 2012-05-17 08:38:55 PDT
Chrome Version       : 20.0.1132.3 and 21.0.1139.0

What steps will reproduce the problem?
1. Goto http://www.google.ru/
2. Open DevTools console
3. Write "document.all" and expand the HTMLAllCollection object result

What is the expected result?
To see the properties of the object.

What happens instead?
JS error with the following stack trace:
Uncaught TypeError: Cannot read property 'length' of null ObjectPropertiesSection.js:565
- callback ObjectPropertiesSection.js:565
- mycallback RemoteObject.js:307
- InspectorBackendClass.dispatch InspectorBackend.js:186

Please provide any additional information below. Attach a screenshot if
possible.

UserAgentString: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.3 Safari/536.11


Original bug report: http://code.google.com/p/chromium/issues/detail?id=128533
Comment 1 Yury Semikhatsky 2012-05-17 08:54:36 PDT
Created attachment 142482 [details]
Patch
Comment 2 Yury Semikhatsky 2012-05-17 08:59:54 PDT
Committed r117454: <http://trac.webkit.org/changeset/117454>
Comment 3 Andrey Adaikin 2012-05-18 03:23:13 PDT
Comment on attachment 142482 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=142482&action=review

> Source/WebCore/inspector/InjectedScriptSource.js:274
> +        if (!this._isDefined(object))

Should we also modify the code below in the same way:
287                    var resolvedArg = this._objectForId(parsedArgId);
288                    if (!resolvedArg)
289                        return "Could not find object with given id";
?

Otherwise, although this does fix the original problem, but for example setting a property to a document.all still is not working.

Scenario to repro this in DevTools:
1) type in console "var a = {foo:123}; a;"
2) expand the result, double click on "123", and write "document.all"
3) observe the live edit getting ignored (unlike, for example, "document.all[0]") - I guess this is because of line 288 as I pointed out
Comment 4 Yury Semikhatsky 2012-05-18 08:54:00 PDT
Reopening to attach new patch.
Comment 5 Yury Semikhatsky 2012-05-18 08:54:07 PDT
Created attachment 142725 [details]
Patch
Comment 6 Yury Semikhatsky 2012-05-18 08:55:08 PDT
(In reply to comment #5)
> Created an attachment (id=142725) [details]
> Patch

This patch addresses the problem pointed out by Andrey.
Comment 7 Yury Semikhatsky 2012-05-18 08:56:48 PDT
Committed r117599: <http://trac.webkit.org/changeset/117599>