OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights |
3 * reserved. | 3 * reserved. |
4 * | 4 * |
5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. | 5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. |
6 * | 6 * |
7 * Other contributors: | 7 * Other contributors: |
8 * Robert O'Callahan <roc+@cs.cmu.edu> | 8 * Robert O'Callahan <roc+@cs.cmu.edu> |
9 * David Baron <dbaron@fas.harvard.edu> | 9 * David Baron <dbaron@fas.harvard.edu> |
10 * Christian Biesinger <cbiesinger@web.de> | 10 * Christian Biesinger <cbiesinger@web.de> |
(...skipping 782 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
793 // needs the m_has3DTransformedDescendant set. | 793 // needs the m_has3DTransformedDescendant set. |
794 if (preserves3D()) | 794 if (preserves3D()) |
795 return has3DTransform() || m_has3DTransformedDescendant; | 795 return has3DTransform() || m_has3DTransformedDescendant; |
796 | 796 |
797 return has3DTransform(); | 797 return has3DTransform(); |
798 } | 798 } |
799 | 799 |
800 void PaintLayer::updateLayerPosition() { | 800 void PaintLayer::updateLayerPosition() { |
801 LayoutPoint localPoint; | 801 LayoutPoint localPoint; |
802 | 802 |
803 bool didResize = false; | |
804 if (layoutObject()->isInline() && layoutObject()->isLayoutInline()) { | 803 if (layoutObject()->isInline() && layoutObject()->isLayoutInline()) { |
805 LayoutInline* inlineFlow = toLayoutInline(layoutObject()); | 804 LayoutInline* inlineFlow = toLayoutInline(layoutObject()); |
806 IntRect lineBox = enclosingIntRect(inlineFlow->linesBoundingBox()); | 805 IntRect lineBox = enclosingIntRect(inlineFlow->linesBoundingBox()); |
807 m_size = lineBox.size(); | 806 m_size = lineBox.size(); |
808 } else if (LayoutBox* box = layoutBox()) { | 807 } else if (LayoutBox* box = layoutBox()) { |
809 IntSize newSize = pixelSnappedIntSize(box->size(), box->location()); | 808 m_size = pixelSnappedIntSize(box->size(), box->location()); |
810 didResize = newSize != m_size; | |
811 m_size = newSize; | |
812 localPoint.moveBy(box->topLeftLocation()); | 809 localPoint.moveBy(box->topLeftLocation()); |
813 } | 810 } |
814 | 811 |
815 if (!layoutObject()->isOutOfFlowPositioned() && | 812 if (!layoutObject()->isOutOfFlowPositioned() && |
816 !layoutObject()->isColumnSpanAll() && layoutObject()->parent()) { | 813 !layoutObject()->isColumnSpanAll() && layoutObject()->parent()) { |
817 // We must adjust our position by walking up the layout tree looking for the | 814 // We must adjust our position by walking up the layout tree looking for the |
818 // nearest enclosing object with a layer. | 815 // nearest enclosing object with a layer. |
819 LayoutObject* curr = layoutObject()->parent(); | 816 LayoutObject* curr = layoutObject()->parent(); |
820 while (curr && !curr->hasLayer()) { | 817 while (curr && !curr->hasLayer()) { |
821 if (curr->isBox() && !curr->isTableRow()) { | 818 if (curr->isBox() && !curr->isTableRow()) { |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
859 LayoutSize newOffset = layoutObject()->offsetForInFlowPosition(); | 856 LayoutSize newOffset = layoutObject()->offsetForInFlowPosition(); |
860 if (m_rareData || !newOffset.isZero()) | 857 if (m_rareData || !newOffset.isZero()) |
861 ensureRareData().offsetForInFlowPosition = newOffset; | 858 ensureRareData().offsetForInFlowPosition = newOffset; |
862 localPoint.move(newOffset); | 859 localPoint.move(newOffset); |
863 } else if (m_rareData) { | 860 } else if (m_rareData) { |
864 m_rareData->offsetForInFlowPosition = LayoutSize(); | 861 m_rareData->offsetForInFlowPosition = LayoutSize(); |
865 } | 862 } |
866 | 863 |
867 m_location = localPoint; | 864 m_location = localPoint; |
868 | 865 |
869 if (m_scrollableArea && didResize) | |
870 m_scrollableArea->visibleSizeChanged(); | |
871 | |
872 #if DCHECK_IS_ON() | 866 #if DCHECK_IS_ON() |
873 m_needsPositionUpdate = false; | 867 m_needsPositionUpdate = false; |
874 #endif | 868 #endif |
875 } | 869 } |
876 | 870 |
877 TransformationMatrix PaintLayer::perspectiveTransform() const { | 871 TransformationMatrix PaintLayer::perspectiveTransform() const { |
878 if (!layoutObject()->hasTransformRelatedProperty()) | 872 if (!layoutObject()->hasTransformRelatedProperty()) |
879 return TransformationMatrix(); | 873 return TransformationMatrix(); |
880 | 874 |
881 const ComputedStyle& style = layoutObject()->styleRef(); | 875 const ComputedStyle& style = layoutObject()->styleRef(); |
(...skipping 2390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3272 } | 3266 } |
3273 | 3267 |
3274 void showLayerTree(const blink::LayoutObject* layoutObject) { | 3268 void showLayerTree(const blink::LayoutObject* layoutObject) { |
3275 if (!layoutObject) { | 3269 if (!layoutObject) { |
3276 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); | 3270 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); |
3277 return; | 3271 return; |
3278 } | 3272 } |
3279 showLayerTree(layoutObject->enclosingLayer()); | 3273 showLayerTree(layoutObject->enclosingLayer()); |
3280 } | 3274 } |
3281 #endif | 3275 #endif |
OLD | NEW |