<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>148680</bug_id>
          
          <creation_ts>2015-09-01 09:41:19 -0700</creation_ts>
          <short_desc>Web Inspector: add explicit version checking for legacy backends</short_desc>
          <delta_ts>2026-01-12 09:09:33 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Web Inspector</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Blaze Burg">bburg</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>graouts</cc>
    
    <cc>inspector-bugzilla-changes</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1122553</commentid>
    <comment_count>0</comment_count>
    <who name="Blaze Burg">bburg</who>
    <bug_when>2015-09-01 09:41:19 -0700</bug_when>
    <thetext>In several places we do awkward things like the following since we can&apos;t directly test protocol version or supported features.

// COMPATIBILITY (iOS 9): Legacy backends don&apos;t support breakpoint ignore count. Since support
// can&apos;t be tested directly, check for CSS.getSupportedSystemFontFamilyNames.
if (CSSAgent.getSupportedSystemFontFamilyNames) {

In cases where we can&apos;t use Agent.command.supports(...), it would be better if we had checks against the shipped protocol version, like:

if (WebInspector.backendVersion.builtBefore(WebInspector.BackendVersions.iOS9))
if (WebInspector.backendVersion.equalTo(WebInspector.BackendVersions.iOS8))
if (WebInspector.backendVersion.builtAfter(WebInspector.BackendVersions.iOS6))

Feel free to suggest better comparison operator names, these are clunky. I believe WebKit uses &quot;builtOnOrAfter(10, 10, 0)&quot; or similar.
In the legacy protocol versions, we can embed a top-level &quot;version&quot; field and parse it in the frontend. And, going forward, we can use
a version string of iOS9+ once a legacy copy of iOS9 has been copied over.

We could also implement fine-grained feature checking, like WebInspector.backendVersion.supports(&quot;Debugger.BreakpointIgnoreCounts&quot;), which will return false for old versions; once that specific feature support lands in trunk, we add the feature key &quot;Debugger.BreakpointIgnoreCounts&quot; in a file somewhere that feeds into backendVersion.supports(). Once the next legacy protocol version is created, we delete all the old feature key checks and replace them with backendVersion.equalOrLaterThan(new-version).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1122554</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2015-09-01 09:41:32 -0700</bug_when>
    <thetext>&lt;rdar://problem/22519698&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1122560</commentid>
    <comment_count>2</comment_count>
    <who name="Timothy Hatcher">timothy</who>
    <bug_when>2015-09-01 10:01:07 -0700</bug_when>
    <thetext>iOS 9 was added to the Legacy folder last week.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1122614</commentid>
    <comment_count>3</comment_count>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2015-09-01 11:49:50 -0700</bug_when>
    <thetext>I think we could just give the Inspector domain a version number. And bump it whenever we want/need to.

    {
        &quot;domain&quot;: &quot;Inspector&quot;,
        &quot;constants&quot;: [
            { &quot;name&quot;: &quot;Version&quot;, &quot;value&quot;: 1000 }
        ]
    }

Would generate:

    InspectorBackend.registerConstant(&quot;Inspector.Version&quot;, 1000);

We could retroactively add it to Legacy Inspector-iOS-*.json files. And add WebInspector.BackendVersions.iOS7-9 constants (700, 800, 900) to the frontend.

That said, I still think we should be feature checking the protocol when possible. This would only be used for when we can&apos;t easily do that (like new properties in types).</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>