| OLD | NEW |
| 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 1462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1473 } | 1473 } |
| 1474 | 1474 |
| 1475 void FrameView::addBackgroundAttachmentFixedObject(LayoutObject* object) { | 1475 void FrameView::addBackgroundAttachmentFixedObject(LayoutObject* object) { |
| 1476 ASSERT(!m_backgroundAttachmentFixedObjects.contains(object)); | 1476 ASSERT(!m_backgroundAttachmentFixedObjects.contains(object)); |
| 1477 | 1477 |
| 1478 m_backgroundAttachmentFixedObjects.add(object); | 1478 m_backgroundAttachmentFixedObjects.add(object); |
| 1479 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator()) | 1479 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator()) |
| 1480 scrollingCoordinator->frameViewHasBackgroundAttachmentFixedObjectsDidChange( | 1480 scrollingCoordinator->frameViewHasBackgroundAttachmentFixedObjectsDidChange( |
| 1481 this); | 1481 this); |
| 1482 | 1482 |
| 1483 // TODO(pdr): When slimming paint v2 is enabled, invalidate the scroll paint | 1483 // Ensure main thread scrolling reasons are recomputed. |
| 1484 // property subtree for this so main thread scroll reasons are recomputed. | 1484 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
| 1485 setNeedsPaintPropertyUpdate(); |
| 1486 // The object's scroll properties are not affected by its own background. |
| 1487 object->setAllAncestorsNeedPaintPropertyUpdate(); |
| 1488 } |
| 1485 } | 1489 } |
| 1486 | 1490 |
| 1487 void FrameView::removeBackgroundAttachmentFixedObject(LayoutObject* object) { | 1491 void FrameView::removeBackgroundAttachmentFixedObject(LayoutObject* object) { |
| 1488 ASSERT(m_backgroundAttachmentFixedObjects.contains(object)); | 1492 ASSERT(m_backgroundAttachmentFixedObjects.contains(object)); |
| 1489 | 1493 |
| 1490 m_backgroundAttachmentFixedObjects.remove(object); | 1494 m_backgroundAttachmentFixedObjects.remove(object); |
| 1491 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator()) | 1495 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator()) |
| 1492 scrollingCoordinator->frameViewHasBackgroundAttachmentFixedObjectsDidChange( | 1496 scrollingCoordinator->frameViewHasBackgroundAttachmentFixedObjectsDidChange( |
| 1493 this); | 1497 this); |
| 1494 | 1498 |
| 1495 // TODO(pdr): When slimming paint v2 is enabled, invalidate the scroll paint | 1499 // Ensure main thread scrolling reasons are recomputed. |
| 1496 // property subtree for this so main thread scroll reasons are recomputed. | 1500 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
| 1501 setNeedsPaintPropertyUpdate(); |
| 1502 // The object's scroll properties are not affected by its own background. |
| 1503 object->setAllAncestorsNeedPaintPropertyUpdate(); |
| 1504 } |
| 1497 } | 1505 } |
| 1498 | 1506 |
| 1499 void FrameView::addViewportConstrainedObject(LayoutObject* object) { | 1507 void FrameView::addViewportConstrainedObject(LayoutObject* object) { |
| 1500 if (!m_viewportConstrainedObjects) | 1508 if (!m_viewportConstrainedObjects) |
| 1501 m_viewportConstrainedObjects = wrapUnique(new ViewportConstrainedObjectSet); | 1509 m_viewportConstrainedObjects = wrapUnique(new ViewportConstrainedObjectSet); |
| 1502 | 1510 |
| 1503 if (!m_viewportConstrainedObjects->contains(object)) { | 1511 if (!m_viewportConstrainedObjects->contains(object)) { |
| 1504 m_viewportConstrainedObjects->add(object); | 1512 m_viewportConstrainedObjects->add(object); |
| 1505 | 1513 |
| 1506 if (ScrollingCoordinator* scrollingCoordinator = | 1514 if (ScrollingCoordinator* scrollingCoordinator = |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1592 void FrameView::scrollContentsIfNeededRecursive() { | 1600 void FrameView::scrollContentsIfNeededRecursive() { |
| 1593 forAllNonThrottledFrameViews( | 1601 forAllNonThrottledFrameViews( |
| 1594 [](FrameView& frameView) { frameView.scrollContentsIfNeeded(); }); | 1602 [](FrameView& frameView) { frameView.scrollContentsIfNeeded(); }); |
| 1595 } | 1603 } |
| 1596 | 1604 |
| 1597 void FrameView::invalidateBackgroundAttachmentFixedObjects() { | 1605 void FrameView::invalidateBackgroundAttachmentFixedObjects() { |
| 1598 for (const auto& layoutObject : m_backgroundAttachmentFixedObjects) | 1606 for (const auto& layoutObject : m_backgroundAttachmentFixedObjects) |
| 1599 layoutObject->setShouldDoFullPaintInvalidation(); | 1607 layoutObject->setShouldDoFullPaintInvalidation(); |
| 1600 } | 1608 } |
| 1601 | 1609 |
| 1610 bool FrameView::hasBackgroundAttachmentFixedDescendants( |
| 1611 const LayoutObject& object) const { |
| 1612 for (const auto* potentialDescendant : m_backgroundAttachmentFixedObjects) { |
| 1613 if (potentialDescendant == &object) |
| 1614 continue; |
| 1615 if (potentialDescendant->isDescendantOf(&object)) |
| 1616 return true; |
| 1617 } |
| 1618 return false; |
| 1619 } |
| 1620 |
| 1602 bool FrameView::invalidateViewportConstrainedObjects() { | 1621 bool FrameView::invalidateViewportConstrainedObjects() { |
| 1603 bool fastPathAllowed = true; | 1622 bool fastPathAllowed = true; |
| 1604 for (const auto& viewportConstrainedObject : *m_viewportConstrainedObjects) { | 1623 for (const auto& viewportConstrainedObject : *m_viewportConstrainedObjects) { |
| 1605 LayoutObject* layoutObject = viewportConstrainedObject; | 1624 LayoutObject* layoutObject = viewportConstrainedObject; |
| 1606 LayoutItem layoutItem = LayoutItem(layoutObject); | 1625 LayoutItem layoutItem = LayoutItem(layoutObject); |
| 1607 ASSERT(layoutItem.style()->hasViewportConstrainedPosition()); | 1626 ASSERT(layoutItem.style()->hasViewportConstrainedPosition()); |
| 1608 ASSERT(layoutItem.hasLayer()); | 1627 ASSERT(layoutItem.hasLayer()); |
| 1609 PaintLayer* layer = LayoutBoxModel(layoutItem).layer(); | 1628 PaintLayer* layer = LayoutBoxModel(layoutItem).layer(); |
| 1610 | 1629 |
| 1611 if (layer->isPaintInvalidationContainer()) | 1630 if (layer->isPaintInvalidationContainer()) |
| (...skipping 3001 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4613 DCHECK(m_frame->isMainFrame()); | 4632 DCHECK(m_frame->isMainFrame()); |
| 4614 return m_initialViewportSize.width(); | 4633 return m_initialViewportSize.width(); |
| 4615 } | 4634 } |
| 4616 | 4635 |
| 4617 int FrameView::initialViewportHeight() const { | 4636 int FrameView::initialViewportHeight() const { |
| 4618 DCHECK(m_frame->isMainFrame()); | 4637 DCHECK(m_frame->isMainFrame()); |
| 4619 return m_initialViewportSize.height(); | 4638 return m_initialViewportSize.height(); |
| 4620 } | 4639 } |
| 4621 | 4640 |
| 4622 } // namespace blink | 4641 } // namespace blink |
| OLD | NEW |