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

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

Issue 2467693002: Implement overlay scrollbar fade out for non-composited scrollers. (Closed)
Patch Set: sigh....git cl format Created 4 years, 1 month 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
OLDNEW
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 775 matching lines...) Expand 10 before | Expand all | Expand 10 after
786 // needs the m_has3DTransformedDescendant set. 786 // needs the m_has3DTransformedDescendant set.
787 if (preserves3D()) 787 if (preserves3D())
788 return has3DTransform() || m_has3DTransformedDescendant; 788 return has3DTransform() || m_has3DTransformedDescendant;
789 789
790 return has3DTransform(); 790 return has3DTransform();
791 } 791 }
792 792
793 void PaintLayer::updateLayerPosition() { 793 void PaintLayer::updateLayerPosition() {
794 LayoutPoint localPoint; 794 LayoutPoint localPoint;
795 795
796 bool didResize = false;
796 if (layoutObject()->isInline() && layoutObject()->isLayoutInline()) { 797 if (layoutObject()->isInline() && layoutObject()->isLayoutInline()) {
797 LayoutInline* inlineFlow = toLayoutInline(layoutObject()); 798 LayoutInline* inlineFlow = toLayoutInline(layoutObject());
798 IntRect lineBox = enclosingIntRect(inlineFlow->linesBoundingBox()); 799 IntRect lineBox = enclosingIntRect(inlineFlow->linesBoundingBox());
799 m_size = lineBox.size(); 800 m_size = lineBox.size();
800 } else if (LayoutBox* box = layoutBox()) { 801 } else if (LayoutBox* box = layoutBox()) {
801 m_size = pixelSnappedIntSize(box->size(), box->location()); 802 IntSize newSize = pixelSnappedIntSize(box->size(), box->location());
803 didResize = newSize != m_size;
804 m_size = newSize;
802 localPoint.moveBy(box->topLeftLocation()); 805 localPoint.moveBy(box->topLeftLocation());
803 } 806 }
804 807
805 if (!layoutObject()->isOutOfFlowPositioned() && 808 if (!layoutObject()->isOutOfFlowPositioned() &&
806 !layoutObject()->isColumnSpanAll() && layoutObject()->parent()) { 809 !layoutObject()->isColumnSpanAll() && layoutObject()->parent()) {
807 // We must adjust our position by walking up the layout tree looking for the 810 // We must adjust our position by walking up the layout tree looking for the
808 // nearest enclosing object with a layer. 811 // nearest enclosing object with a layer.
809 LayoutObject* curr = layoutObject()->parent(); 812 LayoutObject* curr = layoutObject()->parent();
810 while (curr && !curr->hasLayer()) { 813 while (curr && !curr->hasLayer()) {
811 if (curr->isBox() && !curr->isTableRow()) { 814 if (curr->isBox() && !curr->isTableRow()) {
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
849 LayoutSize newOffset = layoutObject()->offsetForInFlowPosition(); 852 LayoutSize newOffset = layoutObject()->offsetForInFlowPosition();
850 if (m_rareData || !newOffset.isZero()) 853 if (m_rareData || !newOffset.isZero())
851 ensureRareData().offsetForInFlowPosition = newOffset; 854 ensureRareData().offsetForInFlowPosition = newOffset;
852 localPoint.move(newOffset); 855 localPoint.move(newOffset);
853 } else if (m_rareData) { 856 } else if (m_rareData) {
854 m_rareData->offsetForInFlowPosition = LayoutSize(); 857 m_rareData->offsetForInFlowPosition = LayoutSize();
855 } 858 }
856 859
857 m_location = localPoint; 860 m_location = localPoint;
858 861
862 if (m_scrollableArea && didResize)
863 m_scrollableArea->visibleSizeChanged();
864
859 #if DCHECK_IS_ON() 865 #if DCHECK_IS_ON()
860 m_needsPositionUpdate = false; 866 m_needsPositionUpdate = false;
861 #endif 867 #endif
862 } 868 }
863 869
864 TransformationMatrix PaintLayer::perspectiveTransform() const { 870 TransformationMatrix PaintLayer::perspectiveTransform() const {
865 if (!layoutObject()->hasTransformRelatedProperty()) 871 if (!layoutObject()->hasTransformRelatedProperty())
866 return TransformationMatrix(); 872 return TransformationMatrix();
867 873
868 const ComputedStyle& style = layoutObject()->styleRef(); 874 const ComputedStyle& style = layoutObject()->styleRef();
(...skipping 2354 matching lines...) Expand 10 before | Expand all | Expand 10 after
3223 } 3229 }
3224 3230
3225 void showLayerTree(const blink::LayoutObject* layoutObject) { 3231 void showLayerTree(const blink::LayoutObject* layoutObject) {
3226 if (!layoutObject) { 3232 if (!layoutObject) {
3227 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); 3233 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n");
3228 return; 3234 return;
3229 } 3235 }
3230 showLayerTree(layoutObject->enclosingLayer()); 3236 showLayerTree(layoutObject->enclosingLayer());
3231 } 3237 }
3232 #endif 3238 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698