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. | 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. |
7 * All rights reserved. | 7 * All rights reserved. |
8 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. | 8 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. |
9 * | 9 * |
10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
(...skipping 1134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1145 result = overflowClipRect(LayoutPoint()); | 1145 result = overflowClipRect(LayoutPoint()); |
1146 | 1146 |
1147 if (hasClip()) | 1147 if (hasClip()) |
1148 result.intersect(clipRect(LayoutPoint())); | 1148 result.intersect(clipRect(LayoutPoint())); |
1149 | 1149 |
1150 return result; | 1150 return result; |
1151 } | 1151 } |
1152 | 1152 |
1153 bool LayoutBox::mapScrollingContentsRectToBoxSpace( | 1153 bool LayoutBox::mapScrollingContentsRectToBoxSpace( |
1154 LayoutRect& rect, | 1154 LayoutRect& rect, |
1155 ApplyOverflowClipFlag applyOverflowClip, | |
1156 VisualRectFlags visualRectFlags) const { | 1155 VisualRectFlags visualRectFlags) const { |
1157 if (!hasClipRelatedProperty()) | 1156 if (!hasClipRelatedProperty()) |
1158 return true; | 1157 return true; |
1159 | 1158 |
1160 if (applyOverflowClip == ApplyNonScrollOverflowClip) | |
1161 return true; | |
1162 | |
1163 if (hasOverflowClip()) { | 1159 if (hasOverflowClip()) { |
1164 LayoutSize offset = LayoutSize(-scrolledContentOffset()); | 1160 LayoutSize offset = LayoutSize(-scrolledContentOffset()); |
1165 rect.move(offset); | 1161 rect.move(offset); |
1166 } | 1162 } |
1167 | 1163 |
1168 // This won't work fully correctly for fixed-position elements, who should | 1164 // This won't work fully correctly for fixed-position elements, who should |
1169 // receive CSS clip but for whom the current object is not in the containing | 1165 // receive CSS clip but for whom the current object is not in the containing |
1170 // block chain. | 1166 // block chain. |
1171 LayoutRect clipRect = clippingRect(); | 1167 LayoutRect clipRect = clippingRect(); |
1172 | 1168 |
(...skipping 1190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2363 // LayoutObject::setStyle, the relative position flag on the LayoutObject | 2359 // LayoutObject::setStyle, the relative position flag on the LayoutObject |
2364 // has been cleared, so use the one on the style(). | 2360 // has been cleared, so use the one on the style(). |
2365 topLeft += layer()->offsetForInFlowPosition(); | 2361 topLeft += layer()->offsetForInFlowPosition(); |
2366 } | 2362 } |
2367 | 2363 |
2368 // FIXME: We ignore the lightweight clipping rect that controls use, since if | 2364 // FIXME: We ignore the lightweight clipping rect that controls use, since if |
2369 // |o| is in mid-layout, its controlClipRect will be wrong. For overflow clip | 2365 // |o| is in mid-layout, its controlClipRect will be wrong. For overflow clip |
2370 // we use the values cached by the layer. | 2366 // we use the values cached by the layer. |
2371 rect.setLocation(topLeft); | 2367 rect.setLocation(topLeft); |
2372 | 2368 |
2373 if (container->isBox() && | 2369 if (container->isBox() && container != ancestor && |
2374 !toLayoutBox(container)->mapScrollingContentsRectToBoxSpace( | 2370 !toLayoutBox(container)->mapScrollingContentsRectToBoxSpace( |
2375 rect, container == ancestor ? ApplyNonScrollOverflowClip | 2371 rect, visualRectFlags)) |
2376 : ApplyOverflowClip, | |
2377 visualRectFlags)) | |
2378 return false; | 2372 return false; |
2379 | 2373 |
2380 if (ancestorSkipped) { | 2374 if (ancestorSkipped) { |
2381 // If the ancestor is below the container, then we need to map the rect into | 2375 // If the ancestor is below the container, then we need to map the rect into |
2382 // ancestor's coordinates. | 2376 // ancestor's coordinates. |
2383 LayoutSize containerOffset = | 2377 LayoutSize containerOffset = |
2384 ancestor->offsetFromAncestorContainer(container); | 2378 ancestor->offsetFromAncestorContainer(container); |
2385 rect.move(-containerOffset); | 2379 rect.move(-containerOffset); |
2386 // If the ancestor is fixed, then the rect is already in its coordinates so | 2380 // If the ancestor is fixed, then the rect is already in its coordinates so |
2387 // doesn't need viewport-adjusting. | 2381 // doesn't need viewport-adjusting. |
(...skipping 3204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5592 LayoutRect rect = frameRect(); | 5586 LayoutRect rect = frameRect(); |
5593 | 5587 |
5594 LayoutBlock* block = containingBlock(); | 5588 LayoutBlock* block = containingBlock(); |
5595 if (block) | 5589 if (block) |
5596 block->adjustChildDebugRect(rect); | 5590 block->adjustChildDebugRect(rect); |
5597 | 5591 |
5598 return rect; | 5592 return rect; |
5599 } | 5593 } |
5600 | 5594 |
5601 } // namespace blink | 5595 } // namespace blink |
OLD | NEW |