Bug 86741 - Web Inspector: error when expanding an HTMLAllCollection object in the console
Summary: Web Inspector: error when expanding an HTMLAllCollection object in the console
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Yury Semikhatsky
Depends on:
Reported: 2012-05-17 08:38 PDT by Yury Semikhatsky
Modified: 2012-05-18 08:56 PDT (History)
10 users (show)

See Also:

Patch (4.26 KB, patch)
2012-05-17 08:54 PDT, Yury Semikhatsky
no flags Details | Formatted Diff | Diff
Patch (3.05 KB, patch)
2012-05-18 08:54 PDT, Yury Semikhatsky
pfeldman: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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

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]
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]

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]
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>