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

Side by Side Diff: Source/core/rendering/RenderBox.cpp

Issue 726123002: Ensure invalidation of non-composited scrollbars on resize (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/rendering/RenderBox.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com)
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. 7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 1289 matching lines...) Expand 10 before | Expand all | Expand 10 after
1300 return false; 1300 return false;
1301 } 1301 }
1302 1302
1303 PaintInvalidationReason RenderBox::invalidatePaintIfNeeded(const PaintInvalidati onState& paintInvalidationState, const RenderLayerModelObject& newPaintInvalidat ionContainer) 1303 PaintInvalidationReason RenderBox::invalidatePaintIfNeeded(const PaintInvalidati onState& paintInvalidationState, const RenderLayerModelObject& newPaintInvalidat ionContainer)
1304 { 1304 {
1305 PaintInvalidationReason reason = RenderBoxModelObject::invalidatePaintIfNeed ed(paintInvalidationState, newPaintInvalidationContainer); 1305 PaintInvalidationReason reason = RenderBoxModelObject::invalidatePaintIfNeed ed(paintInvalidationState, newPaintInvalidationContainer);
1306 1306
1307 // If we are set to do a full paint invalidation that means the RenderView w ill be 1307 // If we are set to do a full paint invalidation that means the RenderView w ill be
1308 // issue paint invalidations. We can then skip issuing of paint invalidation s for the child 1308 // issue paint invalidations. We can then skip issuing of paint invalidation s for the child
1309 // renderers as they'll be covered by the RenderView. 1309 // renderers as they'll be covered by the RenderView.
1310 if (!view()->doingFullPaintInvalidation()) { 1310 if (!view()->doingFullPaintInvalidation() && !isFullPaintInvalidationReason( reason)) {
1311 if (!isFullPaintInvalidationReason(reason)) 1311 invalidatePaintForOverflowIfNeeded();
1312 invalidatePaintForOverflowIfNeeded();
1313 1312
1314 // Issue paint invalidations for any scrollbars if there is a scrollable area for this renderer. 1313 // Issue paint invalidations for any scrollbars if there is a scrollable area for this renderer.
1315 if (ScrollableArea* area = scrollableArea()) { 1314 if (ScrollableArea* area = scrollableArea()) {
1316 if (area->hasVerticalBarDamage()) 1315 if (area->hasVerticalBarDamage())
1317 invalidatePaintRectangle(area->verticalBarDamage()); 1316 invalidatePaintRectangle(area->verticalBarDamage());
1318 if (area->hasHorizontalBarDamage()) 1317 if (area->hasHorizontalBarDamage())
1319 invalidatePaintRectangle(area->horizontalBarDamage()); 1318 invalidatePaintRectangle(area->horizontalBarDamage());
1320 } 1319 }
1321 } 1320 }
1322 1321
(...skipping 2434 matching lines...) Expand 10 before | Expand all | Expand 10 after
3757 { 3756 {
3758 // Checkboxes and radioboxes are not isReplaced() nor do they have their own renderer in which to override avoidFloats(). 3757 // Checkboxes and radioboxes are not isReplaced() nor do they have their own renderer in which to override avoidFloats().
3759 return node && node->isElementNode() && toElement(node)->isFormControlElemen t(); 3758 return node && node->isElementNode() && toElement(node)->isFormControlElemen t();
3760 } 3759 }
3761 3760
3762 bool RenderBox::avoidsFloats() const 3761 bool RenderBox::avoidsFloats() const
3763 { 3762 {
3764 return isReplaced() || isReplacedElement(node()) || hasOverflowClip() || isH R() || isLegend() || isWritingModeRoot() || isFlexItemIncludingDeprecated(); 3763 return isReplaced() || isReplacedElement(node()) || hasOverflowClip() || isH R() || isLegend() || isWritingModeRoot() || isFlexItemIncludingDeprecated();
3765 } 3764 }
3766 3765
3766 bool RenderBox::hasNonCompositedScrollbars() const
3767 {
3768 if (RenderLayer* layer = this->layer()) {
3769 if (RenderLayerScrollableArea* scrollableArea = layer->scrollableArea()) {
3770 if (scrollableArea->hasHorizontalScrollbar() && !scrollableArea->lay erForHorizontalScrollbar())
3771 return true;
3772 if (scrollableArea->hasVerticalScrollbar() && !scrollableArea->layer ForVerticalScrollbar())
3773 return true;
3774 }
3775 }
3776 return false;
3777 }
3778
3767 PaintInvalidationReason RenderBox::paintInvalidationReason(const RenderLayerMode lObject& paintInvalidationContainer, 3779 PaintInvalidationReason RenderBox::paintInvalidationReason(const RenderLayerMode lObject& paintInvalidationContainer,
3768 const LayoutRect& oldBounds, const LayoutPoint& oldLocation, const LayoutRec t& newBounds, const LayoutPoint& newLocation) const 3780 const LayoutRect& oldBounds, const LayoutPoint& oldLocation, const LayoutRec t& newBounds, const LayoutPoint& newLocation) const
3769 { 3781 {
3770 PaintInvalidationReason invalidationReason = RenderBoxModelObject::paintInva lidationReason(paintInvalidationContainer, oldBounds, oldLocation, newBounds, ne wLocation); 3782 PaintInvalidationReason invalidationReason = RenderBoxModelObject::paintInva lidationReason(paintInvalidationContainer, oldBounds, oldLocation, newBounds, ne wLocation);
3771 if (isFullPaintInvalidationReason(invalidationReason)) 3783 if (isFullPaintInvalidationReason(invalidationReason))
3772 return invalidationReason; 3784 return invalidationReason;
3773 3785
3774 // If the transform is not identity or translation, incremental invalidation is not applicable 3786 // If the transform is not identity or translation, incremental invalidation is not applicable
3775 // because the difference between oldBounds and newBounds doesn't cover all area needing invalidation. 3787 // because the difference between oldBounds and newBounds doesn't cover all area needing invalidation.
3776 // FIXME: Should also consider ancestor transforms since paintInvalidationCo ntainer. crbug.com/426111. 3788 // FIXME: Should also consider ancestor transforms since paintInvalidationCo ntainer. crbug.com/426111.
3777 if (invalidationReason == PaintInvalidationIncremental 3789 if (invalidationReason == PaintInvalidationIncremental
3778 && paintInvalidationContainer != this 3790 && paintInvalidationContainer != this
3779 && hasLayer() && layer()->transform() && !layer()->transform()->isIdenti tyOrTranslation()) 3791 && hasLayer() && layer()->transform() && !layer()->transform()->isIdenti tyOrTranslation())
3780 return PaintInvalidationBoundsChange; 3792 return PaintInvalidationBoundsChange;
3781 3793
3782 if (!style()->hasBackground() && !style()->hasBoxDecorations()) 3794 if (!style()->hasBackground() && !style()->hasBoxDecorations()) {
3795 // We could let incremental invalidation cover non-composited scrollbars , but just
3796 // do a full invalidation because incremental invalidation will go away with slimming paint.
3797 if (invalidationReason == PaintInvalidationIncremental && hasNonComposit edScrollbars())
3798 return PaintInvalidationBorderBoxChange;
3783 return invalidationReason; 3799 return invalidationReason;
3800 }
3784 3801
3785 LayoutSize oldBorderBoxSize = computePreviousBorderBoxSize(oldBounds.size()) ; 3802 LayoutSize oldBorderBoxSize = computePreviousBorderBoxSize(oldBounds.size()) ;
3786 LayoutSize newBorderBoxSize = size(); 3803 LayoutSize newBorderBoxSize = size();
3787 3804
3788 if (oldBorderBoxSize == newBorderBoxSize) 3805 if (oldBorderBoxSize == newBorderBoxSize)
3789 return invalidationReason; 3806 return invalidationReason;
3790 3807
3808 // See another hasNonCompositedScrollbars() callsite above.
3809 if (hasNonCompositedScrollbars())
3810 return PaintInvalidationBorderBoxChange;
3811
3791 // FIXME: Implement correct incremental invalidation for visual overflowing effects. 3812 // FIXME: Implement correct incremental invalidation for visual overflowing effects.
3792 if (style()->hasVisualOverflowingEffect() || style()->hasAppearance() || sty le()->hasFilter()) 3813 if (style()->hasVisualOverflowingEffect() || style()->hasAppearance() || sty le()->hasFilter())
3793 return PaintInvalidationBorderBoxChange; 3814 return PaintInvalidationBorderBoxChange;
3794 3815
3795 if (style()->hasBorderRadius()) { 3816 if (style()->hasBorderRadius()) {
3796 // If a border-radius exists and width/height is smaller than radius wid th/height, 3817 // If a border-radius exists and width/height is smaller than radius wid th/height,
3797 // we need to fully invalidate to cover the changed radius. 3818 // we need to fully invalidate to cover the changed radius.
3798 RoundedRect oldRoundedRect = style()->getRoundedBorderFor(LayoutRect(Lay outPoint(0, 0), oldBorderBoxSize)); 3819 RoundedRect oldRoundedRect = style()->getRoundedBorderFor(LayoutRect(Lay outPoint(0, 0), oldBorderBoxSize));
3799 RoundedRect newRoundedRect = style()->getRoundedBorderFor(LayoutRect(Lay outPoint(0, 0), newBorderBoxSize)); 3820 RoundedRect newRoundedRect = style()->getRoundedBorderFor(LayoutRect(Lay outPoint(0, 0), newBorderBoxSize));
3800 if (oldRoundedRect.radii() != newRoundedRect.radii()) 3821 if (oldRoundedRect.radii() != newRoundedRect.radii())
(...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after
4439 4460
4440 setLogicalTop(oldLogicalTop); 4461 setLogicalTop(oldLogicalTop);
4441 setLogicalWidth(oldLogicalWidth); 4462 setLogicalWidth(oldLogicalWidth);
4442 setMarginLeft(oldMarginLeft); 4463 setMarginLeft(oldMarginLeft);
4443 setMarginRight(oldMarginRight); 4464 setMarginRight(oldMarginRight);
4444 4465
4445 return borderBox; 4466 return borderBox;
4446 } 4467 }
4447 4468
4448 } // namespace blink 4469 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderBox.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698