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