| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2011 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 662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 673 clipParentWebLayer = toWebLayer(parent->compositedLayerMapping()->parent
ForSublayers()); | 673 clipParentWebLayer = toWebLayer(parent->compositedLayerMapping()->parent
ForSublayers()); |
| 674 | 674 |
| 675 child->setClipParent(clipParentWebLayer); | 675 child->setClipParent(clipParentWebLayer); |
| 676 } | 676 } |
| 677 | 677 |
| 678 void ScrollingCoordinator::willDestroyLayer(PaintLayer* layer) | 678 void ScrollingCoordinator::willDestroyLayer(PaintLayer* layer) |
| 679 { | 679 { |
| 680 m_layersWithTouchRects.remove(layer); | 680 m_layersWithTouchRects.remove(layer); |
| 681 } | 681 } |
| 682 | 682 |
| 683 void ScrollingCoordinator::updateHaveWheelEventHandlers() | |
| 684 { | |
| 685 ASSERT(isMainThread()); | |
| 686 ASSERT(m_page); | |
| 687 if (!m_page->mainFrame()->isLocalFrame() || !m_page->deprecatedLocalMainFram
e()->view()) | |
| 688 return; | |
| 689 | |
| 690 if (WebLayer* scrollLayer = toWebLayer(m_page->deprecatedLocalMainFrame()->v
iew()->layerForScrolling())) { | |
| 691 bool haveHandlers = m_page->frameHost().eventHandlerRegistry().hasEventH
andlers(EventHandlerRegistry::WheelEvent); | |
| 692 scrollLayer->setHaveWheelEventHandlers(haveHandlers); | |
| 693 } | |
| 694 } | |
| 695 | |
| 696 void ScrollingCoordinator::updateHaveScrollEventHandlers() | 683 void ScrollingCoordinator::updateHaveScrollEventHandlers() |
| 697 { | 684 { |
| 698 ASSERT(isMainThread()); | 685 ASSERT(isMainThread()); |
| 699 ASSERT(m_page); | 686 ASSERT(m_page); |
| 700 if (!m_page->mainFrame()->isLocalFrame() || !m_page->deprecatedLocalMainFram
e()->view()) | 687 if (!m_page->mainFrame()->isLocalFrame() || !m_page->deprecatedLocalMainFram
e()->view()) |
| 701 return; | 688 return; |
| 702 | 689 |
| 703 // Currently the compositor only cares whether there are scroll handlers any
where on the page | 690 // Currently the compositor only cares whether there are scroll handlers any
where on the page |
| 704 // instead on a per-layer basis. We therefore only update this information f
or the root | 691 // instead on a per-layer basis. We therefore only update this information f
or the root |
| 705 // scrolling layer. | 692 // scrolling layer. |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 953 | 940 |
| 954 void ScrollingCoordinator::frameViewRootLayerDidChange(FrameView* frameView) | 941 void ScrollingCoordinator::frameViewRootLayerDidChange(FrameView* frameView) |
| 955 { | 942 { |
| 956 ASSERT(isMainThread()); | 943 ASSERT(isMainThread()); |
| 957 ASSERT(m_page); | 944 ASSERT(m_page); |
| 958 | 945 |
| 959 if (!coordinatesScrollingForFrameView(frameView)) | 946 if (!coordinatesScrollingForFrameView(frameView)) |
| 960 return; | 947 return; |
| 961 | 948 |
| 962 notifyGeometryChanged(); | 949 notifyGeometryChanged(); |
| 963 updateHaveWheelEventHandlers(); | |
| 964 updateHaveScrollEventHandlers(); | 950 updateHaveScrollEventHandlers(); |
| 965 } | 951 } |
| 966 | 952 |
| 967 #if OS(MACOSX) | 953 #if OS(MACOSX) |
| 968 void ScrollingCoordinator::handleWheelEventPhase(PlatformWheelEventPhase phase) | 954 void ScrollingCoordinator::handleWheelEventPhase(PlatformWheelEventPhase phase) |
| 969 { | 955 { |
| 970 ASSERT(isMainThread()); | 956 ASSERT(isMainThread()); |
| 971 | 957 |
| 972 if (!m_page) | 958 if (!m_page) |
| 973 return; | 959 return; |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1082 bool frameIsScrollable = frameView && frameView->isScrollable(); | 1068 bool frameIsScrollable = frameView && frameView->isScrollable(); |
| 1083 if (frameIsScrollable != m_wasFrameScrollable) | 1069 if (frameIsScrollable != m_wasFrameScrollable) |
| 1084 return true; | 1070 return true; |
| 1085 | 1071 |
| 1086 if (WebLayer* scrollLayer = frameView ? toWebLayer(frameView->layerForScroll
ing()) : nullptr) | 1072 if (WebLayer* scrollLayer = frameView ? toWebLayer(frameView->layerForScroll
ing()) : nullptr) |
| 1087 return WebSize(frameView->contentsSize()) != scrollLayer->bounds(); | 1073 return WebSize(frameView->contentsSize()) != scrollLayer->bounds(); |
| 1088 return false; | 1074 return false; |
| 1089 } | 1075 } |
| 1090 | 1076 |
| 1091 } // namespace blink | 1077 } // namespace blink |
| OLD | NEW |