| 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 1239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1250 return 0; | 1250 return 0; |
| 1251 | 1251 |
| 1252 unsigned count = 0; | 1252 unsigned count = 0; |
| 1253 for (TouchEventTargetSet::const_iterator iter = touchHandlers->begin(); iter
!= touchHandlers->end(); ++iter) | 1253 for (TouchEventTargetSet::const_iterator iter = touchHandlers->begin(); iter
!= touchHandlers->end(); ++iter) |
| 1254 count += iter->value; | 1254 count += iter->value; |
| 1255 return count; | 1255 return count; |
| 1256 } | 1256 } |
| 1257 | 1257 |
| 1258 static RenderLayer* findRenderLayerForGraphicsLayer(RenderLayer* searchRoot, Gra
phicsLayer* graphicsLayer, String* layerType) | 1258 static RenderLayer* findRenderLayerForGraphicsLayer(RenderLayer* searchRoot, Gra
phicsLayer* graphicsLayer, String* layerType) |
| 1259 { | 1259 { |
| 1260 if (searchRoot->compositedLayerMapping() && graphicsLayer == searchRoot->com
positedLayerMapping()->mainGraphicsLayer()) | 1260 // Note, we only want to return the RenderLayer that _truly_ owns the Graphi
csLayer, not just the |
| 1261 // first RenderLayer we encounter that paints into it. |
| 1262 if (searchRoot->compositingState() == PaintsIntoOwnBacking && graphicsLayer
== searchRoot->compositedLayerMapping()->mainGraphicsLayer()) |
| 1261 return searchRoot; | 1263 return searchRoot; |
| 1262 | 1264 |
| 1263 GraphicsLayer* layerForScrolling = searchRoot->scrollableArea() ? searchRoot
->scrollableArea()->layerForScrolling() : 0; | 1265 GraphicsLayer* layerForScrolling = searchRoot->scrollableArea() ? searchRoot
->scrollableArea()->layerForScrolling() : 0; |
| 1264 if (graphicsLayer == layerForScrolling) { | 1266 if (graphicsLayer == layerForScrolling) { |
| 1265 *layerType = "scrolling"; | 1267 *layerType = "scrolling"; |
| 1266 return searchRoot; | 1268 return searchRoot; |
| 1267 } | 1269 } |
| 1268 | 1270 |
| 1269 GraphicsLayer* layerForHorizontalScrollbar = searchRoot->scrollableArea() ?
searchRoot->scrollableArea()->layerForHorizontalScrollbar() : 0; | 1271 GraphicsLayer* layerForHorizontalScrollbar = searchRoot->scrollableArea() ?
searchRoot->scrollableArea()->layerForHorizontalScrollbar() : 0; |
| 1270 if (graphicsLayer == layerForHorizontalScrollbar) { | 1272 if (graphicsLayer == layerForHorizontalScrollbar) { |
| (...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1733 element->document().updateLayout(); | 1735 element->document().updateLayout(); |
| 1734 | 1736 |
| 1735 RenderObject* renderer = element->renderer(); | 1737 RenderObject* renderer = element->renderer(); |
| 1736 if (!renderer || !renderer->isBox()) { | 1738 if (!renderer || !renderer->isBox()) { |
| 1737 es.throwUninformativeAndGenericDOMException(InvalidAccessError); | 1739 es.throwUninformativeAndGenericDOMException(InvalidAccessError); |
| 1738 return String(); | 1740 return String(); |
| 1739 } | 1741 } |
| 1740 | 1742 |
| 1741 RenderLayer* layer = toRenderBox(renderer)->layer(); | 1743 RenderLayer* layer = toRenderBox(renderer)->layer(); |
| 1742 if (!layer | 1744 if (!layer |
| 1743 || !layer->compositedLayerMapping() | 1745 || !layer->hasCompositedLayerMapping() |
| 1744 || !layer->compositedLayerMapping()->mainGraphicsLayer()) { | 1746 || !layer->compositedLayerMapping()->mainGraphicsLayer()) { |
| 1745 // Don't raise exception in these cases which may be normally used in te
sts. | 1747 // Don't raise exception in these cases which may be normally used in te
sts. |
| 1746 return String(); | 1748 return String(); |
| 1747 } | 1749 } |
| 1748 | 1750 |
| 1749 return layer->compositedLayerMapping()->mainGraphicsLayer()->layerTreeAsText
(flags); | 1751 return layer->compositedLayerMapping()->mainGraphicsLayer()->layerTreeAsText
(flags); |
| 1750 } | 1752 } |
| 1751 | 1753 |
| 1752 static RenderLayer* getRenderLayerForElement(Element* element, ExceptionState& e
s) | 1754 static RenderLayer* getRenderLayerForElement(Element* element, ExceptionState& e
s) |
| 1753 { | 1755 { |
| (...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2270 } | 2272 } |
| 2271 | 2273 |
| 2272 document->updateLayout(); | 2274 document->updateLayout(); |
| 2273 | 2275 |
| 2274 RenderView* view = document->renderView(); | 2276 RenderView* view = document->renderView(); |
| 2275 if (view->compositor()) | 2277 if (view->compositor()) |
| 2276 view->compositor()->updateCompositingLayers(CompositingUpdateFinishAllDe
ferredWork); | 2278 view->compositor()->updateCompositingLayers(CompositingUpdateFinishAllDe
ferredWork); |
| 2277 } | 2279 } |
| 2278 | 2280 |
| 2279 } | 2281 } |
| OLD | NEW |