<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@lists.webkit.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>bburg@apple.com
</td>
</tr>
<tr>
<th>CC</th>
<td>bburg@apple.com, graouts@webkit.org, joepeck@webkit.org, mattbaker@apple.com, nvasilyev@apple.com, timothy@apple.com, webkit-bug-importer@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 "builtOnOrAfter(10, 10, 0)" or similar.
In the legacy protocol versions, we can embed a top-level "version" 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("Debugger.BreakpointIgnoreCounts"), which will return false for old versions; once that specific feature support lands in trunk, we add the feature key "Debugger.BreakpointIgnoreCounts" 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>