-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PDF loading examples #27129
base: master
Are you sure you want to change the base?
PDF loading examples #27129
Conversation
These examples show that Firefox and Safari ignore Content-Type for a variety of loading scenarios whereas Chrome appears to require application/pdf consistently. (Chrome does instantiate the PDF plugin container in more cases, but that then fails to load the PDF.) Given this, it seems to me there's an opportunity to require application/pdf going forward. (Note that you cannot count on the test results. I'm not really sure how to test this yet.)
How much of this is web observable? In particular I'm curious about
I take it from
maybe none of it is observable yet, or at least you haven't figured out how. Hmm, maybe a PDF that embeds an image request, which hits the server? Then the server could tell is if that endpoint was hit? I have no idea how to create such a PDF, but I imagine it's possible... |
So this is observable to some extent with respect to whether fallback is shown for the (Your idea is interesting though and something we might need as well. The other alternative might be using reference tests. But again, we first need to decide on what we want.) |
HTML fallbacks could work for Recording requests for files referenced in the pdf could work if that is possible but I don't know that it is. (Clickable) links in the pdf are an option but that gets messy. If APIs get added for things like PDF support discovery then maybe an event indicating a PDF was loaded (or not) would also be warranted. |
Found this while creating #27129.
Found this while creating #27129.
…ndler, a=testonly Automatic update from web-platform-tests wptserve: correct sorting in DirectoryHandler Found this while creating web-platform-tests/wpt#27129. -- wpt-commits: b4c87a442f82ff5e1de9a94e735b7b6c5f2e60c5 wpt-pr: 27148
…ndler, a=testonly Automatic update from web-platform-tests wptserve: correct sorting in DirectoryHandler Found this while creating web-platform-tests/wpt#27129. -- wpt-commits: b4c87a442f82ff5e1de9a94e735b7b6c5f2e60c5 wpt-pr: 27148 UltraBlame original commit: 4b364b242ddcc4ac290b8a0685d76f8b158d002a
…ndler, a=testonly Automatic update from web-platform-tests wptserve: correct sorting in DirectoryHandler Found this while creating web-platform-tests/wpt#27129. -- wpt-commits: b4c87a442f82ff5e1de9a94e735b7b6c5f2e60c5 wpt-pr: 27148
…ndler, a=testonly Automatic update from web-platform-tests wptserve: correct sorting in DirectoryHandler Found this while creating web-platform-tests/wpt#27129. -- wpt-commits: b4c87a442f82ff5e1de9a94e735b7b6c5f2e60c5 wpt-pr: 27148 UltraBlame original commit: 9c7a799d20ebf91211786a0df2f07d5e7284681b
I tried briefly to convert these into real tests. Interestingly it looks like Chrome does not display fallback content inside these objects. The failures are also quite variable, sometimes displaying the content as text, sometimes displaying "Error / Failed to load PDF document.", and sometimes displaying a blank white square (with a border for an iframe). In all cases Chrome takes up 300x150 space. If I change the setting: then the result is that cases which would previously display a PDF successfully, or would say "Error / Failed to load PDF document", instead display a download button: although I suspect the behavior is different for top-level browsing contexts. So, I'm less hopeful about achieving full interop here. It would take some effort on everyone's part. Oh, and if we were to convert these into real tests, I think they would need to be reftests to account for Chrome's behavior, because the lack of fallback content means you can't use getBoundingClientRect() or similar. |
These examples show that Firefox and Safari ignore
Content-Type
for a variety of loading scenarios whereas Chrome appears to requireapplication/pdf
consistently. (Chrome does instantiate the PDF plugin container in more cases, but that then fails to load the PDF.)Given this, it seems to me there's an opportunity to require
application/pdf
going forward.(Note that you cannot count on the test results. I'm not really sure how to test this yet.)
I created this to investigate whatwg/html#6003.
@domenic @youennf @rwlbuis thoughts?