No paginationMode for WKWebView

Originator:ahmedkhalaf.92
Number:rdar://41763266 Date Originated:July 3 2018, 9:30 AM
Status:Open Resolved:
Product:WebKit Product Version:
Classification: Reproducible:
 
Summary:
`UIWebView` had a `paginationMode` property than enabled us to break the web page into pages with four different flows (left-to-right, right-to-left, top-to-bottom, and bottom-to-top), in addition to none (default unpaginated mode).

Currently, WKWebView has no such property, and provides no API for an equivalent functionality.

Steps to Reproduce:
1. Try to set the `paginationMode` property.

Expected Results:
`WKWebView` accepts a `paginationMode` value.

Actual Results:
No such property exists.

Version:
Current

Notes:
This functionality is essential for developing e-book reader apps (especially EPub readers), since it relies on HTML.

There are unreliable workarounds. For example, CSS has a column-width property, that can be set to the desired page width in pixels. 

But this has its caveats:

1. One has to set a “suitable” meta viewport header in the html document. 
2. To achieve right-to-left pagination, the root HTML element should have its `dir` attribute set to `rtl`, even if the document t is not right-to-left. That, or resort to -webkit-transforms (i.e. flipping each column, in addition to flipping the whole webView).
3. If the `WKWebView` doesn’t fill the whole device width, and its width value happens to be nonintegral (has fractions), there may be mismatch in evaluation of that value between UIKit and the HTML rendering. This results in a very subtle difference in width. Which when the HTML content gets so large (and so is the page count), the very last pages appear partially.

Configuration:
Current

Comments

That is definitely something necessary, Since I've started developing FolioReaderKit (https://github.com/FolioReader/FolioReaderKit) I wanted that, but I had to use UIWebView.

By hebertialmeida at July 3, 2018, 3:56 p.m. (reply...)

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!