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

Side by Side Diff: Source/core/rendering/compositing/RenderLayerCompositor.cpp

Issue 564983003: Clip iframe overflow controls. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: . Created 6 years, 3 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 | « LayoutTests/TestExpectations ('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 Apple Inc. All rights reserved. 2 * Copyright (C) 2009, 2010 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 475 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 { 486 {
487 if (m_overflowControlsHostLayer) 487 if (m_overflowControlsHostLayer)
488 m_overflowControlsHostLayer->setPosition(contentsOffset); 488 m_overflowControlsHostLayer->setPosition(contentsOffset);
489 } 489 }
490 490
491 void RenderLayerCompositor::frameViewDidChangeSize() 491 void RenderLayerCompositor::frameViewDidChangeSize()
492 { 492 {
493 if (m_containerLayer) { 493 if (m_containerLayer) {
494 FrameView* frameView = m_renderView.frameView(); 494 FrameView* frameView = m_renderView.frameView();
495 m_containerLayer->setSize(frameView->unscaledVisibleContentSize()); 495 m_containerLayer->setSize(frameView->unscaledVisibleContentSize());
496 m_overflowControlsHostLayer->setSize(frameView->unscaledVisibleContentSi ze(IncludeScrollbars));
496 497
497 frameViewDidScroll(); 498 frameViewDidScroll();
498 updateOverflowControlsLayers(); 499 updateOverflowControlsLayers();
499 } 500 }
500 } 501 }
501 502
502 enum AcceleratedFixedRootBackgroundHistogramBuckets { 503 enum AcceleratedFixedRootBackgroundHistogramBuckets {
503 ScrolledMainFrameBucket = 0, 504 ScrolledMainFrameBucket = 0,
504 ScrolledMainFrameWithAcceleratedFixedRootBackground = 1, 505 ScrolledMainFrameWithAcceleratedFixedRootBackground = 1,
505 ScrolledMainFrameWithUnacceleratedFixedRootBackground = 2, 506 ScrolledMainFrameWithUnacceleratedFixedRootBackground = 2,
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
710 m_rootContentLayer->setSize(documentRect.size()); 711 m_rootContentLayer->setSize(documentRect.size());
711 m_rootContentLayer->setPosition(documentRect.location()); 712 m_rootContentLayer->setPosition(documentRect.location());
712 #if USE(RUBBER_BANDING) 713 #if USE(RUBBER_BANDING)
713 if (m_layerForOverhangShadow) 714 if (m_layerForOverhangShadow)
714 OverscrollTheme::theme()->updateOverhangShadowLayer(m_layerForOverha ngShadow.get(), m_rootContentLayer.get()); 715 OverscrollTheme::theme()->updateOverhangShadowLayer(m_layerForOverha ngShadow.get(), m_rootContentLayer.get());
715 #endif 716 #endif
716 } 717 }
717 if (m_containerLayer) { 718 if (m_containerLayer) {
718 FrameView* frameView = m_renderView.frameView(); 719 FrameView* frameView = m_renderView.frameView();
719 m_containerLayer->setSize(frameView->unscaledVisibleContentSize()); 720 m_containerLayer->setSize(frameView->unscaledVisibleContentSize());
721 m_overflowControlsHostLayer->setSize(frameView->unscaledVisibleContentSi ze(IncludeScrollbars));
720 } 722 }
721 } 723 }
722 724
723 void RenderLayerCompositor::updatePotentialCompositingReasonsFromStyle(RenderLay er* layer) 725 void RenderLayerCompositor::updatePotentialCompositingReasonsFromStyle(RenderLay er* layer)
724 { 726 {
725 layer->setPotentialCompositingReasonsFromStyle(m_compositingReasonFinder.pot entialCompositingReasonsFromStyle(layer->renderer())); 727 layer->setPotentialCompositingReasonsFromStyle(m_compositingReasonFinder.pot entialCompositingReasonsFromStyle(layer->renderer()));
726 } 728 }
727 729
728 void RenderLayerCompositor::updateDirectCompositingReasons(RenderLayer* layer) 730 void RenderLayerCompositor::updateDirectCompositingReasons(RenderLayer* layer)
729 { 731 {
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
980 m_overflowControlsHostLayer = GraphicsLayer::create(graphicsLayerFactory (), this); 982 m_overflowControlsHostLayer = GraphicsLayer::create(graphicsLayerFactory (), this);
981 983
982 // Create a clipping layer if this is an iframe or settings require to c lip. 984 // Create a clipping layer if this is an iframe or settings require to c lip.
983 m_containerLayer = GraphicsLayer::create(graphicsLayerFactory(), this); 985 m_containerLayer = GraphicsLayer::create(graphicsLayerFactory(), this);
984 bool containerMasksToBounds = !m_renderView.frame()->isLocalRoot(); 986 bool containerMasksToBounds = !m_renderView.frame()->isLocalRoot();
985 if (Settings* settings = m_renderView.document().settings()) { 987 if (Settings* settings = m_renderView.document().settings()) {
986 if (settings->mainFrameClipsContent()) 988 if (settings->mainFrameClipsContent())
987 containerMasksToBounds = true; 989 containerMasksToBounds = true;
988 } 990 }
989 m_containerLayer->setMasksToBounds(containerMasksToBounds); 991 m_containerLayer->setMasksToBounds(containerMasksToBounds);
992 m_overflowControlsHostLayer->setMasksToBounds(containerMasksToBounds);
990 993
991 m_scrollLayer = GraphicsLayer::create(graphicsLayerFactory(), this); 994 m_scrollLayer = GraphicsLayer::create(graphicsLayerFactory(), this);
992 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordina tor()) 995 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordina tor())
993 scrollingCoordinator->setLayerIsContainerForFixedPositionLayers(m_sc rollLayer.get(), true); 996 scrollingCoordinator->setLayerIsContainerForFixedPositionLayers(m_sc rollLayer.get(), true);
994 997
995 // Hook them up 998 // Hook them up
996 m_overflowControlsHostLayer->addChild(m_containerLayer.get()); 999 m_overflowControlsHostLayer->addChild(m_containerLayer.get());
997 m_containerLayer->addChild(m_scrollLayer.get()); 1000 m_containerLayer->addChild(m_scrollLayer.get());
998 m_scrollLayer->addChild(m_rootContentLayer.get()); 1001 m_scrollLayer->addChild(m_rootContentLayer.get());
999 1002
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
1171 } else if (graphicsLayer == m_scrollLayer.get()) { 1174 } else if (graphicsLayer == m_scrollLayer.get()) {
1172 name = "LocalFrame Scrolling Layer"; 1175 name = "LocalFrame Scrolling Layer";
1173 } else { 1176 } else {
1174 ASSERT_NOT_REACHED(); 1177 ASSERT_NOT_REACHED();
1175 } 1178 }
1176 1179
1177 return name; 1180 return name;
1178 } 1181 }
1179 1182
1180 } // namespace blink 1183 } // namespace blink
OLDNEW
« no previous file with comments | « LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698