Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(627)

Side by Side Diff: Source/core/rendering/PointerEventsHitRules.cpp

Issue 45733010: Add pointer-events="bounding-box" for svg content. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: make assert more specific Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 Copyright (C) 2007 Rob Buis <buis@kde.org> 2 Copyright (C) 2007 Rob Buis <buis@kde.org>
3 3
4 This library is free software; you can redistribute it and/or 4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public 5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either 6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version. 7 version 2 of the License, or (at your option) any later version.
8 8
9 This library is distributed in the hope that it will be useful, 9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of 10 but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 10 matching lines...) Expand all
21 #include "core/rendering/PointerEventsHitRules.h" 21 #include "core/rendering/PointerEventsHitRules.h"
22 22
23 namespace WebCore { 23 namespace WebCore {
24 24
25 PointerEventsHitRules::PointerEventsHitRules(EHitTesting hitTesting, const HitTe stRequest& request, EPointerEvents pointerEvents) 25 PointerEventsHitRules::PointerEventsHitRules(EHitTesting hitTesting, const HitTe stRequest& request, EPointerEvents pointerEvents)
26 : requireVisible(false) 26 : requireVisible(false)
27 , requireFill(false) 27 , requireFill(false)
28 , requireStroke(false) 28 , requireStroke(false)
29 , canHitStroke(false) 29 , canHitStroke(false)
30 , canHitFill(false) 30 , canHitFill(false)
31 , canHitBoundingBox(false)
31 { 32 {
32 if (request.svgClipContent()) 33 if (request.svgClipContent())
33 pointerEvents = PE_FILL; 34 pointerEvents = PE_FILL;
34 35
35 if (hitTesting == SVG_GEOMETRY_HITTESTING) { 36 if (hitTesting == SVG_GEOMETRY_HITTESTING) {
36 switch (pointerEvents) 37 switch (pointerEvents)
37 { 38 {
39 case PE_BOUNDINGBOX:
40 canHitBoundingBox = true;
41 break;
38 case PE_VISIBLE_PAINTED: 42 case PE_VISIBLE_PAINTED:
39 case PE_AUTO: // "auto" is like "visiblePainted" when in SVG content 43 case PE_AUTO: // "auto" is like "visiblePainted" when in SVG content
40 requireFill = true; 44 requireFill = true;
41 requireStroke = true; 45 requireStroke = true;
42 case PE_VISIBLE: 46 case PE_VISIBLE:
43 requireVisible = true; 47 requireVisible = true;
44 canHitFill = true; 48 canHitFill = true;
45 canHitStroke = true; 49 canHitStroke = true;
46 break; 50 break;
47 case PE_VISIBLE_FILL: 51 case PE_VISIBLE_FILL:
(...skipping 17 matching lines...) Expand all
65 case PE_STROKE: 69 case PE_STROKE:
66 canHitStroke = true; 70 canHitStroke = true;
67 break; 71 break;
68 case PE_NONE: 72 case PE_NONE:
69 // nothing to do here, defaults are all false. 73 // nothing to do here, defaults are all false.
70 break; 74 break;
71 } 75 }
72 } else { 76 } else {
73 switch (pointerEvents) 77 switch (pointerEvents)
74 { 78 {
79 case PE_BOUNDINGBOX:
80 canHitBoundingBox = true;
81 break;
75 case PE_VISIBLE_PAINTED: 82 case PE_VISIBLE_PAINTED:
76 case PE_AUTO: // "auto" is like "visiblePainted" when in SVG content 83 case PE_AUTO: // "auto" is like "visiblePainted" when in SVG content
77 requireVisible = true; 84 requireVisible = true;
78 requireFill = true; 85 requireFill = true;
79 requireStroke = true; 86 requireStroke = true;
80 canHitFill = true; 87 canHitFill = true;
81 canHitStroke = true; 88 canHitStroke = true;
82 break; 89 break;
83 case PE_VISIBLE_FILL: 90 case PE_VISIBLE_FILL:
84 case PE_VISIBLE_STROKE: 91 case PE_VISIBLE_STROKE:
(...skipping 17 matching lines...) Expand all
102 case PE_NONE: 109 case PE_NONE:
103 // nothing to do here, defaults are all false. 110 // nothing to do here, defaults are all false.
104 break; 111 break;
105 } 112 }
106 } 113 }
107 } 114 }
108 115
109 } 116 }
110 117
111 // vim:ts=4:noet 118 // vim:ts=4:noet
OLDNEW
« no previous file with comments | « Source/core/rendering/PointerEventsHitRules.h ('k') | Source/core/rendering/style/RenderStyleConstants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698