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

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

Issue 14703004: Reland "Unifies ScrollView and RenderLayer to use non-shi..." (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebased Created 7 years, 7 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/rendering/RenderLayer.cpp ('k') | no next file » | 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) 2009, 2010, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after
669 // The reflection layer has the bounds of m_owningLayer->reflectionLayer (), 669 // The reflection layer has the bounds of m_owningLayer->reflectionLayer (),
670 // but the reflected layer is the bounds of this layer, so we need to po sition it appropriately. 670 // but the reflected layer is the bounds of this layer, so we need to po sition it appropriately.
671 FloatRect layerBounds = compositedBounds(); 671 FloatRect layerBounds = compositedBounds();
672 FloatRect reflectionLayerBounds = reflectionBacking->compositedBounds(); 672 FloatRect reflectionLayerBounds = reflectionBacking->compositedBounds();
673 reflectionBacking->graphicsLayer()->setReplicatedLayerPosition(FloatPoin t(layerBounds.location() - reflectionLayerBounds.location())); 673 reflectionBacking->graphicsLayer()->setReplicatedLayerPosition(FloatPoin t(layerBounds.location() - reflectionLayerBounds.location()));
674 } 674 }
675 675
676 if (m_scrollingLayer) { 676 if (m_scrollingLayer) {
677 ASSERT(m_scrollingContentsLayer); 677 ASSERT(m_scrollingContentsLayer);
678 RenderBox* renderBox = toRenderBox(renderer()); 678 RenderBox* renderBox = toRenderBox(renderer());
679 IntRect paddingBox(renderBox->borderLeft(), renderBox->borderTop(), rend erBox->width() - renderBox->borderLeft() - renderBox->borderRight(), renderBox-> height() - renderBox->borderTop() - renderBox->borderBottom()); 679 IntRect clientBox = enclosingIntRect(renderBox->clientBoxRect());
680 IntSize scrollOffset = m_owningLayer->adjustedScrollOffset(); 680 // FIXME: We should make RenderBox::clientBoxRect consider scrollbar pla cement.
681 if (style->shouldPlaceBlockDirectionScrollbarOnLogicalLeft())
682 clientBox.move(renderBox->verticalScrollbarWidth(), 0);
681 683
682 m_scrollingLayer->setPosition(FloatPoint(paddingBox.location() - localCo mpositingBounds.location())); 684 IntSize adjustedScrollOffset = m_owningLayer->adjustedScrollOffset();
683 685 m_scrollingLayer->setPosition(FloatPoint(clientBox.location() - localCom positingBounds.location()));
684 m_scrollingLayer->setSize(paddingBox.size()); 686 m_scrollingLayer->setSize(clientBox.size());
685 m_scrollingContentsLayer->setPosition(FloatPoint(-scrollOffset.width(), -scrollOffset.height())); 687 m_scrollingContentsLayer->setPosition(FloatPoint(-adjustedScrollOffset.w idth(), -adjustedScrollOffset.height()));
686 688
687 IntSize oldScrollingLayerOffset = m_scrollingLayer->offsetFromRenderer() ; 689 IntSize oldScrollingLayerOffset = m_scrollingLayer->offsetFromRenderer() ;
688 m_scrollingLayer->setOffsetFromRenderer(-toIntSize(paddingBox.location() )); 690 m_scrollingLayer->setOffsetFromRenderer(-toIntSize(clientBox.location()) );
689 691
690 bool paddingBoxOffsetChanged = oldScrollingLayerOffset != m_scrollingLay er->offsetFromRenderer(); 692 bool clientBoxOffsetChanged = oldScrollingLayerOffset != m_scrollingLaye r->offsetFromRenderer();
691 693
692 IntSize scrollSize(m_owningLayer->scrollWidth(), m_owningLayer->scrollHe ight()); 694 IntSize scrollSize(m_owningLayer->scrollWidth(), m_owningLayer->scrollHe ight());
693 if (scrollSize != m_scrollingContentsLayer->size() || paddingBoxOffsetCh anged) 695 if (scrollSize != m_scrollingContentsLayer->size() || clientBoxOffsetCha nged)
694 m_scrollingContentsLayer->setNeedsDisplay(); 696 m_scrollingContentsLayer->setNeedsDisplay();
695 697
696 IntSize scrollingContentsOffset = toIntSize(paddingBox.location() - scro llOffset); 698 IntSize scrollingContentsOffset = toIntSize(clientBox.location() - adjus tedScrollOffset);
697 if (scrollingContentsOffset != m_scrollingContentsLayer->offsetFromRende rer() || scrollSize != m_scrollingContentsLayer->size()) 699 if (scrollingContentsOffset != m_scrollingContentsLayer->offsetFromRende rer() || scrollSize != m_scrollingContentsLayer->size())
698 compositor()->scrollingLayerDidChange(m_owningLayer); 700 compositor()->scrollingLayerDidChange(m_owningLayer);
699 701
700 m_scrollingContentsLayer->setSize(scrollSize); 702 m_scrollingContentsLayer->setSize(scrollSize);
701 // FIXME: The paint offset and the scroll offset should really be separa te concepts. 703 // FIXME: The paint offset and the scroll offset should really be separa te concepts.
702 m_scrollingContentsLayer->setOffsetFromRenderer(scrollingContentsOffset, GraphicsLayer::DontSetNeedsDisplay); 704 m_scrollingContentsLayer->setOffsetFromRenderer(scrollingContentsOffset, GraphicsLayer::DontSetNeedsDisplay);
703 705
704 if (m_foregroundLayer) { 706 if (m_foregroundLayer) {
705 if (m_foregroundLayer->size() != m_scrollingContentsLayer->size()) 707 if (m_foregroundLayer->size() != m_scrollingContentsLayer->size())
706 m_foregroundLayer->setSize(m_scrollingContentsLayer->size()); 708 m_foregroundLayer->setSize(m_scrollingContentsLayer->size());
(...skipping 1257 matching lines...) Expand 10 before | Expand all | Expand 10 after
1964 info.addMember(m_childContainmentLayer, "childContainmentLayer"); 1966 info.addMember(m_childContainmentLayer, "childContainmentLayer");
1965 info.addMember(m_maskLayer, "maskLayer"); 1967 info.addMember(m_maskLayer, "maskLayer");
1966 info.addMember(m_layerForHorizontalScrollbar, "layerForHorizontalScrollbar") ; 1968 info.addMember(m_layerForHorizontalScrollbar, "layerForHorizontalScrollbar") ;
1967 info.addMember(m_layerForVerticalScrollbar, "layerForVerticalScrollbar"); 1969 info.addMember(m_layerForVerticalScrollbar, "layerForVerticalScrollbar");
1968 info.addMember(m_layerForScrollCorner, "layerForScrollCorner"); 1970 info.addMember(m_layerForScrollCorner, "layerForScrollCorner");
1969 info.addMember(m_scrollingLayer, "scrollingLayer"); 1971 info.addMember(m_scrollingLayer, "scrollingLayer");
1970 info.addMember(m_scrollingContentsLayer, "scrollingContentsLayer"); 1972 info.addMember(m_scrollingContentsLayer, "scrollingContentsLayer");
1971 } 1973 }
1972 1974
1973 } // namespace WebCore 1975 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderLayer.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698