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) { | |
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 | |
chrishtr
2014/12/17 19:11:00
Does this FIXME still apply now that there is recu
mstensho (USE GERRIT)
2014/12/17 19:29:53
Yes, we're still not quite there. I have prepared
| |
1470 // are different pagination layers involved. | |
1471 if (!ancestorLayer->enclosingPaginationLayer() || ancestorLayer->enclosingPa ginationLayer() != paginationLayer) { | |
1472 // The easy case. The ancestor layer is not within the pagination layer. | |
1473 return offset + paginationLayer->visualOffsetFromAncestor(ancestorLayer) ; | |
1474 } | |
1475 // The ancestor layer is also inside the pagination layer, so we need to sub tract the visual | |
1476 // distance from the ancestor layer to the pagination layer. | |
1477 LayoutPoint offsetFromPaginationLayerToAncestor; | |
chrishtr
2014/12/17 19:11:00
How about replacing 1477-1479 by:
offset.moveBy(-
mstensho (USE GERRIT)
2014/12/17 19:29:53
Done.
| |
1478 ancestorLayer->convertToLayerCoords(paginationLayer, offsetFromPaginationLay erToAncestor); | |
1479 offset.moveBy(-flowThread->flowThreadPointToVisualPoint(offsetFromPagination LayerToAncestor)); | |
1480 return offset; | |
1481 } | |
1482 | |
1457 void RenderLayer::didUpdateNeedsCompositedScrolling() | 1483 void RenderLayer::didUpdateNeedsCompositedScrolling() |
1458 { | 1484 { |
1459 updateSelfPaintingLayer(); | 1485 updateSelfPaintingLayer(); |
1460 } | 1486 } |
1461 | 1487 |
1462 void RenderLayer::updateReflectionInfo(const RenderStyle* oldStyle) | 1488 void RenderLayer::updateReflectionInfo(const RenderStyle* oldStyle) |
1463 { | 1489 { |
1464 ASSERT(!oldStyle || !renderer()->style()->reflectionDataEquivalent(oldStyle) ); | 1490 ASSERT(!oldStyle || !renderer()->style()->reflectionDataEquivalent(oldStyle) ); |
1465 if (renderer()->hasReflection()) { | 1491 if (renderer()->hasReflection()) { |
1466 if (!m_reflectionInfo) | 1492 if (!m_reflectionInfo) |
(...skipping 1408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2875 } | 2901 } |
2876 } | 2902 } |
2877 | 2903 |
2878 void showLayerTree(const blink::RenderObject* renderer) | 2904 void showLayerTree(const blink::RenderObject* renderer) |
2879 { | 2905 { |
2880 if (!renderer) | 2906 if (!renderer) |
2881 return; | 2907 return; |
2882 showLayerTree(renderer->enclosingLayer()); | 2908 showLayerTree(renderer->enclosingLayer()); |
2883 } | 2909 } |
2884 #endif | 2910 #endif |
OLD | NEW |