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

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

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

Powered by Google App Engine
This is Rietveld 408576698