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

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp

Issue 2529293012: Invalidate paint properties on paint offset changes (Closed)
Patch Set: Simpler fix for overflowclip Created 4 years 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) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
3 * reserved. 3 * reserved.
4 * 4 *
5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. 5 * Portions are Copyright (C) 1998 Netscape Communications Corporation.
6 * 6 *
7 * Other contributors: 7 * Other contributors:
8 * Robert O'Callahan <roc+@cs.cmu.edu> 8 * Robert O'Callahan <roc+@cs.cmu.edu>
9 * David Baron <dbaron@fas.harvard.edu> 9 * David Baron <dbaron@fas.harvard.edu>
10 * Christian Biesinger <cbiesinger@gmail.com> 10 * Christian Biesinger <cbiesinger@gmail.com>
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 if (!frameView->invalidateViewportConstrainedObjects()) 435 if (!frameView->invalidateViewportConstrainedObjects())
436 requiresPaintInvalidation = true; 436 requiresPaintInvalidation = true;
437 } 437 }
438 438
439 // Just schedule a full paint invalidation of our object. 439 // Just schedule a full paint invalidation of our object.
440 // FIXME: This invalidation will be unnecessary in slimming paint phase 2. 440 // FIXME: This invalidation will be unnecessary in slimming paint phase 2.
441 if (requiresPaintInvalidation) { 441 if (requiresPaintInvalidation) {
442 box().setShouldDoFullPaintInvalidationIncludingNonCompositingDescendants(); 442 box().setShouldDoFullPaintInvalidationIncludingNonCompositingDescendants();
443 } 443 }
444 444
445 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) {
446 // The scrollOffsetTranslation paint property depends on the scroll offset.
447 // (see: PaintPropertyTreeBuilder.updateProperties(FrameView&,...) and
448 // PaintPropertyTreeBuilder.updateScrollAndScrollTranslation).
449 if (!RuntimeEnabledFeatures::rootLayerScrollingEnabled() &&
450 layer()->isRootLayer()) {
451 frameView->setNeedsPaintPropertyUpdate();
452 } else {
453 box().setNeedsPaintPropertyUpdate();
454 }
455 }
456
445 // Schedule the scroll DOM event. 457 // Schedule the scroll DOM event.
446 if (box().node()) 458 if (box().node())
447 box().node()->document().enqueueScrollEventForNode(box().node()); 459 box().node()->document().enqueueScrollEventForNode(box().node());
448 460
449 if (AXObjectCache* cache = box().document().existingAXObjectCache()) 461 if (AXObjectCache* cache = box().document().existingAXObjectCache())
450 cache->handleScrollPositionChanged(&box()); 462 cache->handleScrollPositionChanged(&box());
451 box().view()->clearHitTestCache(); 463 box().view()->clearHitTestCache();
452 464
453 // Inform the FrameLoader of the new scroll position, so it can be restored 465 // Inform the FrameLoader of the new scroll position, so it can be restored
454 // when navigating back. 466 // when navigating back.
(...skipping 1209 matching lines...) Expand 10 before | Expand all | Expand 10 after
1664 isVisibleToHitTest &= owner->layoutObject() && 1676 isVisibleToHitTest &= owner->layoutObject() &&
1665 owner->layoutObject()->style()->visibleToHitTesting(); 1677 owner->layoutObject()->style()->visibleToHitTesting();
1666 } 1678 }
1667 1679
1668 bool didScrollOverflow = m_scrollsOverflow; 1680 bool didScrollOverflow = m_scrollsOverflow;
1669 1681
1670 m_scrollsOverflow = hasOverflow && isVisibleToHitTest; 1682 m_scrollsOverflow = hasOverflow && isVisibleToHitTest;
1671 if (didScrollOverflow == scrollsOverflow()) 1683 if (didScrollOverflow == scrollsOverflow())
1672 return; 1684 return;
1673 1685
1686 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) {
1687 // The scroll and scroll offset properties depend on |scrollsOverflow| (see:
1688 // PaintPropertyTreeBuilder::updateScrollAndScrollTranslation).
1689 box().setNeedsPaintPropertyUpdate();
1690 }
1691
1674 if (m_scrollsOverflow) { 1692 if (m_scrollsOverflow) {
1675 DCHECK(canHaveOverflowScrollbars(box())); 1693 DCHECK(canHaveOverflowScrollbars(box()));
1676 frameView->addScrollableArea(this); 1694 frameView->addScrollableArea(this);
1677 } else { 1695 } else {
1678 frameView->removeScrollableArea(this); 1696 frameView->removeScrollableArea(this);
1679 } 1697 }
1680 } 1698 }
1681 1699
1682 void PaintLayerScrollableArea::updateCompositingLayersAfterScroll() { 1700 void PaintLayerScrollableArea::updateCompositingLayersAfterScroll() {
1683 PaintLayerCompositor* compositor = box().view()->compositor(); 1701 PaintLayerCompositor* compositor = box().view()->compositor();
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
2016 2034
2017 void PaintLayerScrollableArea::DelayScrollOffsetClampScope:: 2035 void PaintLayerScrollableArea::DelayScrollOffsetClampScope::
2018 clampScrollableAreas() { 2036 clampScrollableAreas() {
2019 for (auto& scrollableArea : *s_needsClamp) 2037 for (auto& scrollableArea : *s_needsClamp)
2020 scrollableArea->clampScrollOffsetAfterOverflowChange(); 2038 scrollableArea->clampScrollOffsetAfterOverflowChange();
2021 delete s_needsClamp; 2039 delete s_needsClamp;
2022 s_needsClamp = nullptr; 2040 s_needsClamp = nullptr;
2023 } 2041 }
2024 2042
2025 } // namespace blink 2043 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698