Chromium Code Reviews| 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 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 430 || renderer()->hasFilter() | 430 || renderer()->hasFilter() |
| 431 || renderer()->hasBlendMode() | 431 || renderer()->hasBlendMode() |
| 432 || layer()->isTransparent() | 432 || layer()->isTransparent() |
| 433 || renderer()->isRenderRegion(); | 433 || renderer()->isRenderRegion(); |
| 434 | 434 |
| 435 return couldBeNormalFlow && !preventsElementFromBeingNormalFlow; | 435 return couldBeNormalFlow && !preventsElementFromBeingNormalFlow; |
| 436 } | 436 } |
| 437 | 437 |
| 438 void RenderLayerStackingNode::updateIsNormalFlowOnly() | 438 void RenderLayerStackingNode::updateIsNormalFlowOnly() |
| 439 { | 439 { |
| 440 bool isNormalFlowOnly = shouldBeNormalFlowOnly(); | 440 bool newIsNormalFlowOnly = shouldBeNormalFlowOnly(); |
|
dglazkov
2013/11/06 17:31:05
Here and elsewhere: would you not be able to resol
Peter Kasting
2013/11/06 18:41:46
Personally I think the "new" route reads more clea
| |
| 441 if (isNormalFlowOnly == m_isNormalFlowOnly) | 441 if (newIsNormalFlowOnly == isNormalFlowOnly()) |
| 442 return; | 442 return; |
| 443 | 443 |
| 444 m_isNormalFlowOnly = isNormalFlowOnly; | 444 m_isNormalFlowOnly = newIsNormalFlowOnly; |
| 445 if (RenderLayer* p = layer()->parent()) | 445 if (RenderLayer* p = layer()->parent()) |
| 446 p->stackingNode()->dirtyNormalFlowList(); | 446 p->stackingNode()->dirtyNormalFlowList(); |
| 447 dirtyStackingContainerZOrderLists(); | 447 dirtyStackingContainerZOrderLists(); |
| 448 } | 448 } |
| 449 | 449 |
| 450 bool RenderLayerStackingNode::needsToBeStackingContainer() const | 450 bool RenderLayerStackingNode::needsToBeStackingContainer() const |
| 451 { | 451 { |
| 452 return layer()->scrollableArea() && layer()->scrollableArea()->adjustForForc eCompositedScrollingMode(m_needsToBeStackingContainer); | 452 return layer()->scrollableArea() && layer()->scrollableArea()->adjustForForc eCompositedScrollingMode(m_needsToBeStackingContainer); |
| 453 } | 453 } |
| 454 | 454 |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 611 | 611 |
| 612 bool RenderLayerStackingNode::descendantsAreContiguousInStackingOrder() const | 612 bool RenderLayerStackingNode::descendantsAreContiguousInStackingOrder() const |
| 613 { | 613 { |
| 614 if (isStackingContext() || !ancestorStackingContainerNode()) | 614 if (isStackingContext() || !ancestorStackingContainerNode()) |
| 615 return true; | 615 return true; |
| 616 | 616 |
| 617 ASSERT(!m_descendantsAreContiguousInStackingOrderDirty); | 617 ASSERT(!m_descendantsAreContiguousInStackingOrderDirty); |
| 618 return m_descendantsAreContiguousInStackingOrder; | 618 return m_descendantsAreContiguousInStackingOrder; |
| 619 } | 619 } |
| 620 | 620 |
| 621 bool RenderLayerStackingNode::setNeedsToBeStackingContainer(bool needsToBeStacki ngContainer) | 621 bool RenderLayerStackingNode::setNeedsToBeStackingContainer(bool newNeedsToBeSta ckingContainer) |
| 622 { | 622 { |
| 623 if (m_needsToBeStackingContainer == needsToBeStackingContainer) | 623 if (needsToBeStackingContainer() == newNeedsToBeStackingContainer) |
| 624 return false; | 624 return false; |
| 625 | 625 |
| 626 // Count the total number of RenderLayers which need to be stacking | 626 // Count the total number of RenderLayers which need to be stacking |
| 627 // containers some point. This should be recorded at most once per | 627 // containers some point. This should be recorded at most once per |
| 628 // RenderLayer, so we check m_needsToBeStackingContainerHasBeenRecorded. | 628 // RenderLayer, so we check m_needsToBeStackingContainerHasBeenRecorded. |
| 629 if (layer()->acceleratedCompositingForOverflowScrollEnabled() && !m_needsToB eStackingContainerHasBeenRecorded) { | 629 if (layer()->acceleratedCompositingForOverflowScrollEnabled() && !m_needsToB eStackingContainerHasBeenRecorded) { |
| 630 WebKit::Platform::current()->histogramEnumeration("Renderer.CompositedSc rolling", RenderLayer::NeedsToBeStackingContainerBucket, RenderLayer::Composited ScrollingHistogramMax); | 630 WebKit::Platform::current()->histogramEnumeration("Renderer.CompositedSc rolling", RenderLayer::NeedsToBeStackingContainerBucket, RenderLayer::Composited ScrollingHistogramMax); |
| 631 m_needsToBeStackingContainerHasBeenRecorded = true; | 631 m_needsToBeStackingContainerHasBeenRecorded = true; |
| 632 } | 632 } |
| 633 | 633 |
| 634 m_needsToBeStackingContainer = needsToBeStackingContainer; | 634 m_needsToBeStackingContainer = newNeedsToBeStackingContainer; |
| 635 | 635 |
| 636 return true; | 636 return true; |
| 637 } | 637 } |
| 638 | 638 |
| 639 RenderLayerStackingNode* RenderLayerStackingNode::ancestorStackingContainerNode( ) const | 639 RenderLayerStackingNode* RenderLayerStackingNode::ancestorStackingContainerNode( ) const |
| 640 { | 640 { |
| 641 RenderLayer* ancestor = layer()->parent(); | 641 RenderLayer* ancestor = layer()->parent(); |
| 642 while (ancestor && !ancestor->stackingNode()->isStackingContainer()) | 642 while (ancestor && !ancestor->stackingNode()->isStackingContainer()) |
| 643 ancestor = ancestor->parent(); | 643 ancestor = ancestor->parent(); |
| 644 if (ancestor) | 644 if (ancestor) |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 655 return ancestor->stackingNode(); | 655 return ancestor->stackingNode(); |
| 656 return 0; | 656 return 0; |
| 657 } | 657 } |
| 658 | 658 |
| 659 RenderLayerModelObject* RenderLayerStackingNode::renderer() const | 659 RenderLayerModelObject* RenderLayerStackingNode::renderer() const |
| 660 { | 660 { |
| 661 return m_layer->renderer(); | 661 return m_layer->renderer(); |
| 662 } | 662 } |
| 663 | 663 |
| 664 } // namespace WebCore | 664 } // namespace WebCore |
| OLD | NEW |