Changeset 223605 in webkit
- Timestamp:
- Oct 18, 2017 7:18:24 AM (6 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r223604 r223605 1 2017-10-18 Zalan Bujtas <zalan@apple.com> 2 3 [FrameView::layout cleanup] Move frame flattening layout logic to a separate function 4 https://bugs.webkit.org/show_bug.cgi?id=178425 5 <rdar://problem/35045836> 6 7 Reviewed by Antti Koivisto. 8 9 No change in functionality. 10 11 * page/FrameView.cpp: 12 (WebCore::FrameView::handleLayoutWithFrameFlatteningIfNeeded): 13 (WebCore::FrameView::layout): 14 (WebCore::FrameView::startLayoutAtMainFrameViewIfNeeded): 15 * page/FrameView.h: 16 1 17 2017-10-18 Antti Koivisto <antti@apple.com> 2 18 -
trunk/Source/WebCore/page/FrameView.cpp
r223590 r223605 1323 1323 #endif 1324 1324 1325 bool FrameView::handleLayoutWithFrameFlatteningIfNeeded(bool allowSubtreeLayout) 1326 { 1327 if (!isInChildFrameWithFrameFlattening()) 1328 return false; 1329 1330 if (!m_frameFlatteningViewSizeForMediaQuery) { 1331 LOG_WITH_STREAM(MediaQueries, stream << "FrameView " << this << " snapshotting size " << ScrollView::layoutSize() << " for media queries"); 1332 m_frameFlatteningViewSizeForMediaQuery = ScrollView::layoutSize(); 1333 } 1334 startLayoutAtMainFrameViewIfNeeded(allowSubtreeLayout); 1335 auto* layoutRoot = m_subtreeLayoutRoot ? m_subtreeLayoutRoot : frame().document()->renderView(); 1336 return !layoutRoot || !layoutRoot->needsLayout(); 1337 } 1338 1325 1339 void FrameView::layout(bool allowSubtreeLayout) 1326 1340 { … … 1347 1361 // Every scroll that happens during layout is programmatic. 1348 1362 SetForScope<bool> changeInProgrammaticScroll(m_inProgrammaticScroll, true); 1349 1350 bool inChildFrameLayoutWithFrameFlattening = isInChildFrameWithFrameFlattening();1351 1352 if (inChildFrameLayoutWithFrameFlattening) {1353 if (!m_frameFlatteningViewSizeForMediaQuery) {1354 LOG_WITH_STREAM(MediaQueries, stream << "FrameView " << this << " snapshotting size " << ScrollView::layoutSize() << " for media queries");1355 m_frameFlatteningViewSizeForMediaQuery = ScrollView::layoutSize();1356 }1357 startLayoutAtMainFrameViewIfNeeded(allowSubtreeLayout);1358 auto* layoutRoot = m_subtreeLayoutRoot ? m_subtreeLayoutRoot : frame().document()->renderView();1359 if (!layoutRoot || !layoutRoot->needsLayout())1360 return;1361 }1362 1363 1363 1364 TraceScope tracingScope(LayoutStart, LayoutEnd); 1365 1366 if (handleLayoutWithFrameFlatteningIfNeeded(allowSubtreeLayout)) 1367 return; 1364 1368 1365 1369 #if PLATFORM(IOS) … … 1395 1399 SetForScope<bool> changeSchedulingEnabled(m_layoutSchedulingEnabled, false); 1396 1400 1397 if (!m_nestedLayoutCount && !m_inSynchronousPostLayout && m_postLayoutTasksTimer.isActive() && !i nChildFrameLayoutWithFrameFlattening) {1401 if (!m_nestedLayoutCount && !m_inSynchronousPostLayout && m_postLayoutTasksTimer.isActive() && !isInChildFrameWithFrameFlattening()) { 1398 1402 // This is a new top-level layout. If there are any remaining tasks from the previous 1399 1403 // layout, finish them now. … … 1577 1581 if (!m_postLayoutTasksTimer.isActive()) { 1578 1582 if (!m_inSynchronousPostLayout) { 1579 if (i nChildFrameLayoutWithFrameFlattening)1583 if (isInChildFrameWithFrameFlattening()) 1580 1584 updateWidgetPositions(); 1581 1585 else { … … 1585 1589 } 1586 1590 1587 if (!m_postLayoutTasksTimer.isActive() && (needsLayout() || m_inSynchronousPostLayout || i nChildFrameLayoutWithFrameFlattening)) {1591 if (!m_postLayoutTasksTimer.isActive() && (needsLayout() || m_inSynchronousPostLayout || isInChildFrameWithFrameFlattening())) { 1588 1592 // If we need layout or are already in a synchronous call to postLayoutTasks(), 1589 1593 // defer widget updates and event dispatch until after we return. postLayoutTasks() … … 4290 4294 } 4291 4295 4292 void FrameView::startLayoutAtMainFrameViewIfNeeded(bool allowSubtree )4296 void FrameView::startLayoutAtMainFrameViewIfNeeded(bool allowSubtreeLayout) 4293 4297 { 4294 4298 // When we start a layout at the child level as opposed to the topmost frame view and this child … … 4311 4315 4312 4316 LOG(Layout, " frame flattening, starting from root"); 4313 parentView->layout(allowSubtree );4317 parentView->layout(allowSubtreeLayout); 4314 4318 } 4315 4319 -
trunk/Source/WebCore/page/FrameView.h
r223569 r223605 763 763 FrameView* parentFrameView() const; 764 764 765 void startLayoutAtMainFrameViewIfNeeded(bool allowSubtree); 765 bool handleLayoutWithFrameFlatteningIfNeeded(bool allowSubtreeLayout); 766 void startLayoutAtMainFrameViewIfNeeded(bool allowSubtreeLayout); 766 767 bool frameFlatteningEnabled() const; 767 768 bool isFrameFlatteningValidForThisFrame() const;
Note: See TracChangeset
for help on using the changeset viewer.