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

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

Issue 206603002: Add EventHandlerRegistry (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Tests. Created 6 years, 9 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
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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 #include "core/dom/DOMStringList.h" 55 #include "core/dom/DOMStringList.h"
56 #include "core/dom/Document.h" 56 #include "core/dom/Document.h"
57 #include "core/dom/DocumentMarker.h" 57 #include "core/dom/DocumentMarker.h"
58 #include "core/dom/DocumentMarkerController.h" 58 #include "core/dom/DocumentMarkerController.h"
59 #include "core/dom/Element.h" 59 #include "core/dom/Element.h"
60 #include "core/dom/ExceptionCode.h" 60 #include "core/dom/ExceptionCode.h"
61 #include "core/dom/FullscreenElementStack.h" 61 #include "core/dom/FullscreenElementStack.h"
62 #include "core/dom/NodeRenderStyle.h" 62 #include "core/dom/NodeRenderStyle.h"
63 #include "core/dom/PseudoElement.h" 63 #include "core/dom/PseudoElement.h"
64 #include "core/dom/Range.h" 64 #include "core/dom/Range.h"
65 #include "core/dom/ScrollEventHandlerController.h"
65 #include "core/dom/StaticNodeList.h" 66 #include "core/dom/StaticNodeList.h"
66 #include "core/dom/TreeScope.h" 67 #include "core/dom/TreeScope.h"
67 #include "core/dom/ViewportDescription.h" 68 #include "core/dom/ViewportDescription.h"
68 #include "core/dom/WheelController.h" 69 #include "core/dom/WheelController.h"
69 #include "core/dom/shadow/ComposedTreeWalker.h" 70 #include "core/dom/shadow/ComposedTreeWalker.h"
70 #include "core/dom/shadow/ElementShadow.h" 71 #include "core/dom/shadow/ElementShadow.h"
71 #include "core/dom/shadow/SelectRuleFeatureSet.h" 72 #include "core/dom/shadow/SelectRuleFeatureSet.h"
72 #include "core/dom/shadow/ShadowRoot.h" 73 #include "core/dom/shadow/ShadowRoot.h"
73 #include "core/editing/Editor.h" 74 #include "core/editing/Editor.h"
74 #include "core/editing/PlainTextRange.h" 75 #include "core/editing/PlainTextRange.h"
(...skipping 1205 matching lines...) Expand 10 before | Expand all | Expand 10 after
1280 unsigned Internals::wheelEventHandlerCount(Document* document, ExceptionState& e xceptionState) 1281 unsigned Internals::wheelEventHandlerCount(Document* document, ExceptionState& e xceptionState)
1281 { 1282 {
1282 if (!document) { 1283 if (!document) {
1283 exceptionState.throwDOMException(InvalidAccessError, "No context documen t is available."); 1284 exceptionState.throwDOMException(InvalidAccessError, "No context documen t is available.");
1284 return 0; 1285 return 0;
1285 } 1286 }
1286 1287
1287 return WheelController::from(*document)->wheelEventHandlerCount(); 1288 return WheelController::from(*document)->wheelEventHandlerCount();
1288 } 1289 }
1289 1290
1291 unsigned Internals::scrollEventHandlerCount(Document* document, ExceptionState& exceptionState)
1292 {
1293 if (!document) {
1294 exceptionState.throwDOMException(InvalidAccessError, "No context documen t is available.");
1295 return 0;
1296 }
1297
1298 return ScrollEventHandlerController::from(*document)->scrollEventHandlerCoun t();
1299 }
1300
1290 unsigned Internals::touchEventHandlerCount(Document* document, ExceptionState& e xceptionState) 1301 unsigned Internals::touchEventHandlerCount(Document* document, ExceptionState& e xceptionState)
1291 { 1302 {
1292 if (!document) { 1303 if (!document) {
1293 exceptionState.throwDOMException(InvalidAccessError, "No context documen t is available."); 1304 exceptionState.throwDOMException(InvalidAccessError, "No context documen t is available.");
1294 return 0; 1305 return 0;
1295 } 1306 }
1296 1307
1297 const TouchEventTargetSet* touchHandlers = document->touchEventTargets(); 1308 const TouchEventTargetSet* touchHandlers = document->touchEventTargets();
1298 if (!touchHandlers) 1309 if (!touchHandlers)
1299 return 0; 1310 return 0;
(...skipping 1139 matching lines...) Expand 10 before | Expand all | Expand 10 after
2439 } 2450 }
2440 2451
2441 String Internals::textSurroundingNode(Node* node, int x, int y, unsigned long ma xLength) 2452 String Internals::textSurroundingNode(Node* node, int x, int y, unsigned long ma xLength)
2442 { 2453 {
2443 blink::WebPoint point(x, y); 2454 blink::WebPoint point(x, y);
2444 SurroundingText surroundingText(VisiblePosition(node->renderer()->positionFo rPoint(static_cast<IntPoint>(point))), maxLength); 2455 SurroundingText surroundingText(VisiblePosition(node->renderer()->positionFo rPoint(static_cast<IntPoint>(point))), maxLength);
2445 return surroundingText.content(); 2456 return surroundingText.content();
2446 } 2457 }
2447 2458
2448 } 2459 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698