Skip to content

odr.chunks.loadAll(): load every part before a print #1281

Open

Description

@andiwand

Asked for by the iOS session (opendocument-app/OpenDocument.ios#219).

With HtmlConfig::lazy_loading, a print shows a part that has not loaded as empty space (docs/design/lazy-loading.md, open question "Print at level 3"). beforeprint cannot wait for scripts. So the iOS app loads everything itself before it prints: it calls odr.chunks.show on each [data-odr-chunk-src] chunk, then waits until no [data-odr-chunk-loading] is left.

Proposal: odr.chunks.loadAll() returns a Promise that resolves once every part has filled, or that rejects if a part fails to load. A host awaits it before a print. The Android evaluateJavascript cannot await a Promise, so a host bridge message, such as chunksLoaded, would serve the droid app.

Loading every part costs what level 3 avoids, so the API should be for an explicit print, not for every page load.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions