Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006 Apple Computer, Inc. | 2 * Copyright (C) 2006 Apple Computer, Inc. |
| 3 * Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ | 3 * Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ |
| 4 * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies) | 4 * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies) |
| 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 20 matching lines...) Expand all Loading... | |
| 31 ReadOnly = 1 << 1, | 31 ReadOnly = 1 << 1, |
| 32 Active = 1 << 2, | 32 Active = 1 << 2, |
| 33 Move = 1 << 3, | 33 Move = 1 << 3, |
| 34 Release = 1 << 4, | 34 Release = 1 << 4, |
| 35 IgnoreClipping = 1 << 5, | 35 IgnoreClipping = 1 << 5, |
| 36 SVGClipContent = 1 << 6, | 36 SVGClipContent = 1 << 6, |
| 37 TouchEvent = 1 << 7, | 37 TouchEvent = 1 << 7, |
| 38 AllowChildFrameContent = 1 << 8, | 38 AllowChildFrameContent = 1 << 8, |
| 39 ChildFrameHitTest = 1 << 9, | 39 ChildFrameHitTest = 1 << 9, |
| 40 IgnorePointerEventsNone = 1 << 10, | 40 IgnorePointerEventsNone = 1 << 10, |
| 41 // Collect a list of nodes instead of just one. | |
| 42 // (e.g., for elementsFromPoint or rect-based tests). | |
|
Rick Byers
2015/02/04 10:34:03
Is it legal to ask for a list-based hit-test witho
pdr.
2015/02/17 04:10:13
It's not, I've updated the comment to be a bit mor
Rick Byers
2015/02/20 20:02:23
That enforces the penetrating part, but does anyth
| |
| 43 ListBased = 1 << 11, | |
| 44 // Continues hit testing even after a hit has been found. This is useful | |
| 45 // with list-based testing for finding all nodes in an area. | |
| 46 Penetrating = 1 << 12, | |
|
Rick Byers
2015/02/04 10:34:03
What does it mean to have a penetrating hit test t
pdr.
2015/02/17 04:10:13
It doesn't make sense. I've renamed this Penetrati
| |
| 41 }; | 47 }; |
| 42 | 48 |
| 43 typedef unsigned HitTestRequestType; | 49 typedef unsigned HitTestRequestType; |
| 44 | 50 |
| 45 HitTestRequest(HitTestRequestType requestType) | 51 HitTestRequest(HitTestRequestType requestType) |
| 46 : m_requestType(requestType) | 52 : m_requestType(requestType) |
| 47 { | 53 { |
| 48 } | 54 } |
| 49 | 55 |
| 50 bool readOnly() const { return m_requestType & ReadOnly; } | 56 bool readOnly() const { return m_requestType & ReadOnly; } |
| 51 bool active() const { return m_requestType & Active; } | 57 bool active() const { return m_requestType & Active; } |
| 52 bool move() const { return m_requestType & Move; } | 58 bool move() const { return m_requestType & Move; } |
| 53 bool release() const { return m_requestType & Release; } | 59 bool release() const { return m_requestType & Release; } |
| 54 bool ignoreClipping() const { return m_requestType & IgnoreClipping; } | 60 bool ignoreClipping() const { return m_requestType & IgnoreClipping; } |
| 55 bool svgClipContent() const { return m_requestType & SVGClipContent; } | 61 bool svgClipContent() const { return m_requestType & SVGClipContent; } |
| 56 bool touchEvent() const { return m_requestType & TouchEvent; } | 62 bool touchEvent() const { return m_requestType & TouchEvent; } |
| 57 bool allowsChildFrameContent() const { return m_requestType & AllowChildFram eContent; } | 63 bool allowsChildFrameContent() const { return m_requestType & AllowChildFram eContent; } |
| 58 bool isChildFrameHitTest() const { return m_requestType & ChildFrameHitTest; } | 64 bool isChildFrameHitTest() const { return m_requestType & ChildFrameHitTest; } |
| 59 bool ignorePointerEventsNone() const { return m_requestType & IgnorePointerE ventsNone; } | 65 bool ignorePointerEventsNone() const { return m_requestType & IgnorePointerE ventsNone; } |
| 66 bool listBased() const { return m_requestType & ListBased; } | |
| 67 bool penetrating() const { return m_requestType & Penetrating; } | |
| 60 | 68 |
| 61 // Convenience functions | 69 // Convenience functions |
| 62 bool touchMove() const { return move() && touchEvent(); } | 70 bool touchMove() const { return move() && touchEvent(); } |
| 63 | 71 |
| 64 HitTestRequestType type() const { return m_requestType; } | 72 HitTestRequestType type() const { return m_requestType; } |
| 65 | 73 |
| 66 private: | 74 private: |
| 67 HitTestRequestType m_requestType; | 75 HitTestRequestType m_requestType; |
| 68 }; | 76 }; |
| 69 | 77 |
| 70 } // namespace blink | 78 } // namespace blink |
| 71 | 79 |
| 72 #endif // HitTestRequest_h | 80 #endif // HitTestRequest_h |
| OLD | NEW |