| 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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 } | 112 } |
| 113 } | 113 } |
| 114 | 114 |
| 115 void ScrollingCoordinator::notifyLayoutUpdated() | 115 void ScrollingCoordinator::notifyLayoutUpdated() |
| 116 { | 116 { |
| 117 m_scrollGestureRegionIsDirty = true; | 117 m_scrollGestureRegionIsDirty = true; |
| 118 m_touchEventTargetRectsAreDirty = true; | 118 m_touchEventTargetRectsAreDirty = true; |
| 119 m_shouldScrollOnMainThreadDirty = true; | 119 m_shouldScrollOnMainThreadDirty = true; |
| 120 } | 120 } |
| 121 | 121 |
| 122 void ScrollingCoordinator::scrollableAreasDidChange() |
| 123 { |
| 124 // Layout may update scrollable area bounding boxes. It also sets the same d
irty |
| 125 // flag making this one redundant (See |ScrollingCoordinator::notifyLayoutUp
dated|). |
| 126 // So if layout is expected, ignore this call allowing scrolling coordinator |
| 127 // to be notified post-layout to recompute gesture regions. |
| 128 if (!m_page->deprecatedLocalMainFrame()->view() || m_page->deprecatedLocalMa
inFrame()->view()->needsLayout()) |
| 129 return; |
| 130 |
| 131 m_scrollGestureRegionIsDirty = true; |
| 132 } |
| 133 |
| 122 void ScrollingCoordinator::updateAfterCompositingChangeIfNeeded() | 134 void ScrollingCoordinator::updateAfterCompositingChangeIfNeeded() |
| 123 { | 135 { |
| 124 if (!m_page->mainFrame()->isLocalFrame()) | 136 if (!m_page->mainFrame()->isLocalFrame()) |
| 125 return; | 137 return; |
| 126 | 138 |
| 127 if (!shouldUpdateAfterCompositingChange()) | 139 if (!shouldUpdateAfterCompositingChange()) |
| 128 return; | 140 return; |
| 129 | 141 |
| 130 TRACE_EVENT0("input", "ScrollingCoordinator::updateAfterCompositingChangeIfN
eeded"); | 142 TRACE_EVENT0("input", "ScrollingCoordinator::updateAfterCompositingChangeIfN
eeded"); |
| 131 | 143 |
| (...skipping 884 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1016 bool frameIsScrollable = frameView && frameView->isScrollable(); | 1028 bool frameIsScrollable = frameView && frameView->isScrollable(); |
| 1017 if (frameIsScrollable != m_wasFrameScrollable) | 1029 if (frameIsScrollable != m_wasFrameScrollable) |
| 1018 return true; | 1030 return true; |
| 1019 | 1031 |
| 1020 if (WebLayer* scrollLayer = frameView ? toWebLayer(frameView->layerForScroll
ing()) : nullptr) | 1032 if (WebLayer* scrollLayer = frameView ? toWebLayer(frameView->layerForScroll
ing()) : nullptr) |
| 1021 return blink::WebSize(frameView->contentsSize()) != scrollLayer->bounds(
); | 1033 return blink::WebSize(frameView->contentsSize()) != scrollLayer->bounds(
); |
| 1022 return false; | 1034 return false; |
| 1023 } | 1035 } |
| 1024 | 1036 |
| 1025 } // namespace blink | 1037 } // namespace blink |
| OLD | NEW |