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 1551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1562 { | 1562 { |
1563 RefPtr<HitTestingTransformState> transformState; | 1563 RefPtr<HitTestingTransformState> transformState; |
1564 LayoutPoint offset; | 1564 LayoutPoint offset; |
1565 if (containerTransformState) { | 1565 if (containerTransformState) { |
1566 // If we're already computing transform state, then it's relative to the
container (which we know is non-null). | 1566 // If we're already computing transform state, then it's relative to the
container (which we know is non-null). |
1567 transformState = HitTestingTransformState::create(*containerTransformSta
te); | 1567 transformState = HitTestingTransformState::create(*containerTransformSta
te); |
1568 convertToLayerCoords(containerLayer, offset); | 1568 convertToLayerCoords(containerLayer, offset); |
1569 } else { | 1569 } else { |
1570 // If this is the first time we need to make transform state, then base
it off of hitTestLocation, | 1570 // If this is the first time we need to make transform state, then base
it off of hitTestLocation, |
1571 // which is relative to rootLayer. | 1571 // which is relative to rootLayer. |
1572 transformState = HitTestingTransformState::create(hitTestLocation.transf
ormedPoint(), hitTestLocation.transformedRect(), FloatQuad(hitTestRect)); | 1572 transformState = HitTestingTransformState::create(hitTestLocation.transf
ormedPoint(), hitTestLocation.transformedRect(), FloatQuad(FloatRect(hitTestRect
))); |
1573 convertToLayerCoords(rootLayer, offset); | 1573 convertToLayerCoords(rootLayer, offset); |
1574 } | 1574 } |
1575 offset.moveBy(translationOffset); | 1575 offset.moveBy(translationOffset); |
1576 | 1576 |
1577 LayoutObject* containerLayoutObject = containerLayer ? containerLayer->layou
tObject() : 0; | 1577 LayoutObject* containerLayoutObject = containerLayer ? containerLayer->layou
tObject() : 0; |
1578 if (layoutObject()->shouldUseTransformFromContainer(containerLayoutObject))
{ | 1578 if (layoutObject()->shouldUseTransformFromContainer(containerLayoutObject))
{ |
1579 TransformationMatrix containerTransform; | 1579 TransformationMatrix containerTransform; |
1580 layoutObject()->getTransformFromContainer(containerLayoutObject, toLayou
tSize(offset), containerTransform); | 1580 layoutObject()->getTransformFromContainer(containerLayoutObject, toLayou
tSize(offset), containerTransform); |
1581 transformState->applyTransform(containerTransform, HitTestingTransformSt
ate::AccumulateTransform); | 1581 transformState->applyTransform(containerTransform, HitTestingTransformSt
ate::AccumulateTransform); |
1582 } else { | 1582 } else { |
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2169 if (isRootLayer()) | 2169 if (isRootLayer()) |
2170 return LayoutRect(m_layoutObject->view()->unscaledDocumentRect()); | 2170 return LayoutRect(m_layoutObject->view()->unscaledDocumentRect()); |
2171 | 2171 |
2172 // The layer created for the LayoutFlowThread is just a helper for painting
and hit-testing, | 2172 // The layer created for the LayoutFlowThread is just a helper for painting
and hit-testing, |
2173 // and should not contribute to the bounding box. The LayoutMultiColumnSets
will contribute | 2173 // and should not contribute to the bounding box. The LayoutMultiColumnSets
will contribute |
2174 // the correct size for the layout content of the multicol container. | 2174 // the correct size for the layout content of the multicol container. |
2175 if (layoutObject()->isLayoutFlowThread()) | 2175 if (layoutObject()->isLayoutFlowThread()) |
2176 return LayoutRect(); | 2176 return LayoutRect(); |
2177 | 2177 |
2178 LayoutRect result = clipper().localClipRect(); | 2178 LayoutRect result = clipper().localClipRect(); |
2179 if (result == LayoutRect::infiniteIntRect()) { | 2179 // TODO(chrishtr): avoid converting to IntRect and back. |
| 2180 if (result == LayoutRect(LayoutRect::infiniteIntRect())) { |
2180 LayoutPoint origin; | 2181 LayoutPoint origin; |
2181 result = physicalBoundingBox(ancestorLayer, &origin); | 2182 result = physicalBoundingBox(ancestorLayer, &origin); |
2182 | 2183 |
2183 const_cast<DeprecatedPaintLayer*>(this)->stackingNode()->updateLayerList
sIfNeeded(); | 2184 const_cast<DeprecatedPaintLayer*>(this)->stackingNode()->updateLayerList
sIfNeeded(); |
2184 | 2185 |
2185 // Reflections are implemented with Layers that hang off of the reflecte
d layer. However, | 2186 // Reflections are implemented with Layers that hang off of the reflecte
d layer. However, |
2186 // the reflection layer subtree does not include the subtree of the pare
nt Layer, so | 2187 // the reflection layer subtree does not include the subtree of the pare
nt Layer, so |
2187 // a recursive computation of stacking children yields no results. This
breaks cases when there are stacking | 2188 // a recursive computation of stacking children yields no results. This
breaks cases when there are stacking |
2188 // children of the parent, that need to be included in reflected composi
ted bounds. | 2189 // children of the parent, that need to be included in reflected composi
ted bounds. |
2189 // Fix this by including composited bounds of stacking children of the r
eflected Layer. | 2190 // Fix this by including composited bounds of stacking children of the r
eflected Layer. |
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2682 | 2683 |
2683 void showLayerTree(const blink::LayoutObject* layoutObject) | 2684 void showLayerTree(const blink::LayoutObject* layoutObject) |
2684 { | 2685 { |
2685 if (!layoutObject) { | 2686 if (!layoutObject) { |
2686 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); | 2687 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); |
2687 return; | 2688 return; |
2688 } | 2689 } |
2689 showLayerTree(layoutObject->enclosingLayer()); | 2690 showLayerTree(layoutObject->enclosingLayer()); |
2690 } | 2691 } |
2691 #endif | 2692 #endif |
OLD | NEW |