Bug 65112 - Web Inspector: Implement setPropertyValue using evaluate and callFunctionOn
Summary: Web Inspector: Implement setPropertyValue using evaluate and callFunctionOn
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: 2011-07-25 08:38 PDT by Pavel Feldman
Modified: 2011-07-26 03:21 PDT (History)
10 users (show)

See Also:


Attachments
Patch (19.35 KB, patch)
2011-07-25 08:51 PDT, Pavel Feldman
no flags Details | Formatted Diff | Diff
Patch (19.83 KB, patch)
2011-07-25 09:28 PDT, Pavel Feldman
no flags Details | Formatted Diff | Diff
Patch (20.05 KB, patch)
2011-07-25 09:31 PDT, Pavel Feldman
yurys: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pavel Feldman 2011-07-25 08:38:33 PDT
Patch to follow.
Comment 1 Pavel Feldman 2011-07-25 08:51:53 PDT
Created attachment 101874 [details]
Patch
Comment 2 Yury Semikhatsky 2011-07-25 09:03:02 PDT
Comment on attachment 101874 [details]
Patch

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

> LayoutTests/inspector/runtime/runtime-setPropertyValue.html:70
> +                InspectorTest.evaluateInPage("dumpObjects('Set undefined')", next);

You also need to test the case when setPropertyValue fails with an exception.

> Source/WebCore/inspector/front-end/ObjectPropertiesSection.js:206
> +            this.valueElement.addStyleClass("console-formatted-" + this.property.value.subtype);

Consider using <type>-<subtype> instead.

> Source/WebCore/inspector/front-end/RemoteObject.js:149
>              callback("Can't get a property of non-object.");

get -> set.

> Source/WebCore/inspector/front-end/RemoteObject.js:158
> +                callback(error || result);

What is the expected type of the callback parameter?
Comment 3 Pavel Feldman 2011-07-25 09:27:20 PDT
(In reply to comment #2)
> (From update of attachment 101874 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=101874&action=review
> 
> > LayoutTests/inspector/runtime/runtime-setPropertyValue.html:70
> > +                InspectorTest.evaluateInPage("dumpObjects('Set undefined')", next);
> 
> You also need to test the case when setPropertyValue fails with an exception.
> 

Done.

> > Source/WebCore/inspector/front-end/ObjectPropertiesSection.js:206
> > +            this.valueElement.addStyleClass("console-formatted-" + this.property.value.subtype);
> 
> Consider using <type>-<subtype> instead.
> 

I'd need to change it in too many places :(

> > Source/WebCore/inspector/front-end/RemoteObject.js:149
> >              callback("Can't get a property of non-object.");
> 
> get -> set.
> 

Done.

> > Source/WebCore/inspector/front-end/RemoteObject.js:158
> > +                callback(error || result);
> 
> What is the expected type of the callback parameter?

This is error message / error object.
Comment 4 Pavel Feldman 2011-07-25 09:28:03 PDT
Created attachment 101880 [details]
Patch
Comment 5 Pavel Feldman 2011-07-25 09:31:29 PDT
Created attachment 101881 [details]
Patch
Comment 6 Yury Semikhatsky 2011-07-25 23:29:31 PDT
(In reply to comment #3)
> > > Source/WebCore/inspector/front-end/RemoteObject.js:158
> > > +                callback(error || result);
> > 
> > What is the expected type of the callback parameter?
> 
> This is error message / error object.
Can we come up with something more definite here and say that the error is always an error object?
Comment 7 Pavel Feldman 2011-07-26 03:21:08 PDT
Committed r91750: <http://trac.webkit.org/changeset/91750>