Changeset 223742 in webkit
- Timestamp:
- Oct 19, 2017 9:52:06 PM (7 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r223738 r223742 1 2017-10-19 Zalan Bujtas <zalan@apple.com> 2 3 [FrameView::layout cleanup] Move style update related logic to a separate function 4 https://bugs.webkit.org/show_bug.cgi?id=178558 5 <rdar://problem/35088218> 6 7 Reviewed by Simon Fraser. 8 9 No change in functionality. 10 11 * page/FrameView.cpp: 12 (WebCore::FrameView::ensureStyleIsUpToDateForLayout): 13 (WebCore::FrameView::layout): 14 * page/FrameView.h: 15 1 16 2017-10-19 JF Bastien <jfbastien@apple.com> 2 17 -
trunk/Source/WebCore/page/FrameView.cpp
r223720 r223742 1364 1364 } 1365 1365 1366 void FrameView::updateStyleForLayout() 1367 { 1368 Document& document = *frame().document(); 1369 // Viewport-dependent media queries may cause us to need completely different style information. 1370 auto* styleResolver = document.styleScope().resolverIfExists(); 1371 if (!styleResolver || styleResolver->hasMediaQueriesAffectedByViewportChange()) { 1372 LOG(Layout, " hasMediaQueriesAffectedByViewportChange, enqueueing style recalc"); 1373 document.styleScope().didChangeStyleSheetEnvironment(); 1374 // FIXME: This instrumentation event is not strictly accurate since cached media query results do not persist across StyleResolver rebuilds. 1375 InspectorInstrumentation::mediaQueryResultChanged(document); 1376 } 1377 document.evaluateMediaQueryList(); 1378 // If there is any pagination to apply, it will affect the RenderView's style, so we should 1379 // take care of that now. 1380 applyPaginationToViewport(); 1381 // Always ensure our style info is up-to-date. This can happen in situations where 1382 // the layout beats any sort of style recalc update that needs to occur. 1383 document.updateStyleIfNeeded(); 1384 } 1385 1366 1386 void FrameView::layout(bool allowSubtreeLayout) 1367 1387 { … … 1421 1441 performPostLayoutTasks(); 1422 1442 1423 // Viewport-dependent media queries may cause us to need completely different style information. 1424 auto* styleResolver = document.styleScope().resolverIfExists(); 1425 if (!styleResolver || styleResolver->hasMediaQueriesAffectedByViewportChange()) { 1426 LOG(Layout, " hasMediaQueriesAffectedByViewportChange, enqueueing style recalc"); 1427 document.styleScope().didChangeStyleSheetEnvironment(); 1428 // FIXME: This instrumentation event is not strictly accurate since cached media query results do not persist across StyleResolver rebuilds. 1429 InspectorInstrumentation::mediaQueryResultChanged(document); 1430 } 1431 document.evaluateMediaQueryList(); 1432 // If there is any pagination to apply, it will affect the RenderView's style, so we should 1433 // take care of that now. 1434 applyPaginationToViewport(); 1435 // Always ensure our style info is up-to-date. This can happen in situations where 1436 // the layout beats any sort of style recalc update that needs to occur. 1437 document.updateStyleIfNeeded(); 1438 // If there is only one ref to this view left, then its going to be destroyed as soon as we exit, 1439 // so there's no point to continuing to layout 1443 updateStyleForLayout(); 1440 1444 if (hasOneRef()) 1441 1445 return; -
trunk/Source/WebCore/page/FrameView.h
r223717 r223742 738 738 739 739 void adjustScrollbarsForLayout(bool firstLayout); 740 void updateStyleForLayout(); 740 741 741 742 void handleDeferredScrollbarsUpdateAfterDirectionChange();
Note: See TracChangeset
for help on using the changeset viewer.