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

Side by Side Diff: Source/core/testing/Internals.cpp

Issue 225903009: Migrate touch events to EventHandlerRegistry (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed HTMLInputElement adding handler at document destruction and removed dead oilpan code. Created 6 years, 5 months 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * Copyright (C) 2013 Apple Inc. All rights reserved. 3 * Copyright (C) 2013 Apple Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 1291 matching lines...) Expand 10 before | Expand all | Expand 10 after
1302 return eventHandlerCount(*document, EventHandlerRegistry::ScrollEvent); 1302 return eventHandlerCount(*document, EventHandlerRegistry::ScrollEvent);
1303 } 1303 }
1304 1304
1305 unsigned Internals::touchEventHandlerCount(Document* document, ExceptionState& e xceptionState) 1305 unsigned Internals::touchEventHandlerCount(Document* document, ExceptionState& e xceptionState)
1306 { 1306 {
1307 if (!document) { 1307 if (!document) {
1308 exceptionState.throwDOMException(InvalidAccessError, "No context documen t is available."); 1308 exceptionState.throwDOMException(InvalidAccessError, "No context documen t is available.");
1309 return 0; 1309 return 0;
1310 } 1310 }
1311 1311
1312 const TouchEventTargetSet* touchHandlers = document->touchEventTargets(); 1312 return eventHandlerCount(*document, EventHandlerRegistry::TouchEvent);
1313 if (!touchHandlers)
1314 return 0;
1315
1316 unsigned count = 0;
1317 for (TouchEventTargetSet::const_iterator iter = touchHandlers->begin(); iter != touchHandlers->end(); ++iter)
1318 count += iter->value;
1319 return count;
1320 } 1313 }
1321 1314
1322 static RenderLayer* findRenderLayerForGraphicsLayer(RenderLayer* searchRoot, Gra phicsLayer* graphicsLayer, IntSize* layerOffset, String* layerType) 1315 static RenderLayer* findRenderLayerForGraphicsLayer(RenderLayer* searchRoot, Gra phicsLayer* graphicsLayer, IntSize* layerOffset, String* layerType)
1323 { 1316 {
1324 *layerOffset = IntSize(); 1317 *layerOffset = IntSize();
1325 if (searchRoot->hasCompositedLayerMapping() && graphicsLayer == searchRoot-> compositedLayerMapping()->mainGraphicsLayer()) { 1318 if (searchRoot->hasCompositedLayerMapping() && graphicsLayer == searchRoot-> compositedLayerMapping()->mainGraphicsLayer()) {
1326 LayoutRect rect; 1319 LayoutRect rect;
1327 RenderLayer::mapRectToPaintBackingCoordinates(searchRoot->renderer(), re ct); 1320 RenderLayer::mapRectToPaintBackingCoordinates(searchRoot->renderer(), re ct);
1328 *layerOffset = IntSize(rect.x(), rect.y()); 1321 *layerOffset = IntSize(rect.x(), rect.y());
1329 return searchRoot; 1322 return searchRoot;
(...skipping 1025 matching lines...) Expand 10 before | Expand all | Expand 10 after
2355 } 2348 }
2356 networkStateNotifier().setWebConnectionTypeForTest(webtype); 2349 networkStateNotifier().setWebConnectionTypeForTest(webtype);
2357 } 2350 }
2358 2351
2359 unsigned Internals::countHitRegions(CanvasRenderingContext2D* context) 2352 unsigned Internals::countHitRegions(CanvasRenderingContext2D* context)
2360 { 2353 {
2361 return context->hitRegionsCount(); 2354 return context->hitRegionsCount();
2362 } 2355 }
2363 2356
2364 } // namespace WebCore 2357 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698