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 675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
686 for (RenderLayer* curr = parent(); curr; curr = curr->parent()) { | 686 for (RenderLayer* curr = parent(); curr; curr = curr->parent()) { |
687 if (curr->renderer()->hasColumns()) { | 687 if (curr->renderer()->hasColumns()) { |
688 m_isPaginated = checkContainingBlockChainForPagination(renderer(), c
urr->renderBox()); | 688 m_isPaginated = checkContainingBlockChainForPagination(renderer(), c
urr->renderBox()); |
689 return; | 689 return; |
690 } | 690 } |
691 if (curr->stackingNode() == ancestorStackingContextNode) | 691 if (curr->stackingNode() == ancestorStackingContextNode) |
692 return; | 692 return; |
693 } | 693 } |
694 } | 694 } |
695 | 695 |
696 void RenderLayer::mapRectToRepaintBacking(const RenderLayerModelObject* repaintC
ontainer, LayoutRect& rect) const | 696 void RenderLayer::mapRectToRepaintBacking(const RenderObject* renderObject, cons
t RenderLayerModelObject* repaintContainer, LayoutRect& rect) |
697 { | 697 { |
698 if (!repaintContainer->groupedMapping()) { | 698 if (!repaintContainer->groupedMapping()) { |
699 m_renderer->mapRectToRepaintBacking(repaintContainer, rect); | 699 renderObject->mapRectToRepaintBacking(repaintContainer, rect); |
700 return; | 700 return; |
701 } | 701 } |
702 | 702 |
703 ASSERT(enclosingTransformedAncestor()); | 703 ASSERT(repaintContainer->layer()->enclosingTransformedAncestor()); |
704 ASSERT(enclosingTransformedAncestor()->renderer()); | 704 ASSERT(repaintContainer->layer()->enclosingTransformedAncestor()->renderer()
); |
705 | 705 |
706 // FIXME: this defensive code should not have to exist. None of these pointe
rs should ever be 0. See crbug.com/370410. | 706 // FIXME: this defensive code should not have to exist. None of these pointe
rs should ever be 0. See crbug.com/370410. |
707 RenderLayerModelObject* transformedAncestor = 0; | 707 RenderLayerModelObject* transformedAncestor = 0; |
708 if (RenderLayer* ancestor = repaintContainer->layer()->enclosingTransformedA
ncestor()) | 708 if (RenderLayer* ancestor = repaintContainer->layer()->enclosingTransformedA
ncestor()) |
709 transformedAncestor = ancestor->renderer(); | 709 transformedAncestor = ancestor->renderer(); |
710 if (!transformedAncestor) | 710 if (!transformedAncestor) |
711 return; | 711 return; |
712 | 712 |
713 // If the transformedAncestor is actually the RenderView, we might get | 713 // If the transformedAncestor is actually the RenderView, we might get |
714 // confused and think that we can use LayoutState. Ideally, we'd made | 714 // confused and think that we can use LayoutState. Ideally, we'd made |
715 // LayoutState work for all composited layers as well, but until then | 715 // LayoutState work for all composited layers as well, but until then |
716 // we need to disable LayoutState for squashed layers. | 716 // we need to disable LayoutState for squashed layers. |
717 LayoutStateDisabler layoutStateDisabler(*transformedAncestor); | 717 LayoutStateDisabler layoutStateDisabler(*transformedAncestor); |
718 | 718 |
719 // This code adjusts the repaint rectangle to be in the space of the transfo
rmed ancestor of the grouped (i.e. squashed) | 719 // This code adjusts the repaint rectangle to be in the space of the transfo
rmed ancestor of the grouped (i.e. squashed) |
720 // layer. This is because all layers that squash together need to repaint w.
r.t. a single container that is | 720 // layer. This is because all layers that squash together need to repaint w.
r.t. a single container that is |
721 // an ancestor of all of them, in order to properly take into account any lo
cal transforms etc. | 721 // an ancestor of all of them, in order to properly take into account any lo
cal transforms etc. |
722 // FIXME: remove this special-case code that works around the repainting cod
e structure. | 722 // FIXME: remove this special-case code that works around the repainting cod
e structure. |
723 m_renderer->mapRectToRepaintBacking(transformedAncestor, rect); | 723 renderObject->mapRectToRepaintBacking(transformedAncestor, rect); |
724 rect.moveBy(-repaintContainer->groupedMapping()->squashingOffsetFromTransfor
medAncestor()); | 724 rect.moveBy(-repaintContainer->groupedMapping()->squashingOffsetFromTransfor
medAncestor()); |
725 | 725 |
726 return; | 726 return; |
727 } | 727 } |
728 | 728 |
729 LayoutRect RenderLayer::computeRepaintRect(const RenderObject* renderObject, con
st RenderLayer* repaintContainer) | 729 LayoutRect RenderLayer::computeRepaintRect(const RenderObject* renderObject, con
st RenderLayer* repaintContainer) |
730 { | 730 { |
731 if (!repaintContainer->groupedMapping()) | 731 if (!repaintContainer->groupedMapping()) |
732 return renderObject->computeRepaintRect(repaintContainer->renderer()); | 732 return renderObject->computeRepaintRect(repaintContainer->renderer()); |
733 LayoutRect rect = renderObject->clippedOverflowRectForRepaint(repaintContain
er->renderer()); | 733 LayoutRect rect = renderObject->clippedOverflowRectForRepaint(repaintContain
er->renderer()); |
734 repaintContainer->mapRectToRepaintBacking(repaintContainer->renderer(), rect
); | 734 mapRectToRepaintBacking(repaintContainer->renderer(), repaintContainer->rend
erer(), rect); |
735 return rect; | 735 return rect; |
736 } | 736 } |
737 | 737 |
738 void RenderLayer::setHasVisibleContent() | 738 void RenderLayer::setHasVisibleContent() |
739 { | 739 { |
740 if (m_hasVisibleContent && !m_visibleContentStatusDirty) { | 740 if (m_hasVisibleContent && !m_visibleContentStatusDirty) { |
741 ASSERT(!parent() || parent()->hasVisibleDescendant()); | 741 ASSERT(!parent() || parent()->hasVisibleDescendant()); |
742 return; | 742 return; |
743 } | 743 } |
744 | 744 |
(...skipping 3144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3889 } | 3889 } |
3890 } | 3890 } |
3891 | 3891 |
3892 void showLayerTree(const WebCore::RenderObject* renderer) | 3892 void showLayerTree(const WebCore::RenderObject* renderer) |
3893 { | 3893 { |
3894 if (!renderer) | 3894 if (!renderer) |
3895 return; | 3895 return; |
3896 showLayerTree(renderer->enclosingLayer()); | 3896 showLayerTree(renderer->enclosingLayer()); |
3897 } | 3897 } |
3898 #endif | 3898 #endif |
OLD | NEW |