Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(30)

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintLayer.cpp

Issue 2013953002: Remove inlineBoundingBoxOffset from PaintLayer::updateLayerPosition (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 738 matching lines...) Expand 10 before | Expand all | Expand 10 after
749 // the m_has3DTransformedDescendant set. 749 // the m_has3DTransformedDescendant set.
750 if (preserves3D()) 750 if (preserves3D())
751 return has3DTransform() || m_has3DTransformedDescendant; 751 return has3DTransform() || m_has3DTransformedDescendant;
752 752
753 return has3DTransform(); 753 return has3DTransform();
754 } 754 }
755 755
756 void PaintLayer::updateLayerPosition() 756 void PaintLayer::updateLayerPosition()
757 { 757 {
758 LayoutPoint localPoint; 758 LayoutPoint localPoint;
759 LayoutPoint inlineBoundingBoxOffset; // We don't put this into the Layer x/y for inlines, so we need to subtract it out when done.
760 759
761 if (layoutObject()->isInline() && layoutObject()->isLayoutInline()) { 760 if (layoutObject()->isInline() && layoutObject()->isLayoutInline()) {
762 LayoutInline* inlineFlow = toLayoutInline(layoutObject()); 761 LayoutInline* inlineFlow = toLayoutInline(layoutObject());
763 IntRect lineBox = enclosingIntRect(inlineFlow->linesBoundingBox()); 762 IntRect lineBox = enclosingIntRect(inlineFlow->linesBoundingBox());
764 m_size = lineBox.size(); 763 m_size = lineBox.size();
765 inlineBoundingBoxOffset = lineBox.location();
766 localPoint.moveBy(inlineBoundingBoxOffset);
767 } else if (LayoutBox* box = layoutBox()) { 764 } else if (LayoutBox* box = layoutBox()) {
768 m_size = pixelSnappedIntSize(box->size(), box->location()); 765 m_size = pixelSnappedIntSize(box->size(), box->location());
769 localPoint.moveBy(box->topLeftLocation()); 766 localPoint.moveBy(box->topLeftLocation());
770 } 767 }
771 768
772 if (!layoutObject()->isOutOfFlowPositioned() && !layoutObject()->isColumnSpa nAll() && layoutObject()->parent()) { 769 if (!layoutObject()->isOutOfFlowPositioned() && !layoutObject()->isColumnSpa nAll() && layoutObject()->parent()) {
773 // We must adjust our position by walking up the layout tree looking for the 770 // We must adjust our position by walking up the layout tree looking for the
774 // nearest enclosing object with a layer. 771 // nearest enclosing object with a layer.
775 LayoutObject* curr = layoutObject()->parent(); 772 LayoutObject* curr = layoutObject()->parent();
776 while (curr && !curr->hasLayer()) { 773 while (curr && !curr->hasLayer()) {
(...skipping 29 matching lines...) Expand all
806 803
807 if (layoutObject()->isInFlowPositioned()) { 804 if (layoutObject()->isInFlowPositioned()) {
808 LayoutSize newOffset = layoutObject()->offsetForInFlowPosition(); 805 LayoutSize newOffset = layoutObject()->offsetForInFlowPosition();
809 if (m_rareData || !newOffset.isZero()) 806 if (m_rareData || !newOffset.isZero())
810 ensureRareData().offsetForInFlowPosition = newOffset; 807 ensureRareData().offsetForInFlowPosition = newOffset;
811 localPoint.move(newOffset); 808 localPoint.move(newOffset);
812 } else if (m_rareData) { 809 } else if (m_rareData) {
813 m_rareData->offsetForInFlowPosition = LayoutSize(); 810 m_rareData->offsetForInFlowPosition = LayoutSize();
814 } 811 }
815 812
816 // FIXME: We'd really like to just get rid of the concept of a layer rectang le and rely on the layoutObjects.
817 localPoint.moveBy(-inlineBoundingBoxOffset);
818
819 if (m_location != localPoint) { 813 if (m_location != localPoint) {
820 setNeedsRepaint(); 814 setNeedsRepaint();
821 } 815 }
822 m_location = localPoint; 816 m_location = localPoint;
823 817
824 #if ENABLE(ASSERT) 818 #if ENABLE(ASSERT)
825 m_needsPositionUpdate = false; 819 m_needsPositionUpdate = false;
826 #endif 820 #endif
827 } 821 }
828 822
(...skipping 2083 matching lines...) Expand 10 before | Expand all | Expand 10 after
2912 2906
2913 void showLayerTree(const blink::LayoutObject* layoutObject) 2907 void showLayerTree(const blink::LayoutObject* layoutObject)
2914 { 2908 {
2915 if (!layoutObject) { 2909 if (!layoutObject) {
2916 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); 2910 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n");
2917 return; 2911 return;
2918 } 2912 }
2919 showLayerTree(layoutObject->enclosingLayer()); 2913 showLayerTree(layoutObject->enclosingLayer());
2920 } 2914 }
2921 #endif 2915 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698