Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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() const; |
| 143 int layoutWidth() const { return layoutSize().width(); } | 143 int layoutWidth() const { return layoutSize().width(); } |
| 144 int layoutHeight() const { return layoutSize().height(); } | 144 int layoutHeight() const { return layoutSize().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 // Similar to layoutSize functions, but don't exclude the scrollbars. For CS S @media width/height MQ rules. | |
| 151 IntSize mediaSize() const; | |
|
jamesr
2013/05/06 22:52:03
is this the same as calling visibleContentRect(Inc
Xianzhu
2013/05/06 22:55:44
They are the same for non-fixed-layout mode. For f
jamesr
2013/05/06 23:38:49
Can we instead give layoutSize() the Includes/Excl
| |
| 152 int mediaWidth() const { return mediaSize().width(); } | |
| 153 int mediaHeight() const { return mediaSize().height(); } | |
| 154 | |
| 150 // Functions for getting/setting the size of the document contained inside t he ScrollView (as an IntSize or as individual width and height | 155 // 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). | 156 // values). |
| 152 virtual IntSize contentsSize() const OVERRIDE; // Always at least as big as the visibleWidth()/visibleHeight(). | 157 virtual IntSize contentsSize() const OVERRIDE; // Always at least as big as the visibleWidth()/visibleHeight(). |
| 153 int contentsWidth() const { return contentsSize().width(); } | 158 int contentsWidth() const { return contentsSize().width(); } |
| 154 int contentsHeight() const { return contentsSize().height(); } | 159 int contentsHeight() const { return contentsSize().height(); } |
| 155 virtual void setContentsSize(const IntSize&); | 160 virtual void setContentsSize(const IntSize&); |
| 156 | 161 |
| 157 // Functions for querying the current scrolled position (both as a point, a size, or as individual X and Y values). | 162 // 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(); } | 163 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. | 164 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 Loading... | |
| 383 ASSERT(!widget || widget->isScrollView()); | 388 ASSERT(!widget || widget->isScrollView()); |
| 384 return static_cast<const ScrollView*>(widget); | 389 return static_cast<const ScrollView*>(widget); |
| 385 } | 390 } |
| 386 | 391 |
| 387 // This will catch anyone doing an unnecessary cast. | 392 // This will catch anyone doing an unnecessary cast. |
| 388 void toScrollView(const ScrollView*); | 393 void toScrollView(const ScrollView*); |
| 389 | 394 |
| 390 } // namespace WebCore | 395 } // namespace WebCore |
| 391 | 396 |
| 392 #endif // ScrollView_h | 397 #endif // ScrollView_h |
| OLD | NEW |