| 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 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 break; | 433 break; |
| 434 otherContainingBlock = otherContainingBlock->containingBlock(); | 434 otherContainingBlock = otherContainingBlock->containingBlock(); |
| 435 } | 435 } |
| 436 | 436 |
| 437 return true; | 437 return true; |
| 438 } | 438 } |
| 439 | 439 |
| 440 void RenderLayer::updateLayerPositionsAfterDocumentScroll() | 440 void RenderLayer::updateLayerPositionsAfterDocumentScroll() |
| 441 { | 441 { |
| 442 ASSERT(this == renderer()->view()->layer()); | 442 ASSERT(this == renderer()->view()->layer()); |
| 443 | 443 updateLayerPositionsAfterScroll(); |
| 444 RenderGeometryMap geometryMap(UseTransforms); | |
| 445 updateLayerPositionsAfterScroll(&geometryMap); | |
| 446 } | 444 } |
| 447 | 445 |
| 448 void RenderLayer::updateLayerPositionsAfterOverflowScroll() | 446 void RenderLayer::updateLayerPositionsAfterOverflowScroll() |
| 449 { | 447 { |
| 450 RenderGeometryMap geometryMap(UseTransforms); | |
| 451 RenderView* view = renderer()->view(); | |
| 452 if (this != view->layer()) | |
| 453 geometryMap.pushMappingsToAncestor(parent(), 0); | |
| 454 | |
| 455 // FIXME: why is it OK to not check the ancestors of this layer in order to | 448 // FIXME: why is it OK to not check the ancestors of this layer in order to |
| 456 // initialize the HasSeenViewportConstrainedAncestor and HasSeenAncestorWith
OverflowClip flags? | 449 // initialize the HasSeenViewportConstrainedAncestor and HasSeenAncestorWith
OverflowClip flags? |
| 457 updateLayerPositionsAfterScroll(&geometryMap, IsOverflowScroll); | 450 updateLayerPositionsAfterScroll(IsOverflowScroll); |
| 458 } | 451 } |
| 459 | 452 |
| 460 void RenderLayer::updateLayerPositionsAfterScroll(RenderGeometryMap* geometryMap
, UpdateLayerPositionsAfterScrollFlags flags) | 453 void RenderLayer::updateLayerPositionsAfterScroll(UpdateLayerPositionsAfterScrol
lFlags flags) |
| 461 { | 454 { |
| 462 // FIXME: This shouldn't be needed, but there are some corner cases where | 455 // FIXME: This shouldn't be needed, but there are some corner cases where |
| 463 // these flags are still dirty. Update so that the check below is valid. | 456 // these flags are still dirty. Update so that the check below is valid. |
| 464 updateDescendantDependentFlags(); | 457 updateDescendantDependentFlags(); |
| 465 | 458 |
| 466 // If we have no visible content and no visible descendants, there is no poi
nt recomputing | 459 // If we have no visible content and no visible descendants, there is no poi
nt recomputing |
| 467 // our rectangles as they will be empty. If our visibility changes, we are e
xpected to | 460 // our rectangles as they will be empty. If our visibility changes, we are e
xpected to |
| 468 // recompute all our positions anyway. | 461 // recompute all our positions anyway. |
| 469 if (subtreeIsInvisible()) | 462 if (subtreeIsInvisible()) |
| 470 return; | 463 return; |
| 471 | 464 |
| 472 bool positionChanged = updateLayerPosition(); | 465 if (updateLayerPosition()) |
| 473 if (positionChanged) | |
| 474 flags |= HasChangedAncestor; | 466 flags |= HasChangedAncestor; |
| 475 | 467 |
| 476 if (geometryMap) | |
| 477 geometryMap->pushMappingsToAncestor(this, parent()); | |
| 478 | |
| 479 if ((flags & HasChangedAncestor) || (flags & HasSeenViewportConstrainedAnces
tor) || (flags & IsOverflowScroll)) | 468 if ((flags & HasChangedAncestor) || (flags & HasSeenViewportConstrainedAnces
tor) || (flags & IsOverflowScroll)) |
| 480 m_clipper.clearClipRects(); | 469 m_clipper.clearClipRects(); |
| 481 | 470 |
| 482 if (renderer()->style()->hasViewportConstrainedPosition()) | 471 if (renderer()->style()->hasViewportConstrainedPosition()) |
| 483 flags |= HasSeenViewportConstrainedAncestor; | 472 flags |= HasSeenViewportConstrainedAncestor; |
| 484 | 473 |
| 485 if (renderer()->hasOverflowClip()) | 474 if (renderer()->hasOverflowClip()) |
| 486 flags |= HasSeenAncestorWithOverflowClip; | 475 flags |= HasSeenAncestorWithOverflowClip; |
| 487 | 476 |
| 488 if ((flags & IsOverflowScroll) && (flags & HasSeenAncestorWithOverflowClip)
&& !m_canSkipRepaintRectsUpdateOnScroll) { | 477 if ((flags & IsOverflowScroll) && (flags & HasSeenAncestorWithOverflowClip)
&& !m_canSkipRepaintRectsUpdateOnScroll) { |
| 489 // FIXME: We could track the repaint container as we walk down the tree. | 478 // FIXME: We could track the repaint container as we walk down the tree. |
| 490 repainter().computeRepaintRects(); | 479 repainter().computeRepaintRects(); |
| 491 } else { | 480 } else { |
| 492 // Check that RenderLayerRepainter's cached rects are correct. | 481 // Check that RenderLayerRepainter's cached rects are correct. |
| 493 // FIXME: re-enable these assertions when the issue with table cells is
resolved: https://bugs.webkit.org/show_bug.cgi?id=103432 | 482 // FIXME: re-enable these assertions when the issue with table cells is
resolved: https://bugs.webkit.org/show_bug.cgi?id=103432 |
| 494 // ASSERT(repainter().m_repaintRect == renderer()->clippedOverflowRectFo
rRepaint(renderer()->containerForRepaint())); | 483 // ASSERT(repainter().m_repaintRect == renderer()->clippedOverflowRectFo
rRepaint(renderer()->containerForRepaint())); |
| 495 } | 484 } |
| 496 | 485 |
| 497 for (RenderLayer* child = firstChild(); child; child = child->nextSibling()) | 486 for (RenderLayer* child = firstChild(); child; child = child->nextSibling()) |
| 498 child->updateLayerPositionsAfterScroll(geometryMap, flags); | 487 child->updateLayerPositionsAfterScroll(flags); |
| 499 | 488 |
| 500 // We don't update our reflection as scrolling is a translation which does n
ot change the size() | 489 // We don't update our reflection as scrolling is a translation which does n
ot change the size() |
| 501 // of an object, thus RenderReplica will still repaint itself properly as th
e layer position was | 490 // of an object, thus RenderReplica will still repaint itself properly as th
e layer position was |
| 502 // updated above. | 491 // updated above. |
| 503 | |
| 504 if (geometryMap) | |
| 505 geometryMap->popMappingsToAncestor(parent()); | |
| 506 } | 492 } |
| 507 | 493 |
| 508 void RenderLayer::updateTransform() | 494 void RenderLayer::updateTransform() |
| 509 { | 495 { |
| 510 // hasTransform() on the renderer is also true when there is transform-style
: preserve-3d or perspective set, | 496 // hasTransform() on the renderer is also true when there is transform-style
: preserve-3d or perspective set, |
| 511 // so check style too. | 497 // so check style too. |
| 512 bool hasTransform = renderer()->hasTransform() && renderer()->style()->hasTr
ansform(); | 498 bool hasTransform = renderer()->hasTransform() && renderer()->style()->hasTr
ansform(); |
| 513 bool had3DTransform = has3DTransform(); | 499 bool had3DTransform = has3DTransform(); |
| 514 | 500 |
| 515 bool hadTransform = m_transform; | 501 bool hadTransform = m_transform; |
| (...skipping 3373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3889 } | 3875 } |
| 3890 } | 3876 } |
| 3891 | 3877 |
| 3892 void showLayerTree(const WebCore::RenderObject* renderer) | 3878 void showLayerTree(const WebCore::RenderObject* renderer) |
| 3893 { | 3879 { |
| 3894 if (!renderer) | 3880 if (!renderer) |
| 3895 return; | 3881 return; |
| 3896 showLayerTree(renderer->enclosingLayer()); | 3882 showLayerTree(renderer->enclosingLayer()); |
| 3897 } | 3883 } |
| 3898 #endif | 3884 #endif |
| OLD | NEW |