OLD | NEW |
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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 #include "core/css/resolver/StyleResolver.h" | 50 #include "core/css/resolver/StyleResolver.h" |
51 #include "core/css/resolver/StyleResolverStats.h" | 51 #include "core/css/resolver/StyleResolverStats.h" |
52 #include "core/css/resolver/ViewportStyleResolver.h" | 52 #include "core/css/resolver/ViewportStyleResolver.h" |
53 #include "core/dom/ClientRect.h" | 53 #include "core/dom/ClientRect.h" |
54 #include "core/dom/ClientRectList.h" | 54 #include "core/dom/ClientRectList.h" |
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/EventHandlerRegistry.h" |
60 #include "core/dom/ExceptionCode.h" | 61 #include "core/dom/ExceptionCode.h" |
61 #include "core/dom/FullscreenElementStack.h" | 62 #include "core/dom/FullscreenElementStack.h" |
62 #include "core/dom/NodeRenderStyle.h" | 63 #include "core/dom/NodeRenderStyle.h" |
63 #include "core/dom/PseudoElement.h" | 64 #include "core/dom/PseudoElement.h" |
64 #include "core/dom/Range.h" | 65 #include "core/dom/Range.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/shadow/ComposedTreeWalker.h" | 69 #include "core/dom/shadow/ComposedTreeWalker.h" |
70 #include "core/dom/shadow/ElementShadow.h" | 70 #include "core/dom/shadow/ElementShadow.h" |
71 #include "core/dom/shadow/SelectRuleFeatureSet.h" | 71 #include "core/dom/shadow/SelectRuleFeatureSet.h" |
72 #include "core/dom/shadow/ShadowRoot.h" | 72 #include "core/dom/shadow/ShadowRoot.h" |
73 #include "core/editing/Editor.h" | 73 #include "core/editing/Editor.h" |
74 #include "core/editing/PlainTextRange.h" | 74 #include "core/editing/PlainTextRange.h" |
75 #include "core/editing/SpellCheckRequester.h" | 75 #include "core/editing/SpellCheckRequester.h" |
76 #include "core/editing/SpellChecker.h" | 76 #include "core/editing/SpellChecker.h" |
77 #include "core/editing/SurroundingText.h" | 77 #include "core/editing/SurroundingText.h" |
78 #include "core/editing/TextIterator.h" | 78 #include "core/editing/TextIterator.h" |
(...skipping 1198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1277 return document->activeDOMObjectCount(); | 1277 return document->activeDOMObjectCount(); |
1278 } | 1278 } |
1279 | 1279 |
1280 unsigned Internals::wheelEventHandlerCount(Document* document, ExceptionState& e
xceptionState) | 1280 unsigned Internals::wheelEventHandlerCount(Document* document, ExceptionState& e
xceptionState) |
1281 { | 1281 { |
1282 if (!document) { | 1282 if (!document) { |
1283 exceptionState.throwDOMException(InvalidAccessError, "No context documen
t is available."); | 1283 exceptionState.throwDOMException(InvalidAccessError, "No context documen
t is available."); |
1284 return 0; | 1284 return 0; |
1285 } | 1285 } |
1286 | 1286 |
1287 return WheelController::from(*document)->wheelEventHandlerCount(); | 1287 return EventHandlerRegistry::from(*document)->eventHandlerCount(EventHandler
Registry::WheelEvent); |
| 1288 } |
| 1289 |
| 1290 unsigned Internals::scrollEventHandlerCount(Document* document, ExceptionState&
exceptionState) |
| 1291 { |
| 1292 if (!document) { |
| 1293 exceptionState.throwDOMException(InvalidAccessError, "No context documen
t is available."); |
| 1294 return 0; |
| 1295 } |
| 1296 |
| 1297 return EventHandlerRegistry::from(*document)->eventHandlerCount(EventHandler
Registry::ScrollEvent); |
1288 } | 1298 } |
1289 | 1299 |
1290 unsigned Internals::touchEventHandlerCount(Document* document, ExceptionState& e
xceptionState) | 1300 unsigned Internals::touchEventHandlerCount(Document* document, ExceptionState& e
xceptionState) |
1291 { | 1301 { |
1292 if (!document) { | 1302 if (!document) { |
1293 exceptionState.throwDOMException(InvalidAccessError, "No context documen
t is available."); | 1303 exceptionState.throwDOMException(InvalidAccessError, "No context documen
t is available."); |
1294 return 0; | 1304 return 0; |
1295 } | 1305 } |
1296 | 1306 |
1297 const TouchEventTargetSet* touchHandlers = document->touchEventTargets(); | 1307 return EventHandlerRegistry::from(*document)->eventHandlerCount(EventHandler
Registry::TouchEvent); |
1298 if (!touchHandlers) | |
1299 return 0; | |
1300 | |
1301 unsigned count = 0; | |
1302 for (TouchEventTargetSet::const_iterator iter = touchHandlers->begin(); iter
!= touchHandlers->end(); ++iter) | |
1303 count += iter->value; | |
1304 return count; | |
1305 } | 1308 } |
1306 | 1309 |
1307 static RenderLayer* findRenderLayerForGraphicsLayer(RenderLayer* searchRoot, Gra
phicsLayer* graphicsLayer, String* layerType) | 1310 static RenderLayer* findRenderLayerForGraphicsLayer(RenderLayer* searchRoot, Gra
phicsLayer* graphicsLayer, String* layerType) |
1308 { | 1311 { |
1309 if (searchRoot->hasCompositedLayerMapping() && graphicsLayer == searchRoot->
compositedLayerMapping()->mainGraphicsLayer()) | 1312 if (searchRoot->hasCompositedLayerMapping() && graphicsLayer == searchRoot->
compositedLayerMapping()->mainGraphicsLayer()) |
1310 return searchRoot; | 1313 return searchRoot; |
1311 | 1314 |
1312 GraphicsLayer* layerForScrolling = searchRoot->scrollableArea() ? searchRoot
->scrollableArea()->layerForScrolling() : 0; | 1315 GraphicsLayer* layerForScrolling = searchRoot->scrollableArea() ? searchRoot
->scrollableArea()->layerForScrolling() : 0; |
1313 if (graphicsLayer == layerForScrolling) { | 1316 if (graphicsLayer == layerForScrolling) { |
1314 *layerType = "scrolling"; | 1317 *layerType = "scrolling"; |
(...skipping 1128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2443 } | 2446 } |
2444 | 2447 |
2445 String Internals::textSurroundingNode(Node* node, int x, int y, unsigned long ma
xLength) | 2448 String Internals::textSurroundingNode(Node* node, int x, int y, unsigned long ma
xLength) |
2446 { | 2449 { |
2447 blink::WebPoint point(x, y); | 2450 blink::WebPoint point(x, y); |
2448 SurroundingText surroundingText(VisiblePosition(node->renderer()->positionFo
rPoint(static_cast<IntPoint>(point))), maxLength); | 2451 SurroundingText surroundingText(VisiblePosition(node->renderer()->positionFo
rPoint(static_cast<IntPoint>(point))), maxLength); |
2449 return surroundingText.content(); | 2452 return surroundingText.content(); |
2450 } | 2453 } |
2451 | 2454 |
2452 } | 2455 } |
OLD | NEW |