Index: Source/WebCore/testing/Internals.cpp |
=================================================================== |
--- Source/WebCore/testing/Internals.cpp (revision 138187) |
+++ Source/WebCore/testing/Internals.cpp (working copy) |
@@ -73,6 +73,7 @@ |
#include "RenderTreeAsText.h" |
#include "RuntimeEnabledFeatures.h" |
#include "SchemeRegistry.h" |
+#include "ScrollingCoordinator.h" |
#include "SelectRuleFeatureSet.h" |
#include "SerializedScriptValue.h" |
#include "Settings.h" |
@@ -1200,9 +1201,39 @@ |
return 0; |
} |
- return document->touchEventHandlerCount(); |
+ const TouchEventTargetSet* touchHandlers = document->touchEventTargets(); |
+ if (!touchHandlers) |
+ return 0; |
+ |
+ unsigned count = 0; |
+ for (TouchEventTargetSet::const_iterator iter = touchHandlers->begin(); iter != touchHandlers->end(); ++iter) |
+ count += iter->value; |
+ return count; |
} |
+#if ENABLE(TOUCH_EVENT_TRACKING) |
+PassRefPtr<ClientRectList> Internals::touchEventTargetClientRects(Document* document, ExceptionCode& ec) |
+{ |
+ if (!document || !document->view() || !document->page()) { |
+ ec = INVALID_ACCESS_ERR; |
+ return 0; |
+ } |
+ if (!document->page()->scrollingCoordinator()) |
+ return ClientRectList::create(); |
+ |
+ document->updateLayoutIgnorePendingStylesheets(); |
+ |
+ Vector<IntRect> absoluteRects; |
+ document->page()->scrollingCoordinator()->computeAbsoluteTouchEventTargetRects(document, absoluteRects); |
+ Vector<FloatQuad> absoluteQuads(absoluteRects.size()); |
+ |
+ for (size_t i = 0; i < absoluteRects.size(); ++i) |
+ absoluteQuads[i] = FloatQuad(absoluteRects[i]); |
+ |
+ return ClientRectList::create(absoluteQuads); |
+} |
+#endif |
+ |
PassRefPtr<NodeList> Internals::nodesFromRect(Document* document, int x, int y, unsigned topPadding, unsigned rightPadding, |
unsigned bottomPadding, unsigned leftPadding, bool ignoreClipping, bool allowShadowContent, ExceptionCode& ec) const |
{ |