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

Side by Side Diff: Source/core/paint/DeprecatedPaintLayer.cpp

Issue 1028383002: Enable new multicol for testing and experimental web platform features. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Need to mark virtual/slimmingpaint/svg/text/columns-do-not-apply.html as failing too. Created 5 years, 9 months 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/paint/DeprecatedPaintLayer.h ('k') | Source/web/WebSettingsImpl.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 // Finally, make the visual rectangle relative to |ancestorLayer|. 472 // Finally, make the visual rectangle relative to |ancestorLayer|.
473 if (ancestorLayer->enclosingPaginationLayer() != paginationLayer) { 473 if (ancestorLayer->enclosingPaginationLayer() != paginationLayer) {
474 rect.moveBy(paginationLayer->visualOffsetFromAncestor(ancestorLayer)); 474 rect.moveBy(paginationLayer->visualOffsetFromAncestor(ancestorLayer));
475 return; 475 return;
476 } 476 }
477 // The ancestor layer is inside the same pagination layer as |layer|, so we need to subtract 477 // The ancestor layer is inside the same pagination layer as |layer|, so we need to subtract
478 // the visual distance from the ancestor layer to the pagination layer. 478 // the visual distance from the ancestor layer to the pagination layer.
479 rect.moveBy(-ancestorLayer->visualOffsetFromAncestor(paginationLayer)); 479 rect.moveBy(-ancestorLayer->visualOffsetFromAncestor(paginationLayer));
480 } 480 }
481 481
482 bool DeprecatedPaintLayer::useRegionBasedColumns() const
483 {
484 return layoutObject()->document().regionBasedColumnsEnabled();
485 }
486
487 void DeprecatedPaintLayer::updatePaginationRecursive(bool needsPaginationUpdate) 482 void DeprecatedPaintLayer::updatePaginationRecursive(bool needsPaginationUpdate)
488 { 483 {
489 m_isPaginated = false; 484 m_isPaginated = false;
490 m_enclosingPaginationLayer = 0; 485 m_enclosingPaginationLayer = 0;
491 486
492 if (useRegionBasedColumns() && layoutObject()->isLayoutFlowThread()) 487 if (RuntimeEnabledFeatures::regionBasedColumnsEnabled() && layoutObject()->i sLayoutFlowThread())
493 needsPaginationUpdate = true; 488 needsPaginationUpdate = true;
494 489
495 if (needsPaginationUpdate) 490 if (needsPaginationUpdate)
496 updatePagination(); 491 updatePagination();
497 492
498 if (layoutObject()->hasColumns()) 493 if (layoutObject()->hasColumns())
499 needsPaginationUpdate = true; 494 needsPaginationUpdate = true;
500 495
501 for (DeprecatedPaintLayer* child = firstChild(); child; child = child->nextS ibling()) 496 for (DeprecatedPaintLayer* child = firstChild(); child; child = child->nextS ibling())
502 child->updatePaginationRecursive(needsPaginationUpdate); 497 child->updatePaginationRecursive(needsPaginationUpdate);
503 } 498 }
504 499
505 void DeprecatedPaintLayer::updatePagination() 500 void DeprecatedPaintLayer::updatePagination()
506 { 501 {
507 bool usesRegionBasedColumns = useRegionBasedColumns(); 502 bool usesRegionBasedColumns = RuntimeEnabledFeatures::regionBasedColumnsEnab led();
508 if ((!usesRegionBasedColumns && compositingState() != NotComposited) || !par ent()) 503 if ((!usesRegionBasedColumns && compositingState() != NotComposited) || !par ent())
509 return; // FIXME: For now the LayoutView can't be paginated. Eventually printing will move to a model where it is though. 504 return; // FIXME: For now the LayoutView can't be paginated. Eventually printing will move to a model where it is though.
510 505
511 // The main difference between the paginated booleans for the old column cod e and the new column code 506 // The main difference between the paginated booleans for the old column cod e and the new column code
512 // is that each paginated layer has to paint on its own with the new code. T here is no 507 // is that each paginated layer has to paint on its own with the new code. T here is no
513 // recurring into child layers. This means that the m_isPaginated bits for t he new column code can't just be set on 508 // recurring into child layers. This means that the m_isPaginated bits for t he new column code can't just be set on
514 // "roots" that get split and paint all their descendants. Instead each laye r has to be checked individually and 509 // "roots" that get split and paint all their descendants. Instead each laye r has to be checked individually and
515 // genuinely know if it is going to have to split itself up when painting on ly its contents (and not any other descendant 510 // genuinely know if it is going to have to split itself up when painting on ly its contents (and not any other descendant
516 // layers). We track an enclosingPaginationLayer instead of using a simple b it, since we want to be able to get back 511 // layers). We track an enclosingPaginationLayer instead of using a simple b it, since we want to be able to get back
517 // to that layer easily. 512 // to that layer easily.
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
859 854
860 if (positionedParent->layoutObject()->isRelPositioned() && positionedPar ent->layoutObject()->isLayoutInline()) { 855 if (positionedParent->layoutObject()->isRelPositioned() && positionedPar ent->layoutObject()->isLayoutInline()) {
861 LayoutSize offset = toLayoutInline(positionedParent->layoutObject()) ->offsetForInFlowPositionedInline(*toLayoutBox(layoutObject())); 856 LayoutSize offset = toLayoutInline(positionedParent->layoutObject()) ->offsetForInFlowPositionedInline(*toLayoutBox(layoutObject()));
862 localPoint += offset; 857 localPoint += offset;
863 } 858 }
864 } else if (parent()) { 859 } else if (parent()) {
865 // FIXME: This code is very wrong, but luckily only needed in the old/cu rrent multicol 860 // FIXME: This code is very wrong, but luckily only needed in the old/cu rrent multicol
866 // implementation. The compositing system doesn't understand columns and we're hacking 861 // implementation. The compositing system doesn't understand columns and we're hacking
867 // around that fact by faking the position of the Layers when we think w e'll end up 862 // around that fact by faking the position of the Layers when we think w e'll end up
868 // being composited. 863 // being composited.
869 if (hasStyleDeterminedDirectCompositingReasons() && !useRegionBasedColum ns()) { 864 if (hasStyleDeterminedDirectCompositingReasons() && !RuntimeEnabledFeatu res::regionBasedColumnsEnabled()) {
870 // FIXME: Composited layers ignore pagination, so about the best we can do is make sure they're offset into the appropriate column. 865 // FIXME: Composited layers ignore pagination, so about the best we can do is make sure they're offset into the appropriate column.
871 // They won't split across columns properly. 866 // They won't split across columns properly.
872 if (!parent()->layoutObject()->hasColumns() && parent()->layoutObjec t()->isDocumentElement() && layoutObject()->view()->hasColumns()) 867 if (!parent()->layoutObject()->hasColumns() && parent()->layoutObjec t()->isDocumentElement() && layoutObject()->view()->hasColumns())
873 localPoint += layoutObject()->view()->columnOffset(localPoint); 868 localPoint += layoutObject()->view()->columnOffset(localPoint);
874 else 869 else
875 localPoint += parent()->layoutObject()->columnOffset(localPoint) ; 870 localPoint += parent()->layoutObject()->columnOffset(localPoint) ;
876 } 871 }
877 872
878 if (parent()->layoutObject()->hasOverflowClip()) { 873 if (parent()->layoutObject()->hasOverflowClip()) {
879 IntSize scrollOffset = parent()->layoutBox()->scrolledContentOffset( ); 874 IntSize scrollOffset = parent()->layoutBox()->scrolledContentOffset( );
(...skipping 1575 matching lines...) Expand 10 before | Expand all | Expand 10 after
2455 if (this != ancestorLayer && !hasVisibleContent() && !hasVisibleDescendant() ) 2450 if (this != ancestorLayer && !hasVisibleContent() && !hasVisibleDescendant() )
2456 return LayoutRect(); 2451 return LayoutRect();
2457 2452
2458 // The root layer is always just the size of the document. 2453 // The root layer is always just the size of the document.
2459 if (isRootLayer()) 2454 if (isRootLayer())
2460 return LayoutRect(m_renderer->view()->unscaledDocumentRect()); 2455 return LayoutRect(m_renderer->view()->unscaledDocumentRect());
2461 2456
2462 // The layer created for the LayoutFlowThread is just a helper for painting and hit-testing, 2457 // The layer created for the LayoutFlowThread is just a helper for painting and hit-testing,
2463 // and should not contribute to the bounding box. The LayoutMultiColumnSets will contribute 2458 // and should not contribute to the bounding box. The LayoutMultiColumnSets will contribute
2464 // the correct size for the rendered content of the multicol container. 2459 // the correct size for the rendered content of the multicol container.
2465 if (useRegionBasedColumns() && layoutObject()->isLayoutFlowThread()) 2460 if (RuntimeEnabledFeatures::regionBasedColumnsEnabled() && layoutObject()->i sLayoutFlowThread())
2466 return LayoutRect(); 2461 return LayoutRect();
2467 2462
2468 LayoutRect result = clipper().localClipRect(); 2463 LayoutRect result = clipper().localClipRect();
2469 if (result == LayoutRect::infiniteIntRect()) { 2464 if (result == LayoutRect::infiniteIntRect()) {
2470 LayoutPoint origin; 2465 LayoutPoint origin;
2471 result = physicalBoundingBox(ancestorLayer, &origin); 2466 result = physicalBoundingBox(ancestorLayer, &origin);
2472 2467
2473 const_cast<DeprecatedPaintLayer*>(this)->stackingNode()->updateLayerList sIfNeeded(); 2468 const_cast<DeprecatedPaintLayer*>(this)->stackingNode()->updateLayerList sIfNeeded();
2474 2469
2475 // Reflections are implemented with Layers that hang off of the reflecte d layer. However, 2470 // Reflections are implemented with Layers that hang off of the reflecte d layer. However,
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after
2973 } 2968 }
2974 } 2969 }
2975 2970
2976 void showLayerTree(const blink::LayoutObject* renderer) 2971 void showLayerTree(const blink::LayoutObject* renderer)
2977 { 2972 {
2978 if (!renderer) 2973 if (!renderer)
2979 return; 2974 return;
2980 showLayerTree(renderer->enclosingLayer()); 2975 showLayerTree(renderer->enclosingLayer());
2981 } 2976 }
2982 #endif 2977 #endif
OLDNEW
« no previous file with comments | « Source/core/paint/DeprecatedPaintLayer.h ('k') | Source/web/WebSettingsImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698