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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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() 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 // The spec DOM Level 2 Events states that the resize event occurs when docu ment view size (a.k.a layout size) is changed. Refer to http://www.w3.org/TR/DOM -Level-2-Events/events.html | |
146 // However, we don't want scrollbar to emit a resize event because other bro wsers don't have this behavior, and actual site is badly affected. Refer to webk it.org/b/80242 | |
kenneth.r.christiansen
2013/05/06 19:50:51
I don't think this explains it very well. You want
| |
147 // So we use layoutSizeIncludingScrollbars() to emit a resize event due to a bove practical reason. | |
148 IntSize layoutSizeIncludingScrollbars() const; | |
145 IntSize fixedLayoutSize() const; | 149 IntSize fixedLayoutSize() const; |
146 void setFixedLayoutSize(const IntSize&); | 150 void setFixedLayoutSize(const IntSize&); |
147 bool useFixedLayout() const; | 151 bool useFixedLayout() const; |
148 void setUseFixedLayout(bool enable); | 152 void setUseFixedLayout(bool enable); |
149 | 153 |
150 // Functions for getting/setting the size of the document contained inside t he ScrollView (as an IntSize or as individual width and height | 154 // 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). | 155 // values). |
152 virtual IntSize contentsSize() const OVERRIDE; // Always at least as big as the visibleWidth()/visibleHeight(). | 156 virtual IntSize contentsSize() const OVERRIDE; // Always at least as big as the visibleWidth()/visibleHeight(). |
153 int contentsWidth() const { return contentsSize().width(); } | 157 int contentsWidth() const { return contentsSize().width(); } |
154 int contentsHeight() const { return contentsSize().height(); } | 158 int contentsHeight() const { return contentsSize().height(); } |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
383 ASSERT(!widget || widget->isScrollView()); | 387 ASSERT(!widget || widget->isScrollView()); |
384 return static_cast<const ScrollView*>(widget); | 388 return static_cast<const ScrollView*>(widget); |
385 } | 389 } |
386 | 390 |
387 // This will catch anyone doing an unnecessary cast. | 391 // This will catch anyone doing an unnecessary cast. |
388 void toScrollView(const ScrollView*); | 392 void toScrollView(const ScrollView*); |
389 | 393 |
390 } // namespace WebCore | 394 } // namespace WebCore |
391 | 395 |
392 #endif // ScrollView_h | 396 #endif // ScrollView_h |
OLD | NEW |