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 794 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
805 | 805 |
806 bool didResize = false; | 806 bool didResize = false; |
807 if (layoutObject()->isInline() && layoutObject()->isLayoutInline()) { | 807 if (layoutObject()->isInline() && layoutObject()->isLayoutInline()) { |
808 LayoutInline* inlineFlow = toLayoutInline(layoutObject()); | 808 LayoutInline* inlineFlow = toLayoutInline(layoutObject()); |
809 IntRect lineBox = enclosingIntRect(inlineFlow->linesBoundingBox()); | 809 IntRect lineBox = enclosingIntRect(inlineFlow->linesBoundingBox()); |
810 m_size = lineBox.size(); | 810 m_size = lineBox.size(); |
811 } else if (LayoutBox* box = layoutBox()) { | 811 } else if (LayoutBox* box = layoutBox()) { |
812 IntSize newSize = pixelSnappedIntSize(box->size(), box->location()); | 812 IntSize newSize = pixelSnappedIntSize(box->size(), box->location()); |
813 didResize = newSize != m_size; | 813 didResize = newSize != m_size; |
814 m_size = newSize; | 814 m_size = newSize; |
815 localPoint.moveBy(box->topLeftLocation()); | 815 localPoint.moveBy(box->physicalLocation()); |
816 } | 816 } |
817 | 817 |
818 if (!layoutObject()->isOutOfFlowPositioned() && | 818 if (!layoutObject()->isOutOfFlowPositioned() && |
819 !layoutObject()->isColumnSpanAll() && layoutObject()->parent()) { | 819 !layoutObject()->isColumnSpanAll() && layoutObject()->parent()) { |
820 // We must adjust our position by walking up the layout tree looking for the | 820 // We must adjust our position by walking up the layout tree looking for the |
821 // nearest enclosing object with a layer. | 821 // nearest enclosing object with a layer. |
822 LayoutObject* curr = layoutObject()->parent(); | 822 LayoutObject* curr = layoutObject()->parent(); |
823 while (curr && !curr->hasLayer()) { | 823 while (curr && !curr->hasLayer()) { |
824 if (curr->isBox() && !curr->isTableRow()) { | 824 if (curr->isBox() && !curr->isTableRow()) { |
825 // Rows and cells share the same coordinate space (that of the section). | 825 // Rows and cells share the same coordinate space (that of the section). |
826 // Omit them when computing our xpos/ypos. | 826 // Omit them when computing our xpos/ypos. |
827 localPoint.moveBy(toLayoutBox(curr)->topLeftLocation()); | 827 localPoint.moveBy(toLayoutBox(curr)->physicalLocation()); |
828 } | 828 } |
829 curr = curr->parent(); | 829 curr = curr->parent(); |
830 } | 830 } |
831 if (curr->isBox() && curr->isTableRow()) { | 831 if (curr->isBox() && curr->isTableRow()) { |
832 // Put ourselves into the row coordinate space. | 832 // Put ourselves into the row coordinate space. |
833 localPoint.moveBy(-toLayoutBox(curr)->topLeftLocation()); | 833 localPoint.moveBy(-toLayoutBox(curr)->physicalLocation()); |
834 } | 834 } |
835 } | 835 } |
836 | 836 |
837 // Subtract our parent's scroll offset. | 837 // Subtract our parent's scroll offset. |
838 if (PaintLayer* containingLayer = | 838 if (PaintLayer* containingLayer = |
839 layoutObject()->isOutOfFlowPositioned() | 839 layoutObject()->isOutOfFlowPositioned() |
840 ? containingLayerForOutOfFlowPositioned() | 840 ? containingLayerForOutOfFlowPositioned() |
841 : nullptr) { | 841 : nullptr) { |
842 // For positioned layers, we subtract out the enclosing positioned layer's | 842 // For positioned layers, we subtract out the enclosing positioned layer's |
843 // scroll offset. | 843 // scroll offset. |
(...skipping 2425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3269 } | 3269 } |
3270 | 3270 |
3271 void showLayerTree(const blink::LayoutObject* layoutObject) { | 3271 void showLayerTree(const blink::LayoutObject* layoutObject) { |
3272 if (!layoutObject) { | 3272 if (!layoutObject) { |
3273 LOG(INFO) << "Cannot showLayerTree. Root is (nil)"; | 3273 LOG(INFO) << "Cannot showLayerTree. Root is (nil)"; |
3274 return; | 3274 return; |
3275 } | 3275 } |
3276 showLayerTree(layoutObject->enclosingLayer()); | 3276 showLayerTree(layoutObject->enclosingLayer()); |
3277 } | 3277 } |
3278 #endif | 3278 #endif |
OLD | NEW |