Changeset 247223 in webkit
- Timestamp:
- Jul 8, 2019 12:03:42 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r247222 r247223 1 2019-07-08 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 [iPadOS] Viewport pops while loading sohu.com, xinhuanet.com, and various other websites 4 https://bugs.webkit.org/show_bug.cgi?id=199575 5 <rdar://problem/51842220> 6 7 Reviewed by Simon Fraser. 8 9 Adjusts an existing layout test, and introduces a new test to verify that the shrink-to-fit heuristic is given a 10 chance to run before document load. See WebKit ChangeLog for more details. 11 12 * fast/viewport/ios/shrink-to-fit-content-before-document-load-expected.txt: Added. 13 * fast/viewport/ios/shrink-to-fit-content-before-document-load.html: Added. 14 * fast/viewport/ios/shrink-to-fit-content-temporary-overflow.html: 15 16 Tweak this layout test to add the temporarily overflowing element after document load. 17 1 18 2019-07-08 Wenson Hsieh <wenson_hsieh@apple.com> 2 19 -
trunk/LayoutTests/fast/viewport/ios/shrink-to-fit-content-temporary-overflow.html
r244849 r247223 49 49 description("This test verifies that a temporary change in content width does not cause the viewport width to permanently expand to try and accomodate the content. To test manually, load the page and check that the box below reads 'PASS'. This test is only intended to run on devices with less than 1200px screen width."); 50 50 51 function forceLayoutByScrollingTo(y) { 52 document.scrollingElement.scrollTo(0, y); 53 return document.scrollingElement.scrollTop; 54 } 55 56 addEventListener("DOMContentLoaded", () => { 57 forceLayoutByScrollingTo(1); 58 const bar = document.createElement("div"); 59 bar.classList.add("bar"); 60 document.body.appendChild(bar); 61 forceLayoutByScrollingTo(0); 62 bar.remove(); 63 }); 64 51 65 addEventListener("load", async () => { 52 66 if (!window.testRunner) … … 63 77 <div id="description"></div> 64 78 <div class="square"></div> 65 <script>66 const bar = document.createElement("div");67 bar.classList.add("bar");68 document.body.appendChild(bar);69 document.scrollingElement.scrollTo(0, 1);70 document.scrollingElement.scrollTo(0, 0);71 document.scrollingElement.scrollTop;72 bar.remove();73 </script>74 79 </body> 75 80 </html> -
trunk/Source/WebKit/ChangeLog
r247218 r247223 1 2019-07-08 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 [iPadOS] Viewport pops while loading sohu.com, xinhuanet.com, and various other websites 4 https://bugs.webkit.org/show_bug.cgi?id=199575 5 <rdar://problem/51842220> 6 7 Reviewed by Simon Fraser. 8 9 Currently, the shrink-to-fit-content heuristic added to scale desktop sites fit within the viewport on iPadOS 10 only runs during two intervals: after document load, and after page load. On very script-heavy websites, this 11 may cause a visible jump, as rendering may commence well before the document is finished parsing. 12 13 To mitigate this, we move the first opportunity for the shrink-to-fit heuristic from after document, to right 14 after the page transition has completed (before we unfreeze the layer tree). 15 16 * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: 17 (WebKit::WebFrameLoaderClient::dispatchDidFinishDocumentLoad): 18 * WebProcess/WebPage/WebPage.cpp: 19 (WebKit::WebPage::didCompletePageTransition): 20 (WebKit::WebPage::didFinishDocumentLoad): Deleted. 21 22 Remove this didFinishDocumentLoad hook, which was only used to schedule the shrink-to-fit timer. 23 24 * WebProcess/WebPage/WebPage.h: 25 * WebProcess/WebPage/ios/WebPageIOS.mm: 26 (WebKit::WebPage::immediatelyShrinkToFitContent): 27 28 m_mainFrame might be null after page transition completes, so we need to ensure immediatelyShrinkToFitContent is 29 robust in this scenario. 30 1 31 2019-07-08 Chris Dumez <cdumez@apple.com> 2 32 -
trunk/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
r246767 r247223 615 615 // Notify the UIProcess. 616 616 webPage->send(Messages::WebPageProxy::DidFinishDocumentLoadForFrame(m_frame->frameID(), navigationID, UserData(WebProcess::singleton().transformObjectsToHandles(userData.get()).get()))); 617 618 webPage->didFinishDocumentLoad(*m_frame);619 617 } 620 618 -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp
r247192 r247223 3271 3271 void WebPage::didCompletePageTransition() 3272 3272 { 3273 #if ENABLE(VIEWPORT_RESIZING) 3274 if (immediatelyShrinkToFitContent()) 3275 viewportConfigurationChanged(ZoomToInitialScale::Yes); 3276 #endif 3277 3273 3278 unfreezeLayerTree(LayerTreeFreezeReason::PageTransition); 3274 3279 … … 5796 5801 } 5797 5802 5798 void WebPage::didFinishDocumentLoad(WebFrame& frame)5799 {5800 if (!frame.isMainFrame())5801 return;5802 5803 #if ENABLE(VIEWPORT_RESIZING)5804 scheduleShrinkToFitContent();5805 #endif5806 }5807 5808 5803 void WebPage::didFinishLoad(WebFrame& frame) 5809 5804 { -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.h
r247161 r247223 360 360 void willReplaceMultipartContent(const WebFrame&); 361 361 void didReplaceMultipartContent(const WebFrame&); 362 void didFinishDocumentLoad(WebFrame&);363 362 void didFinishLoad(WebFrame&); 364 363 void show(); -
trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm
r247200 r247223 3321 3321 return false; 3322 3322 3323 if (!m_mainFrame) 3324 return false; 3325 3323 3326 if (!m_page->settings().allowViewportShrinkToFitContent()) 3324 3327 return false;
Note: See TracChangeset
for help on using the changeset viewer.