Bug 139307

Summary: Web Inspector: Hide Compositing Borders Button if backend returns an error that it is unsupported
Product: WebKit Reporter: Joseph Pecoraro <joepeck>
Component: Web InspectorAssignee: Joseph Pecoraro <joepeck>
Status: RESOLVED FIXED    
Severity: Normal CC: graouts, joepeck, timothy, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
[PATCH] Proposed Fix darin: review+, joepeck: commit-queue-

Description Joseph Pecoraro 2014-12-05 12:13:44 PST
* SUMMARY
Hide Compositing Borders Button if backend returns an error that it is unsupported.

With augmentative agents, some protocol methods exist in the BackendCommands but may be unsupported by the backend.

For now, somethings can just respond as "unsupported" and we can update the UI appropriately. Things like CompositingBorders where we always send a request.

We may need to look into an alternative solution since we don't want an "isSupported" for every operation. This is just easy since we always make the request.
Comment 1 Radar WebKit Bug Importer 2014-12-05 12:14:19 PST
<rdar://problem/19159939>
Comment 2 Joseph Pecoraro 2014-12-05 13:25:14 PST
Created attachment 242655 [details]
[PATCH] Proposed Fix
Comment 3 Darin Adler 2014-12-09 14:44:02 PST
Comment on attachment 242655 [details]
[PATCH] Proposed Fix

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

> Source/WebInspectorUI/UserInterface/Views/DOMTreeContentView.js:450
> +            if (error === "unsupported")
> +                button.enabled = false;

Is this really a one-shot? I would have expected this to say:

    button.enabled = error !== "unsupported";
Comment 4 Joseph Pecoraro 2014-12-09 15:12:22 PST
Comment on attachment 242655 [details]
[PATCH] Proposed Fix

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

>> Source/WebInspectorUI/UserInterface/Views/DOMTreeContentView.js:450
>> +                button.enabled = false;
> 
> Is this really a one-shot? I would have expected this to say:
> 
>     button.enabled = error !== "unsupported";

You're right, it isn't exactly a one-shot. It would happen each time the DOMTreeContentView is shown. I'll take your suggestion, this is not performance sensitive.
Comment 5 Joseph Pecoraro 2014-12-10 15:30:54 PST
http://trac.webkit.org/changeset/177108