Closed
Bug 1249474
Opened 9 years ago
Closed 9 years ago
Accept header sent for images prevents w3.org from serving us SVG images in W3C's style sheet
Categories
(Core :: Networking: HTTP, defect)
Core
Networking: HTTP
Tracking
()
RESOLVED
FIXED
mozilla47
Tracking | Status | |
---|---|---|
firefox47 | --- | fixed |
People
(Reporter: heycam, Assigned: miketaylr)
References
Details
(Keywords: dev-doc-complete, site-compat, Whiteboard: [necko-active])
Attachments
(2 files, 3 obsolete files)
(deleted),
patch
|
miketaylr
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
miketaylr
:
review+
|
Details | Diff | Splinter Review |
(Not sure if this is the right component.)
I was looking into the W3C’s new TR style sheet today and I noticed that for the image in the top-left of the page indicating the document’s maturity (the blue “Recommendation” strip for example) Firefox gets served a PNG and other browsers get served an SVG.
https://w3c.github.io/tr-design/src/sample.html
So on my HiDPI Mac Firefox looks a bit blurry compared to other browsers.
Current Accept headers being sent:
Firefox: image/png,image/*;q=0.8,*/*;q=0.5
Chrome: image/webp,image/*,*/*;q=0.8
Safari: */*
Edge: image/png, image/svg+xml, image/jxr, image/*;q=0.8, */*;q=0.5
What should we do about this?
Comment 1•9 years ago
|
||
We have 4 options:
1) Do nothing, given that the W3C are probably the only organization in the entire world doing this
2) Tell the W3C to stop, referencing https://wiki.whatwg.org/wiki/Why_not_conneg
3) Change the Image accept header to */*, matching Safari, as Accept sniffing is dead and bytes are expensive
4) Change to image/svg+xml,image/png,image/*;q=0.8,*/*;q=0.5 - i.e. add SVG in at the highest priority
Gerv
Comment 2•9 years ago
|
||
Matching Safari seems good. If we're adding support for a new format such as WebP it may be worth adding that in front and it may have been worth adding SVG at some point, but now that everyone supports it, it seems like a waste of bytes.
Comment 3•9 years ago
|
||
There would be a faint glimmer of hope that Accept sniffing would work for webp if we added support, as the only browser (AIUI) to support it also does send the correct Accept.
It seems like the W3C site sends SVG unless Accept specifically prioritises PNG higher, so Safari's Accept header works.
Gerv
Comment 4•9 years ago
|
||
Yeah if we add WebP switching to image/webp,*/* for a decade or so seems worthwhile (up to the point where servers stop bothering to negotiate).
Assignee | ||
Comment 5•9 years ago
|
||
Is there any potential downside to option 3, matching Safari?
(Only thing I can think of off the top of my head is some device detection frameworks use default Accept header values to identify a browser, but I would be surprised if they were looking at Accept headers for image requests.)
Comment 6•9 years ago
|
||
Option 4 seems most compatible with the existing design decision, which is to indicate that preferred formats are preferred. I would not assume that w3c are the only people running rfc2616-compliant servers, or with multiple available image formats.
Comment 7•9 years ago
|
||
(In reply to Martin Thomson [:mt:] from comment #6)
> Option 4 seems most compatible with the existing design decision, which is
> to indicate that preferred formats are preferred. I would not assume that
> w3c are the only people running rfc2616-compliant servers, or with multiple
> available image formats.
Do you know of any other example? This is the first one I've seen in many years.
Gerv
Comment 8•9 years ago
|
||
Accept is a hint from the client; the server can do whatever it likes (including ignoring it). Well-behaved servers will try to honour the client's preferences.
Sending `Accept: */*` or `Accept: image/*` and then adding the formats that are not yet widely supported is a good strategy.
There may be some content out there that still relies on things like `Accept: image/png` or (as we see here) `Accept: image/svg+xml`. Seems like if we had some solid data, we could come up with a list of what formats are considered common enough to omit here.
Considering that we don't support WebP or JPEG-XR and no one really negotiates GIF vs. PNG, matching Safari makes sense to me.
Comment 10•9 years ago
|
||
we have consensus here to match safari. Will someone take the bug and submit a patch please?
Whiteboard: [necko-active]
Assignee | ||
Comment 11•9 years ago
|
||
Sure, I'll take it (looks like just a simple pref change).
Assignee: nobody → miket
Assignee | ||
Comment 12•9 years ago
|
||
This matches the behavior of Safari.
Assignee | ||
Comment 13•9 years ago
|
||
Comment on attachment 8724136 [details] [diff] [review]
Change default Accept header for images to */*. r=?
Patrick, would you mind reviewing (and let me know if I'm missing something obvious here)?
Attachment #8724136 -
Flags: review?(mcmanus)
Assignee | ||
Comment 14•9 years ago
|
||
Assignee | ||
Comment 15•9 years ago
|
||
Comment on attachment 8724136 [details] [diff] [review]
Change default Accept header for images to */*. r=?
I see there's a number of tests I need to update, so let's hold off on review until I have those ready.
Attachment #8724136 -
Flags: review?(mcmanus)
Assignee | ||
Comment 16•9 years ago
|
||
Assignee | ||
Comment 17•9 years ago
|
||
This matches the behavior of Safari.
Assignee | ||
Updated•9 years ago
|
Attachment #8724136 -
Attachment is obsolete: true
Assignee | ||
Comment 18•9 years ago
|
||
OK, failing tests fixed: https://treeherder.mozilla.org/#/jobs?repo=try&revision=edb56c6da63c&selectedJob=17306072
Assignee | ||
Updated•9 years ago
|
Attachment #8724409 -
Flags: review?(mcmanus)
Assignee | ||
Updated•9 years ago
|
Attachment #8724408 -
Flags: review?(mcmanus)
Updated•9 years ago
|
Attachment #8724408 -
Flags: review?(mcmanus) → review+
Updated•9 years ago
|
Attachment #8724409 -
Flags: review?(mcmanus) → review+
Assignee | ||
Comment 19•9 years ago
|
||
Attachment #8724903 -
Flags: review+
Assignee | ||
Updated•9 years ago
|
Attachment #8724408 -
Attachment is obsolete: true
Assignee | ||
Comment 20•9 years ago
|
||
This matches the behavior of Safari.
Attachment #8724904 -
Flags: review+
Assignee | ||
Updated•9 years ago
|
Attachment #8724409 -
Attachment is obsolete: true
Assignee | ||
Comment 21•9 years ago
|
||
Updating commit message, carrying forward r+.
Comment 22•9 years ago
|
||
Assignee | ||
Updated•9 years ago
|
Keywords: dev-doc-needed,
site-compat
Comment 23•9 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/c1a33cdbdb0b
https://hg.mozilla.org/mozilla-central/rev/1e076b4fd00f
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox47:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla47
Comment 24•9 years ago
|
||
Posted the site compatibility doc: https://www.fxsitecompat.com/en-CA/docs/2016/accept-header-for-images-has-been-changed/
Comment 25•8 years ago
|
||
Docs Updated:
https://developer.mozilla.org/en-US/docs/Web/HTTP/Content_negotiation/List_of_default_Accept_values?document_saved=true#Values_for_an_image
and
https://developer.mozilla.org/en-US/Firefox/Releases/47#HTTP
Keywords: dev-doc-needed → dev-doc-complete
You need to log in
before you can comment on or make changes to this bug.
Description
•