Bug 75555
| Summary: | Web Inspector: misreported total page size of pages loading resources as data URIs | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Joshua Cody <josh> |
| Component: | Web Inspector (Deprecated) | Assignee: | Alexander Pavlov (apavlov) <apavlov> |
| Status: | RESOLVED INVALID | ||
| Severity: | Normal | CC: | apavlov, bweinstein, joepeck, keishi, loislo, mathias, pfeldman, pmuellr, rik, yurys |
| Priority: | P2 | ||
| Version: | 528+ (Nightly build) | ||
| Hardware: | All | ||
| OS: | All | ||
| URL: | http://joshuacody.net/public/data-uri-test/index.html | ||
Joshua Cody
When embedding a data URI in a CSS file, the file size of said data URI is added as an inline resource in the "Network" tab and to the total weight of the CSS file, thus, it's counted twice. This is particularly evident in the misreported total page size of pages loading Typekit fonts, which injects a CSS file with fonts represented as data URIs. Thus the file size is say, 102kb, and the inspector reports another 100kb of fonts as inlined resources.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Timothy Hatcher
Good point! I suspect this is true for any data URL that comes originally as part of another resource. We probially shouldn't count data URLs in the total since they either are already counted in another resource or were generated by JavaScript after the load.
Joshua Cody
Not sure if I mistyped the title or if it was changed, but this isn't only an issue with Typekit fonts. The place I first saw it was loading an image via a data URI in CSS.
Alexander Pavlov (apavlov)
The proposed straightforward solution is arguable, since deliberate subtraction of inlined data: URI resource sizes may entail unexpected results elsewhere. For example, we might calculate the network speed based on the "host" resource size. It isn't going to be too reliable if we divide the 2kb CSS resource size (rather than 102kb, as stated in the original post) by the transfer time.
Pavel and other involved folks may have an opinion, too. Please speak up!
Alexander Pavlov (apavlov)
@Joshua Cody: the URL you reference is no longer available. Could you set up a similar test case on a publicly available server?
Brian Burg
Closing as invalid, as this bug pertains to the old inspector UI and/or its tests.
Please file a new bug (https://www.webkit.org/new-inspector-bug) if the bug/feature/issue is still relevant to WebKit trunk.