Page::pageCount() is inaccurate when we allow the first paint in App Mode, which happens when Document::setVisualUpdatesAllowed(true) is called. It should be accurate. After layout is updated, the page count should be accurate, but it is not for paginated content that contains images because auto-height images are given a layout height of 0 after the first pass. They require a second pass to get the right height. They shouldn't. <rdar://problem/13758445>
Created attachment 200141 [details] Patch
Comment on attachment 200141 [details] Patch r=me
Thanks, Dave! http://trac.webkit.org/changeset/149393