final Object fromCache = cache.getCachedObject(request);
if (fromCache != null && fromCache instanceof CSSStyleSheet) {
sheet = new Stylesheet(element, (CSSStyleSheet) fromCache, uri);
}
else {
final WebResponse response = client.loadWebResponse(request);
uri = response.getRequestSettings().getUrl().toExternalForm();
client.printContentIfNecessary(response);
client.throwFailingHttpStatusCodeExceptionIfNecessary(response);
// CSS content must have downloaded OK; go ahead and build the corresponding stylesheet.
final String css = response.getContentAsString();