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

Side by Side Diff: Source/core/frame/FrameView.cpp

Issue 1223173006: Get rid of clampScrollOffset and make maximumScrollPosition sane. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Revert changes to Element::clientWidth, etc. Created 5 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/frame/FrameView.h ('k') | Source/core/layout/LayoutTextControlSingleLine.cpp » ('j') | 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) 1998, 1999 Torben Weis <weis@kde.org> 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
3 * 1999 Lars Knoll <knoll@kde.org> 3 * 1999 Lars Knoll <knoll@kde.org>
4 * 1999 Antti Koivisto <koivisto@kde.org> 4 * 1999 Antti Koivisto <koivisto@kde.org>
5 * 2000 Dirk Mueller <mueller@kde.org> 5 * 2000 Dirk Mueller <mueller@kde.org>
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com)
8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com)
9 * Copyright (C) 2009 Google Inc. All rights reserved. 9 * Copyright (C) 2009 Google Inc. All rights reserved.
10 * 10 *
(...skipping 2972 matching lines...) Expand 10 before | Expand all | Expand 10 after
2983 2983
2984 void FrameView::setTopControlsViewportAdjustment(float adjustment) 2984 void FrameView::setTopControlsViewportAdjustment(float adjustment)
2985 { 2985 {
2986 m_topControlsViewportAdjustment = adjustment; 2986 m_topControlsViewportAdjustment = adjustment;
2987 } 2987 }
2988 2988
2989 IntPoint FrameView::maximumScrollPosition() const 2989 IntPoint FrameView::maximumScrollPosition() const
2990 { 2990 {
2991 // Make the same calculation as in CC's LayerImpl::MaxScrollOffset() 2991 // Make the same calculation as in CC's LayerImpl::MaxScrollOffset()
2992 // FIXME: We probably shouldn't be storing the bounds in a float. crbug.com/ 422331. 2992 // FIXME: We probably shouldn't be storing the bounds in a float. crbug.com/ 422331.
2993 FloatSize visibleSize = visibleContentSize(ExcludeScrollbars); 2993 IntSize visibleSize = visibleContentSize(ExcludeScrollbars) + topControlsSiz e();
2994 visibleSize.expand(0, m_topControlsViewportAdjustment); 2994 IntSize contentBounds = contentsSize();
2995 2995 IntPoint maximumPosition = -scrollOrigin() + (contentBounds - visibleSize);
2996 FloatSize contentBounds = contentsSize(); 2996 return maximumPosition.expandedTo(minimumScrollPosition());
2997 contentBounds = flooredIntSize(contentBounds);
2998
2999 FloatSize maximumOffset = contentBounds - visibleSize - toIntSize(scrollOrig in());
3000
3001 IntPoint snappedMaximumOffset = flooredIntPoint(maximumOffset);
3002 snappedMaximumOffset = snappedMaximumOffset.expandedTo(minimumScrollPosition ());
3003 return snappedMaximumOffset;
3004 } 2997 }
3005 2998
3006 void FrameView::addChild(PassRefPtrWillBeRawPtr<Widget> prpChild) 2999 void FrameView::addChild(PassRefPtrWillBeRawPtr<Widget> prpChild)
3007 { 3000 {
3008 Widget* child = prpChild.get(); 3001 Widget* child = prpChild.get();
3009 ASSERT(child != this && !child->parent()); 3002 ASSERT(child != this && !child->parent());
3010 child->setParent(this); 3003 child->setParent(this);
3011 m_children.add(prpChild); 3004 m_children.add(prpChild);
3012 } 3005 }
3013 3006
(...skipping 927 matching lines...) Expand 10 before | Expand all | Expand 10 after
3941 3934
3942 if (!graphicsLayer) 3935 if (!graphicsLayer)
3943 return; 3936 return;
3944 3937
3945 DeprecatedPaintLayer::mapRectToPaintInvalidationBacking(localFrame->contentL ayoutObject(), paintInvalidationContainer, viewRect); 3938 DeprecatedPaintLayer::mapRectToPaintInvalidationBacking(localFrame->contentL ayoutObject(), paintInvalidationContainer, viewRect);
3946 3939
3947 graphicsLayerTimingRequests.add(graphicsLayer, Vector<std::pair<int64_t, Web Rect>>()).storedValue->value.append(std::make_pair(m_frame->frameID(), enclosing IntRect(viewRect))); 3940 graphicsLayerTimingRequests.add(graphicsLayer, Vector<std::pair<int64_t, Web Rect>>()).storedValue->value.append(std::make_pair(m_frame->frameID(), enclosing IntRect(viewRect)));
3948 } 3941 }
3949 3942
3950 } // namespace blink 3943 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/frame/FrameView.h ('k') | Source/core/layout/LayoutTextControlSingleLine.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698