| 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 1145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1156 unsigned Internals::touchEventHandlerCount(Document* document) | 1156 unsigned Internals::touchEventHandlerCount(Document* document) |
| 1157 { | 1157 { |
| 1158 ASSERT(document); | 1158 ASSERT(document); |
| 1159 return eventHandlerCount(*document, EventHandlerRegistry::TouchEvent); | 1159 return eventHandlerCount(*document, EventHandlerRegistry::TouchEvent); |
| 1160 } | 1160 } |
| 1161 | 1161 |
| 1162 static DeprecatedPaintLayer* findLayerForGraphicsLayer(DeprecatedPaintLayer* sea
rchRoot, GraphicsLayer* graphicsLayer, IntSize* layerOffset, String* layerType) | 1162 static DeprecatedPaintLayer* findLayerForGraphicsLayer(DeprecatedPaintLayer* sea
rchRoot, GraphicsLayer* graphicsLayer, IntSize* layerOffset, String* layerType) |
| 1163 { | 1163 { |
| 1164 *layerOffset = IntSize(); | 1164 *layerOffset = IntSize(); |
| 1165 if (searchRoot->hasCompositedDeprecatedPaintLayerMapping() && graphicsLayer
== searchRoot->compositedDeprecatedPaintLayerMapping()->mainGraphicsLayer()) { | 1165 if (searchRoot->hasCompositedDeprecatedPaintLayerMapping() && graphicsLayer
== searchRoot->compositedDeprecatedPaintLayerMapping()->mainGraphicsLayer()) { |
| 1166 // If the |graphicsLayer| sets the scrollingContent layer as its |
| 1167 // scroll parent, consider it belongs to the scrolling layer and |
| 1168 // mark the layer type as "scrolling". |
| 1169 if (!searchRoot->layoutObject()->hasTransformRelatedProperty() && search
Root->scrollParent() && searchRoot->parent() == searchRoot->scrollParent()) { |
| 1170 *layerType = "scrolling"; |
| 1171 // For hit-test rect visualization to work, the hit-test rect should |
| 1172 // be relative to the scrolling layer and in this case the hit-test |
| 1173 // rect is relative to the element's own GraphicsLayer. So we will h
ave |
| 1174 // to adjust the rect to be relative to the scrolling layer here. |
| 1175 // Only when the element's offsetParent == scroller's offsetParent w
e |
| 1176 // can compute the element's relative position to the scrolling cont
ent |
| 1177 // in this way. |
| 1178 if (searchRoot->layoutObject()->offsetParent() == searchRoot->parent
()->layoutObject()->offsetParent()) { |
| 1179 LayoutBoxModelObject* current = searchRoot->layoutObject(); |
| 1180 LayoutBoxModelObject* parent = searchRoot->parent()->layoutObjec
t(); |
| 1181 layerOffset->setWidth((parent->offsetLeft() - current->offsetLef
t()).toInt()); |
| 1182 layerOffset->setHeight((parent->offsetTop() - current->offsetTop
()).toInt()); |
| 1183 return searchRoot->parent(); |
| 1184 } |
| 1185 } |
| 1186 |
| 1166 LayoutRect rect; | 1187 LayoutRect rect; |
| 1167 DeprecatedPaintLayer::mapRectToPaintBackingCoordinates(searchRoot->layou
tObject(), rect); | 1188 DeprecatedPaintLayer::mapRectToPaintBackingCoordinates(searchRoot->layou
tObject(), rect); |
| 1168 *layerOffset = IntSize(rect.x(), rect.y()); | 1189 *layerOffset = IntSize(rect.x(), rect.y()); |
| 1169 return searchRoot; | 1190 return searchRoot; |
| 1170 } | 1191 } |
| 1171 | 1192 |
| 1193 // If the |graphicsLayer| is a scroller's scrollingContent layer, |
| 1194 // consider this is a scrolling layer. |
| 1172 GraphicsLayer* layerForScrolling = searchRoot->scrollableArea() ? searchRoot
->scrollableArea()->layerForScrolling() : 0; | 1195 GraphicsLayer* layerForScrolling = searchRoot->scrollableArea() ? searchRoot
->scrollableArea()->layerForScrolling() : 0; |
| 1173 if (graphicsLayer == layerForScrolling) { | 1196 if (graphicsLayer == layerForScrolling) { |
| 1174 *layerType = "scrolling"; | 1197 *layerType = "scrolling"; |
| 1175 return searchRoot; | 1198 return searchRoot; |
| 1176 } | 1199 } |
| 1177 | 1200 |
| 1178 if (searchRoot->compositingState() == PaintsIntoGroupedBacking) { | 1201 if (searchRoot->compositingState() == PaintsIntoGroupedBacking) { |
| 1179 GraphicsLayer* squashingLayer = searchRoot->groupedMapping()->squashingL
ayer(); | 1202 GraphicsLayer* squashingLayer = searchRoot->groupedMapping()->squashingL
ayer(); |
| 1180 if (graphicsLayer == squashingLayer) { | 1203 if (graphicsLayer == squashingLayer) { |
| 1181 *layerType ="squashing"; | 1204 *layerType ="squashing"; |
| (...skipping 1131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2313 | 2336 |
| 2314 ClientRectList* Internals::focusRingRects(Element* element) | 2337 ClientRectList* Internals::focusRingRects(Element* element) |
| 2315 { | 2338 { |
| 2316 Vector<LayoutRect> rects; | 2339 Vector<LayoutRect> rects; |
| 2317 if (element && element->layoutObject()) | 2340 if (element && element->layoutObject()) |
| 2318 element->layoutObject()->addFocusRingRects(rects, LayoutPoint()); | 2341 element->layoutObject()->addFocusRingRects(rects, LayoutPoint()); |
| 2319 return ClientRectList::create(rects); | 2342 return ClientRectList::create(rects); |
| 2320 } | 2343 } |
| 2321 | 2344 |
| 2322 } // namespace blink | 2345 } // namespace blink |
| OLD | NEW |