OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
reserved. |
3 * | 3 * |
4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. | 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. |
5 * | 5 * |
6 * Other contributors: | 6 * Other contributors: |
7 * Robert O'Callahan <roc+@cs.cmu.edu> | 7 * Robert O'Callahan <roc+@cs.cmu.edu> |
8 * David Baron <dbaron@fas.harvard.edu> | 8 * David Baron <dbaron@fas.harvard.edu> |
9 * Christian Biesinger <cbiesinger@web.de> | 9 * Christian Biesinger <cbiesinger@web.de> |
10 * Randall Jesup <rjesup@wgate.com> | 10 * Randall Jesup <rjesup@wgate.com> |
(...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
702 for (RenderLayer* curr = parent(); curr; curr = curr->parent()) { | 702 for (RenderLayer* curr = parent(); curr; curr = curr->parent()) { |
703 if (curr->renderer()->hasColumns()) { | 703 if (curr->renderer()->hasColumns()) { |
704 m_isPaginated = checkContainingBlockChainForPagination(renderer(), c
urr->renderBox()); | 704 m_isPaginated = checkContainingBlockChainForPagination(renderer(), c
urr->renderBox()); |
705 return; | 705 return; |
706 } | 706 } |
707 if (curr->stackingNode() == ancestorStackingContextNode) | 707 if (curr->stackingNode() == ancestorStackingContextNode) |
708 return; | 708 return; |
709 } | 709 } |
710 } | 710 } |
711 | 711 |
| 712 void RenderLayer::mapRectToRepaintBacking(const RenderLayerModelObject* repaintC
ontainer, LayoutRect& rect) const |
| 713 { |
| 714 if (!repaintContainer->groupedMapping()) { |
| 715 m_renderer->mapRectToRepaintBacking(repaintContainer, rect); |
| 716 return; |
| 717 } |
| 718 |
| 719 ASSERT(enclosingTransformedAncestor()); |
| 720 ASSERT(enclosingTransformedAncestor()->renderer()); |
| 721 |
| 722 // FIXME: this defensive code should not have to exist. None of these pointe
rs should ever be 0. See crbug.com/370410. |
| 723 RenderLayerModelObject* transformedAncestor = 0; |
| 724 if (RenderLayer* ancestor = repaintContainer->layer()->enclosingTransformedA
ncestor()) |
| 725 transformedAncestor = ancestor->renderer(); |
| 726 if (!transformedAncestor) |
| 727 return; |
| 728 |
| 729 // If the transformedAncestor is actually the RenderView, we might get |
| 730 // confused and think that we can use LayoutState. Ideally, we'd made |
| 731 // LayoutState work for all composited layers as well, but until then |
| 732 // we need to disable LayoutState for squashed layers. |
| 733 LayoutStateDisabler layoutStateDisabler(*transformedAncestor); |
| 734 |
| 735 // This code adjusts the repaint rectangle to be in the space of the transfo
rmed ancestor of the grouped (i.e. squashed) |
| 736 // layer. This is because all layers that squash together need to repaint w.
r.t. a single container that is |
| 737 // an ancestor of all of them, in order to properly take into account any lo
cal transforms etc. |
| 738 // FIXME: remove this special-case code that works around the repainting cod
e structure. |
| 739 m_renderer->mapRectToRepaintBacking(transformedAncestor, rect); |
| 740 rect.moveBy(-repaintContainer->groupedMapping()->squashingOffsetFromTransfor
medAncestor()); |
| 741 |
| 742 return; |
| 743 } |
| 744 |
| 745 LayoutRect RenderLayer::computeRepaintRect(const RenderLayerModelObject* repaint
Container) const |
| 746 { |
| 747 if (!repaintContainer->groupedMapping()) |
| 748 return m_renderer->computeRepaintRect(repaintContainer); |
| 749 LayoutRect rect = renderer()->clippedOverflowRectForRepaint(repaintContainer
); |
| 750 repaintContainer->layer()->mapRectToRepaintBacking(repaintContainer, rect); |
| 751 return rect; |
| 752 } |
| 753 |
712 void RenderLayer::setHasVisibleContent() | 754 void RenderLayer::setHasVisibleContent() |
713 { | 755 { |
714 if (m_hasVisibleContent && !m_visibleContentStatusDirty) { | 756 if (m_hasVisibleContent && !m_visibleContentStatusDirty) { |
715 ASSERT(!parent() || parent()->hasVisibleDescendant()); | 757 ASSERT(!parent() || parent()->hasVisibleDescendant()); |
716 return; | 758 return; |
717 } | 759 } |
718 | 760 |
719 m_hasVisibleContent = true; | 761 m_hasVisibleContent = true; |
720 m_visibleContentStatusDirty = false; | 762 m_visibleContentStatusDirty = false; |
721 | 763 |
(...skipping 3299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4021 } | 4063 } |
4022 } | 4064 } |
4023 | 4065 |
4024 void showLayerTree(const WebCore::RenderObject* renderer) | 4066 void showLayerTree(const WebCore::RenderObject* renderer) |
4025 { | 4067 { |
4026 if (!renderer) | 4068 if (!renderer) |
4027 return; | 4069 return; |
4028 showLayerTree(renderer->enclosingLayer()); | 4070 showLayerTree(renderer->enclosingLayer()); |
4029 } | 4071 } |
4030 #endif | 4072 #endif |
OLD | NEW |