Chromium Code Reviews| Index: Source/core/layout/LayoutView.cpp |
| diff --git a/Source/core/layout/LayoutView.cpp b/Source/core/layout/LayoutView.cpp |
| index 72da1bc1a320550cbf9401be221cc8dd4a2d5d42..e1f81d8d9d8be945ca92a3d2c32162a4e546a854 100644 |
| --- a/Source/core/layout/LayoutView.cpp |
| +++ b/Source/core/layout/LayoutView.cpp |
| @@ -102,23 +102,27 @@ bool LayoutView::hitTestNoLifecycleUpdate(HitTestResult& result) |
| uint64_t domTreeVersion = document().domTreeVersion(); |
| HitTestResult cacheResult = result; |
| - bool cacheHit = m_hitTestCache->lookupCachedResult(cacheResult, domTreeVersion); |
| - bool hitLayer = layer()->hitTest(result); |
| - |
| - // FrameView scrollbars are not the same as Layer scrollbars tested by Layer::hitTestOverflowControls, |
| - // so we need to test FrameView scrollbars separately here. Note that it's important we do this after |
| - // the hit test above, because that may overwrite the entire HitTestResult when it finds a hit. |
| - IntPoint framePoint = frameView()->contentsToFrame(result.hitTestLocation().roundedPoint()); |
| - if (Scrollbar* frameScrollbar = frameView()->scrollbarAtFramePoint(framePoint)) |
| - result.setScrollbar(frameScrollbar); |
| - |
| - if (cacheHit) { |
| + bool hitLayer = false; |
| + if (m_hitTestCache->lookupCachedResult(cacheResult, domTreeVersion)) { |
| m_hitTestCacheHits++; |
| + hitLayer = true; |
| +#if ENABLE(ASSERT) |
| m_hitTestCache->verifyCachedResult(result, cacheResult); |
|
dtapuska
2015/08/17 21:23:14
verifyCacheResult logs some UMA metrics. rbyers@ i
esprehn
2015/08/18 20:27:41
Please delete the code for now and add it back lat
dtapuska
2015/08/18 20:56:34
Done.
|
| - } |
| +#endif |
| + result = cacheResult; |
| + } else { |
| + hitLayer = layer()->hitTest(result); |
| - if (hitLayer) |
| - m_hitTestCache->addCachedResult(result, domTreeVersion); |
| + // FrameView scrollbars are not the same as Layer scrollbars tested by Layer::hitTestOverflowControls, |
| + // so we need to test FrameView scrollbars separately here. Note that it's important we do this after |
| + // the hit test above, because that may overwrite the entire HitTestResult when it finds a hit. |
| + IntPoint framePoint = frameView()->contentsToFrame(result.hitTestLocation().roundedPoint()); |
| + if (Scrollbar* frameScrollbar = frameView()->scrollbarAtFramePoint(framePoint)) |
| + result.setScrollbar(frameScrollbar); |
| + |
| + if (hitLayer) |
| + m_hitTestCache->addCachedResult(result, domTreeVersion); |
| + } |
| TRACE_EVENT_END1("blink,devtools.timeline", "HitTest", "endData", InspectorHitTestEvent::endData(result.hitTestRequest(), result.hitTestLocation(), result)); |
| return hitLayer; |