| 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 828 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 839 { | 839 { |
| 840 if (!layoutObject()->hasTransformRelatedProperty()) | 840 if (!layoutObject()->hasTransformRelatedProperty()) |
| 841 return FloatPoint(); | 841 return FloatPoint(); |
| 842 | 842 |
| 843 const LayoutRect borderBox = toLayoutBox(layoutObject())->borderBoxRect(); | 843 const LayoutRect borderBox = toLayoutBox(layoutObject())->borderBoxRect(); |
| 844 const ComputedStyle& style = layoutObject()->styleRef(); | 844 const ComputedStyle& style = layoutObject()->styleRef(); |
| 845 | 845 |
| 846 return FloatPoint(floatValueForLength(style.perspectiveOriginX(), borderBox.
width().toFloat()), floatValueForLength(style.perspectiveOriginY(), borderBox.he
ight().toFloat())); | 846 return FloatPoint(floatValueForLength(style.perspectiveOriginX(), borderBox.
width().toFloat()), floatValueForLength(style.perspectiveOriginY(), borderBox.he
ight().toFloat())); |
| 847 } | 847 } |
| 848 | 848 |
| 849 static inline bool isContainerForFixedPositioned(PaintLayer* layer) | |
| 850 { | |
| 851 return layer->isRootLayer() || layer->hasTransformRelatedProperty(); | |
| 852 } | |
| 853 | |
| 854 static inline bool isContainerForPositioned(PaintLayer* layer) | |
| 855 { | |
| 856 // FIXME: This is not in sync with containingBlock. | |
| 857 // LayoutObject::canContainFixedPositionObjects() should probably be used | |
| 858 // instead. | |
| 859 LayoutBoxModelObject* layerlayoutObject = layer->layoutObject(); | |
| 860 return layer->isRootLayer() || layerlayoutObject->isPositioned() || layer->h
asTransformRelatedProperty() || layerlayoutObject->style()->containsPaint(); | |
| 861 } | |
| 862 | |
| 863 PaintLayer* PaintLayer::containingLayerForOutOfFlowPositioned(const PaintLayer*
ancestor, bool* skippedAncestor) const | 849 PaintLayer* PaintLayer::containingLayerForOutOfFlowPositioned(const PaintLayer*
ancestor, bool* skippedAncestor) const |
| 864 { | 850 { |
| 865 ASSERT(!ancestor || skippedAncestor); // If we have specified an ancestor, s
urely the caller needs to know whether we skipped it. | 851 ASSERT(!ancestor || skippedAncestor); // If we have specified an ancestor, s
urely the caller needs to know whether we skipped it. |
| 866 if (skippedAncestor) | 852 if (skippedAncestor) |
| 867 *skippedAncestor = false; | 853 *skippedAncestor = false; |
| 868 if (layoutObject()->style()->position() == FixedPosition) { | 854 if (layoutObject()->style()->position() == FixedPosition) { |
| 869 PaintLayer* curr = parent(); | 855 PaintLayer* curr = parent(); |
| 870 while (curr && !isContainerForFixedPositioned(curr)) { | 856 while (curr && !curr->layoutObject()->canContainFixedPositionObjects())
{ |
| 871 if (skippedAncestor && curr == ancestor) | 857 if (skippedAncestor && curr == ancestor) |
| 872 *skippedAncestor = true; | 858 *skippedAncestor = true; |
| 873 curr = curr->parent(); | 859 curr = curr->parent(); |
| 874 } | 860 } |
| 875 | 861 |
| 876 return curr; | 862 return curr; |
| 877 } | 863 } |
| 878 | 864 |
| 879 PaintLayer* curr = parent(); | 865 PaintLayer* curr = parent(); |
| 880 while (curr && !isContainerForPositioned(curr)) { | 866 while (curr && !curr->layoutObject()->canContainAbsolutePositionObjects()) { |
| 881 if (skippedAncestor && curr == ancestor) | 867 if (skippedAncestor && curr == ancestor) |
| 882 *skippedAncestor = true; | 868 *skippedAncestor = true; |
| 883 curr = curr->parent(); | 869 curr = curr->parent(); |
| 884 } | 870 } |
| 885 | 871 |
| 886 return curr; | 872 return curr; |
| 887 } | 873 } |
| 888 | 874 |
| 889 PaintLayer* PaintLayer::enclosingTransformedAncestor() const | 875 PaintLayer* PaintLayer::enclosingTransformedAncestor() const |
| 890 { | 876 { |
| (...skipping 2057 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2948 | 2934 |
| 2949 void showLayerTree(const blink::LayoutObject* layoutObject) | 2935 void showLayerTree(const blink::LayoutObject* layoutObject) |
| 2950 { | 2936 { |
| 2951 if (!layoutObject) { | 2937 if (!layoutObject) { |
| 2952 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); | 2938 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); |
| 2953 return; | 2939 return; |
| 2954 } | 2940 } |
| 2955 showLayerTree(layoutObject->enclosingLayer()); | 2941 showLayerTree(layoutObject->enclosingLayer()); |
| 2956 } | 2942 } |
| 2957 #endif | 2943 #endif |
| OLD | NEW |