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

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: skobes@ + dtapuska@ comments addressed 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 782 matching lines...) Expand 10 before | Expand all | Expand 10 after
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;
803 if (layoutObject()->isInline() && layoutObject()->isLayoutInline()) { 804 if (layoutObject()->isInline() && layoutObject()->isLayoutInline()) {
804 LayoutInline* inlineFlow = toLayoutInline(layoutObject()); 805 LayoutInline* inlineFlow = toLayoutInline(layoutObject());
805 IntRect lineBox = enclosingIntRect(inlineFlow->linesBoundingBox()); 806 IntRect lineBox = enclosingIntRect(inlineFlow->linesBoundingBox());
806 m_size = lineBox.size(); 807 m_size = lineBox.size();
807 } else if (LayoutBox* box = layoutBox()) { 808 } else if (LayoutBox* box = layoutBox()) {
808 m_size = pixelSnappedIntSize(box->size(), box->location()); 809 IntSize newSize = pixelSnappedIntSize(box->size(), box->location());
810 didResize = newSize != m_size;
811 m_size = newSize;
809 localPoint.moveBy(box->topLeftLocation()); 812 localPoint.moveBy(box->topLeftLocation());
810 } 813 }
811 814
812 if (!layoutObject()->isOutOfFlowPositioned() && 815 if (!layoutObject()->isOutOfFlowPositioned() &&
813 !layoutObject()->isColumnSpanAll() && layoutObject()->parent()) { 816 !layoutObject()->isColumnSpanAll() && layoutObject()->parent()) {
814 // We must adjust our position by walking up the layout tree looking for the 817 // We must adjust our position by walking up the layout tree looking for the
815 // nearest enclosing object with a layer. 818 // nearest enclosing object with a layer.
816 LayoutObject* curr = layoutObject()->parent(); 819 LayoutObject* curr = layoutObject()->parent();
817 while (curr && !curr->hasLayer()) { 820 while (curr && !curr->hasLayer()) {
818 if (curr->isBox() && !curr->isTableRow()) { 821 if (curr->isBox() && !curr->isTableRow()) {
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
856 LayoutSize newOffset = layoutObject()->offsetForInFlowPosition(); 859 LayoutSize newOffset = layoutObject()->offsetForInFlowPosition();
857 if (m_rareData || !newOffset.isZero()) 860 if (m_rareData || !newOffset.isZero())
858 ensureRareData().offsetForInFlowPosition = newOffset; 861 ensureRareData().offsetForInFlowPosition = newOffset;
859 localPoint.move(newOffset); 862 localPoint.move(newOffset);
860 } else if (m_rareData) { 863 } else if (m_rareData) {
861 m_rareData->offsetForInFlowPosition = LayoutSize(); 864 m_rareData->offsetForInFlowPosition = LayoutSize();
862 } 865 }
863 866
864 m_location = localPoint; 867 m_location = localPoint;
865 868
869 if (m_scrollableArea && didResize)
870 m_scrollableArea->visibleSizeChanged();
871
866 #if DCHECK_IS_ON() 872 #if DCHECK_IS_ON()
867 m_needsPositionUpdate = false; 873 m_needsPositionUpdate = false;
868 #endif 874 #endif
869 } 875 }
870 876
871 TransformationMatrix PaintLayer::perspectiveTransform() const { 877 TransformationMatrix PaintLayer::perspectiveTransform() const {
872 if (!layoutObject()->hasTransformRelatedProperty()) 878 if (!layoutObject()->hasTransformRelatedProperty())
873 return TransformationMatrix(); 879 return TransformationMatrix();
874 880
875 const ComputedStyle& style = layoutObject()->styleRef(); 881 const ComputedStyle& style = layoutObject()->styleRef();
(...skipping 2390 matching lines...) Expand 10 before | Expand all | Expand 10 after
3266 } 3272 }
3267 3273
3268 void showLayerTree(const blink::LayoutObject* layoutObject) { 3274 void showLayerTree(const blink::LayoutObject* layoutObject) {
3269 if (!layoutObject) { 3275 if (!layoutObject) {
3270 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); 3276 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n");
3271 return; 3277 return;
3272 } 3278 }
3273 showLayerTree(layoutObject->enclosingLayer()); 3279 showLayerTree(layoutObject->enclosingLayer());
3274 } 3280 }
3275 #endif 3281 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698