Changeset 117555 in webkit
- Timestamp:
- May 18, 2012 12:37:01 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ChangeLog
r117551 r117555 1 2012-05-18 Zalan Bujtas <zbujtas@gmail.com> 2 3 [Qt] Gesture tap highlighter needs to take overflow clip into account. 4 https://bugs.webkit.org/show_bug.cgi?id=84989 5 6 Reviewed by Kenneth Rohde Christiansen. 7 8 * ManualTests/qt/tap-highlighting-overflow-hidden.html: Added. 9 1 10 2012-05-18 Christophe Dumez <christophe.dumez@intel.com> 2 11 -
trunk/Source/WebCore/ChangeLog
r117549 r117555 1 2012-05-18 Zalan Bujtas <zbujtas@gmail.com> 2 3 [Qt] Gesture tap highlighter needs to take overflow clip into account. 4 https://bugs.webkit.org/show_bug.cgi?id=84989 5 6 Reviewed by Kenneth Rohde Christiansen. 7 8 Apply overflow clip on the focus ring if needed. 9 10 Follow up patches are needed to address the following cases. 11 12 [Qt] Gesture tap highlighter should take parent iframe's transform into account. 13 https://bugs.webkit.org/show_bug.cgi?id=86645 14 15 [Qt] Gesture tap highlighter needs to take frame clipping into account. 16 https://bugs.webkit.org/show_bug.cgi?id=86646 17 18 [Qt] Gesture tap highlighter's overflow clip is not always correct when 19 nested enclosing containers have transforms. 20 https://bugs.webkit.org/show_bug.cgi?id=86641 21 22 Manual test: ManualTests/qt/tap-highlighting-overflow-hidden.html 23 24 * page/GestureTapHighlighter.cpp: 25 (WebCore::GestureTapHighlighter::pathForNodeHighlight): 26 1 27 2012-05-17 Carlos Garcia Campos <cgarcia@igalia.com> 2 28 -
trunk/Source/WebCore/page/GestureTapHighlighter.cpp
r113990 r117555 40 40 #include "RenderBoxModelObject.h" 41 41 #include "RenderInline.h" 42 #include "RenderLayer.h" 42 43 #include "RenderObject.h" 43 44 … … 135 136 } 136 137 137 Path pathForRenderer(RenderObject*o)138 Path absolutePathForRenderer(RenderObject* const o) 138 139 { 139 140 ASSERT(o); 140 Path path;141 141 142 142 Vector<IntRect> rects; 143 o->addFocusRingRects(rects, /* acc. offset */ ownerFrameToMainFrameOffset(o)); 143 LayoutPoint frameOffset = ownerFrameToMainFrameOffset(o); 144 o->addFocusRingRects(rects, frameOffset); 144 145 145 146 if (rects.isEmpty()) 146 return path;147 return Path(); 147 148 148 149 // The basic idea is to allow up to three different boxes in order to highlight … … 185 186 } 186 187 188 // Clip the overflow rects if needed, before the ring path is formed to 189 // ensure rounded highlight rects. This clipping has the problem with nested 190 // divs with transforms, which could be resolved by proper Path::intersecting. 191 for (int i = drawableRects.size() - 1; i >= 0; --i) { 192 LayoutRect& ringRect = drawableRects.at(i); 193 LayoutPoint ringRectLocation = ringRect.location(); 194 195 ringRect.moveBy(-frameOffset); 196 197 RenderLayer* layer = o->enclosingLayer(); 198 RenderObject* currentRenderer = o; 199 200 // Check ancestor layers for overflow clip and intersect them. 201 while (layer) { 202 RenderObject* layerRenderer = layer->renderer(); 203 204 if (layerRenderer->hasOverflowClip() && layerRenderer != currentRenderer) { 205 ringRect.move(currentRenderer->offsetFromAncestorContainer(layerRenderer)); 206 currentRenderer = layerRenderer; 207 208 ASSERT(layerRenderer->isBox()); 209 ringRect.intersect(toRenderBox(layerRenderer)->borderBoxRect()); 210 211 if (ringRect.isEmpty()) 212 break; 213 } 214 layer = layer->parent(); 215 } 216 217 if (ringRect.isEmpty()) { 218 drawableRects.remove(i); 219 continue; 220 } 221 // After clipping, reset the original position so that parents' transforms apply correctly. 222 ringRect.setLocation(ringRectLocation); 223 } 224 225 Path path; 187 226 for (size_t i = 0; i < drawableRects.size(); ++i) { 188 227 LayoutRect prev = i ? drawableRects.at(i - 1) : LayoutRect(); … … 191 230 } 192 231 232 path.transform(localToAbsoluteTransform(o)); 193 233 return path; 194 234 } … … 202 242 RenderObject* renderer = node->renderer(); 203 243 204 Path path;205 244 if (!renderer || (!renderer->isBox() && !renderer->isRenderInline())) 206 return path; 207 208 path = pathForRenderer(renderer); 209 path.transform(localToAbsoluteTransform(renderer)); 210 211 return path; 245 return Path(); 246 247 return absolutePathForRenderer(renderer); 212 248 } 213 249
Note: See TracChangeset
for help on using the changeset viewer.