Chromium Code Reviews| 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 1252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1263 return 0; | 1263 return 0; |
| 1264 | 1264 |
| 1265 unsigned count = 0; | 1265 unsigned count = 0; |
| 1266 for (TouchEventTargetSet::const_iterator iter = touchHandlers->begin(); iter != touchHandlers->end(); ++iter) | 1266 for (TouchEventTargetSet::const_iterator iter = touchHandlers->begin(); iter != touchHandlers->end(); ++iter) |
| 1267 count += iter->value; | 1267 count += iter->value; |
| 1268 return count; | 1268 return count; |
| 1269 } | 1269 } |
| 1270 | 1270 |
| 1271 static RenderLayer* findRenderLayerForGraphicsLayer(RenderLayer* searchRoot, Gra phicsLayer* graphicsLayer, String* layerType) | 1271 static RenderLayer* findRenderLayerForGraphicsLayer(RenderLayer* searchRoot, Gra phicsLayer* graphicsLayer, String* layerType) |
| 1272 { | 1272 { |
| 1273 if (searchRoot->compositedLayerMapping() && graphicsLayer == searchRoot->com positedLayerMapping()->mainGraphicsLayer()) | 1273 // Note, we only want to return the RenderLayer that _truly_ owns the Graphi csLayer, not just the |
| 1274 // first RenderLayer we encounter that paints into it. | |
| 1275 if (searchRoot->compositingState() == PaintsIntoOwnBacking && graphicsLayer == searchRoot->compositedLayerMapping()->mainGraphicsLayer()) | |
|
shawnsingh
2013/11/12 21:12:50
Option 1: maybe we should keep this as hasComposit
| |
| 1274 return searchRoot; | 1276 return searchRoot; |
| 1275 | 1277 |
| 1276 GraphicsLayer* layerForScrolling = searchRoot->scrollableArea() ? searchRoot ->scrollableArea()->layerForScrolling() : 0; | 1278 GraphicsLayer* layerForScrolling = searchRoot->scrollableArea() ? searchRoot ->scrollableArea()->layerForScrolling() : 0; |
| 1277 if (graphicsLayer == layerForScrolling) { | 1279 if (graphicsLayer == layerForScrolling) { |
| 1278 *layerType = "scrolling"; | 1280 *layerType = "scrolling"; |
| 1279 return searchRoot; | 1281 return searchRoot; |
| 1280 } | 1282 } |
| 1281 | 1283 |
| 1282 GraphicsLayer* layerForHorizontalScrollbar = searchRoot->scrollableArea() ? searchRoot->scrollableArea()->layerForHorizontalScrollbar() : 0; | 1284 GraphicsLayer* layerForHorizontalScrollbar = searchRoot->scrollableArea() ? searchRoot->scrollableArea()->layerForHorizontalScrollbar() : 0; |
| 1283 if (graphicsLayer == layerForHorizontalScrollbar) { | 1285 if (graphicsLayer == layerForHorizontalScrollbar) { |
| (...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1746 element->document().updateLayout(); | 1748 element->document().updateLayout(); |
| 1747 | 1749 |
| 1748 RenderObject* renderer = element->renderer(); | 1750 RenderObject* renderer = element->renderer(); |
| 1749 if (!renderer || !renderer->isBox()) { | 1751 if (!renderer || !renderer->isBox()) { |
| 1750 es.throwUninformativeAndGenericDOMException(InvalidAccessError); | 1752 es.throwUninformativeAndGenericDOMException(InvalidAccessError); |
| 1751 return String(); | 1753 return String(); |
| 1752 } | 1754 } |
| 1753 | 1755 |
| 1754 RenderLayer* layer = toRenderBox(renderer)->layer(); | 1756 RenderLayer* layer = toRenderBox(renderer)->layer(); |
| 1755 if (!layer | 1757 if (!layer |
| 1756 || !layer->compositedLayerMapping() | 1758 || !layer->hasCompositedLayerMapping() |
| 1757 || !layer->compositedLayerMapping()->mainGraphicsLayer()) { | 1759 || !layer->compositedLayerMapping()->mainGraphicsLayer()) { |
| 1758 // Don't raise exception in these cases which may be normally used in te sts. | 1760 // Don't raise exception in these cases which may be normally used in te sts. |
| 1759 return String(); | 1761 return String(); |
| 1760 } | 1762 } |
| 1761 | 1763 |
| 1762 return layer->compositedLayerMapping()->mainGraphicsLayer()->layerTreeAsText (flags); | 1764 return layer->compositedLayerMapping()->mainGraphicsLayer()->layerTreeAsText (flags); |
| 1763 } | 1765 } |
| 1764 | 1766 |
| 1765 static RenderLayer* getRenderLayerForElement(Element* element, ExceptionState& e s) | 1767 static RenderLayer* getRenderLayerForElement(Element* element, ExceptionState& e s) |
| 1766 { | 1768 { |
| (...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2261 } | 2263 } |
| 2262 | 2264 |
| 2263 document->updateLayout(); | 2265 document->updateLayout(); |
| 2264 | 2266 |
| 2265 RenderView* view = document->renderView(); | 2267 RenderView* view = document->renderView(); |
| 2266 if (view->compositor()) | 2268 if (view->compositor()) |
| 2267 view->compositor()->updateCompositingLayers(CompositingUpdateFinishAllDe ferredWork); | 2269 view->compositor()->updateCompositingLayers(CompositingUpdateFinishAllDe ferredWork); |
| 2268 } | 2270 } |
| 2269 | 2271 |
| 2270 } | 2272 } |
| OLD | NEW |