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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 CompositingQueriesAreOnlyAllowedInCertainDocumentLifecyclePhases; | 102 CompositingQueriesAreOnlyAllowedInCertainDocumentLifecyclePhases; |
103 | 103 |
104 } // namespace | 104 } // namespace |
105 | 105 |
106 using namespace HTMLNames; | 106 using namespace HTMLNames; |
107 | 107 |
108 RenderLayer::RenderLayer(RenderLayerModelObject* renderer, LayerType type) | 108 RenderLayer::RenderLayer(RenderLayerModelObject* renderer, LayerType type) |
109 : m_layerType(type) | 109 : m_layerType(type) |
110 , m_hasSelfPaintingLayerDescendant(false) | 110 , m_hasSelfPaintingLayerDescendant(false) |
111 , m_hasSelfPaintingLayerDescendantDirty(false) | 111 , m_hasSelfPaintingLayerDescendantDirty(false) |
112 , m_hasOutOfFlowPositionedDescendant(false) | |
113 , m_hasOutOfFlowPositionedDescendantDirty(true) | |
114 , m_isUnclippedDescendant(false) | |
115 , m_isRootLayer(renderer->isRenderView()) | 112 , m_isRootLayer(renderer->isRenderView()) |
116 , m_usedTransparency(false) | 113 , m_usedTransparency(false) |
117 , m_visibleContentStatusDirty(true) | 114 , m_visibleContentStatusDirty(true) |
118 , m_hasVisibleContent(false) | 115 , m_hasVisibleContent(false) |
119 , m_visibleDescendantStatusDirty(false) | 116 , m_visibleDescendantStatusDirty(false) |
120 , m_hasVisibleDescendant(false) | 117 , m_hasVisibleDescendant(false) |
121 , m_hasVisibleNonLayerContent(false) | 118 , m_hasVisibleNonLayerContent(false) |
122 , m_isPaginated(false) | 119 , m_isPaginated(false) |
123 , m_3DTransformedDescendantStatusDirty(true) | 120 , m_3DTransformedDescendantStatusDirty(true) |
124 , m_has3DTransformedDescendant(false) | 121 , m_has3DTransformedDescendant(false) |
(...skipping 30 matching lines...) Expand all Loading... |
155 if (!renderer->slowFirstChild() && renderer->style()) { | 152 if (!renderer->slowFirstChild() && renderer->style()) { |
156 m_visibleContentStatusDirty = false; | 153 m_visibleContentStatusDirty = false; |
157 m_hasVisibleContent = renderer->style()->visibility() == VISIBLE; | 154 m_hasVisibleContent = renderer->style()->visibility() == VISIBLE; |
158 } | 155 } |
159 | 156 |
160 updateScrollableArea(); | 157 updateScrollableArea(); |
161 } | 158 } |
162 | 159 |
163 RenderLayer::~RenderLayer() | 160 RenderLayer::~RenderLayer() |
164 { | 161 { |
165 if (!m_renderer->documentBeingDestroyed()) | |
166 compositor()->removeOutOfFlowPositionedLayer(this); | |
167 | |
168 if (renderer()->frame() && renderer()->frame()->page()) { | 162 if (renderer()->frame() && renderer()->frame()->page()) { |
169 if (ScrollingCoordinator* scrollingCoordinator = renderer()->frame()->pa
ge()->scrollingCoordinator()) | 163 if (ScrollingCoordinator* scrollingCoordinator = renderer()->frame()->pa
ge()->scrollingCoordinator()) |
170 scrollingCoordinator->willDestroyRenderLayer(this); | 164 scrollingCoordinator->willDestroyRenderLayer(this); |
171 } | 165 } |
172 | 166 |
173 removeFilterInfoIfNeeded(); | 167 removeFilterInfoIfNeeded(); |
174 | 168 |
175 if (groupedMapping()) { | 169 if (groupedMapping()) { |
176 DisableCompositingQueryAsserts disabler; | 170 DisableCompositingQueryAsserts disabler; |
177 groupedMapping()->removeRenderLayerFromSquashingGraphicsLayer(this); | 171 groupedMapping()->removeRenderLayerFromSquashingGraphicsLayer(this); |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 layer->m_hasSelfPaintingLayerDescendantDirty = true; | 339 layer->m_hasSelfPaintingLayerDescendantDirty = true; |
346 // If we have reached a self-painting layer, we know our parent should h
ave a self-painting descendant | 340 // If we have reached a self-painting layer, we know our parent should h
ave a self-painting descendant |
347 // in this case, there is no need to dirty our ancestors further. | 341 // in this case, there is no need to dirty our ancestors further. |
348 if (layer->isSelfPaintingLayer()) { | 342 if (layer->isSelfPaintingLayer()) { |
349 ASSERT(!parent() || parent()->m_hasSelfPaintingLayerDescendantDirty
|| parent()->hasSelfPaintingLayerDescendant()); | 343 ASSERT(!parent() || parent()->m_hasSelfPaintingLayerDescendantDirty
|| parent()->hasSelfPaintingLayerDescendant()); |
350 break; | 344 break; |
351 } | 345 } |
352 } | 346 } |
353 } | 347 } |
354 | 348 |
355 void RenderLayer::setAncestorChainHasOutOfFlowPositionedDescendant() | |
356 { | |
357 for (RenderLayer* layer = this; layer; layer = layer->parent()) { | |
358 if (!layer->m_hasOutOfFlowPositionedDescendantDirty && layer->hasOutOfFl
owPositionedDescendant()) | |
359 break; | |
360 | |
361 layer->setHasOutOfFlowPositionedDescendantDirty(false); | |
362 layer->setHasOutOfFlowPositionedDescendant(true); | |
363 } | |
364 } | |
365 | |
366 void RenderLayer::dirtyAncestorChainHasOutOfFlowPositionedDescendantStatus() | |
367 { | |
368 for (RenderLayer* layer = this; layer; layer = layer->parent()) { | |
369 layer->setHasOutOfFlowPositionedDescendantDirty(true); | |
370 | |
371 // If we have reached an out of flow positioned layer, we know our paren
t should have an out-of-flow positioned descendant. | |
372 // In this case, there is no need to dirty our ancestors further. | |
373 if (layer->renderer()->isOutOfFlowPositioned()) { | |
374 ASSERT(!parent() || parent()->m_hasOutOfFlowPositionedDescendantDirt
y || parent()->hasOutOfFlowPositionedDescendant()); | |
375 break; | |
376 } | |
377 } | |
378 } | |
379 | |
380 bool RenderLayer::scrollsWithRespectTo(const RenderLayer* other) const | 349 bool RenderLayer::scrollsWithRespectTo(const RenderLayer* other) const |
381 { | 350 { |
382 const EPosition position = renderer()->style()->position(); | 351 const EPosition position = renderer()->style()->position(); |
383 const EPosition otherPosition = other->renderer()->style()->position(); | 352 const EPosition otherPosition = other->renderer()->style()->position(); |
384 const RenderObject* containingBlock = renderer()->containingBlock(); | 353 const RenderObject* containingBlock = renderer()->containingBlock(); |
385 const RenderObject* otherContainingBlock = other->renderer()->containingBloc
k(); | 354 const RenderObject* otherContainingBlock = other->renderer()->containingBloc
k(); |
386 const RenderLayer* rootLayer = renderer()->view()->compositor()->rootRenderL
ayer(); | 355 const RenderLayer* rootLayer = renderer()->view()->compositor()->rootRenderL
ayer(); |
387 | 356 |
388 // Fixed-position elements are a special case. They are static with respect | 357 // Fixed-position elements are a special case. They are static with respect |
389 // to the viewport, which is not represented by any RenderObject, and their | 358 // to the viewport, which is not represented by any RenderObject, and their |
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
795 { | 764 { |
796 for (RenderLayer* layer = this; layer; layer = layer->parent()) { | 765 for (RenderLayer* layer = this; layer; layer = layer->parent()) { |
797 if (!layer->m_visibleDescendantStatusDirty && layer->hasVisibleDescendan
t()) | 766 if (!layer->m_visibleDescendantStatusDirty && layer->hasVisibleDescendan
t()) |
798 break; | 767 break; |
799 | 768 |
800 layer->m_hasVisibleDescendant = true; | 769 layer->m_hasVisibleDescendant = true; |
801 layer->m_visibleDescendantStatusDirty = false; | 770 layer->m_visibleDescendantStatusDirty = false; |
802 } | 771 } |
803 } | 772 } |
804 | 773 |
805 void RenderLayer::updateIsUnclippedDescendant() | |
806 { | |
807 TRACE_EVENT0("blink_rendering", "RenderLayer::updateIsUnclippedDescendant"); | |
808 ASSERT(renderer()->isOutOfFlowPositioned()); | |
809 if (!m_hasVisibleContent && !m_hasVisibleDescendant) | |
810 return; | |
811 | |
812 FrameView* frameView = renderer()->view()->frameView(); | |
813 if (!frameView) | |
814 return; | |
815 | |
816 setIsUnclippedDescendant(false); | |
817 | |
818 const RenderObject* containingBlock = renderer()->containingBlock(); | |
819 for (RenderLayer* ancestor = parent(); ancestor && ancestor->renderer() != c
ontainingBlock; ancestor = ancestor->parent()) { | |
820 // TODO(vollick): This isn't quite right. Whenever ancestor is composite
d and clips | |
821 // overflow, we're technically unclipped. However, this will currently c
ause a huge | |
822 // number of layers to report that they are unclipped. Eventually, when
we've formally | |
823 // separated the clipping, transform, opacity, and stacking trees here a
nd in the | |
824 // compositor, we will be able to relax this restriction without it bein
g prohibitively | |
825 // expensive (currently, we have to do a lot of work in the compositor t
o honor a | |
826 // clip child/parent relationship). | |
827 if (ancestor->scrollsOverflow()) { | |
828 setIsUnclippedDescendant(true); | |
829 return; | |
830 } | |
831 } | |
832 } | |
833 | |
834 // FIXME: this is quite brute-force. We could be more efficient if we were to | 774 // FIXME: this is quite brute-force. We could be more efficient if we were to |
835 // track state and update it as appropriate as changes are made in the Render tr
ee. | 775 // track state and update it as appropriate as changes are made in the Render tr
ee. |
836 void RenderLayer::updateScrollingStateAfterCompositingChange() | 776 void RenderLayer::updateScrollingStateAfterCompositingChange() |
837 { | 777 { |
838 TRACE_EVENT0("blink_rendering", "RenderLayer::updateScrollingStateAfterCompo
sitingChange"); | 778 TRACE_EVENT0("blink_rendering", "RenderLayer::updateScrollingStateAfterCompo
sitingChange"); |
839 m_hasVisibleNonLayerContent = false; | 779 m_hasVisibleNonLayerContent = false; |
840 for (RenderObject* r = renderer()->slowFirstChild(); r; r = r->nextSibling()
) { | 780 for (RenderObject* r = renderer()->slowFirstChild(); r; r = r->nextSibling()
) { |
841 if (!r->hasLayer()) { | 781 if (!r->hasLayer()) { |
842 m_hasVisibleNonLayerContent = true; | 782 m_hasVisibleNonLayerContent = true; |
843 break; | 783 break; |
844 } | 784 } |
845 } | 785 } |
846 | 786 |
847 m_hasNonCompositedChild = false; | 787 m_hasNonCompositedChild = false; |
848 for (RenderLayer* child = firstChild(); child; child = child->nextSibling())
{ | 788 for (RenderLayer* child = firstChild(); child; child = child->nextSibling())
{ |
849 if (child->compositingState() == NotComposited) { | 789 if (child->compositingState() == NotComposited) { |
850 m_hasNonCompositedChild = true; | 790 m_hasNonCompositedChild = true; |
851 return; | 791 return; |
852 } | 792 } |
853 } | 793 } |
854 } | 794 } |
855 | 795 |
856 static bool subtreeContainsOutOfFlowPositionedLayer(const RenderLayer* subtreeRo
ot) | |
857 { | |
858 return (subtreeRoot->renderer() && subtreeRoot->renderer()->isOutOfFlowPosit
ioned()) || subtreeRoot->hasOutOfFlowPositionedDescendant(); | |
859 } | |
860 | |
861 void RenderLayer::updateDescendantDependentFlags() | 796 void RenderLayer::updateDescendantDependentFlags() |
862 { | 797 { |
863 if (m_visibleDescendantStatusDirty || m_hasSelfPaintingLayerDescendantDirty
|| m_hasOutOfFlowPositionedDescendantDirty) { | 798 if (m_visibleDescendantStatusDirty || m_hasSelfPaintingLayerDescendantDirty)
{ |
864 m_hasVisibleDescendant = false; | 799 m_hasVisibleDescendant = false; |
865 m_hasSelfPaintingLayerDescendant = false; | 800 m_hasSelfPaintingLayerDescendant = false; |
866 m_hasOutOfFlowPositionedDescendant = false; | |
867 | 801 |
868 for (RenderLayer* child = firstChild(); child; child = child->nextSiblin
g()) { | 802 for (RenderLayer* child = firstChild(); child; child = child->nextSiblin
g()) { |
869 child->updateDescendantDependentFlags(); | 803 child->updateDescendantDependentFlags(); |
870 | 804 |
871 bool hasVisibleDescendant = child->m_hasVisibleContent || child->m_h
asVisibleDescendant; | 805 bool hasVisibleDescendant = child->m_hasVisibleContent || child->m_h
asVisibleDescendant; |
872 bool hasSelfPaintingLayerDescendant = child->isSelfPaintingLayer() |
| child->hasSelfPaintingLayerDescendant(); | 806 bool hasSelfPaintingLayerDescendant = child->isSelfPaintingLayer() |
| child->hasSelfPaintingLayerDescendant(); |
873 bool hasOutOfFlowPositionedDescendant = subtreeContainsOutOfFlowPosi
tionedLayer(child); | |
874 | 807 |
875 m_hasVisibleDescendant |= hasVisibleDescendant; | 808 m_hasVisibleDescendant |= hasVisibleDescendant; |
876 m_hasSelfPaintingLayerDescendant |= hasSelfPaintingLayerDescendant; | 809 m_hasSelfPaintingLayerDescendant |= hasSelfPaintingLayerDescendant; |
877 m_hasOutOfFlowPositionedDescendant |= hasOutOfFlowPositionedDescenda
nt; | |
878 | 810 |
879 if (m_hasVisibleDescendant && m_hasSelfPaintingLayerDescendant && ha
sOutOfFlowPositionedDescendant) | 811 if (m_hasVisibleDescendant && m_hasSelfPaintingLayerDescendant) |
880 break; | 812 break; |
881 } | 813 } |
882 | 814 |
883 m_visibleDescendantStatusDirty = false; | 815 m_visibleDescendantStatusDirty = false; |
884 m_hasSelfPaintingLayerDescendantDirty = false; | 816 m_hasSelfPaintingLayerDescendantDirty = false; |
885 m_hasOutOfFlowPositionedDescendantDirty = false; | |
886 } | 817 } |
887 | 818 |
888 if (m_blendInfo.childLayerHasBlendModeStatusDirty()) { | 819 if (m_blendInfo.childLayerHasBlendModeStatusDirty()) { |
889 m_blendInfo.setChildLayerHasBlendMode(false); | 820 m_blendInfo.setChildLayerHasBlendMode(false); |
890 for (RenderLayer* child = firstChild(); child; child = child->nextSiblin
g()) { | 821 for (RenderLayer* child = firstChild(); child; child = child->nextSiblin
g()) { |
891 if (!child->stackingNode()->isStackingContext()) | 822 if (!child->stackingNode()->isStackingContext()) |
892 child->updateDescendantDependentFlags(); | 823 child->updateDescendantDependentFlags(); |
893 | 824 |
894 bool childLayerHadBlendMode = child->blendInfo().childLayerHasBlendM
odeWhileDirty(); | 825 bool childLayerHadBlendMode = child->blendInfo().childLayerHasBlendM
odeWhileDirty(); |
895 bool childLayerHasBlendMode = childLayerHadBlendMode || child->blend
Info().hasBlendMode(); | 826 bool childLayerHasBlendMode = childLayerHadBlendMode || child->blend
Info().hasBlendMode(); |
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1463 child->updateDescendantDependentFlags(); | 1394 child->updateDescendantDependentFlags(); |
1464 if (child->m_hasVisibleContent || child->m_hasVisibleDescendant) | 1395 if (child->m_hasVisibleContent || child->m_hasVisibleDescendant) |
1465 setAncestorChainHasVisibleDescendant(); | 1396 setAncestorChainHasVisibleDescendant(); |
1466 | 1397 |
1467 if (child->isSelfPaintingLayer() || child->hasSelfPaintingLayerDescendant()) | 1398 if (child->isSelfPaintingLayer() || child->hasSelfPaintingLayerDescendant()) |
1468 setAncestorChainHasSelfPaintingLayerDescendant(); | 1399 setAncestorChainHasSelfPaintingLayerDescendant(); |
1469 | 1400 |
1470 if (child->blendInfo().hasBlendMode() || child->blendInfo().childLayerHasBle
ndMode()) | 1401 if (child->blendInfo().hasBlendMode() || child->blendInfo().childLayerHasBle
ndMode()) |
1471 m_blendInfo.setAncestorChainBlendedDescendant(); | 1402 m_blendInfo.setAncestorChainBlendedDescendant(); |
1472 | 1403 |
1473 if (subtreeContainsOutOfFlowPositionedLayer(child)) { | |
1474 // Now that the out of flow positioned descendant is in the tree, we | |
1475 // need to tell the compositor to reevaluate the compositing | |
1476 // requirements since we may be able to mark more layers as having | |
1477 // an 'unclipped' descendant. | |
1478 compositor()->setNeedsUpdateCompositingRequirementsState(); | |
1479 setAncestorChainHasOutOfFlowPositionedDescendant(); | |
1480 } | |
1481 | |
1482 compositor()->layerWasAdded(this, child); | 1404 compositor()->layerWasAdded(this, child); |
1483 } | 1405 } |
1484 | 1406 |
1485 RenderLayer* RenderLayer::removeChild(RenderLayer* oldChild) | 1407 RenderLayer* RenderLayer::removeChild(RenderLayer* oldChild) |
1486 { | 1408 { |
1487 if (!renderer()->documentBeingDestroyed()) | 1409 if (!renderer()->documentBeingDestroyed()) |
1488 compositor()->layerWillBeRemoved(this, oldChild); | 1410 compositor()->layerWillBeRemoved(this, oldChild); |
1489 | 1411 |
1490 // remove the child | 1412 // remove the child |
1491 if (oldChild->previousSibling()) | 1413 if (oldChild->previousSibling()) |
(...skipping 17 matching lines...) Expand all Loading... |
1509 } | 1431 } |
1510 | 1432 |
1511 if (renderer()->style()->visibility() != VISIBLE) | 1433 if (renderer()->style()->visibility() != VISIBLE) |
1512 dirtyVisibleContentStatus(); | 1434 dirtyVisibleContentStatus(); |
1513 | 1435 |
1514 oldChild->setPreviousSibling(0); | 1436 oldChild->setPreviousSibling(0); |
1515 oldChild->setNextSibling(0); | 1437 oldChild->setNextSibling(0); |
1516 oldChild->m_parent = 0; | 1438 oldChild->m_parent = 0; |
1517 | 1439 |
1518 oldChild->updateDescendantDependentFlags(); | 1440 oldChild->updateDescendantDependentFlags(); |
1519 if (subtreeContainsOutOfFlowPositionedLayer(oldChild)) { | |
1520 // It may now be the case that a layer no longer has an unclipped | |
1521 // descendant. Let the compositor know that it needs to reevaluate | |
1522 // its compositing requirements to check this. | |
1523 compositor()->setNeedsUpdateCompositingRequirementsState(); | |
1524 dirtyAncestorChainHasOutOfFlowPositionedDescendantStatus(); | |
1525 } | |
1526 | 1441 |
1527 if (oldChild->m_hasVisibleContent || oldChild->m_hasVisibleDescendant) | 1442 if (oldChild->m_hasVisibleContent || oldChild->m_hasVisibleDescendant) |
1528 dirtyAncestorChainVisibleDescendantStatus(); | 1443 dirtyAncestorChainVisibleDescendantStatus(); |
1529 | 1444 |
1530 if (oldChild->m_blendInfo.hasBlendMode() || oldChild->blendInfo().childLayer
HasBlendMode()) | 1445 if (oldChild->m_blendInfo.hasBlendMode() || oldChild->blendInfo().childLayer
HasBlendMode()) |
1531 m_blendInfo.dirtyAncestorChainBlendedDescendantStatus(); | 1446 m_blendInfo.dirtyAncestorChainBlendedDescendantStatus(); |
1532 | 1447 |
1533 if (oldChild->isSelfPaintingLayer() || oldChild->hasSelfPaintingLayerDescend
ant()) | 1448 if (oldChild->isSelfPaintingLayer() || oldChild->hasSelfPaintingLayerDescend
ant()) |
1534 dirtyAncestorChainHasSelfPaintingLayerDescendantStatus(); | 1449 dirtyAncestorChainHasSelfPaintingLayerDescendantStatus(); |
1535 | 1450 |
(...skipping 2194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3730 | 3645 |
3731 if (renderer()->isReplaced() || renderer()->hasMask()) | 3646 if (renderer()->isReplaced() || renderer()->hasMask()) |
3732 return true; | 3647 return true; |
3733 | 3648 |
3734 if (hasVisibleBoxDecorations()) | 3649 if (hasVisibleBoxDecorations()) |
3735 return true; | 3650 return true; |
3736 | 3651 |
3737 return false; | 3652 return false; |
3738 } | 3653 } |
3739 | 3654 |
3740 void RenderLayer::updateOutOfFlowPositioned(const RenderStyle* oldStyle) | |
3741 { | |
3742 ASSERT(!oldStyle || renderer()->style()->position() != oldStyle->position())
; | |
3743 | |
3744 bool wasOutOfFlowPositioned = oldStyle && (oldStyle->position() == AbsoluteP
osition || oldStyle->position() == FixedPosition); | |
3745 bool isOutOfFlowPositioned = renderer()->isOutOfFlowPositioned(); | |
3746 if (!wasOutOfFlowPositioned && !isOutOfFlowPositioned) | |
3747 return; | |
3748 | |
3749 // Ensures that we reset the above bits correctly. | |
3750 compositor()->setNeedsUpdateCompositingRequirementsState(); | |
3751 | |
3752 if (wasOutOfFlowPositioned && isOutOfFlowPositioned) | |
3753 return; | |
3754 | |
3755 if (isOutOfFlowPositioned) { | |
3756 setAncestorChainHasOutOfFlowPositionedDescendant(); | |
3757 compositor()->addOutOfFlowPositionedLayer(this); | |
3758 } else { | |
3759 dirtyAncestorChainHasSelfPaintingLayerDescendantStatus(); | |
3760 compositor()->removeOutOfFlowPositionedLayer(this); | |
3761 | |
3762 // We need to reset the isUnclippedDescendant bit here because normally | |
3763 // the "unclipped-ness" property is only updated in | |
3764 // RenderLayerCompositor::updateCompositingRequirementsState(). However, | |
3765 // it is only updated for layers which are known to be out of flow. | |
3766 // Since this is no longer out of flow, we have to explicitly ensure | |
3767 // that it doesn't think it is unclipped. | |
3768 setIsUnclippedDescendant(false); | |
3769 } | |
3770 } | |
3771 | |
3772 static bool hasOrHadFilters(const RenderStyle* oldStyle, const RenderStyle* newS
tyle) | 3655 static bool hasOrHadFilters(const RenderStyle* oldStyle, const RenderStyle* newS
tyle) |
3773 { | 3656 { |
3774 ASSERT(newStyle); | 3657 ASSERT(newStyle); |
3775 return (oldStyle && oldStyle->hasFilter()) || newStyle->hasFilter(); | 3658 return (oldStyle && oldStyle->hasFilter()) || newStyle->hasFilter(); |
3776 } | 3659 } |
3777 | 3660 |
3778 inline bool RenderLayer::needsCompositingLayersRebuiltForClip(const RenderStyle*
oldStyle, const RenderStyle* newStyle) const | 3661 inline bool RenderLayer::needsCompositingLayersRebuiltForClip(const RenderStyle*
oldStyle, const RenderStyle* newStyle) const |
3779 { | 3662 { |
3780 ASSERT(newStyle); | 3663 ASSERT(newStyle); |
3781 return oldStyle && (oldStyle->clip() != newStyle->clip() || oldStyle->hasCli
p() != newStyle->hasClip()); | 3664 return oldStyle && (oldStyle->clip() != newStyle->clip() || oldStyle->hasCli
p() != newStyle->hasClip()); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3840 } | 3723 } |
3841 | 3724 |
3842 void RenderLayer::styleChanged(StyleDifference diff, const RenderStyle* oldStyle
) | 3725 void RenderLayer::styleChanged(StyleDifference diff, const RenderStyle* oldStyle
) |
3843 { | 3726 { |
3844 m_stackingNode->updateIsNormalFlowOnly(); | 3727 m_stackingNode->updateIsNormalFlowOnly(); |
3845 m_stackingNode->updateStackingNodesAfterStyleChange(oldStyle); | 3728 m_stackingNode->updateStackingNodesAfterStyleChange(oldStyle); |
3846 | 3729 |
3847 if (m_scrollableArea) | 3730 if (m_scrollableArea) |
3848 m_scrollableArea->updateAfterStyleChange(oldStyle); | 3731 m_scrollableArea->updateAfterStyleChange(oldStyle); |
3849 | 3732 |
3850 if (!oldStyle || oldStyle->visibility() != renderer()->style()->visibility()
) { | |
3851 ASSERT(!oldStyle || diff.needsRepaint() || diff.needsLayout()); | |
3852 compositor()->setNeedsUpdateCompositingRequirementsState(); | |
3853 } | |
3854 | |
3855 // Overlay scrollbars can make this layer self-painting so we need | 3733 // Overlay scrollbars can make this layer self-painting so we need |
3856 // to recompute the bit once scrollbars have been updated. | 3734 // to recompute the bit once scrollbars have been updated. |
3857 updateSelfPaintingLayer(); | 3735 updateSelfPaintingLayer(); |
3858 | 3736 |
3859 if (!oldStyle || renderer()->style()->position() != oldStyle->position()) { | |
3860 ASSERT(!oldStyle || diff.needsFullLayout()); | |
3861 updateOutOfFlowPositioned(oldStyle); | |
3862 } | |
3863 | |
3864 if (!oldStyle || !renderer()->style()->reflectionDataEquivalent(oldStyle)) { | 3737 if (!oldStyle || !renderer()->style()->reflectionDataEquivalent(oldStyle)) { |
3865 ASSERT(!oldStyle || diff.needsFullLayout()); | 3738 ASSERT(!oldStyle || diff.needsFullLayout()); |
3866 updateReflectionInfo(oldStyle); | 3739 updateReflectionInfo(oldStyle); |
3867 } | 3740 } |
3868 | 3741 |
3869 if (RuntimeEnabledFeatures::cssCompositingEnabled()) | 3742 if (RuntimeEnabledFeatures::cssCompositingEnabled()) |
3870 m_blendInfo.updateBlendMode(); | 3743 m_blendInfo.updateBlendMode(); |
3871 | 3744 |
3872 updateDescendantDependentFlags(); | 3745 updateDescendantDependentFlags(); |
3873 | 3746 |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4054 } | 3927 } |
4055 } | 3928 } |
4056 | 3929 |
4057 void showLayerTree(const WebCore::RenderObject* renderer) | 3930 void showLayerTree(const WebCore::RenderObject* renderer) |
4058 { | 3931 { |
4059 if (!renderer) | 3932 if (!renderer) |
4060 return; | 3933 return; |
4061 showLayerTree(renderer->enclosingLayer()); | 3934 showLayerTree(renderer->enclosingLayer()); |
4062 } | 3935 } |
4063 #endif | 3936 #endif |
OLD | NEW |