| 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 1261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1272 ASSERT(document); | 1272 ASSERT(document); |
| 1273 return eventHandlerCount(*document, EventHandlerRegistry::WheelEventBlocking
); | 1273 return eventHandlerCount(*document, EventHandlerRegistry::WheelEventBlocking
); |
| 1274 } | 1274 } |
| 1275 | 1275 |
| 1276 unsigned Internals::scrollEventHandlerCount(Document* document) | 1276 unsigned Internals::scrollEventHandlerCount(Document* document) |
| 1277 { | 1277 { |
| 1278 ASSERT(document); | 1278 ASSERT(document); |
| 1279 return eventHandlerCount(*document, EventHandlerRegistry::ScrollEvent); | 1279 return eventHandlerCount(*document, EventHandlerRegistry::ScrollEvent); |
| 1280 } | 1280 } |
| 1281 | 1281 |
| 1282 unsigned Internals::blockingTouchStartOrMoveEventHandlerCount(Document* document
) |
| 1283 { |
| 1284 DCHECK(document); |
| 1285 return eventHandlerCount(*document, EventHandlerRegistry::TouchStartOrMoveEv
entBlocking); |
| 1286 } |
| 1287 |
| 1288 unsigned Internals::passiveTouchStartOrMoveEventHandlerCount(Document* document) |
| 1289 { |
| 1290 DCHECK(document); |
| 1291 return eventHandlerCount(*document, EventHandlerRegistry::TouchStartOrMoveEv
entPassive); |
| 1292 } |
| 1293 |
| 1282 unsigned Internals::touchStartOrMoveEventHandlerCount(Document* document) | 1294 unsigned Internals::touchStartOrMoveEventHandlerCount(Document* document) |
| 1283 { | 1295 { |
| 1284 ASSERT(document); | 1296 ASSERT(document); |
| 1285 return eventHandlerCount(*document, EventHandlerRegistry::TouchStartOrMoveEv
entBlocking) + eventHandlerCount(*document, EventHandlerRegistry::TouchStartOrMo
veEventPassive); | 1297 return eventHandlerCount(*document, EventHandlerRegistry::TouchStartOrMoveEv
entBlocking) + eventHandlerCount(*document, EventHandlerRegistry::TouchStartOrMo
veEventPassive); |
| 1286 } | 1298 } |
| 1287 | 1299 |
| 1288 unsigned Internals::touchEndOrCancelEventHandlerCount(Document* document) | 1300 unsigned Internals::touchEndOrCancelEventHandlerCount(Document* document) |
| 1289 { | 1301 { |
| 1290 ASSERT(document); | 1302 ASSERT(document); |
| 1291 return eventHandlerCount(*document, EventHandlerRegistry::TouchEndOrCancelEv
entBlocking) + eventHandlerCount(*document, EventHandlerRegistry::TouchEndOrCanc
elEventPassive); | 1303 return eventHandlerCount(*document, EventHandlerRegistry::TouchEndOrCancelEv
entBlocking) + eventHandlerCount(*document, EventHandlerRegistry::TouchEndOrCanc
elEventPassive); |
| 1292 } | 1304 } |
| 1293 | 1305 |
| 1306 String toTouchActionString(TouchAction TouchAction) |
| 1307 { |
| 1308 switch (TouchAction) { |
| 1309 case TouchActionNone: |
| 1310 return "none"; |
| 1311 case TouchActionPanLeft: |
| 1312 return "pan-left"; |
| 1313 case TouchActionPanRight: |
| 1314 return "pan-right"; |
| 1315 case TouchActionPanX: |
| 1316 return "pan-x"; |
| 1317 case TouchActionPanUp: |
| 1318 return "pan-up"; |
| 1319 case TouchActionPanDown: |
| 1320 return "pan-down"; |
| 1321 case TouchActionPanY: |
| 1322 return "pan-y"; |
| 1323 case TouchActionPan: |
| 1324 return "pan"; |
| 1325 case TouchActionPinchZoom: |
| 1326 return "pinch-zoom"; |
| 1327 case TouchActionManipulation: |
| 1328 return "manipulation"; |
| 1329 case TouchActionDoubleTapZoom: |
| 1330 return "double-tap-zoom"; |
| 1331 case TouchActionAuto: |
| 1332 return "auto"; |
| 1333 default: |
| 1334 return ""; |
| 1335 } |
| 1336 } |
| 1337 |
| 1338 String Internals::touchActionType(Element* inputElement) |
| 1339 { |
| 1340 DCHECK(inputElement && inputElement->layoutObject()); |
| 1341 return toTouchActionString(inputElement->layoutObject()->styleRef().getTouch
Action()); |
| 1342 } |
| 1343 |
| 1294 static PaintLayer* findLayerForGraphicsLayer(PaintLayer* searchRoot, GraphicsLay
er* graphicsLayer, IntSize* layerOffset, String* layerType) | 1344 static PaintLayer* findLayerForGraphicsLayer(PaintLayer* searchRoot, GraphicsLay
er* graphicsLayer, IntSize* layerOffset, String* layerType) |
| 1295 { | 1345 { |
| 1296 *layerOffset = IntSize(); | 1346 *layerOffset = IntSize(); |
| 1297 if (searchRoot->hasCompositedLayerMapping() && graphicsLayer == searchRoot->
compositedLayerMapping()->mainGraphicsLayer()) { | 1347 if (searchRoot->hasCompositedLayerMapping() && graphicsLayer == searchRoot->
compositedLayerMapping()->mainGraphicsLayer()) { |
| 1298 // If the |graphicsLayer| sets the scrollingContent layer as its | 1348 // If the |graphicsLayer| sets the scrollingContent layer as its |
| 1299 // scroll parent, consider it belongs to the scrolling layer and | 1349 // scroll parent, consider it belongs to the scrolling layer and |
| 1300 // mark the layer type as "scrolling". | 1350 // mark the layer type as "scrolling". |
| 1301 if (!searchRoot->layoutObject()->hasTransformRelatedProperty() && search
Root->scrollParent() && searchRoot->parent() == searchRoot->scrollParent()) { | 1351 if (!searchRoot->layoutObject()->hasTransformRelatedProperty() && search
Root->scrollParent() && searchRoot->parent() == searchRoot->scrollParent()) { |
| 1302 *layerType = "scrolling"; | 1352 *layerType = "scrolling"; |
| 1303 // For hit-test rect visualization to work, the hit-test rect should | 1353 // For hit-test rect visualization to work, the hit-test rect should |
| (...skipping 1309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2613 } | 2663 } |
| 2614 | 2664 |
| 2615 String Internals::getProgrammaticScrollAnimationState(Node* node) const | 2665 String Internals::getProgrammaticScrollAnimationState(Node* node) const |
| 2616 { | 2666 { |
| 2617 if (ScrollableArea* scrollableArea = scrollableAreaForNode(node)) | 2667 if (ScrollableArea* scrollableArea = scrollableAreaForNode(node)) |
| 2618 return scrollableArea->programmaticScrollAnimator().runStateAsText(); | 2668 return scrollableArea->programmaticScrollAnimator().runStateAsText(); |
| 2619 return String(); | 2669 return String(); |
| 2620 } | 2670 } |
| 2621 | 2671 |
| 2622 } // namespace blink | 2672 } // namespace blink |
| OLD | NEW |