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 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 455 // Finally, make the visual rectangle relative to |ancestorLayer|. | 455 // Finally, make the visual rectangle relative to |ancestorLayer|. |
| 456 // FIXME: Handle nested fragmentation contexts (crbug.com/423076). For now j ust give up if there | 456 // FIXME: Handle nested fragmentation contexts (crbug.com/423076). For now j ust give up if there |
| 457 // are different pagination layers involved. | 457 // are different pagination layers involved. |
| 458 if (!ancestorLayer->enclosingPaginationLayer() || ancestorLayer->enclosingPa ginationLayer() != paginationLayer) { | 458 if (!ancestorLayer->enclosingPaginationLayer() || ancestorLayer->enclosingPa ginationLayer() != paginationLayer) { |
| 459 // The easy case. The ancestor layer is not within the pagination layer. | 459 // The easy case. The ancestor layer is not within the pagination layer. |
| 460 paginationLayer->convertToLayerCoords(ancestorLayer, rect); | 460 paginationLayer->convertToLayerCoords(ancestorLayer, rect); |
| 461 return; | 461 return; |
| 462 } | 462 } |
| 463 // The ancestor layer is also inside the pagination layer, so we need to sub tract the visual | 463 // The ancestor layer is also inside the pagination layer, so we need to sub tract the visual |
| 464 // distance from the ancestor layer to the pagination layer. | 464 // distance from the ancestor layer to the pagination layer. |
| 465 LayoutPoint offsetFromPaginationLayerToAncestor; | 465 rect.moveBy(-ancestorLayer->visualOffsetFromAncestor(paginationLayer)); |
| 466 ancestorLayer->convertToLayerCoords(paginationLayer, offsetFromPaginationLay erToAncestor); | |
| 467 offsetFromPaginationLayerToAncestor = flowThread->flowThreadPointToVisualPoi nt(offsetFromPaginationLayerToAncestor); | |
| 468 rect.moveBy(-offsetFromPaginationLayerToAncestor); | |
| 469 } | 466 } |
| 470 | 467 |
| 471 bool RenderLayer::useRegionBasedColumns() const | 468 bool RenderLayer::useRegionBasedColumns() const |
| 472 { | 469 { |
| 473 return renderer()->document().regionBasedColumnsEnabled(); | 470 return renderer()->document().regionBasedColumnsEnabled(); |
| 474 } | 471 } |
| 475 | 472 |
| 476 void RenderLayer::updatePaginationRecursive(bool needsPaginationUpdate) | 473 void RenderLayer::updatePaginationRecursive(bool needsPaginationUpdate) |
| 477 { | 474 { |
| 478 m_isPaginated = false; | 475 m_isPaginated = false; |
| (...skipping 968 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1447 currLayer = accumulateOffsetTowardsAncestor(currLayer, ancestorLayer, lo cation); | 1444 currLayer = accumulateOffsetTowardsAncestor(currLayer, ancestorLayer, lo cation); |
| 1448 } | 1445 } |
| 1449 | 1446 |
| 1450 void RenderLayer::convertToLayerCoords(const RenderLayer* ancestorLayer, LayoutR ect& rect) const | 1447 void RenderLayer::convertToLayerCoords(const RenderLayer* ancestorLayer, LayoutR ect& rect) const |
| 1451 { | 1448 { |
| 1452 LayoutPoint delta; | 1449 LayoutPoint delta; |
| 1453 convertToLayerCoords(ancestorLayer, delta); | 1450 convertToLayerCoords(ancestorLayer, delta); |
| 1454 rect.moveBy(delta); | 1451 rect.moveBy(delta); |
| 1455 } | 1452 } |
| 1456 | 1453 |
| 1454 LayoutPoint RenderLayer::visualOffsetFromAncestor(const RenderLayer* ancestorLay er) const | |
| 1455 { | |
| 1456 RenderLayer* paginationLayer = enclosingPaginationLayer(); | |
| 1457 LayoutPoint offset; | |
| 1458 if (!paginationLayer || paginationLayer == this) { | |
|
chrishtr
2014/12/16 17:33:45
Do you need to special-case paginationLayer == thi
mstensho (USE GERRIT)
2014/12/16 22:31:47
If paginationLayer == this, this is the flow threa
| |
| 1459 convertToLayerCoords(ancestorLayer, offset); | |
| 1460 return offset; | |
| 1461 } | |
| 1462 | |
| 1463 RenderFlowThread* flowThread = toRenderFlowThread(paginationLayer->renderer( )); | |
| 1464 convertToLayerCoords(paginationLayer, offset); | |
| 1465 offset = flowThread->flowThreadPointToVisualPoint(offset); | |
| 1466 if (ancestorLayer == paginationLayer) | |
| 1467 return offset; | |
| 1468 | |
| 1469 // FIXME: Handle nested fragmentation contexts (crbug.com/423076). For now j ust give up if there | |
| 1470 // are different pagination layers involved. | |
| 1471 if (!ancestorLayer->enclosingPaginationLayer() || ancestorLayer->enclosingPa ginationLayer() != paginationLayer) { | |
|
chrishtr
2014/12/16 17:33:45
Why are lines 1471 - 1472 not implementable as a r
mstensho (USE GERRIT)
2014/12/16 22:31:47
Done.
| |
| 1472 // The easy case. The ancestor layer is not within the pagination layer. | |
| 1473 paginationLayer->convertToLayerCoords(ancestorLayer, offset); | |
| 1474 return offset; | |
| 1475 } | |
| 1476 // The ancestor layer is also inside the pagination layer, so we need to sub tract the visual | |
| 1477 // distance from the ancestor layer to the pagination layer. | |
| 1478 LayoutPoint offsetFromPaginationLayerToAncestor; | |
| 1479 ancestorLayer->convertToLayerCoords(paginationLayer, offsetFromPaginationLay erToAncestor); | |
| 1480 offset.moveBy(-flowThread->flowThreadPointToVisualPoint(offsetFromPagination LayerToAncestor)); | |
| 1481 return offset; | |
| 1482 } | |
| 1483 | |
| 1457 void RenderLayer::didUpdateNeedsCompositedScrolling() | 1484 void RenderLayer::didUpdateNeedsCompositedScrolling() |
| 1458 { | 1485 { |
| 1459 updateSelfPaintingLayer(); | 1486 updateSelfPaintingLayer(); |
| 1460 } | 1487 } |
| 1461 | 1488 |
| 1462 void RenderLayer::updateReflectionInfo(const RenderStyle* oldStyle) | 1489 void RenderLayer::updateReflectionInfo(const RenderStyle* oldStyle) |
| 1463 { | 1490 { |
| 1464 ASSERT(!oldStyle || !renderer()->style()->reflectionDataEquivalent(oldStyle) ); | 1491 ASSERT(!oldStyle || !renderer()->style()->reflectionDataEquivalent(oldStyle) ); |
| 1465 if (renderer()->hasReflection()) { | 1492 if (renderer()->hasReflection()) { |
| 1466 if (!m_reflectionInfo) | 1493 if (!m_reflectionInfo) |
| (...skipping 1408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2875 } | 2902 } |
| 2876 } | 2903 } |
| 2877 | 2904 |
| 2878 void showLayerTree(const blink::RenderObject* renderer) | 2905 void showLayerTree(const blink::RenderObject* renderer) |
| 2879 { | 2906 { |
| 2880 if (!renderer) | 2907 if (!renderer) |
| 2881 return; | 2908 return; |
| 2882 showLayerTree(renderer->enclosingLayer()); | 2909 showLayerTree(renderer->enclosingLayer()); |
| 2883 } | 2910 } |
| 2884 #endif | 2911 #endif |
| OLD | NEW |