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

Side by Side Diff: Source/core/layout/LayoutBox.cpp

Issue 949303002: Fix invalidation during painting of scrollbars (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: NeedsRebaseline Created 5 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/layout/LayoutBox.h ('k') | Source/core/layout/LayoutFlexibleBox.cpp » ('j') | 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 582 matching lines...) Expand 10 before | Expand all | Expand 10 after
593 { 593 {
594 const LayoutStyle& styleToUse = styleRef(); 594 const LayoutStyle& styleToUse = styleRef();
595 if (!styleToUse.logicalMaxHeight().isMaxSizeNone()) { 595 if (!styleToUse.logicalMaxHeight().isMaxSizeNone()) {
596 LayoutUnit maxH = computeContentLogicalHeight(styleToUse.logicalMaxHeigh t(), intrinsicContentHeight); 596 LayoutUnit maxH = computeContentLogicalHeight(styleToUse.logicalMaxHeigh t(), intrinsicContentHeight);
597 if (maxH != -1) 597 if (maxH != -1)
598 logicalHeight = std::min(logicalHeight, maxH); 598 logicalHeight = std::min(logicalHeight, maxH);
599 } 599 }
600 return std::max(logicalHeight, computeContentLogicalHeight(styleToUse.logica lMinHeight(), intrinsicContentHeight)); 600 return std::max(logicalHeight, computeContentLogicalHeight(styleToUse.logica lMinHeight(), intrinsicContentHeight));
601 } 601 }
602 602
603 void LayoutBox::setLocationAndUpdateOverflowControlsIfNeeded(const LayoutPoint& location)
604 {
605 if (LayerScrollableArea* scrollableArea = this->scrollableArea()) {
606 IntSize oldPixelSnappedBorderRectSize = pixelSnappedBorderBoxRect().size ();
607 setLocation(location);
608 if (pixelSnappedBorderBoxRect().size() != oldPixelSnappedBorderRectSize)
609 scrollableArea->updateAfterLayout();
610 return;
611 }
612
613 setLocation(location);
614 }
615
603 IntRect LayoutBox::absoluteContentBox() const 616 IntRect LayoutBox::absoluteContentBox() const
604 { 617 {
605 // This is wrong with transforms and flipped writing modes. 618 // This is wrong with transforms and flipped writing modes.
606 IntRect rect = pixelSnappedIntRect(contentBoxRect()); 619 IntRect rect = pixelSnappedIntRect(contentBoxRect());
607 FloatPoint absPos = localToAbsolute(); 620 FloatPoint absPos = localToAbsolute();
608 rect.move(absPos.x(), absPos.y()); 621 rect.move(absPos.x(), absPos.y());
609 return rect; 622 return rect;
610 } 623 }
611 624
612 IntSize LayoutBox::absoluteContentBoxOffset() const 625 IntSize LayoutBox::absoluteContentBoxOffset() const
(...skipping 1099 matching lines...) Expand 10 before | Expand all | Expand 10 after
1712 1725
1713 if (container()->isLayoutInline()) 1726 if (container()->isLayoutInline())
1714 moveWithEdgeOfInlineContainerIfNecessary(box->isHorizontal()); 1727 moveWithEdgeOfInlineContainerIfNecessary(box->isHorizontal());
1715 1728
1716 // Nuke the box. 1729 // Nuke the box.
1717 box->remove(DontMarkLineBoxes); 1730 box->remove(DontMarkLineBoxes);
1718 box->destroy(); 1731 box->destroy();
1719 } else if (isReplaced()) { 1732 } else if (isReplaced()) {
1720 // FIXME: the call to roundedLayoutPoint() below is temporary and should be removed once 1733 // FIXME: the call to roundedLayoutPoint() below is temporary and should be removed once
1721 // the transition to LayoutUnit-based types is complete (crbug.com/32123 7) 1734 // the transition to LayoutUnit-based types is complete (crbug.com/32123 7)
1722 setLocation(box->topLeft().roundedLayoutPoint()); 1735 setLocationAndUpdateOverflowControlsIfNeeded(box->topLeft().roundedLayou tPoint());
1723 setInlineBoxWrapper(box); 1736 setInlineBoxWrapper(box);
1724 } 1737 }
1725 } 1738 }
1726 1739
1727 void LayoutBox::markStaticPositionedBoxForLayout(bool isHorizontal, bool isInlin e) 1740 void LayoutBox::markStaticPositionedBoxForLayout(bool isHorizontal, bool isInlin e)
1728 { 1741 {
1729 ASSERT(isOutOfFlowPositioned()); 1742 ASSERT(isOutOfFlowPositioned());
1730 if (normalChildNeedsLayout()) 1743 if (normalChildNeedsLayout())
1731 return; 1744 return;
1732 if (isInline ? style()->hasStaticInlinePosition(isHorizontal) : style()->has StaticBlockPosition(isHorizontal)) 1745 if (isInline ? style()->hasStaticInlinePosition(isHorizontal) : style()->has StaticBlockPosition(isHorizontal))
(...skipping 2895 matching lines...) Expand 10 before | Expand all | Expand 10 after
4628 } 4641 }
4629 4642
4630 void LayoutBox::invalidateDisplayItemClients(DisplayItemList* displayItemList) c onst 4643 void LayoutBox::invalidateDisplayItemClients(DisplayItemList* displayItemList) c onst
4631 { 4644 {
4632 LayoutBoxModelObject::invalidateDisplayItemClients(displayItemList); 4645 LayoutBoxModelObject::invalidateDisplayItemClients(displayItemList);
4633 if (LayerScrollableArea* area = scrollableArea()) 4646 if (LayerScrollableArea* area = scrollableArea())
4634 displayItemList->invalidate(area->displayItemClient()); 4647 displayItemList->invalidate(area->displayItemClient());
4635 } 4648 }
4636 4649
4637 } // namespace blink 4650 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/layout/LayoutBox.h ('k') | Source/core/layout/LayoutFlexibleBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698