| 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 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 466 | 466 |
| 467 if (renderer()->hasColumns()) | 467 if (renderer()->hasColumns()) |
| 468 needsPaginationUpdate = true; | 468 needsPaginationUpdate = true; |
| 469 | 469 |
| 470 for (RenderLayer* child = firstChild(); child; child = child->nextSibling()) | 470 for (RenderLayer* child = firstChild(); child; child = child->nextSibling()) |
| 471 child->updatePaginationRecursive(needsPaginationUpdate); | 471 child->updatePaginationRecursive(needsPaginationUpdate); |
| 472 } | 472 } |
| 473 | 473 |
| 474 void RenderLayer::updatePagination() | 474 void RenderLayer::updatePagination() |
| 475 { | 475 { |
| 476 if (compositingState() != NotComposited || !parent()) | 476 bool usesRegionBasedColumns = useRegionBasedColumns(); |
| 477 return; // FIXME: We will have to deal with paginated compositing layers
someday. | 477 if ((!usesRegionBasedColumns && compositingState() != NotComposited) || !par
ent()) |
| 478 // FIXME: For now the RenderView can't be paginated. Eventually
printing will move to a model where it is though. | 478 return; // FIXME: For now the RenderView can't be paginated. Eventually
printing will move to a model where it is though. |
| 479 | 479 |
| 480 // The main difference between the paginated booleans for the old column cod
e and the new column code | 480 // The main difference between the paginated booleans for the old column cod
e and the new column code |
| 481 // is that each paginated layer has to paint on its own with the new code. T
here is no | 481 // is that each paginated layer has to paint on its own with the new code. T
here is no |
| 482 // recurring into child layers. This means that the m_isPaginated bits for t
he new column code can't just be set on | 482 // recurring into child layers. This means that the m_isPaginated bits for t
he new column code can't just be set on |
| 483 // "roots" that get split and paint all their descendants. Instead each laye
r has to be checked individually and | 483 // "roots" that get split and paint all their descendants. Instead each laye
r has to be checked individually and |
| 484 // genuinely know if it is going to have to split itself up when painting on
ly its contents (and not any other descendant | 484 // genuinely know if it is going to have to split itself up when painting on
ly its contents (and not any other descendant |
| 485 // layers). We track an enclosingPaginationLayer instead of using a simple b
it, since we want to be able to get back | 485 // layers). We track an enclosingPaginationLayer instead of using a simple b
it, since we want to be able to get back |
| 486 // to that layer easily. | 486 // to that layer easily. |
| 487 bool regionBasedColumnsUsed = useRegionBasedColumns(); | 487 if (usesRegionBasedColumns && renderer()->isRenderFlowThread()) { |
| 488 if (regionBasedColumnsUsed && renderer()->isRenderFlowThread()) { | |
| 489 m_enclosingPaginationLayer = this; | 488 m_enclosingPaginationLayer = this; |
| 490 return; | 489 return; |
| 491 } | 490 } |
| 492 | 491 |
| 493 if (m_stackingNode->isNormalFlowOnly()) { | 492 if (m_stackingNode->isNormalFlowOnly()) { |
| 494 if (regionBasedColumnsUsed) { | 493 if (usesRegionBasedColumns) { |
| 495 // Content inside a transform is not considered to be paginated, sin
ce we simply | 494 // Content inside a transform is not considered to be paginated, sin
ce we simply |
| 496 // paint the transform multiple times in each column, so we don't ha
ve to use | 495 // paint the transform multiple times in each column, so we don't ha
ve to use |
| 497 // fragments for the transformed content. | 496 // fragments for the transformed content. |
| 498 m_enclosingPaginationLayer = parent()->enclosingPaginationLayer(); | 497 m_enclosingPaginationLayer = parent()->enclosingPaginationLayer(); |
| 499 if (m_enclosingPaginationLayer && m_enclosingPaginationLayer->hasTra
nsform()) | 498 if (m_enclosingPaginationLayer && m_enclosingPaginationLayer->hasTra
nsform()) |
| 500 m_enclosingPaginationLayer = 0; | 499 m_enclosingPaginationLayer = 0; |
| 501 } else { | 500 } else { |
| 502 m_isPaginated = parent()->renderer()->hasColumns(); | 501 m_isPaginated = parent()->renderer()->hasColumns(); |
| 503 } | 502 } |
| 504 return; | 503 return; |
| 505 } | 504 } |
| 506 | 505 |
| 507 // For the new columns code, we want to walk up our containing block chain l
ooking for an enclosing layer. Once | 506 // For the new columns code, we want to walk up our containing block chain l
ooking for an enclosing layer. Once |
| 508 // we find one, then we just check its pagination status. | 507 // we find one, then we just check its pagination status. |
| 509 if (regionBasedColumnsUsed) { | 508 if (usesRegionBasedColumns) { |
| 510 RenderView* view = renderer()->view(); | 509 RenderView* view = renderer()->view(); |
| 511 RenderBlock* containingBlock; | 510 RenderBlock* containingBlock; |
| 512 for (containingBlock = renderer()->containingBlock(); | 511 for (containingBlock = renderer()->containingBlock(); |
| 513 containingBlock && containingBlock != view; | 512 containingBlock && containingBlock != view; |
| 514 containingBlock = containingBlock->containingBlock()) { | 513 containingBlock = containingBlock->containingBlock()) { |
| 515 if (containingBlock->hasLayer()) { | 514 if (containingBlock->hasLayer()) { |
| 516 // Content inside a transform is not considered to be paginated,
since we simply | 515 // Content inside a transform is not considered to be paginated,
since we simply |
| 517 // paint the transform multiple times in each column, so we don'
t have to use | 516 // paint the transform multiple times in each column, so we don'
t have to use |
| 518 // fragments for the transformed content. | 517 // fragments for the transformed content. |
| 519 m_enclosingPaginationLayer = containingBlock->layer()->enclosing
PaginationLayer(); | 518 m_enclosingPaginationLayer = containingBlock->layer()->enclosing
PaginationLayer(); |
| (...skipping 2343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2863 } | 2862 } |
| 2864 } | 2863 } |
| 2865 | 2864 |
| 2866 void showLayerTree(const blink::RenderObject* renderer) | 2865 void showLayerTree(const blink::RenderObject* renderer) |
| 2867 { | 2866 { |
| 2868 if (!renderer) | 2867 if (!renderer) |
| 2869 return; | 2868 return; |
| 2870 showLayerTree(renderer->enclosingLayer()); | 2869 showLayerTree(renderer->enclosingLayer()); |
| 2871 } | 2870 } |
| 2872 #endif | 2871 #endif |
| OLD | NEW |