Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Side by Side Diff: third_party/WebKit/Source/core/frame/FrameView.cpp

Issue 2110953002: Make sure to iterate over all viewport-constrained objects for scroll invalidation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2743
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
3 * 1999 Lars Knoll <knoll@kde.org> 3 * 1999 Lars Knoll <knoll@kde.org>
4 * 1999 Antti Koivisto <koivisto@kde.org> 4 * 1999 Antti Koivisto <koivisto@kde.org>
5 * 2000 Dirk Mueller <mueller@kde.org> 5 * 2000 Dirk Mueller <mueller@kde.org>
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com)
8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com)
9 * Copyright (C) 2009 Google Inc. All rights reserved. 9 * Copyright (C) 2009 Google Inc. All rights reserved.
10 * 10 *
(...skipping 1366 matching lines...) Expand 10 before | Expand all | Expand 10 after
1377 } 1377 }
1378 1378
1379 void FrameView::invalidateBackgroundAttachmentFixedObjects() 1379 void FrameView::invalidateBackgroundAttachmentFixedObjects()
1380 { 1380 {
1381 for (const auto& layoutObject : m_backgroundAttachmentFixedObjects) 1381 for (const auto& layoutObject : m_backgroundAttachmentFixedObjects)
1382 layoutObject->setShouldDoFullPaintInvalidation(); 1382 layoutObject->setShouldDoFullPaintInvalidation();
1383 } 1383 }
1384 1384
1385 bool FrameView::invalidateViewportConstrainedObjects() 1385 bool FrameView::invalidateViewportConstrainedObjects()
1386 { 1386 {
1387 bool fastPathAllowed = true;
1387 for (const auto& viewportConstrainedObject : *m_viewportConstrainedObjects) { 1388 for (const auto& viewportConstrainedObject : *m_viewportConstrainedObjects) {
1388 LayoutObject* layoutObject = viewportConstrainedObject; 1389 LayoutObject* layoutObject = viewportConstrainedObject;
1389 LayoutItem layoutItem = LayoutItem(layoutObject); 1390 LayoutItem layoutItem = LayoutItem(layoutObject);
1390 ASSERT(layoutItem.style()->hasViewportConstrainedPosition()); 1391 ASSERT(layoutItem.style()->hasViewportConstrainedPosition());
1391 ASSERT(layoutItem.hasLayer()); 1392 ASSERT(layoutItem.hasLayer());
1392 PaintLayer* layer = LayoutBoxModel(layoutItem).layer(); 1393 PaintLayer* layer = LayoutBoxModel(layoutItem).layer();
1393 1394
1394 if (layer->isPaintInvalidationContainer()) 1395 if (layer->isPaintInvalidationContainer())
1395 continue; 1396 continue;
1396 1397
1397 if (layer->subtreeIsInvisible()) 1398 if (layer->subtreeIsInvisible())
1398 continue; 1399 continue;
1399 1400
1400 // invalidate even if there is an ancestor with a filter that moves pixe ls. 1401 // invalidate even if there is an ancestor with a filter that moves pixe ls.
1401 layoutItem.setShouldDoFullPaintInvalidationIncludingNonCompositingDescen dants(); 1402 layoutItem.setShouldDoFullPaintInvalidationIncludingNonCompositingDescen dants();
1402 1403
1403 TRACE_EVENT_INSTANT1( 1404 TRACE_EVENT_INSTANT1(
1404 TRACE_DISABLED_BY_DEFAULT("devtools.timeline.invalidationTracking"), 1405 TRACE_DISABLED_BY_DEFAULT("devtools.timeline.invalidationTracking"),
1405 "ScrollInvalidationTracking", 1406 "ScrollInvalidationTracking",
1406 TRACE_EVENT_SCOPE_THREAD, 1407 TRACE_EVENT_SCOPE_THREAD,
1407 "data", 1408 "data",
1408 InspectorScrollInvalidationTrackingEvent::data(*layoutObject)); 1409 InspectorScrollInvalidationTrackingEvent::data(*layoutObject));
1409 1410
1410 // If the fixed layer has a blur/drop-shadow filter applied on at least one of its parents, we cannot 1411 // If the fixed layer has a blur/drop-shadow filter applied on at least one of its parents, we cannot
1411 // scroll using the fast path, otherwise the outsets of the filter will be moved around the page. 1412 // scroll using the fast path, otherwise the outsets of the filter will be moved around the page.
1412 if (layer->hasAncestorWithFilterThatMovesPixels()) 1413 if (layer->hasAncestorWithFilterThatMovesPixels())
1413 return false; 1414 fastPathAllowed = false;
1414 } 1415 }
1415 return true; 1416 return fastPathAllowed;
1416 } 1417 }
1417 1418
1418 bool FrameView::scrollContentsFastPath(const IntSize& scrollDelta) 1419 bool FrameView::scrollContentsFastPath(const IntSize& scrollDelta)
1419 { 1420 {
1420 if (!contentsInCompositedLayer()) 1421 if (!contentsInCompositedLayer())
1421 return false; 1422 return false;
1422 1423
1423 invalidateBackgroundAttachmentFixedObjects(); 1424 invalidateBackgroundAttachmentFixedObjects();
1424 1425
1425 if (!m_viewportConstrainedObjects || m_viewportConstrainedObjects->isEmpty() ) { 1426 if (!m_viewportConstrainedObjects || m_viewportConstrainedObjects->isEmpty() ) {
(...skipping 2696 matching lines...) Expand 10 before | Expand all | Expand 10 after
4122 return m_subtreeThrottled || (m_hiddenForThrottling && m_crossOriginForThrot tling); 4123 return m_subtreeThrottled || (m_hiddenForThrottling && m_crossOriginForThrot tling);
4123 } 4124 }
4124 4125
4125 LayoutBox& FrameView::boxForScrollControlPaintInvalidation() const 4126 LayoutBox& FrameView::boxForScrollControlPaintInvalidation() const
4126 { 4127 {
4127 ASSERT(layoutView()); 4128 ASSERT(layoutView());
4128 return *layoutView(); 4129 return *layoutView();
4129 } 4130 }
4130 4131
4131 } // namespace blink 4132 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/paint/invalidation/filter-on-html-element-with-fixed-position-child-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698