Bug 193686 - Web Inspector: Audit: add supports key to test/group for compatibility
Summary: Web Inspector: Audit: add supports key to test/group for compatibility
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Devin Rousso
URL:
Keywords: InRadar
Depends on: WebInspectorAuditTab 193262
Blocks: 193476
  Show dependency treegraph
 
Reported: 2019-01-22 14:38 PST by Devin Rousso
Modified: 2019-01-24 22:47 PST (History)
5 users (show)

See Also:


Attachments
Patch (24.06 KB, patch)
2019-01-23 13:02 PST, Devin Rousso
no flags Details | Formatted Diff | Diff
[Image] After Patch is applied (771.93 KB, image/png)
2019-01-23 13:03 PST, Devin Rousso
no flags Details
Patch (24.06 KB, patch)
2019-01-23 15:45 PST, Devin Rousso
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Devin Rousso 2019-01-22 14:38:33 PST
If the test's/group's "supports" key is less than the minimum of the frontend and backend versions, the test is too old to be run and should be disabled for that inspection target.
 - if backend < supports < frontend, we can visualize results of the test, but some functionality within the test itself may not be available (e.g. the injected `WebInspectorAudit` object)
 - if frontend < supports < backend, we have all the test functionality, but may not be able to parse/visualize all of it
 - if backend <=> frontend < supports, we are fully supported
 - if supports < backend <=> frontend, we are completely out of date
Comment 1 Radar WebKit Bug Importer 2019-01-22 14:38:59 PST
<rdar://problem/47460872>
Comment 2 Devin Rousso 2019-01-23 13:02:12 PST
Created attachment 359932 [details]
Patch
Comment 3 Devin Rousso 2019-01-23 13:03:02 PST
Created attachment 359933 [details]
[Image] After Patch is applied

This "fakely" makes one of the default audits have `supports: 0;` for the sake of testing/demonstration.  The default audit is not actually being changed in this patch.
Comment 4 Devin Rousso 2019-01-23 14:40:16 PST
Comment on attachment 359932 [details]
Patch

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

> Source/WebInspectorUI/UserInterface/Models/AuditTestBase.js:49
> +            if (this._supports < WI.AuditTestBase.Version)
> +                this._supported = false;
> +            else if (InspectorBackend.domains.Audit && this._supports < InspectorBackend.domains.Audit.VERSION)
> +                this._supported = false;

I just realized, I have these written backwards.  It should be `this._supports > ...`.
Comment 5 Devin Rousso 2019-01-23 15:45:54 PST
Created attachment 359965 [details]
Patch
Comment 6 Joseph Pecoraro 2019-01-24 17:33:49 PST
Comment on attachment 359965 [details]
Patch

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

r=me

> Source/WebInspectorUI/UserInterface/Models/AuditTestBase.js:52
> +        if (!this.supported)

Nit: _supported when used inside this class since the getter is simple.

> Source/WebInspectorUI/UserInterface/Models/AuditTestBase.js:89
> +        if (!this.supported)

Nit: _supported when used inside this class since the getter is simple.
Comment 7 Devin Rousso 2019-01-24 22:21:34 PST
Comment on attachment 359965 [details]
Patch

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

>> Source/WebInspectorUI/UserInterface/Models/AuditTestBase.js:52
>> +        if (!this.supported)
> 
> Nit: _supported when used inside this class since the getter is simple.

Considering that it's overridden by a subclass (`WI.AuditTestGroup`), I thought it best to use the non-member version.  This is somewhat similar to what I did with `this.disabled`.
Comment 8 WebKit Commit Bot 2019-01-24 22:47:55 PST
Comment on attachment 359965 [details]
Patch

Clearing flags on attachment: 359965

Committed r240469: <https://trac.webkit.org/changeset/240469>
Comment 9 WebKit Commit Bot 2019-01-24 22:47:56 PST
All reviewed patches have been landed.  Closing bug.