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 * (C) 2000 Simon Hausmann <hausmann@kde.org> | 3 * (C) 2000 Simon Hausmann <hausmann@kde.org> |
| 4 * (C) 2000 Stefan Schimanski (1Stein@gmx.de) | 4 * (C) 2000 Stefan Schimanski (1Stein@gmx.de) |
| 5 * Copyright (C) 2004, 2005, 2006, 2009 Apple Inc. All rights reserved. | 5 * Copyright (C) 2004, 2005, 2006, 2009 Apple Inc. All rights reserved. |
| 6 * Copyright (C) Research In Motion Limited 2011. All rights reserved. | 6 * Copyright (C) Research In Motion Limited 2011. All rights reserved. |
| 7 * | 7 * |
| 8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
| 9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
| 10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 145 } | 145 } |
| 146 | 146 |
| 147 bool LayoutPart::nodeAtPointOverWidget(HitTestResult& result, const HitTestLocat ion& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction ac tion) | 147 bool LayoutPart::nodeAtPointOverWidget(HitTestResult& result, const HitTestLocat ion& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction ac tion) |
| 148 { | 148 { |
| 149 bool hadResult = result.innerNode(); | 149 bool hadResult = result.innerNode(); |
| 150 bool inside = LayoutReplaced::nodeAtPoint(result, locationInContainer, accum ulatedOffset, action); | 150 bool inside = LayoutReplaced::nodeAtPoint(result, locationInContainer, accum ulatedOffset, action); |
| 151 | 151 |
| 152 // Check to see if we are really over the widget itself (and not just in the border/padding area). | 152 // Check to see if we are really over the widget itself (and not just in the border/padding area). |
| 153 if ((inside || result.isRectBasedTest()) && !hadResult && result.innerNode() == node()) | 153 if ((inside || result.isRectBasedTest()) && !hadResult && result.innerNode() == node()) |
| 154 result.setIsOverWidget(contentBoxRect().contains(result.localPoint())); | 154 result.setIsOverWidget(contentBoxRect().contains(result.localPoint())); |
| 155 | |
| 156 // Do not cache hit tests as we don't get appropriate callbacks to invalidat e the cache. | |
| 157 // This includes the border and padding areas for simplicity. | |
| 158 if (inside) | |
|
esprehn
2015/08/10 21:22:02
Why not just use the isOverWidget check we did abo
| |
| 159 result.setCacheable(false); | |
| 160 | |
| 155 return inside; | 161 return inside; |
| 156 } | 162 } |
| 157 | 163 |
| 158 bool LayoutPart::nodeAtPoint(HitTestResult& result, const HitTestLocation& locat ionInContainer, const LayoutPoint& accumulatedOffset, HitTestAction action) | 164 bool LayoutPart::nodeAtPoint(HitTestResult& result, const HitTestLocation& locat ionInContainer, const LayoutPoint& accumulatedOffset, HitTestAction action) |
| 159 { | 165 { |
| 160 if (!widget() || !widget()->isFrameView() || !result.hitTestRequest().allows ChildFrameContent()) | 166 if (!widget() || !widget()->isFrameView() || !result.hitTestRequest().allows ChildFrameContent()) |
| 161 return nodeAtPointOverWidget(result, locationInContainer, accumulatedOff set, action); | 167 return nodeAtPointOverWidget(result, locationInContainer, accumulatedOff set, action); |
| 162 | 168 |
| 163 FrameView* childFrameView = toFrameView(widget()); | 169 FrameView* childFrameView = toFrameView(widget()); |
| 164 LayoutView* childRoot = childFrameView->layoutView(); | 170 LayoutView* childRoot = childFrameView->layoutView(); |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 336 if (widget() && widget()->isFrameView()) { | 342 if (widget() && widget()->isFrameView()) { |
| 337 FrameView* childFrameView = toFrameView(widget()); | 343 FrameView* childFrameView = toFrameView(widget()); |
| 338 PaintInvalidationState childViewPaintInvalidationState(*childFrameView-> layoutView(), paintInvalidationState); | 344 PaintInvalidationState childViewPaintInvalidationState(*childFrameView-> layoutView(), paintInvalidationState); |
| 339 toFrameView(widget())->invalidateTreeIfNeeded(childViewPaintInvalidation State); | 345 toFrameView(widget())->invalidateTreeIfNeeded(childViewPaintInvalidation State); |
| 340 } | 346 } |
| 341 | 347 |
| 342 LayoutReplaced::invalidatePaintOfSubtreesIfNeeded(paintInvalidationState); | 348 LayoutReplaced::invalidatePaintOfSubtreesIfNeeded(paintInvalidationState); |
| 343 } | 349 } |
| 344 | 350 |
| 345 } | 351 } |
| OLD | NEW |