Run following snippet with DevTools opened. <script> function doStuff() { var r = Math.floor(Math.random()*100000); var i = new Image(); i.src = 'http://www.facebook.com/ajax/hovercard/shown.php?'+r; } </script> <button onclick="doStuff()">do stuff</button> Observe preview image source in the Network/Resources panels. Expected: data URL, no network requests Actual: original URL, additional network request is being made Original bug report: http://code.google.com/p/chromium/issues/detail?id=72402
Created attachment 81806 [details] patch
Comment on attachment 81806 [details] patch I don't think this is a reliable solution. We might be not accurate wrt resource size, why should we make content request depend on potential resource size inconsistencies.
Created attachment 81818 [details] patch - check resource size on back-end, return "" for 0-sized resources, NULL for errors
Attachment 81818 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1 Source/WebCore/inspector/InspectorResourceAgent.cpp:127: Use 0 instead of NULL. [readability/null] [4] Total errors found: 1 in 6 files If any of these errors are false positives, please file a bug against check-webkit-style.
Comment on attachment 81818 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=81818&action=review > Source/WebCore/inspector/Inspector.idl:103 > + [domain=Network] void resourceContent(in unsigned long frameId, in String url, in boolean base64Encode, out boolean foundResource, out String content); foundResource -> success > Source/WebCore/inspector/InspectorResourceAgent.cpp:506 > +void InspectorResourceAgent::resourceContent(unsigned long id, const String& url, bool base64Encode, bool* resourceFound, String* content) frameId?
Manually committed r78196: http://trac.webkit.org/changeset/78196