Changeset 223712 in webkit
- Timestamp:
- Oct 19, 2017 2:23:13 PM (6 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r223711 r223712 1 2017-10-19 Zalan Bujtas <zalan@apple.com> 2 3 [FrameView::layout cleanup] Move scrollbars setup logic to a separate function 4 https://bugs.webkit.org/show_bug.cgi?id=178394 5 <rdar://problem/35031066> 6 7 Reviewed by Antti Koivisto. 8 9 Decouple scrollbars setup and the unrelated first-layout logic. 10 FIXME: find out why m_firstLayout depends on the subtree flag (I'd assume we issue full layout the very first time). 11 12 Covered by existing test cases. 13 14 * page/FrameView.cpp: 15 (WebCore::FrameView::adjustScrollbarsForLayout): 16 (WebCore::FrameView::layout): 17 * page/FrameView.h: 18 1 19 2017-10-19 Tim Horton <timothy_horton@apple.com> 2 20 -
trunk/Source/WebCore/page/FrameView.cpp
r223696 r223712 1341 1341 } 1342 1342 1343 void FrameView::adjustScrollbarsForLayout(bool isFirstLayout) 1344 { 1345 ScrollbarMode hMode; 1346 ScrollbarMode vMode; 1347 calculateScrollbarModesForLayout(hMode, vMode); 1348 if (isFirstLayout && !isLayoutNested()) { 1349 setScrollbarsSuppressed(true); 1350 // Set the initial vMode to AlwaysOn if we're auto. 1351 if (vMode == ScrollbarAuto) 1352 setVerticalScrollbarMode(ScrollbarAlwaysOn); // This causes a vertical scrollbar to appear. 1353 // Set the initial hMode to AlwaysOff if we're auto. 1354 if (hMode == ScrollbarAuto) 1355 setHorizontalScrollbarMode(ScrollbarAlwaysOff); // This causes a horizontal scrollbar to disappear. 1356 ASSERT(frame().page()); 1357 if (frame().page()->expectsWheelEventTriggers()) 1358 scrollAnimator().setWheelEventTestTrigger(frame().page()->testTrigger()); 1359 setScrollbarModes(hMode, vMode); 1360 setScrollbarsSuppressed(false, true); 1361 } else if (hMode != horizontalScrollbarMode() || vMode != verticalScrollbarMode()) 1362 setScrollbarModes(hMode, vMode); 1363 } 1364 1343 1365 void FrameView::layout(bool allowSubtreeLayout) 1344 1366 { … … 1437 1459 LOG(Layout, "FrameView %p elapsed time before first layout: %.3fs\n", this, document.timeSinceDocumentCreation().value()); 1438 1460 #endif 1439 ScrollbarMode hMode; 1440 ScrollbarMode vMode; 1441 calculateScrollbarModesForLayout(hMode, vMode); 1442 1443 if (m_firstLayout || (hMode != horizontalScrollbarMode() || vMode != verticalScrollbarMode())) { 1444 if (m_firstLayout) { 1445 setScrollbarsSuppressed(true); 1446 1447 m_firstLayout = false; 1448 m_firstLayoutCallbackPending = true; 1449 m_lastViewportSize = sizeForResizeEvent(); 1450 m_lastZoomFactor = layoutRoot->style().zoom(); 1451 1452 // Set the initial vMode to AlwaysOn if we're auto. 1453 if (vMode == ScrollbarAuto) 1454 setVerticalScrollbarMode(ScrollbarAlwaysOn); // This causes a vertical scrollbar to appear. 1455 // Set the initial hMode to AlwaysOff if we're auto. 1456 if (hMode == ScrollbarAuto) 1457 setHorizontalScrollbarMode(ScrollbarAlwaysOff); // This causes a horizontal scrollbar to disappear. 1458 Page* page = frame().page(); 1459 if (page && page->expectsWheelEventTriggers()) 1460 scrollAnimator().setWheelEventTestTrigger(page->testTrigger()); 1461 setScrollbarModes(hMode, vMode); 1462 setScrollbarsSuppressed(false, true); 1463 } else 1464 setScrollbarModes(hMode, vMode); 1461 if (m_firstLayout) { 1462 m_lastViewportSize = sizeForResizeEvent(); 1463 m_lastZoomFactor = layoutRoot->style().zoom(); 1464 m_firstLayoutCallbackPending = true; 1465 1465 } 1466 adjustScrollbarsForLayout(m_firstLayout); 1466 1467 1467 1468 auto oldSize = m_size; … … 1474 1475 } 1475 1476 m_layoutPhase = InPreLayout; 1477 m_firstLayout = false; 1476 1478 } 1477 1479 -
trunk/Source/WebCore/page/FrameView.h
r223696 r223712 736 736 void sendResizeEventIfNeeded(); 737 737 738 void adjustScrollbarsForLayout(bool firstLayout); 739 738 740 void handleDeferredScrollbarsUpdateAfterDirectionChange(); 739 741
Note: See TracChangeset
for help on using the changeset viewer.