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

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

Issue 2506353002: Incrementally build main thread scrolling reasons [spv2] (Closed)
Patch Set: Cleanup comments Created 4 years, 1 month 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 1461 matching lines...) Expand 10 before | Expand all | Expand 10 after
1472 } 1472 }
1473 1473
1474 void FrameView::addBackgroundAttachmentFixedObject(LayoutObject* object) { 1474 void FrameView::addBackgroundAttachmentFixedObject(LayoutObject* object) {
1475 ASSERT(!m_backgroundAttachmentFixedObjects.contains(object)); 1475 ASSERT(!m_backgroundAttachmentFixedObjects.contains(object));
1476 1476
1477 m_backgroundAttachmentFixedObjects.add(object); 1477 m_backgroundAttachmentFixedObjects.add(object);
1478 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator()) 1478 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator())
1479 scrollingCoordinator->frameViewHasBackgroundAttachmentFixedObjectsDidChange( 1479 scrollingCoordinator->frameViewHasBackgroundAttachmentFixedObjectsDidChange(
1480 this); 1480 this);
1481 1481
1482 // TODO(pdr): When slimming paint v2 is enabled, invalidate the scroll paint 1482 // Ensure main thread scrolling reasons are recomputed.
1483 // property subtree for this so main thread scroll reasons are recomputed. 1483 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
1484 setNeedsPaintPropertyUpdate();
1485 // The object's scroll properties are not affected by its own background.
1486 object->setAllAncestorsNeedPaintPropertyUpdate();
1487 }
1484 } 1488 }
1485 1489
1486 void FrameView::removeBackgroundAttachmentFixedObject(LayoutObject* object) { 1490 void FrameView::removeBackgroundAttachmentFixedObject(LayoutObject* object) {
1487 ASSERT(m_backgroundAttachmentFixedObjects.contains(object)); 1491 ASSERT(m_backgroundAttachmentFixedObjects.contains(object));
1488 1492
1489 m_backgroundAttachmentFixedObjects.remove(object); 1493 m_backgroundAttachmentFixedObjects.remove(object);
1490 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator()) 1494 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator())
1491 scrollingCoordinator->frameViewHasBackgroundAttachmentFixedObjectsDidChange( 1495 scrollingCoordinator->frameViewHasBackgroundAttachmentFixedObjectsDidChange(
1492 this); 1496 this);
1493 1497
1494 // TODO(pdr): When slimming paint v2 is enabled, invalidate the scroll paint 1498 // Ensure main thread scrolling reasons are recomputed.
1495 // property subtree for this so main thread scroll reasons are recomputed. 1499 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
1500 setNeedsPaintPropertyUpdate();
1501 // The object's scroll properties are not affected by its own background.
1502 object->setAllAncestorsNeedPaintPropertyUpdate();
1503 }
1496 } 1504 }
1497 1505
1498 void FrameView::addViewportConstrainedObject(LayoutObject* object) { 1506 void FrameView::addViewportConstrainedObject(LayoutObject* object) {
1499 if (!m_viewportConstrainedObjects) 1507 if (!m_viewportConstrainedObjects)
1500 m_viewportConstrainedObjects = wrapUnique(new ViewportConstrainedObjectSet); 1508 m_viewportConstrainedObjects = wrapUnique(new ViewportConstrainedObjectSet);
1501 1509
1502 if (!m_viewportConstrainedObjects->contains(object)) { 1510 if (!m_viewportConstrainedObjects->contains(object)) {
1503 m_viewportConstrainedObjects->add(object); 1511 m_viewportConstrainedObjects->add(object);
1504 1512
1505 if (ScrollingCoordinator* scrollingCoordinator = 1513 if (ScrollingCoordinator* scrollingCoordinator =
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
1591 void FrameView::scrollContentsIfNeededRecursive() { 1599 void FrameView::scrollContentsIfNeededRecursive() {
1592 forAllNonThrottledFrameViews( 1600 forAllNonThrottledFrameViews(
1593 [](FrameView& frameView) { frameView.scrollContentsIfNeeded(); }); 1601 [](FrameView& frameView) { frameView.scrollContentsIfNeeded(); });
1594 } 1602 }
1595 1603
1596 void FrameView::invalidateBackgroundAttachmentFixedObjects() { 1604 void FrameView::invalidateBackgroundAttachmentFixedObjects() {
1597 for (const auto& layoutObject : m_backgroundAttachmentFixedObjects) 1605 for (const auto& layoutObject : m_backgroundAttachmentFixedObjects)
1598 layoutObject->setShouldDoFullPaintInvalidation(); 1606 layoutObject->setShouldDoFullPaintInvalidation();
1599 } 1607 }
1600 1608
1609 bool FrameView::hasBackgroundAttachmentFixedDescendants(
1610 const LayoutObject& object) const {
1611 for (const auto* potentialDescendant : m_backgroundAttachmentFixedObjects) {
1612 if (potentialDescendant == &object)
1613 continue;
1614 if (potentialDescendant->isDescendantOf(&object))
1615 return true;
1616 }
1617 return false;
1618 }
1619
1601 bool FrameView::invalidateViewportConstrainedObjects() { 1620 bool FrameView::invalidateViewportConstrainedObjects() {
1602 bool fastPathAllowed = true; 1621 bool fastPathAllowed = true;
1603 for (const auto& viewportConstrainedObject : *m_viewportConstrainedObjects) { 1622 for (const auto& viewportConstrainedObject : *m_viewportConstrainedObjects) {
1604 LayoutObject* layoutObject = viewportConstrainedObject; 1623 LayoutObject* layoutObject = viewportConstrainedObject;
1605 LayoutItem layoutItem = LayoutItem(layoutObject); 1624 LayoutItem layoutItem = LayoutItem(layoutObject);
1606 ASSERT(layoutItem.style()->hasViewportConstrainedPosition()); 1625 ASSERT(layoutItem.style()->hasViewportConstrainedPosition());
1607 ASSERT(layoutItem.hasLayer()); 1626 ASSERT(layoutItem.hasLayer());
1608 PaintLayer* layer = LayoutBoxModel(layoutItem).layer(); 1627 PaintLayer* layer = LayoutBoxModel(layoutItem).layer();
1609 1628
1610 if (layer->isPaintInvalidationContainer()) 1629 if (layer->isPaintInvalidationContainer())
(...skipping 2974 matching lines...) Expand 10 before | Expand all | Expand 10 after
4585 DCHECK(m_frame->isMainFrame()); 4604 DCHECK(m_frame->isMainFrame());
4586 return m_initialViewportSize.width(); 4605 return m_initialViewportSize.width();
4587 } 4606 }
4588 4607
4589 int FrameView::initialViewportHeight() const { 4608 int FrameView::initialViewportHeight() const {
4590 DCHECK(m_frame->isMainFrame()); 4609 DCHECK(m_frame->isMainFrame());
4591 return m_initialViewportSize.height(); 4610 return m_initialViewportSize.height();
4592 } 4611 }
4593 4612
4594 } // namespace blink 4613 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698