OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2011 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 return nonFastScrollableRegion; | 178 return nonFastScrollableRegion; |
179 } | 179 } |
180 | 180 |
181 #if ENABLE(TOUCH_EVENT_TRACKING) | 181 #if ENABLE(TOUCH_EVENT_TRACKING) |
182 static void accumulateRendererTouchEventTargetRects(Vector<IntRect>& rects, cons
t RenderObject* renderer, const IntRect& parentRect = IntRect()) | 182 static void accumulateRendererTouchEventTargetRects(Vector<IntRect>& rects, cons
t RenderObject* renderer, const IntRect& parentRect = IntRect()) |
183 { | 183 { |
184 IntRect adjustedParentRect = parentRect; | 184 IntRect adjustedParentRect = parentRect; |
185 if (parentRect.isEmpty() || renderer->isFloating() || renderer->isPositioned
() || renderer->hasTransform()) { | 185 if (parentRect.isEmpty() || renderer->isFloating() || renderer->isPositioned
() || renderer->hasTransform()) { |
186 // FIXME: This method is O(N^2) as it walks the tree to the root for eve
ry renderer. RenderGeometryMap would fix this. | 186 // FIXME: This method is O(N^2) as it walks the tree to the root for eve
ry renderer. RenderGeometryMap would fix this. |
187 IntRect r = enclosingIntRect(renderer->clippedOverflowRectForRepaint(0))
; | 187 IntRect r = enclosingIntRect(renderer->clippedOverflowRectForRepaint(0))
; |
188 if (!r.isEmpty() && !parentRect.contains(r)) { | 188 if (!r.isEmpty()) { |
189 rects.append(r); | 189 // Convert to the top-level view's coordinates. |
190 adjustedParentRect = r; | 190 ASSERT(renderer->document()->view()); |
| 191 for (ScrollView* view = renderer->document()->view(); view && view->
parent(); view = view->parent()) |
| 192 r = view->convertToContainingView(r); |
| 193 |
| 194 if (!parentRect.contains(r)) { |
| 195 rects.append(r); |
| 196 adjustedParentRect = r; |
| 197 } |
191 } | 198 } |
192 } | 199 } |
193 | 200 |
194 for (RenderObject* child = renderer->firstChild(); child; child = child->nex
tSibling()) | 201 for (RenderObject* child = renderer->firstChild(); child; child = child->nex
tSibling()) |
195 accumulateRendererTouchEventTargetRects(rects, child, adjustedParentRect
); | 202 accumulateRendererTouchEventTargetRects(rects, child, adjustedParentRect
); |
196 } | 203 } |
197 | 204 |
198 static void accumulateDocumentEventTargetRects(Vector<IntRect>& rects, const Doc
ument* document) | 205 static void accumulateDocumentEventTargetRects(Vector<IntRect>& rects, const Doc
ument* document) |
199 { | 206 { |
200 ASSERT(document); | 207 ASSERT(document); |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
474 stringBuilder.resize(stringBuilder.length() - 2); | 481 stringBuilder.resize(stringBuilder.length() - 2); |
475 return stringBuilder.toString(); | 482 return stringBuilder.toString(); |
476 } | 483 } |
477 | 484 |
478 String ScrollingCoordinator::mainThreadScrollingReasonsAsText() const | 485 String ScrollingCoordinator::mainThreadScrollingReasonsAsText() const |
479 { | 486 { |
480 return mainThreadScrollingReasonsAsText(mainThreadScrollingReasons()); | 487 return mainThreadScrollingReasonsAsText(mainThreadScrollingReasons()); |
481 } | 488 } |
482 | 489 |
483 } // namespace WebCore | 490 } // namespace WebCore |
OLD | NEW |