OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 12 matching lines...) Expand all Loading... |
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #include "core/frame/VisualViewport.h" | 31 #include "core/frame/VisualViewport.h" |
32 | 32 |
| 33 #include "core/dom/DOMNodeIds.h" |
33 #include "core/frame/FrameHost.h" | 34 #include "core/frame/FrameHost.h" |
34 #include "core/frame/FrameView.h" | 35 #include "core/frame/FrameView.h" |
35 #include "core/frame/LocalFrame.h" | 36 #include "core/frame/LocalFrame.h" |
36 #include "core/frame/PageScaleConstraints.h" | 37 #include "core/frame/PageScaleConstraints.h" |
37 #include "core/frame/PageScaleConstraintsSet.h" | 38 #include "core/frame/PageScaleConstraintsSet.h" |
38 #include "core/frame/Settings.h" | 39 #include "core/frame/Settings.h" |
39 #include "core/inspector/InspectorInstrumentation.h" | 40 #include "core/inspector/InspectorInstrumentation.h" |
40 #include "core/layout/TextAutosizer.h" | 41 #include "core/layout/TextAutosizer.h" |
41 #include "core/layout/compositing/PaintLayerCompositor.h" | 42 #include "core/layout/compositing/PaintLayerCompositor.h" |
42 #include "core/loader/FrameLoaderClient.h" | 43 #include "core/loader/FrameLoaderClient.h" |
43 #include "core/page/ChromeClient.h" | 44 #include "core/page/ChromeClient.h" |
44 #include "core/page/Page.h" | 45 #include "core/page/Page.h" |
45 #include "core/page/scrolling/ScrollingCoordinator.h" | 46 #include "core/page/scrolling/ScrollingCoordinator.h" |
46 #include "platform/Histogram.h" | 47 #include "platform/Histogram.h" |
47 #include "platform/TraceEvent.h" | 48 #include "platform/TraceEvent.h" |
48 #include "platform/geometry/DoubleRect.h" | 49 #include "platform/geometry/DoubleRect.h" |
49 #include "platform/geometry/FloatSize.h" | 50 #include "platform/geometry/FloatSize.h" |
| 51 #include "platform/graphics/CompositorMutableProperties.h" |
50 #include "platform/graphics/GraphicsLayer.h" | 52 #include "platform/graphics/GraphicsLayer.h" |
51 #include "platform/scroll/Scrollbar.h" | 53 #include "platform/scroll/Scrollbar.h" |
52 #include "platform/scroll/ScrollbarThemeOverlay.h" | 54 #include "platform/scroll/ScrollbarThemeOverlay.h" |
53 #include "public/platform/WebCompositorSupport.h" | 55 #include "public/platform/WebCompositorSupport.h" |
54 #include "public/platform/WebLayer.h" | 56 #include "public/platform/WebLayer.h" |
55 #include "public/platform/WebLayerTreeView.h" | 57 #include "public/platform/WebLayerTreeView.h" |
56 #include "public/platform/WebScrollbar.h" | 58 #include "public/platform/WebScrollbar.h" |
57 #include "public/platform/WebScrollbarLayer.h" | 59 #include "public/platform/WebScrollbarLayer.h" |
58 | 60 |
59 using blink::WebLayer; | 61 using blink::WebLayer; |
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 coordinator->setLayerIsContainerForFixedPositionLayers(m_innerViewportSc
rollLayer.get(), true); | 401 coordinator->setLayerIsContainerForFixedPositionLayers(m_innerViewportSc
rollLayer.get(), true); |
400 | 402 |
401 // Set masks to bounds so the compositor doesn't clobber a manually | 403 // Set masks to bounds so the compositor doesn't clobber a manually |
402 // set inner viewport container layer size. | 404 // set inner viewport container layer size. |
403 m_innerViewportContainerLayer->setMasksToBounds(frameHost().settings().m
ainFrameClipsContent()); | 405 m_innerViewportContainerLayer->setMasksToBounds(frameHost().settings().m
ainFrameClipsContent()); |
404 m_innerViewportContainerLayer->setSize(FloatSize(m_size)); | 406 m_innerViewportContainerLayer->setSize(FloatSize(m_size)); |
405 | 407 |
406 m_innerViewportScrollLayer->platformLayer()->setScrollClipLayer( | 408 m_innerViewportScrollLayer->platformLayer()->setScrollClipLayer( |
407 m_innerViewportContainerLayer->platformLayer()); | 409 m_innerViewportContainerLayer->platformLayer()); |
408 m_innerViewportScrollLayer->platformLayer()->setUserScrollable(true, tru
e); | 410 m_innerViewportScrollLayer->platformLayer()->setUserScrollable(true, tru
e); |
| 411 if (mainFrame()) { |
| 412 if (Document* document = mainFrame()->document()) |
| 413 m_innerViewportScrollLayer->setElementId(createCompositorElement
Id(DOMNodeIds::idForNode(document), CompositorSubElementId::Scroll)); |
| 414 } |
409 | 415 |
410 m_rootTransformLayer->addChild(m_innerViewportContainerLayer.get()); | 416 m_rootTransformLayer->addChild(m_innerViewportContainerLayer.get()); |
411 m_innerViewportContainerLayer->addChild(m_overscrollElasticityLayer.get(
)); | 417 m_innerViewportContainerLayer->addChild(m_overscrollElasticityLayer.get(
)); |
412 m_overscrollElasticityLayer->addChild(m_pageScaleLayer.get()); | 418 m_overscrollElasticityLayer->addChild(m_pageScaleLayer.get()); |
413 m_pageScaleLayer->addChild(m_innerViewportScrollLayer.get()); | 419 m_pageScaleLayer->addChild(m_innerViewportScrollLayer.get()); |
414 | 420 |
415 // Ensure this class is set as the scroll layer's ScrollableArea. | 421 // Ensure this class is set as the scroll layer's ScrollableArea. |
416 coordinator->scrollableAreaScrollLayerDidChange(this); | 422 coordinator->scrollableAreaScrollLayerDidChange(this); |
417 | 423 |
418 initializeScrollbars(); | 424 initializeScrollbars(); |
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
835 } else if (graphicsLayer == m_rootTransformLayer) { | 841 } else if (graphicsLayer == m_rootTransformLayer) { |
836 name = "Root Transform Layer"; | 842 name = "Root Transform Layer"; |
837 } else { | 843 } else { |
838 ASSERT_NOT_REACHED(); | 844 ASSERT_NOT_REACHED(); |
839 } | 845 } |
840 | 846 |
841 return name; | 847 return name; |
842 } | 848 } |
843 | 849 |
844 } // namespace blink | 850 } // namespace blink |
OLD | NEW |