Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(101)

Side by Side Diff: Source/core/rendering/RenderLayer.cpp

Issue 799403006: [New Multicolumn] Make computeOffsetFromCompositedAncestor() flowthread-aware. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Simplify test. Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
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 offset.moveBy(paginationLayer->visualOffsetFromAncestor(ancestorLayer));
1474 } else {
1475 // The ancestor layer is also inside the pagination layer, so we need to subtract the visual
1476 // distance from the ancestor layer to the pagination layer.
1477 offset.moveBy(-ancestorLayer->visualOffsetFromAncestor(paginationLayer)) ;
1478 }
1479 return offset;
1480 }
1481
1457 void RenderLayer::didUpdateNeedsCompositedScrolling() 1482 void RenderLayer::didUpdateNeedsCompositedScrolling()
1458 { 1483 {
1459 updateSelfPaintingLayer(); 1484 updateSelfPaintingLayer();
1460 } 1485 }
1461 1486
1462 void RenderLayer::updateReflectionInfo(const RenderStyle* oldStyle) 1487 void RenderLayer::updateReflectionInfo(const RenderStyle* oldStyle)
1463 { 1488 {
1464 ASSERT(!oldStyle || !renderer()->style()->reflectionDataEquivalent(oldStyle) ); 1489 ASSERT(!oldStyle || !renderer()->style()->reflectionDataEquivalent(oldStyle) );
1465 if (renderer()->hasReflection()) { 1490 if (renderer()->hasReflection()) {
1466 if (!m_reflectionInfo) 1491 if (!m_reflectionInfo)
(...skipping 1408 matching lines...) Expand 10 before | Expand all | Expand 10 after
2875 } 2900 }
2876 } 2901 }
2877 2902
2878 void showLayerTree(const blink::RenderObject* renderer) 2903 void showLayerTree(const blink::RenderObject* renderer)
2879 { 2904 {
2880 if (!renderer) 2905 if (!renderer)
2881 return; 2906 return;
2882 showLayerTree(renderer->enclosingLayer()); 2907 showLayerTree(renderer->enclosingLayer());
2883 } 2908 }
2884 #endif 2909 #endif
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderLayer.h ('k') | Source/core/rendering/compositing/CompositedLayerMapping.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698