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

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

Issue 1973023002: Revert of Don't include contents visual overflow into paint invalidation rect (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
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 1963 matching lines...) Expand 10 before | Expand all | Expand 10 after
1974 return joinFragmentainerBreakValues(previousBreakAfterValue, breakBefore()); 1974 return joinFragmentainerBreakValues(previousBreakAfterValue, breakBefore());
1975 } 1975 }
1976 1976
1977 bool LayoutBox::needsForcedBreakBefore(EBreak previousBreakAfterValue) const 1977 bool LayoutBox::needsForcedBreakBefore(EBreak previousBreakAfterValue) const
1978 { 1978 {
1979 return isForcedFragmentainerBreakValue(classABreakPointValue(previousBreakAf terValue)); 1979 return isForcedFragmentainerBreakValue(classABreakPointValue(previousBreakAf terValue));
1980 } 1980 }
1981 1981
1982 LayoutRect LayoutBox::localOverflowRectForPaintInvalidation() const 1982 LayoutRect LayoutBox::localOverflowRectForPaintInvalidation() const
1983 { 1983 {
1984 if (style()->visibility() != VISIBLE) 1984 if (style()->visibility() != VISIBLE) {
1985 return LayoutRect(); 1985 PaintLayer* layer = enclosingLayer();
1986 layer->updateDescendantDependentFlags();
1987 if (layer->subtreeIsInvisible())
1988 return LayoutRect();
1989 }
1986 1990
1987 return selfVisualOverflowRect(); 1991 return visualOverflowRect();
1988 } 1992 }
1989 1993
1990 void LayoutBox::inflateVisualRectForReflectionAndFilterUnderContainer(LayoutRect & rect, const LayoutObject& container, const LayoutBoxModelObject* ancestorToSto pAt) const 1994 void LayoutBox::inflateVisualRectForReflectionAndFilterUnderContainer(LayoutRect & rect, const LayoutObject& container, const LayoutBoxModelObject* ancestorToSto pAt) const
1991 { 1995 {
1992 // Apply visual overflow caused by reflections and filters defined on object s between this object 1996 // Apply visual overflow caused by reflections and filters defined on object s between this object
1993 // and container (not included) or ancestorToStopAt (included). 1997 // and container (not included) or ancestorToStopAt (included).
1994 LayoutSize offsetFromContainer = this->offsetFromContainer(&container); 1998 LayoutSize offsetFromContainer = this->offsetFromContainer(&container);
1995 rect.move(offsetFromContainer); 1999 rect.move(offsetFromContainer);
1996 for (LayoutObject* parent = this->parent(); parent && parent != container; p arent = parent->parent()) { 2000 for (LayoutObject* parent = this->parent(); parent && parent != container; p arent = parent->parent()) {
1997 if (parent->isBox()) { 2001 if (parent->isBox()) {
(...skipping 2439 matching lines...) Expand 10 before | Expand all | Expand 10 after
4437 rect.contract(scrollBarWidth, scrollBarHeight); 4441 rect.contract(scrollBarWidth, scrollBarHeight);
4438 return rect; 4442 return rect;
4439 } 4443 }
4440 4444
4441 LayoutRect LayoutBox::visualOverflowRect() const 4445 LayoutRect LayoutBox::visualOverflowRect() const
4442 { 4446 {
4443 if (!m_overflow) 4447 if (!m_overflow)
4444 return borderBoxRect(); 4448 return borderBoxRect();
4445 if (hasOverflowClip()) 4449 if (hasOverflowClip())
4446 return m_overflow->selfVisualOverflowRect(); 4450 return m_overflow->selfVisualOverflowRect();
4447 return unionRect(m_overflow->selfVisualOverflowRect(), m_overflow->contentsV isualOverflowRect()); 4451 // TODO(wangxianzhu): We should use normal unionRect() which ignores empty r ects.
4452 return unionRectEvenIfEmpty(m_overflow->selfVisualOverflowRect(), m_overflow ->contentsVisualOverflowRect());
4448 } 4453 }
4449 4454
4450 LayoutUnit LayoutBox::offsetLeft() const 4455 LayoutUnit LayoutBox::offsetLeft() const
4451 { 4456 {
4452 return adjustedPositionRelativeToOffsetParent(topLeftLocation()).x(); 4457 return adjustedPositionRelativeToOffsetParent(topLeftLocation()).x();
4453 } 4458 }
4454 4459
4455 LayoutUnit LayoutBox::offsetTop() const 4460 LayoutUnit LayoutBox::offsetTop() const
4456 { 4461 {
4457 return adjustedPositionRelativeToOffsetParent(topLeftLocation()).y(); 4462 return adjustedPositionRelativeToOffsetParent(topLeftLocation()).y();
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
4844 if (!flowThread) { 4849 if (!flowThread) {
4845 // If there's no flow thread, we're not nested. All pages have the same height. Give up. 4850 // If there's no flow thread, we're not nested. All pages have the same height. Give up.
4846 return strutToNextPage; 4851 return strutToNextPage;
4847 } 4852 }
4848 // Start searching for a suitable offset at the top of the next page or colu mn. 4853 // Start searching for a suitable offset at the top of the next page or colu mn.
4849 LayoutUnit flowThreadOffset = offsetFromLogicalTopOfFirstPage() + nextPageLo gicalTop; 4854 LayoutUnit flowThreadOffset = offsetFromLogicalTopOfFirstPage() + nextPageLo gicalTop;
4850 return strutToNextPage + flowThread->nextLogicalTopForUnbreakableContent(flo wThreadOffset, contentLogicalHeight) - flowThreadOffset; 4855 return strutToNextPage + flowThread->nextLogicalTopForUnbreakableContent(flo wThreadOffset, contentLogicalHeight) - flowThreadOffset;
4851 } 4856 }
4852 4857
4853 } // namespace blink 4858 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698