That neatly assumes that documents are data and not code.
That neatly assumes that documents are data and not code.
The thing is we had all the things you say are great, and in spite of this we have created the browser as an application environment. Evidently people don't want a document web.
Adobe PDF and Word are evidence that document readers attempt to become web browsers with time anyway.
[1]: http://stackoverflow.com/questions/9219807/using-javascript-...
The issue you state is a property of three things:
1. The underlying language/vm allows code and data to be interchanged (c++).
2. The underlying vm allows memory to be overwritten and buffer lengths to be exceeded to start with.
3. Pdf allows arbitrary code to execute on your computer.
My point demonstrated.
Embedded JavaScript is another matter, but it's not needed to be executed for parsing the document.
_____________
¹ This gives rise to interesting applications, e.g. you can remove pages or images by just removing a link in the PDF. Yet the object would then still be there. There are some PDFs out there where sensitive information is buried in unlinked objects that still exist within the file. But that's obviously besides the point.