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 929 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
940 } | 940 } |
941 | 941 |
942 void LayoutBox::applyCachedClipAndScrollOffsetForPaintInvalidation(LayoutRect& p aintRect) const | 942 void LayoutBox::applyCachedClipAndScrollOffsetForPaintInvalidation(LayoutRect& p aintRect) const |
943 { | 943 { |
944 ASSERT(hasLayer()); | 944 ASSERT(hasLayer()); |
945 ASSERT(hasOverflowClip()); | 945 ASSERT(hasOverflowClip()); |
946 | 946 |
947 flipForWritingMode(paintRect); | 947 flipForWritingMode(paintRect); |
948 paintRect.move(-scrolledContentOffset()); // For overflow:auto/scroll/hidden . | 948 paintRect.move(-scrolledContentOffset()); // For overflow:auto/scroll/hidden . |
949 | 949 |
950 // Do not clip scroll layer contents because the compositor expects the whol e layer | |
leviw_travelin_and_unemployed
2015/12/09 23:06:26
You said there's a use that prevents us from asser
szager1
2015/12/09 23:21:26
The use is IntersectionObserver :)
| |
951 // to be always invalidated in-time. | |
952 if (usesCompositedScrolling()) { | |
953 flipForWritingMode(paintRect); | |
954 return; | |
955 } | |
956 | |
957 // size() is inaccurate if we're in the middle of a layout of this LayoutBox , so use the | 950 // size() is inaccurate if we're in the middle of a layout of this LayoutBox , so use the |
958 // layer's size instead. Even if the layer's size is wrong, the layer itself will issue paint invalidations | 951 // layer's size instead. Even if the layer's size is wrong, the layer itself will issue paint invalidations |
959 // anyway if its size does change. | 952 // anyway if its size does change. |
960 LayoutRect clipRect(LayoutPoint(), LayoutSize(layer()->size())); | 953 LayoutRect clipRect(LayoutPoint(), LayoutSize(layer()->size())); |
961 paintRect = intersection(paintRect, clipRect); | 954 paintRect = intersection(paintRect, clipRect); |
962 flipForWritingMode(paintRect); | 955 flipForWritingMode(paintRect); |
963 } | 956 } |
964 | 957 |
965 void LayoutBox::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, Layou tUnit& maxLogicalWidth) const | 958 void LayoutBox::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, Layou tUnit& maxLogicalWidth) const |
966 { | 959 { |
(...skipping 958 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1925 // Apply the relative position offset when invalidating a rectangle. Th e layer | 1918 // Apply the relative position offset when invalidating a rectangle. Th e layer |
1926 // is translated, but the layout box isn't, so we need to do this to get the | 1919 // is translated, but the layout box isn't, so we need to do this to get the |
1927 // right dirty rect. Since this is called from LayoutObject::setStyle, the relative position | 1920 // right dirty rect. Since this is called from LayoutObject::setStyle, the relative position |
1928 // flag on the LayoutObject has been cleared, so use the one on the styl e(). | 1921 // flag on the LayoutObject has been cleared, so use the one on the styl e(). |
1929 topLeft += layer()->offsetForInFlowPosition(); | 1922 topLeft += layer()->offsetForInFlowPosition(); |
1930 } | 1923 } |
1931 | 1924 |
1932 // FIXME: We ignore the lightweight clipping rect that controls use, since i f |o| is in mid-layout, | 1925 // FIXME: We ignore the lightweight clipping rect that controls use, since i f |o| is in mid-layout, |
1933 // its controlClipRect will be wrong. For overflow clip we use the values ca ched by the layer. | 1926 // its controlClipRect will be wrong. For overflow clip we use the values ca ched by the layer. |
1934 rect.setLocation(topLeft); | 1927 rect.setLocation(topLeft); |
1935 if (o->hasOverflowClip()) { | 1928 if (o != paintInvalidationContainer && o->hasOverflowClip()) { |
leviw_travelin_and_unemployed
2015/12/09 23:06:26
May be worthy of a comment?
szager1
2015/12/09 23:21:26
I'm not exactly sure what the comment should be.
| |
1936 LayoutBox* containerBox = toLayoutBox(o); | 1929 LayoutBox* containerBox = toLayoutBox(o); |
1937 containerBox->applyCachedClipAndScrollOffsetForPaintInvalidation(rect); | 1930 containerBox->applyCachedClipAndScrollOffsetForPaintInvalidation(rect); |
1938 if (rect.isEmpty()) | 1931 if (rect.isEmpty()) |
1939 return; | 1932 return; |
1940 } | 1933 } |
1941 | 1934 |
1942 if (containerSkipped) { | 1935 if (containerSkipped) { |
1943 // If the paintInvalidationContainer is below o, then we need to map the rect into paintInvalidationContainer's coordinates. | 1936 // If the paintInvalidationContainer is below o, then we need to map the rect into paintInvalidationContainer's coordinates. |
1944 LayoutSize containerOffset = paintInvalidationContainer->offsetFromAnces torContainer(o); | 1937 LayoutSize containerOffset = paintInvalidationContainer->offsetFromAnces torContainer(o); |
1945 rect.move(-containerOffset); | 1938 rect.move(-containerOffset); |
(...skipping 2911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4857 } | 4850 } |
4858 | 4851 |
4859 void LayoutBox::clearPreviousPaintInvalidationRects() | 4852 void LayoutBox::clearPreviousPaintInvalidationRects() |
4860 { | 4853 { |
4861 LayoutBoxModelObject::clearPreviousPaintInvalidationRects(); | 4854 LayoutBoxModelObject::clearPreviousPaintInvalidationRects(); |
4862 if (PaintLayerScrollableArea* scrollableArea = this->scrollableArea()) | 4855 if (PaintLayerScrollableArea* scrollableArea = this->scrollableArea()) |
4863 scrollableArea->clearPreviousPaintInvalidationRects(); | 4856 scrollableArea->clearPreviousPaintInvalidationRects(); |
4864 } | 4857 } |
4865 | 4858 |
4866 } // namespace blink | 4859 } // namespace blink |
OLD | NEW |