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

Side by Side Diff: third_party/WebKit/Source/core/frame/VisualViewport.cpp

Issue 1973083002: Use element id's for animations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 5 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
OLDNEW
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
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 #include <memory> 60 #include <memory>
59 61
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 coordinator->setLayerIsContainerForFixedPositionLayers(m_innerViewportSc rollLayer.get(), true); 392 coordinator->setLayerIsContainerForFixedPositionLayers(m_innerViewportSc rollLayer.get(), true);
391 393
392 // Set masks to bounds so the compositor doesn't clobber a manually 394 // Set masks to bounds so the compositor doesn't clobber a manually
393 // set inner viewport container layer size. 395 // set inner viewport container layer size.
394 m_innerViewportContainerLayer->setMasksToBounds(frameHost().settings().m ainFrameClipsContent()); 396 m_innerViewportContainerLayer->setMasksToBounds(frameHost().settings().m ainFrameClipsContent());
395 m_innerViewportContainerLayer->setSize(FloatSize(m_size)); 397 m_innerViewportContainerLayer->setSize(FloatSize(m_size));
396 398
397 m_innerViewportScrollLayer->platformLayer()->setScrollClipLayer( 399 m_innerViewportScrollLayer->platformLayer()->setScrollClipLayer(
398 m_innerViewportContainerLayer->platformLayer()); 400 m_innerViewportContainerLayer->platformLayer());
399 m_innerViewportScrollLayer->platformLayer()->setUserScrollable(true, tru e); 401 m_innerViewportScrollLayer->platformLayer()->setUserScrollable(true, tru e);
402 if (mainFrame()) {
403 if (Document* document = mainFrame()->document())
404 m_innerViewportScrollLayer->setElementId(createCompositorElement Id(DOMNodeIds::idForNode(document), CompositorSubElementId::Scroll));
405 }
400 406
401 m_rootTransformLayer->addChild(m_innerViewportContainerLayer.get()); 407 m_rootTransformLayer->addChild(m_innerViewportContainerLayer.get());
402 m_innerViewportContainerLayer->addChild(m_overscrollElasticityLayer.get( )); 408 m_innerViewportContainerLayer->addChild(m_overscrollElasticityLayer.get( ));
403 m_overscrollElasticityLayer->addChild(m_pageScaleLayer.get()); 409 m_overscrollElasticityLayer->addChild(m_pageScaleLayer.get());
404 m_pageScaleLayer->addChild(m_innerViewportScrollLayer.get()); 410 m_pageScaleLayer->addChild(m_innerViewportScrollLayer.get());
405 411
406 // Ensure this class is set as the scroll layer's ScrollableArea. 412 // Ensure this class is set as the scroll layer's ScrollableArea.
407 coordinator->scrollableAreaScrollLayerDidChange(this); 413 coordinator->scrollableAreaScrollLayerDidChange(this);
408 414
409 initializeScrollbars(); 415 initializeScrollbars();
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
826 } else if (graphicsLayer == m_rootTransformLayer.get()) { 832 } else if (graphicsLayer == m_rootTransformLayer.get()) {
827 name = "Root Transform Layer"; 833 name = "Root Transform Layer";
828 } else { 834 } else {
829 ASSERT_NOT_REACHED(); 835 ASSERT_NOT_REACHED();
830 } 836 }
831 837
832 return name; 838 return name;
833 } 839 }
834 840
835 } // namespace blink 841 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698