Bug 113427

Summary: Web Inspector: properly track main object for proto objects
Product: WebKit Reporter: Peter Rybin <prybin>
Component: Web Inspector (Deprecated)Assignee: Nobody <webkit-unassigned>
Status: RESOLVED INVALID    
Severity: Normal CC: apavlov, burg, keishi, loislo, pfeldman, pmuellr, vsevik, web-inspector-bugs, yurys
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
For trybots
none
Patch none

Peter Rybin
Reported 2013-03-27 11:02:26 PDT
When showing object property, prototype chain can be expanded. If proto object has accessor property, initial object is still needed to calculate property value: getter can be described in prototype object, but initial object must be passed as 'this'.
Attachments
For trybots (9.52 KB, patch)
2013-03-27 11:05 PDT, Peter Rybin
no flags
Patch (10.63 KB, patch)
2013-03-28 16:47 PDT, Peter Rybin
no flags
Peter Rybin
Comment 1 2013-03-27 11:05:56 PDT
Created attachment 195359 [details] For trybots
Pavel Feldman
Comment 2 2013-03-28 05:17:58 PDT
Comment on attachment 195359 [details] For trybots View in context: https://bugs.webkit.org/attachment.cgi?id=195359&action=review > Source/WebCore/ChangeLog:8 > + Parameter 'mainObjectId' is passed along from object to object when What is it going to be used for? In most cases, all TreeElements belong to a single TreeOutline. You could store root object id there.
Peter Rybin
Comment 3 2013-03-28 05:51:24 PDT
(In reply to comment #2) > (From update of attachment 195359 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=195359&action=review > > > Source/WebCore/ChangeLog:8 > > + Parameter 'mainObjectId' is passed along from object to object when > > What is it going to be used for? In most cases, all TreeElements belong to a single TreeOutline. You could store root object id there. All according to bug description. In your tree you could expand a path: var1 -> __proto__ -> field1 -> __proto__ -> __proto__ -> *foo "*foo" represents an accessor property (i.e. with getter and setter). In order to correctly calculate value of this property, we need to call getter and pass the "main object" (not the prototype object) as 'this'. "Main object" is a value of field1. We need to track it everywhere then.
Yury Semikhatsky
Comment 4 2013-03-28 07:24:23 PDT
Comment on attachment 195359 [details] For trybots View in context: https://bugs.webkit.org/attachment.cgi?id=195359&action=review > Source/WebCore/inspector/front-end/ObjectPropertiesSection.js:184 > + this.mainObjectId = mainObjectId; main sounds too generic to me but I don't have a better suggestion.
Pavel Feldman
Comment 5 2013-03-28 07:42:25 PDT
Comment on attachment 195359 [details] For trybots View in context: https://bugs.webkit.org/attachment.cgi?id=195359&action=review > Source/WebCore/inspector/front-end/WatchExpressionsSidebarPane.js:343 > +WebInspector.WatchExpressionTreeElement = function(property, mainObjectId) Sorry, I don't see how Peter's feature is allowed to affect watch expressions and such.
Yury Semikhatsky
Comment 6 2013-03-28 08:02:39 PDT
Comment on attachment 195359 [details] For trybots View in context: https://bugs.webkit.org/attachment.cgi?id=195359&action=review >> Source/WebCore/inspector/front-end/WatchExpressionsSidebarPane.js:343 >> +WebInspector.WatchExpressionTreeElement = function(property, mainObjectId) > > Sorry, I don't see how Peter's feature is allowed to affect watch expressions and such. That's because the constructor is passed by pointer to ObjectPropertiesSection.prototype.updateProperties
Peter Rybin
Comment 7 2013-03-28 16:47:57 PDT
Peter Rybin
Comment 8 2013-03-28 16:51:44 PDT
Comment on attachment 195359 [details] For trybots View in context: https://bugs.webkit.org/attachment.cgi?id=195359&action=review >> Source/WebCore/inspector/front-end/ObjectPropertiesSection.js:184 >> + this.mainObjectId = mainObjectId; > > main sounds too generic to me but I don't have a better suggestion. I renamed it to prototypeOwner and added a comment.
Yury Semikhatsky
Comment 9 2013-03-29 07:53:54 PDT
Comment on attachment 195679 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=195679&action=review > Source/WebCore/inspector/front-end/ObjectPropertiesSection.js:187 > + // all encountered accessor properties (with getters) are conceptually are still properties are conceptually are -> are conceptually
Vsevolod Vlasov
Comment 10 2013-03-29 08:56:39 PDT
Comment on attachment 195679 [details] Patch I am not sure we really need this according to my comment in https://bugs.webkit.org/show_bug.cgi?id=113357 . Clearing r? for now.
Note You need to log in before you can comment on or make changes to this bug.