OLD | NEW |
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 2413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2424 m_rootContentLayer->setMasksToBounds(true); | 2424 m_rootContentLayer->setMasksToBounds(true); |
2425 } | 2425 } |
2426 | 2426 |
2427 if (!m_overflowControlsHostLayer) { | 2427 if (!m_overflowControlsHostLayer) { |
2428 ASSERT(!m_scrollLayer); | 2428 ASSERT(!m_scrollLayer); |
2429 ASSERT(!m_containerLayer); | 2429 ASSERT(!m_containerLayer); |
2430 | 2430 |
2431 // Create a layer to host the clipping layer and the overflow controls l
ayers. | 2431 // Create a layer to host the clipping layer and the overflow controls l
ayers. |
2432 m_overflowControlsHostLayer = GraphicsLayer::create(graphicsLayerFactory
(), this); | 2432 m_overflowControlsHostLayer = GraphicsLayer::create(graphicsLayerFactory
(), this); |
2433 | 2433 |
2434 // Create a clipping layer if this is an iframe | 2434 // Create a clipping layer if this is an iframe or settings require to c
lip. |
2435 m_containerLayer = GraphicsLayer::create(graphicsLayerFactory(), this); | 2435 m_containerLayer = GraphicsLayer::create(graphicsLayerFactory(), this); |
2436 if (!isMainFrame()) | 2436 bool containerMasksToBounds = !isMainFrame(); |
2437 m_containerLayer->setMasksToBounds(true); | 2437 if (Settings* settings = m_renderView->document().settings()) { |
| 2438 if (settings->rootLayerClipsContent()) |
| 2439 containerMasksToBounds = true; |
| 2440 } |
| 2441 m_containerLayer->setMasksToBounds(containerMasksToBounds); |
2438 | 2442 |
2439 m_scrollLayer = GraphicsLayer::create(graphicsLayerFactory(), this); | 2443 m_scrollLayer = GraphicsLayer::create(graphicsLayerFactory(), this); |
2440 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordina
tor()) | 2444 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordina
tor()) |
2441 scrollingCoordinator->setLayerIsContainerForFixedPositionLayers(m_sc
rollLayer.get(), true); | 2445 scrollingCoordinator->setLayerIsContainerForFixedPositionLayers(m_sc
rollLayer.get(), true); |
2442 | 2446 |
2443 // Hook them up | 2447 // Hook them up |
2444 m_overflowControlsHostLayer->addChild(m_containerLayer.get()); | 2448 m_overflowControlsHostLayer->addChild(m_containerLayer.get()); |
2445 m_containerLayer->addChild(m_scrollLayer.get()); | 2449 m_containerLayer->addChild(m_scrollLayer.get()); |
2446 m_scrollLayer->addChild(m_rootContentLayer.get()); | 2450 m_scrollLayer->addChild(m_rootContentLayer.get()); |
2447 | 2451 |
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2784 } else if (graphicsLayer == m_scrollLayer.get()) { | 2788 } else if (graphicsLayer == m_scrollLayer.get()) { |
2785 name = "Frame Scrolling Layer"; | 2789 name = "Frame Scrolling Layer"; |
2786 } else { | 2790 } else { |
2787 ASSERT_NOT_REACHED(); | 2791 ASSERT_NOT_REACHED(); |
2788 } | 2792 } |
2789 | 2793 |
2790 return name; | 2794 return name; |
2791 } | 2795 } |
2792 | 2796 |
2793 } // namespace WebCore | 2797 } // namespace WebCore |
OLD | NEW |