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

Side by Side Diff: Source/core/platform/ScrollView.h

Issue 14659008: Include scrollbar size in @media width/height (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: layoutSize(VisibleContentRectIncludesScrollbars) Created 7 years, 7 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/css/MediaQueryEvaluator.cpp ('k') | Source/core/platform/ScrollView.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) 2004, 2006, 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2006, 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2009 Holger Hans Peter Freyther 3 * Copyright (C) 2009 Holger Hans Peter Freyther
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 virtual int visibleWidth() const OVERRIDE { return visibleContentRect().widt h(); } 132 virtual int visibleWidth() const OVERRIDE { return visibleContentRect().widt h(); }
133 virtual int visibleHeight() const OVERRIDE { return visibleContentRect().hei ght(); } 133 virtual int visibleHeight() const OVERRIDE { return visibleContentRect().hei ght(); }
134 134
135 // visibleContentRect().size() is computed from unscaledVisibleContentSize() divided by the value of visibleContentScaleFactor. 135 // visibleContentRect().size() is computed from unscaledVisibleContentSize() divided by the value of visibleContentScaleFactor.
136 // For the main frame, visibleContentScaleFactor is equal to the page's page ScaleFactor; it's 1 otherwise. 136 // For the main frame, visibleContentScaleFactor is equal to the page's page ScaleFactor; it's 1 otherwise.
137 IntSize unscaledVisibleContentSize(VisibleContentRectIncludesScrollbars = Ex cludeScrollbars) const; 137 IntSize unscaledVisibleContentSize(VisibleContentRectIncludesScrollbars = Ex cludeScrollbars) const;
138 virtual float visibleContentScaleFactor() const { return 1; } 138 virtual float visibleContentScaleFactor() const { return 1; }
139 139
140 // Functions for getting/setting the size webkit should use to layout the co ntents. By default this is the same as the visible 140 // Functions for getting/setting the size webkit should use to layout the co ntents. By default this is the same as the visible
141 // content size. Explicitly setting a layout size value will cause webkit to layout the contents using this size instead. 141 // content size. Explicitly setting a layout size value will cause webkit to layout the contents using this size instead.
142 IntSize layoutSize() const; 142 IntSize layoutSize(VisibleContentRectIncludesScrollbars = ExcludeScrollbars) const;
143 int layoutWidth() const { return layoutSize().width(); } 143 int layoutWidth(VisibleContentRectIncludesScrollbars scrollbarInclusion = Ex cludeScrollbars) const { return layoutSize(scrollbarInclusion).width(); }
144 int layoutHeight() const { return layoutSize().height(); } 144 int layoutHeight(VisibleContentRectIncludesScrollbars scrollbarInclusion = E xcludeScrollbars) const { return layoutSize(scrollbarInclusion).height(); }
145 IntSize fixedLayoutSize() const; 145 IntSize fixedLayoutSize() const;
146 void setFixedLayoutSize(const IntSize&); 146 void setFixedLayoutSize(const IntSize&);
147 bool useFixedLayout() const; 147 bool useFixedLayout() const;
148 void setUseFixedLayout(bool enable); 148 void setUseFixedLayout(bool enable);
149 149
150 // Functions for getting/setting the size of the document contained inside t he ScrollView (as an IntSize or as individual width and height 150 // Functions for getting/setting the size of the document contained inside t he ScrollView (as an IntSize or as individual width and height
151 // values). 151 // values).
152 virtual IntSize contentsSize() const OVERRIDE; // Always at least as big as the visibleWidth()/visibleHeight(). 152 virtual IntSize contentsSize() const OVERRIDE; // Always at least as big as the visibleWidth()/visibleHeight().
153 int contentsWidth() const { return contentsSize().width(); } 153 int contentsWidth() const { return contentsSize().width(); }
154 int contentsHeight() const { return contentsSize().height(); } 154 int contentsHeight() const { return contentsSize().height(); }
155 virtual void setContentsSize(const IntSize&); 155 virtual void setContentsSize(const IntSize&);
156 156
157 // Functions for querying the current scrolled position (both as a point, a size, or as individual X and Y values). 157 // Functions for querying the current scrolled position (both as a point, a size, or as individual X and Y values).
158 virtual IntPoint scrollPosition() const OVERRIDE { return visibleContentRect ().location(); } 158 virtual IntPoint scrollPosition() const OVERRIDE { return visibleContentRect ().location(); }
159 IntSize scrollOffset() const { return toIntSize(visibleContentRect().locatio n()); } // Gets the scrolled position as an IntSize. Convenient for adding to ot her sizes. 159 IntSize scrollOffset() const { return toIntSize(visibleContentRect().locatio n()); } // Gets the scrolled position as an IntSize. Convenient for adding to ot her sizes.
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 ASSERT(!widget || widget->isScrollView()); 383 ASSERT(!widget || widget->isScrollView());
384 return static_cast<const ScrollView*>(widget); 384 return static_cast<const ScrollView*>(widget);
385 } 385 }
386 386
387 // This will catch anyone doing an unnecessary cast. 387 // This will catch anyone doing an unnecessary cast.
388 void toScrollView(const ScrollView*); 388 void toScrollView(const ScrollView*);
389 389
390 } // namespace WebCore 390 } // namespace WebCore
391 391
392 #endif // ScrollView_h 392 #endif // ScrollView_h
OLDNEW
« no previous file with comments | « Source/core/css/MediaQueryEvaluator.cpp ('k') | Source/core/platform/ScrollView.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698