<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Web Inspector: add explicit version checking for legacy backends"
   href="https://bugs.webkit.org/show_bug.cgi?id=148680">148680</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Web Inspector: add explicit version checking for legacy backends
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>WebKit
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>WebKit Nightly Build
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>Normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P2
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Web Inspector
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>webkit-unassigned&#64;lists.webkit.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>bburg&#64;apple.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>bburg&#64;apple.com, graouts&#64;webkit.org, joepeck&#64;webkit.org, mattbaker&#64;apple.com, nvasilyev&#64;apple.com, timothy&#64;apple.com, webkit-bug-importer&#64;group.apple.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>In several places we do awkward things like the following since we can't directly test protocol version or supported features.

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

In cases where we can'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).</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>