Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 1953 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1964 layer->updateDescendantDependentFlags(); | 1964 layer->updateDescendantDependentFlags(); |
| 1965 if (layer->subtreeIsInvisible()) | 1965 if (layer->subtreeIsInvisible()) |
| 1966 return LayoutRect(); | 1966 return LayoutRect(); |
| 1967 } | 1967 } |
| 1968 | 1968 |
| 1969 return visualOverflowRect(); | 1969 return visualOverflowRect(); |
| 1970 } | 1970 } |
| 1971 | 1971 |
| 1972 bool LayoutBox::mapToVisualRectInAncestorSpace(const LayoutBoxModelObject* ances tor, LayoutRect& rect, VisualRectFlags visualRectFlags) const | 1972 bool LayoutBox::mapToVisualRectInAncestorSpace(const LayoutBoxModelObject* ances tor, LayoutRect& rect, VisualRectFlags visualRectFlags) const |
| 1973 { | 1973 { |
| 1974 // We need to inflate the paint invalidation rect before we use paintInvalid ationState, | 1974 inflateVisualRectForReflectionAndFilter(rect); |
| 1975 // else we would forget to inflate it for the current layoutObject. FIXME: I f these were | |
| 1976 // included into the visual overflow for paint invalidation, we wouldn't hav e this issue. | |
| 1977 inflatePaintInvalidationRectForReflectionAndFilter(rect); | |
| 1978 | 1975 |
| 1979 if (ancestor == this) { | 1976 if (ancestor == this) { |
| 1980 // The final rect returned is always in the physical coordinate space of the ancestor. | 1977 // The final rect returned is always in the physical coordinate space of the ancestor. |
| 1981 flipForWritingMode(rect); | 1978 flipForWritingMode(rect); |
| 1982 return true; | 1979 return true; |
| 1983 } | 1980 } |
| 1984 | 1981 |
| 1985 bool ancestorSkipped; | 1982 bool ancestorSkipped; |
| 1986 LayoutObject* container = this->container(ancestor, &ancestorSkipped); | 1983 bool filterOrReflectionSkipped; |
| 1984 LayoutObject* container = this->container(ancestor, &ancestorSkipped, &filte rOrReflectionSkipped); | |
| 1987 if (!container) | 1985 if (!container) |
| 1988 return true; | 1986 return true; |
| 1989 | 1987 |
| 1988 if (filterOrReflectionSkipped) { | |
| 1989 // Apply filter and reflection outsets between this object and container or ancestor. | |
| 1990 for (LayoutObject* parent = this->parent(); parent && parent != containe r; parent = parent->parent()) { | |
| 1991 if (parent->isBox()) | |
| 1992 toLayoutBox(parent)->inflateVisualRectForReflectionAndFilter(rec t); | |
|
chrishtr
2016/05/02 22:16:30
Doesn't |rect| need to be in the space of parent|
Xianzhu
2016/05/02 22:21:48
Not necessary. The function just inflate the rect
chrishtr
2016/05/02 22:51:50
But if the rect is not originally in the space of
| |
| 1993 if (parent == ancestor) { | |
| 1994 // We meet ancestor before container. | |
| 1995 ASSERT(ancestorSkipped); | |
| 1996 break; | |
| 1997 } | |
| 1998 } | |
| 1999 } | |
| 2000 | |
| 1990 // The rect we compute at each step is shifted by our x/y offset in the pare nt container's coordinate space. | 2001 // The rect we compute at each step is shifted by our x/y offset in the pare nt container's coordinate space. |
| 1991 // Only when we cross a writing mode boundary will we have to possibly flipF orWritingMode (to convert into a more | 2002 // Only when we cross a writing mode boundary will we have to possibly flipF orWritingMode (to convert into a more |
| 1992 // appropriate offset corner for the enclosing container). | 2003 // appropriate offset corner for the enclosing container). |
| 1993 if (isWritingModeRoot()) { | 2004 if (isWritingModeRoot()) { |
| 1994 flipForWritingMode(rect); | 2005 flipForWritingMode(rect); |
| 1995 // Then flip rect currently in physical direction to container's block d irection. | 2006 // Then flip rect currently in physical direction to container's block d irection. |
| 1996 if (container->styleRef().isFlippedBlocksWritingMode()) | 2007 if (container->styleRef().isFlippedBlocksWritingMode()) |
| 1997 rect.setX(m_frameRect.width() - rect.maxX()); | 2008 rect.setX(m_frameRect.width() - rect.maxX()); |
| 1998 } | 2009 } |
| 1999 | 2010 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2036 toLayoutView(container)->adjustOffsetForFixedPosition(rect); | 2047 toLayoutView(container)->adjustOffsetForFixedPosition(rect); |
| 2037 return true; | 2048 return true; |
| 2038 } | 2049 } |
| 2039 | 2050 |
| 2040 if (container->isLayoutView()) | 2051 if (container->isLayoutView()) |
| 2041 return toLayoutView(container)->mapToVisualRectInAncestorSpace(ancestor, rect, position == FixedPosition ? IsFixed : 0, visualRectFlags); | 2052 return toLayoutView(container)->mapToVisualRectInAncestorSpace(ancestor, rect, position == FixedPosition ? IsFixed : 0, visualRectFlags); |
| 2042 else | 2053 else |
| 2043 return container->mapToVisualRectInAncestorSpace(ancestor, rect, visualR ectFlags); | 2054 return container->mapToVisualRectInAncestorSpace(ancestor, rect, visualR ectFlags); |
| 2044 } | 2055 } |
| 2045 | 2056 |
| 2046 void LayoutBox::inflatePaintInvalidationRectForReflectionAndFilter(LayoutRect& p aintInvalidationRect) const | 2057 void LayoutBox::inflateVisualRectForReflectionAndFilter(LayoutRect& paintInvalid ationRect) const |
| 2047 { | 2058 { |
| 2048 if (!RuntimeEnabledFeatures::cssBoxReflectFilterEnabled() && hasReflection() ) | 2059 if (!RuntimeEnabledFeatures::cssBoxReflectFilterEnabled() && hasReflection() ) |
| 2049 paintInvalidationRect.unite(reflectedRect(paintInvalidationRect)); | 2060 paintInvalidationRect.unite(reflectedRect(paintInvalidationRect)); |
| 2050 | 2061 |
| 2051 if (layer() && layer()->hasFilterInducingProperty()) | 2062 if (layer() && layer()->hasFilterInducingProperty()) |
| 2052 paintInvalidationRect = layer()->mapLayoutRectForFilter(paintInvalidatio nRect); | 2063 paintInvalidationRect = layer()->mapLayoutRectForFilter(paintInvalidatio nRect); |
| 2053 } | 2064 } |
| 2054 | 2065 |
| 2055 void LayoutBox::invalidatePaintForOverhangingFloats(bool) | 2066 void LayoutBox::invalidatePaintForOverhangingFloats(bool) |
| 2056 { | 2067 { |
| (...skipping 2694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4751 | 4762 |
| 4752 void LayoutBox::clearPercentHeightDescendants() | 4763 void LayoutBox::clearPercentHeightDescendants() |
| 4753 { | 4764 { |
| 4754 for (LayoutObject* curr = slowFirstChild(); curr; curr = curr->nextInPreOrde r(this)) { | 4765 for (LayoutObject* curr = slowFirstChild(); curr; curr = curr->nextInPreOrde r(this)) { |
| 4755 if (curr->isBox()) | 4766 if (curr->isBox()) |
| 4756 toLayoutBox(curr)->removeFromPercentHeightContainer(); | 4767 toLayoutBox(curr)->removeFromPercentHeightContainer(); |
| 4757 } | 4768 } |
| 4758 } | 4769 } |
| 4759 | 4770 |
| 4760 } // namespace blink | 4771 } // namespace blink |
| OLD | NEW |