OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
reserved. |
3 * | 3 * |
4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. | 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. |
5 * | 5 * |
6 * Other contributors: | 6 * Other contributors: |
7 * Robert O'Callahan <roc+@cs.cmu.edu> | 7 * Robert O'Callahan <roc+@cs.cmu.edu> |
8 * David Baron <dbaron@fas.harvard.edu> | 8 * David Baron <dbaron@fas.harvard.edu> |
9 * Christian Biesinger <cbiesinger@web.de> | 9 * Christian Biesinger <cbiesinger@web.de> |
10 * Randall Jesup <rjesup@wgate.com> | 10 * Randall Jesup <rjesup@wgate.com> |
(...skipping 1363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1374 | 1374 |
1375 if (fixedPositionContainerLayer != ancestorLayer) { | 1375 if (fixedPositionContainerLayer != ancestorLayer) { |
1376 LayoutPoint fixedContainerCoords; | 1376 LayoutPoint fixedContainerCoords; |
1377 layer->convertToLayerCoords(fixedPositionContainerLayer, fixedContai
nerCoords); | 1377 layer->convertToLayerCoords(fixedPositionContainerLayer, fixedContai
nerCoords); |
1378 | 1378 |
1379 LayoutPoint ancestorCoords; | 1379 LayoutPoint ancestorCoords; |
1380 ancestorLayer->convertToLayerCoords(fixedPositionContainerLayer, anc
estorCoords); | 1380 ancestorLayer->convertToLayerCoords(fixedPositionContainerLayer, anc
estorCoords); |
1381 | 1381 |
1382 location += (fixedContainerCoords - ancestorCoords); | 1382 location += (fixedContainerCoords - ancestorCoords); |
1383 } else { | 1383 } else { |
| 1384 // RenderView has been handled in the first top-level 'if' block abo
ve. |
| 1385 ASSERT(ancestorLayer != renderer->view()->layer()); |
| 1386 ASSERT(ancestorLayer->hasTransformRelatedProperty()); |
| 1387 |
1384 location += layer->location(); | 1388 location += layer->location(); |
| 1389 |
| 1390 // The spec (http://dev.w3.org/csswg/css-transforms/#transform-rende
ring) doesn't say if a |
| 1391 // fixed-position element under a scrollable transformed element sho
uld scroll. However, |
| 1392 // other parts of blink scroll the fixed-position element, and the f
ollowing keeps the consistency. |
| 1393 if (RenderLayerScrollableArea* scrollableArea = ancestorLayer->scrol
lableArea()) |
| 1394 location -= LayoutSize(scrollableArea->scrollOffset()); |
1385 } | 1395 } |
1386 return ancestorLayer; | 1396 return ancestorLayer; |
1387 } | 1397 } |
1388 | 1398 |
1389 RenderLayer* parentLayer; | 1399 RenderLayer* parentLayer; |
1390 if (position == AbsolutePosition) { | 1400 if (position == AbsolutePosition) { |
1391 // Do what enclosingPositionedAncestor() does, but check for ancestorLay
er along the way. | 1401 // Do what enclosingPositionedAncestor() does, but check for ancestorLay
er along the way. |
1392 parentLayer = layer->parent(); | 1402 parentLayer = layer->parent(); |
1393 bool foundAncestorFirst = false; | 1403 bool foundAncestorFirst = false; |
1394 while (parentLayer) { | 1404 while (parentLayer) { |
(...skipping 1505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2900 } | 2910 } |
2901 } | 2911 } |
2902 | 2912 |
2903 void showLayerTree(const blink::RenderObject* renderer) | 2913 void showLayerTree(const blink::RenderObject* renderer) |
2904 { | 2914 { |
2905 if (!renderer) | 2915 if (!renderer) |
2906 return; | 2916 return; |
2907 showLayerTree(renderer->enclosingLayer()); | 2917 showLayerTree(renderer->enclosingLayer()); |
2908 } | 2918 } |
2909 #endif | 2919 #endif |
OLD | NEW |