Patent attributes
A document preview system provides previews of a native document to client devices. To generate the preview of a document, the document preview system generates a preview document that presents the native document in a browser-compatible format including elements that correspond to fields in the native document. The document preview system also identifies a mapping between fields of the native document and the elements of the preview. The document preview system also identifies a formula listing for the elements of the preview code. When a user edits a document, the edits may be committed to the document preview system and in parallel generate a preview to update the user's display. When an updated preview is available, the updated preview is rendered in a hidden frame and the user's input context is captured and reproduced when the updated preview replaces the prior preview.