Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. |
| 4 * All rights reserved. | 4 * All rights reserved. |
| 5 * | 5 * |
| 6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
| 10 * | 10 * |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 148 // Layer::hitTestOverflowControls, so we need to test FrameView scrollbars | 148 // Layer::hitTestOverflowControls, so we need to test FrameView scrollbars |
| 149 // separately here. Note that it's important we do this after the hit test | 149 // separately here. Note that it's important we do this after the hit test |
| 150 // above, because that may overwrite the entire HitTestResult when it finds | 150 // above, because that may overwrite the entire HitTestResult when it finds |
| 151 // a hit. | 151 // a hit. |
| 152 IntPoint framePoint = | 152 IntPoint framePoint = |
| 153 frameView()->contentsToFrame(result.hitTestLocation().roundedPoint()); | 153 frameView()->contentsToFrame(result.hitTestLocation().roundedPoint()); |
| 154 if (Scrollbar* frameScrollbar = | 154 if (Scrollbar* frameScrollbar = |
| 155 frameView()->scrollbarAtFramePoint(framePoint)) | 155 frameView()->scrollbarAtFramePoint(framePoint)) |
| 156 result.setScrollbar(frameScrollbar); | 156 result.setScrollbar(frameScrollbar); |
| 157 | 157 |
| 158 // If hitTestResult include scrollbar, innerNode should be the parent of the | |
| 159 // scrollbar. | |
| 160 if (result.scrollbar()) { | |
| 161 // Clear innerNode if hitTest if we hit a scrollbar whose scrollable area | |
| 162 // isn't associated with a LayoutBox we aren't hitting some random element | |
| 163 // below too. | |
|
bokan
2017/04/04 15:18:01
Nit: "Clear innerNode if hitTest if we hit..." ->
| |
| 164 result.setInnerNode(nullptr); | |
| 165 result.setURLElement(nullptr); | |
| 166 ScrollableArea* scrollableArea = result.scrollbar()->getScrollableArea(); | |
| 167 if (scrollableArea && scrollableArea->layoutBox() && | |
| 168 scrollableArea->layoutBox()->node()) { | |
| 169 Node* node = scrollableArea->layoutBox()->node(); | |
| 170 result.setInnerNode(node); | |
| 171 result.setURLElement(node->enclosingLinkEventParentOrSelf()); | |
| 172 } | |
| 173 } | |
| 174 | |
| 158 if (hitLayer) | 175 if (hitLayer) |
| 159 m_hitTestCache->addCachedResult(result, domTreeVersion); | 176 m_hitTestCache->addCachedResult(result, domTreeVersion); |
| 160 } | 177 } |
| 161 | 178 |
| 162 TRACE_EVENT_END1( | 179 TRACE_EVENT_END1( |
| 163 "blink,devtools.timeline", "HitTest", "endData", | 180 "blink,devtools.timeline", "HitTest", "endData", |
| 164 InspectorHitTestEvent::endData(result.hitTestRequest(), | 181 InspectorHitTestEvent::endData(result.hitTestRequest(), |
| 165 result.hitTestLocation(), result)); | 182 result.hitTestLocation(), result)); |
| 166 return hitLayer; | 183 return hitLayer; |
| 167 } | 184 } |
| (...skipping 908 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1076 bool LayoutView::paintedOutputOfObjectHasNoEffectRegardlessOfSize() const { | 1093 bool LayoutView::paintedOutputOfObjectHasNoEffectRegardlessOfSize() const { |
| 1077 // Frame scroll corner is painted using LayoutView as the display item client. | 1094 // Frame scroll corner is painted using LayoutView as the display item client. |
| 1078 if (!RuntimeEnabledFeatures::rootLayerScrollingEnabled() && | 1095 if (!RuntimeEnabledFeatures::rootLayerScrollingEnabled() && |
| 1079 (frameView()->horizontalScrollbar() || frameView()->verticalScrollbar())) | 1096 (frameView()->horizontalScrollbar() || frameView()->verticalScrollbar())) |
| 1080 return false; | 1097 return false; |
| 1081 | 1098 |
| 1082 return LayoutBlockFlow::paintedOutputOfObjectHasNoEffectRegardlessOfSize(); | 1099 return LayoutBlockFlow::paintedOutputOfObjectHasNoEffectRegardlessOfSize(); |
| 1083 } | 1100 } |
| 1084 | 1101 |
| 1085 } // namespace blink | 1102 } // namespace blink |
| OLD | NEW |