| OLD | NEW |
| 1 /* | 1 /* |
| 2 Copyright (C) 1997 Martin Jones (mjones@kde.org) | 2 Copyright (C) 1997 Martin Jones (mjones@kde.org) |
| 3 (C) 1998 Waldo Bastian (bastian@kde.org) | 3 (C) 1998 Waldo Bastian (bastian@kde.org) |
| 4 (C) 1998, 1999 Torben Weis (weis@kde.org) | 4 (C) 1998, 1999 Torben Weis (weis@kde.org) |
| 5 (C) 1999 Lars Knoll (knoll@kde.org) | 5 (C) 1999 Lars Knoll (knoll@kde.org) |
| 6 (C) 1999 Antti Koivisto (koivisto@kde.org) | 6 (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 7 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv
ed. | 7 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv
ed. |
| 8 | 8 |
| 9 This library is free software; you can redistribute it and/or | 9 This library is free software; you can redistribute it and/or |
| 10 modify it under the terms of the GNU Library General Public | 10 modify it under the terms of the GNU Library General Public |
| 11 License as published by the Free Software Foundation; either | 11 License as published by the Free Software Foundation; either |
| 12 version 2 of the License, or (at your option) any later version. | 12 version 2 of the License, or (at your option) any later version. |
| 13 | 13 |
| 14 This library is distributed in the hope that it will be useful, | 14 This library is distributed in the hope that it will be useful, |
| 15 but WITHOUT ANY WARRANTY; without even the implied warranty of | 15 but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 17 Library General Public License for more details. | 17 Library General Public License for more details. |
| 18 | 18 |
| 19 You should have received a copy of the GNU Library General Public License | 19 You should have received a copy of the GNU Library General Public License |
| 20 along with this library; see the file COPYING.LIB. If not, write to | 20 along with this library; see the file COPYING.LIB. If not, write to |
| 21 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 21 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 22 Boston, MA 02110-1301, USA. | 22 Boston, MA 02110-1301, USA. |
| 23 */ | 23 */ |
| 24 | 24 |
| 25 #ifndef FrameView_h | 25 #ifndef FrameView_h |
| 26 #define FrameView_h | 26 #define FrameView_h |
| 27 | 27 |
| 28 #include "core/rendering/PaintPhase.h" | 28 #include "core/rendering/PaintPhase.h" |
| 29 #include "platform/FrameWidget.h" |
| 30 #include "platform/HostWindow.h" |
| 29 #include "platform/RuntimeEnabledFeatures.h" | 31 #include "platform/RuntimeEnabledFeatures.h" |
| 32 #include "platform/Widget.h" |
| 33 #include "platform/Widget.h" |
| 30 #include "platform/geometry/LayoutRect.h" | 34 #include "platform/geometry/LayoutRect.h" |
| 31 #include "platform/graphics/Color.h" | 35 #include "platform/graphics/Color.h" |
| 32 #include "platform/scroll/ScrollView.h" | 36 #include "platform/scroll/ScrollableArea.h" |
| 33 #include "wtf/Forward.h" | 37 #include "wtf/Forward.h" |
| 34 #include "wtf/OwnPtr.h" | 38 #include "wtf/OwnPtr.h" |
| 35 #include "wtf/text/WTFString.h" | 39 #include "wtf/text/WTFString.h" |
| 36 | 40 |
| 37 namespace blink { | 41 namespace blink { |
| 38 | 42 |
| 39 class DocumentLifecycle; | 43 class DocumentLifecycle; |
| 40 class Cursor; | 44 class Cursor; |
| 41 class Element; | 45 class Element; |
| 42 class FloatSize; | 46 class FloatSize; |
| 43 class LocalFrame; | 47 class LocalFrame; |
| 44 class KURL; | 48 class KURL; |
| 45 class Node; | 49 class Node; |
| 46 class Page; | 50 class Page; |
| 47 class RenderBox; | 51 class RenderBox; |
| 48 class RenderObject; | 52 class RenderObject; |
| 49 class RenderStyle; | 53 class RenderStyle; |
| 50 class RenderView; | 54 class RenderView; |
| 51 class RenderWidget; | 55 class RenderWidget; |
| 52 | 56 |
| 53 typedef unsigned long long DOMTimeStamp; | 57 typedef unsigned long long DOMTimeStamp; |
| 54 | 58 |
| 55 class FrameView FINAL : public ScrollView { | 59 class FrameView final : public FrameWidget { |
| 56 public: | 60 public: |
| 57 friend class RenderView; | 61 friend class RenderView; |
| 58 | 62 |
| 59 static PassRefPtr<FrameView> create(LocalFrame*); | 63 static PassRefPtr<FrameView> create(LocalFrame*); |
| 60 static PassRefPtr<FrameView> create(LocalFrame*, const IntSize& initialSize)
; | 64 static PassRefPtr<FrameView> create(LocalFrame*, const IntSize& initialSize)
; |
| 61 | 65 |
| 62 virtual ~FrameView(); | 66 virtual ~FrameView(); |
| 63 | 67 |
| 64 virtual HostWindow* hostWindow() const OVERRIDE; | 68 HostWindow* hostWindow() const; |
| 65 | 69 |
| 66 virtual void invalidateRect(const IntRect&) OVERRIDE; | 70 void invalidateRect(const IntRect&); |
| 67 virtual void setFrameRect(const IntRect&) OVERRIDE; | 71 void setFrameRect(const IntRect&); |
| 68 | 72 |
| 69 LocalFrame& frame() const { return *m_frame; } | 73 LocalFrame& frame() const { return *m_frame; } |
| 70 Page* page() const; | 74 Page* page() const; |
| 71 | 75 |
| 72 RenderView* renderView() const; | 76 RenderView* renderView() const; |
| 73 | 77 |
| 74 virtual void setCanHaveScrollbars(bool) OVERRIDE; | 78 // FIXME(sky): Remove. |
| 79 void setCanHaveScrollbars(bool); |
| 75 | 80 |
| 76 virtual void setContentsSize(const IntSize&) OVERRIDE; | 81 void setContentsSize(const IntSize&); |
| 77 IntPoint clampOffsetAtScale(const IntPoint& offset, float scale) const; | 82 IntPoint clampOffsetAtScale(const IntPoint& offset, float scale) const; |
| 78 | 83 |
| 79 void layout(bool allowSubtree = true); | 84 void layout(bool allowSubtree = true); |
| 80 bool didFirstLayout() const; | 85 bool didFirstLayout() const; |
| 81 void scheduleRelayout(); | 86 void scheduleRelayout(); |
| 82 void scheduleRelayoutOfSubtree(RenderObject*); | 87 void scheduleRelayoutOfSubtree(RenderObject*); |
| 83 bool layoutPending() const; | 88 bool layoutPending() const; |
| 84 bool isInPerformLayout() const; | 89 bool isInPerformLayout() const; |
| 85 | 90 |
| 86 void setCanInvalidatePaintDuringPerformLayout(bool b) { m_canInvalidatePaint
DuringPerformLayout = b; } | 91 void setCanInvalidatePaintDuringPerformLayout(bool b) { m_canInvalidatePaint
DuringPerformLayout = b; } |
| (...skipping 18 matching lines...) Expand all Loading... |
| 105 bool layoutSizeFixedToFrameSize() { return m_layoutSizeFixedToFrameSize; } | 110 bool layoutSizeFixedToFrameSize() { return m_layoutSizeFixedToFrameSize; } |
| 106 | 111 |
| 107 bool needsFullPaintInvalidation() const { return m_doFullPaintInvalidation;
} | 112 bool needsFullPaintInvalidation() const { return m_doFullPaintInvalidation;
} |
| 108 | 113 |
| 109 void updateAcceleratedCompositingSettings(); | 114 void updateAcceleratedCompositingSettings(); |
| 110 | 115 |
| 111 void recalcOverflowAfterStyleChange(); | 116 void recalcOverflowAfterStyleChange(); |
| 112 | 117 |
| 113 bool isEnclosedInCompositingLayer() const; | 118 bool isEnclosedInCompositingLayer() const; |
| 114 | 119 |
| 115 void resetScrollbars(); | |
| 116 void prepareForDetach(); | 120 void prepareForDetach(); |
| 117 virtual void recalculateScrollbarOverlayStyle(); | 121 virtual void recalculateScrollbarOverlayStyle(); |
| 118 | 122 |
| 119 void clear(); | 123 void clear(); |
| 120 | 124 |
| 121 bool isTransparent() const; | 125 bool isTransparent() const; |
| 122 void setTransparent(bool isTransparent); | 126 void setTransparent(bool isTransparent); |
| 123 | 127 |
| 124 // True if the FrameView is not transparent, and the base background color i
s opaque. | 128 // True if the FrameView is not transparent, and the base background color i
s opaque. |
| 125 bool hasOpaqueBackground() const; | 129 bool hasOpaqueBackground() const; |
| 126 | 130 |
| 127 Color baseBackgroundColor() const; | 131 Color baseBackgroundColor() const; |
| 128 void setBaseBackgroundColor(const Color&); | 132 void setBaseBackgroundColor(const Color&); |
| 129 void updateBackgroundRecursively(const Color&, bool); | 133 void updateBackgroundRecursively(const Color&, bool); |
| 130 | 134 |
| 131 void adjustViewSize(); | 135 void adjustViewSize(); |
| 132 | 136 |
| 133 virtual IntRect windowClipRect(IncludeScrollbarsInRect = ExcludeScrollbars)
const OVERRIDE; | 137 IntRect windowClipRect(IncludeScrollbarsInRect = ExcludeScrollbars) const; |
| 134 | 138 |
| 135 virtual float visibleContentScaleFactor() const OVERRIDE { return m_visibleC
ontentScaleFactor; } | 139 float visibleContentScaleFactor() const { return m_visibleContentScaleFactor
; } |
| 136 void setVisibleContentScaleFactor(float); | 140 void setVisibleContentScaleFactor(float); |
| 137 | 141 |
| 138 virtual float inputEventsScaleFactor() const OVERRIDE; | 142 float inputEventsScaleFactor() const; |
| 139 virtual IntSize inputEventsOffsetForEmulation() const OVERRIDE; | 143 IntSize inputEventsOffsetForEmulation() const; |
| 140 void setInputEventsTransformForEmulation(const IntSize&, float); | 144 void setInputEventsTransformForEmulation(const IntSize&, float); |
| 141 | 145 |
| 142 virtual void setScrollPosition(const IntPoint&, ScrollBehavior = ScrollBehav
iorInstant) OVERRIDE; | 146 // FIXME(sky): Remove |
| 143 virtual bool isRubberBandInProgress() const OVERRIDE; | 147 void setScrollPosition(const IntPoint&, ScrollBehavior = ScrollBehaviorInsta
nt); |
| 148 bool isRubberBandInProgress() const; |
| 144 void setScrollPositionNonProgrammatically(const IntPoint&); | 149 void setScrollPositionNonProgrammatically(const IntPoint&); |
| 145 | 150 |
| 146 // This is different than visibleContentRect() in that it ignores negative (
or overly positive) | 151 // This is different than visibleContentRect() in that it ignores negative (
or overly positive) |
| 147 // offsets from rubber-banding, and it takes zooming into account. | 152 // offsets from rubber-banding, and it takes zooming into account. |
| 148 LayoutRect viewportConstrainedVisibleContentRect() const; | 153 LayoutRect viewportConstrainedVisibleContentRect() const; |
| 149 void viewportConstrainedVisibleContentSizeChanged(bool widthChanged, bool he
ightChanged); | 154 void viewportConstrainedVisibleContentSizeChanged(bool widthChanged, bool he
ightChanged); |
| 150 | 155 |
| 151 AtomicString mediaType() const; | 156 AtomicString mediaType() const; |
| 152 void setMediaType(const AtomicString&); | 157 void setMediaType(const AtomicString&); |
| 153 | 158 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 166 | 171 |
| 167 void postLayoutTimerFired(Timer<FrameView>*); | 172 void postLayoutTimerFired(Timer<FrameView>*); |
| 168 | 173 |
| 169 bool wasScrolledByUser() const; | 174 bool wasScrolledByUser() const; |
| 170 void setWasScrolledByUser(bool); | 175 void setWasScrolledByUser(bool); |
| 171 | 176 |
| 172 void addWidget(RenderWidget*); | 177 void addWidget(RenderWidget*); |
| 173 void removeWidget(RenderWidget*); | 178 void removeWidget(RenderWidget*); |
| 174 void updateWidgetPositions(); | 179 void updateWidgetPositions(); |
| 175 | 180 |
| 176 virtual void paintContents(GraphicsContext*, const IntRect& damageRect) OVER
RIDE; | 181 void paintContents(GraphicsContext*, const IntRect& damageRect); |
| 177 void setPaintBehavior(PaintBehavior); | 182 void setPaintBehavior(PaintBehavior); |
| 178 PaintBehavior paintBehavior() const; | 183 PaintBehavior paintBehavior() const; |
| 179 bool isPainting() const; | 184 bool isPainting() const; |
| 180 bool hasEverPainted() const { return m_lastPaintTime; } | 185 bool hasEverPainted() const { return m_lastPaintTime; } |
| 181 void setNodeToDraw(Node*); | 186 void setNodeToDraw(Node*); |
| 182 | 187 |
| 183 virtual void paintOverhangAreas(GraphicsContext*, const IntRect& horizontalO
verhangArea, const IntRect& verticalOverhangArea, const IntRect& dirtyRect) OVER
RIDE; | 188 // FIXME(sky): Remove |
| 189 void paintOverhangAreas(GraphicsContext*, const IntRect& horizontalOverhangA
rea, const IntRect& verticalOverhangArea, const IntRect& dirtyRect); |
| 184 | 190 |
| 185 Color documentBackgroundColor() const; | 191 Color documentBackgroundColor() const; |
| 186 | 192 |
| 187 static double currentFrameTimeStamp() { return s_currentFrameTimeStamp; } | 193 static double currentFrameTimeStamp() { return s_currentFrameTimeStamp; } |
| 188 | 194 |
| 189 void updateLayoutAndStyleForPainting(); | 195 void updateLayoutAndStyleForPainting(); |
| 190 void updateLayoutAndStyleIfNeededRecursive(); | 196 void updateLayoutAndStyleIfNeededRecursive(); |
| 191 | 197 |
| 192 void invalidateTreeIfNeededRecursive(); | 198 void invalidateTreeIfNeededRecursive(); |
| 193 | 199 |
| 194 void forceLayout(bool allowSubtree = false); | 200 void forceLayout(bool allowSubtree = false); |
| 195 | 201 |
| 196 void scrollElementToRect(Element*, const IntRect&); | 202 void scrollElementToRect(Element*, const IntRect&); |
| 197 void scrollContentsIfNeededRecursive(); | 203 void scrollContentsIfNeededRecursive(); |
| 198 | 204 |
| 199 // Methods to convert points and rects between the coordinate space of the r
enderer, and this view. | 205 // Methods to convert points and rects between the coordinate space of the r
enderer, and this view. |
| 200 IntRect convertFromRenderer(const RenderObject&, const IntRect&) const; | 206 IntRect convertFromRenderer(const RenderObject&, const IntRect&) const; |
| 201 IntRect convertToRenderer(const RenderObject&, const IntRect&) const; | 207 IntRect convertToRenderer(const RenderObject&, const IntRect&) const; |
| 202 IntPoint convertFromRenderer(const RenderObject&, const IntPoint&) const; | 208 IntPoint convertFromRenderer(const RenderObject&, const IntPoint&) const; |
| 203 IntPoint convertToRenderer(const RenderObject&, const IntPoint&) const; | 209 IntPoint convertToRenderer(const RenderObject&, const IntPoint&) const; |
| 204 | 210 |
| 205 bool isScrollable(); | 211 bool isScrollable(); |
| 206 | 212 |
| 207 enum ScrollbarModesCalculationStrategy { RulesFromWebContentOnly, AnyRule }; | 213 enum ScrollbarModesCalculationStrategy { RulesFromWebContentOnly, AnyRule }; |
| 208 void calculateScrollbarModesForLayoutAndSetViewportRenderer(ScrollbarMode& h
Mode, ScrollbarMode& vMode, ScrollbarModesCalculationStrategy = AnyRule); | 214 void calculateScrollbarModesForLayoutAndSetViewportRenderer(ScrollbarMode& h
Mode, ScrollbarMode& vMode, ScrollbarModesCalculationStrategy = AnyRule); |
| 209 | 215 |
| 210 virtual IntPoint lastKnownMousePosition() const OVERRIDE; | 216 // FIXME(sky): Maybe remove now that we're not a ScrollView? |
| 217 IntPoint lastKnownMousePosition() const; |
| 211 bool shouldSetCursor() const; | 218 bool shouldSetCursor() const; |
| 212 | 219 |
| 213 void setCursor(const Cursor&); | 220 void setCursor(const Cursor&); |
| 214 | 221 |
| 215 virtual bool scrollbarsCanBeActive() const OVERRIDE; | 222 // FIXME(sky): Remove |
| 223 bool scrollbarsCanBeActive() const; |
| 216 | 224 |
| 217 // FIXME: Remove this method once plugin loading is decoupled from layout. | 225 // FIXME: Remove this method once plugin loading is decoupled from layout. |
| 218 void flushAnyPendingPostLayoutTasks(); | 226 void flushAnyPendingPostLayoutTasks(); |
| 219 | 227 |
| 220 void setTracksPaintInvalidations(bool); | 228 void setTracksPaintInvalidations(bool); |
| 221 bool isTrackingPaintInvalidations() const { return m_isTrackingPaintInvalida
tions; } | 229 bool isTrackingPaintInvalidations() const { return m_isTrackingPaintInvalida
tions; } |
| 222 void resetTrackedPaintInvalidations(); | 230 void resetTrackedPaintInvalidations(); |
| 223 | 231 |
| 224 String trackedPaintInvalidationRectsAsText() const; | 232 String trackedPaintInvalidationRectsAsText() const; |
| 225 | 233 |
| 226 typedef HashSet<ScrollableArea*> ScrollableAreaSet; | 234 typedef HashSet<ScrollableArea*> ScrollableAreaSet; |
| 227 void addScrollableArea(ScrollableArea*); | 235 void addScrollableArea(ScrollableArea*); |
| 228 void removeScrollableArea(ScrollableArea*); | 236 void removeScrollableArea(ScrollableArea*); |
| 229 const ScrollableAreaSet* scrollableAreas() const { return m_scrollableAreas.
get(); } | 237 const ScrollableAreaSet* scrollableAreas() const { return m_scrollableAreas.
get(); } |
| 230 | 238 |
| 231 // With CSS style "resize:" enabled, a little resizer handle will appear at
the bottom | 239 // With CSS style "resize:" enabled, a little resizer handle will appear at
the bottom |
| 232 // right of the object. We keep track of these resizer areas for checking if
touches | 240 // right of the object. We keep track of these resizer areas for checking if
touches |
| 233 // (implemented using Scroll gesture) are targeting the resizer. | 241 // (implemented using Scroll gesture) are targeting the resizer. |
| 234 typedef HashSet<RenderBox*> ResizerAreaSet; | 242 typedef HashSet<RenderBox*> ResizerAreaSet; |
| 235 void addResizerArea(RenderBox&); | 243 void addResizerArea(RenderBox&); |
| 236 void removeResizerArea(RenderBox&); | 244 void removeResizerArea(RenderBox&); |
| 237 const ResizerAreaSet* resizerAreas() const { return m_resizerAreas.get(); } | 245 const ResizerAreaSet* resizerAreas() const { return m_resizerAreas.get(); } |
| 238 | 246 |
| 239 virtual void removeChild(Widget*) OVERRIDE; | 247 void addChild(PassRefPtr<Widget>); |
| 248 void removeChild(Widget*) final; |
| 240 | 249 |
| 241 // This function exists for ports that need to handle wheel events manually. | 250 // This function exists for ports that need to handle wheel events manually. |
| 242 // On Mac WebKit1 the underlying NSScrollView just does the scrolling, but o
n most other platforms | 251 // On Mac WebKit1 the underlying NSScrollView just does the scrolling, but o
n most other platforms |
| 243 // we need this function in order to do the scroll ourselves. | 252 // we need this function in order to do the scroll ourselves. |
| 244 bool wheelEvent(const PlatformWheelEvent&); | 253 bool wheelEvent(const PlatformWheelEvent&); |
| 245 | 254 |
| 246 bool inProgrammaticScroll() const { return m_inProgrammaticScroll; } | 255 bool inProgrammaticScroll() const { return m_inProgrammaticScroll; } |
| 247 void setInProgrammaticScroll(bool programmaticScroll) { m_inProgrammaticScro
ll = programmaticScroll; } | 256 void setInProgrammaticScroll(bool programmaticScroll) { m_inProgrammaticScro
ll = programmaticScroll; } |
| 248 | 257 |
| 249 void setHasSoftwareFilters(bool hasSoftwareFilters) { m_hasSoftwareFilters =
hasSoftwareFilters; } | 258 void setHasSoftwareFilters(bool hasSoftwareFilters) { m_hasSoftwareFilters =
hasSoftwareFilters; } |
| 250 bool hasSoftwareFilters() const { return m_hasSoftwareFilters; } | 259 bool hasSoftwareFilters() const { return m_hasSoftwareFilters; } |
| 251 | 260 |
| 252 virtual bool isActive() const OVERRIDE; | 261 bool isActive() const; |
| 253 | 262 |
| 254 // DEPRECATED: Use viewportConstrainedVisibleContentRect() instead. | 263 // DEPRECATED: Use viewportConstrainedVisibleContentRect() instead. |
| 255 IntSize scrollOffsetForFixedPosition() const; | 264 IntSize scrollOffsetForFixedPosition() const; |
| 256 | 265 |
| 257 // FIXME: This should probably be renamed as the 'inSubtreeLayout' parameter | 266 // FIXME: This should probably be renamed as the 'inSubtreeLayout' parameter |
| 258 // passed around the FrameView layout methods can be true while this returns | 267 // passed around the FrameView layout methods can be true while this returns |
| 259 // false. | 268 // false. |
| 260 bool isSubtreeLayout() const { return !!m_layoutSubtreeRoot; } | 269 bool isSubtreeLayout() const { return !!m_layoutSubtreeRoot; } |
| 261 | 270 |
| 262 // Sets the tickmarks for the FrameView, overriding the default behavior | 271 // Sets the tickmarks for the FrameView, overriding the default behavior |
| 263 // which is to display the tickmarks corresponding to find results. | 272 // which is to display the tickmarks corresponding to find results. |
| 264 // If |m_tickmarks| is empty, the default behavior is restored. | 273 // If |m_tickmarks| is empty, the default behavior is restored. |
| 265 void setTickmarks(const Vector<IntRect>& tickmarks) { m_tickmarks = tickmark
s; } | 274 void setTickmarks(const Vector<IntRect>& tickmarks) { m_tickmarks = tickmark
s; } |
| 266 | 275 |
| 267 // ScrollableArea interface | 276 // ScrollableArea interface |
| 268 virtual void invalidateScrollbarRect(Scrollbar*, const IntRect&) OVERRIDE; | 277 // FIXME(sky): Remove |
| 269 virtual void getTickmarks(Vector<IntRect>&) const OVERRIDE; | 278 void invalidateScrollbarRect(Scrollbar*, const IntRect&); |
| 270 virtual void scrollTo(const IntSize&) OVERRIDE; | 279 void getTickmarks(Vector<IntRect>&) const; |
| 271 virtual IntRect scrollableAreaBoundingBox() const OVERRIDE; | 280 void scrollTo(const IntSize&); |
| 272 virtual bool scrollAnimatorEnabled() const OVERRIDE; | 281 IntRect scrollableAreaBoundingBox() const; |
| 273 virtual bool usesCompositedScrolling() const OVERRIDE; | 282 bool scrollAnimatorEnabled() const; |
| 274 virtual GraphicsLayer* layerForScrolling() const OVERRIDE; | 283 bool usesCompositedScrolling() const; |
| 275 virtual GraphicsLayer* layerForHorizontalScrollbar() const OVERRIDE; | 284 GraphicsLayer* layerForScrolling() const; |
| 276 virtual GraphicsLayer* layerForVerticalScrollbar() const OVERRIDE; | 285 GraphicsLayer* layerForHorizontalScrollbar() const; |
| 277 virtual GraphicsLayer* layerForScrollCorner() const OVERRIDE; | 286 GraphicsLayer* layerForVerticalScrollbar() const; |
| 287 GraphicsLayer* layerForScrollCorner() const; |
| 288 |
| 289 // FIXME(sky): remove |
| 290 IntRect contentsToScreen(const IntRect& rect) const; |
| 291 IntPoint contentsToRootView(const IntPoint& contentsPoint) const { return co
nvertToRootView(contentsPoint); } |
| 292 IntRect contentsToRootView(const IntRect& contentsRect) const { return conve
rtToRootView(contentsRect); } |
| 293 IntRect rootViewToContents(const IntRect& rootViewRect) const { return conve
rtFromRootView(rootViewRect); } |
| 294 IntPoint windowToContents(const IntPoint& windowPoint) const { return conver
tFromContainingWindow(windowPoint); } |
| 295 FloatPoint windowToContents(const FloatPoint& windowPoint) const { return co
nvertFromContainingWindow(windowPoint); } |
| 296 IntPoint contentsToWindow(const IntPoint& contentsPoint) const { return cont
entsToWindow(contentsPoint); } |
| 297 IntRect windowToContents(const IntRect& windowRect) const { return convertFr
omContainingWindow(windowRect); } |
| 298 IntRect contentsToWindow(const IntRect& contentsRect) const { return content
sToWindow(contentsRect); } |
| 299 IntSize scrollOffset() const { return IntSize(); } |
| 300 IntPoint minimumScrollPosition() const { return IntPoint(); } |
| 301 IntPoint maximumScrollPosition() const { return IntPoint(); } |
| 302 IntPoint scrollPosition() const { return IntPoint(); } |
| 303 bool scheduleAnimation(); |
| 304 int scrollX() const { return 0; } |
| 305 int scrollY() const { return 0; } |
| 306 void scrollBy(const IntSize& s, ScrollBehavior behavior = ScrollBehaviorInst
ant) {} |
| 307 void setScrollOffset(const IntPoint&) {} |
| 308 // Scrollbar* horizontalScrollbar() const { return 0; } |
| 309 // Scrollbar* verticalScrollbar() const { return 0; } |
| 310 IntRect visibleContentRect(IncludeScrollbarsInRect = ExcludeScrollbars) cons
t { return IntRect(IntPoint(), expandedIntSize(frameRect().size())); } |
| 311 IntSize unscaledVisibleContentSize(IncludeScrollbarsInRect = ExcludeScrollba
rs) const { return frameRect().size(); } |
| 312 IntPoint clampScrollPosition(const IntPoint& scrollPosition) const { return
scrollPosition; } |
| 313 const IntPoint scrollOrigin() const { return IntPoint(); } |
| 314 // FIXME(sky): Not clear what values these should return. This is just what
they happen to be |
| 315 // returning today. |
| 316 bool paintsEntireContents() const { return false; } |
| 317 bool clipsPaintInvalidations() const { return true; } |
| 278 | 318 |
| 279 protected: | 319 protected: |
| 280 virtual void scrollContentsIfNeeded(); | 320 virtual void scrollContentsIfNeeded(); |
| 281 virtual bool scrollContentsFastPath(const IntSize& scrollDelta) OVERRIDE; | 321 bool scrollContentsFastPath(const IntSize& scrollDelta); |
| 282 virtual void scrollContentsSlowPath(const IntRect& updateRect) OVERRIDE; | 322 void scrollContentsSlowPath(const IntRect& updateRect); |
| 283 | 323 |
| 284 virtual bool isVerticalDocument() const OVERRIDE; | 324 bool isVerticalDocument() const; |
| 285 virtual bool isFlippedDocument() const OVERRIDE; | 325 bool isFlippedDocument() const; |
| 286 | 326 |
| 287 private: | 327 private: |
| 288 explicit FrameView(LocalFrame*); | 328 explicit FrameView(LocalFrame*); |
| 289 | 329 |
| 290 void reset(); | 330 void reset(); |
| 291 void init(); | 331 void init(); |
| 292 | 332 |
| 293 virtual void frameRectsChanged() OVERRIDE; | 333 virtual void frameRectsChanged() OVERRIDE; |
| 294 virtual bool isFrameView() const OVERRIDE { return true; } | 334 virtual bool isFrameView() const OVERRIDE { return true; } |
| 295 | 335 |
| 296 friend class RenderWidget; | 336 friend class RenderWidget; |
| 297 | 337 |
| 298 bool contentsInCompositedLayer() const; | 338 bool contentsInCompositedLayer() const; |
| 299 | 339 |
| 300 void applyOverflowToViewportAndSetRenderer(RenderObject*, ScrollbarMode& hMo
de, ScrollbarMode& vMode); | 340 void applyOverflowToViewportAndSetRenderer(RenderObject*, ScrollbarMode& hMo
de, ScrollbarMode& vMode); |
| 301 void updateOverflowStatus(bool horizontalOverflow, bool verticalOverflow); | 341 void updateOverflowStatus(bool horizontalOverflow, bool verticalOverflow); |
| 302 | 342 |
| 303 void forceLayoutParentViewIfNeeded(); | 343 void forceLayoutParentViewIfNeeded(); |
| 304 void performPreLayoutTasks(); | 344 void performPreLayoutTasks(); |
| 305 void performLayout(RenderObject* rootForThisLayout, bool inSubtreeLayout); | 345 void performLayout(RenderObject* rootForThisLayout, bool inSubtreeLayout); |
| 306 void scheduleOrPerformPostLayoutTasks(); | 346 void scheduleOrPerformPostLayoutTasks(); |
| 307 void performPostLayoutTasks(); | 347 void performPostLayoutTasks(); |
| 308 | 348 |
| 309 void invalidateTreeIfNeeded(); | 349 void invalidateTreeIfNeeded(); |
| 310 | 350 |
| 311 void gatherDebugLayoutRects(RenderObject* layoutRoot); | 351 void gatherDebugLayoutRects(RenderObject* layoutRoot); |
| 312 | 352 |
| 313 DocumentLifecycle& lifecycle() const; | 353 DocumentLifecycle& lifecycle() const; |
| 314 | 354 |
| 315 virtual void contentRectangleForPaintInvalidation(const IntRect&) OVERRIDE; | 355 // FIXME(sky): Remove now that we're not a ScrollView? |
| 316 virtual void contentsResized() OVERRIDE; | 356 void contentRectangleForPaintInvalidation(const IntRect&); |
| 317 virtual void scrollbarExistenceDidChange() OVERRIDE; | 357 void contentsResized(); |
| 358 void scrollbarExistenceDidChange(); |
| 318 | 359 |
| 319 // Override ScrollView methods to do point conversion via renderers, in orde
r to | 360 // Override ScrollView methods to do point conversion via renderers, in orde
r to |
| 320 // take transforms into account. | 361 // take transforms into account. |
| 321 virtual IntRect convertToContainingView(const IntRect&) const OVERRIDE; | 362 virtual IntRect convertToContainingView(const IntRect&) const OVERRIDE; |
| 322 virtual IntRect convertFromContainingView(const IntRect&) const OVERRIDE; | 363 virtual IntRect convertFromContainingView(const IntRect&) const OVERRIDE; |
| 323 virtual IntPoint convertToContainingView(const IntPoint&) const OVERRIDE; | 364 virtual IntPoint convertToContainingView(const IntPoint&) const OVERRIDE; |
| 324 virtual IntPoint convertFromContainingView(const IntPoint&) const OVERRIDE; | 365 virtual IntPoint convertFromContainingView(const IntPoint&) const OVERRIDE; |
| 325 | 366 |
| 326 void updateWidgetPositionsIfNeeded(); | 367 void updateWidgetPositionsIfNeeded(); |
| 327 | 368 |
| 328 bool wasViewportResized(); | 369 bool wasViewportResized(); |
| 329 void sendResizeEventIfNeeded(); | 370 void sendResizeEventIfNeeded(); |
| 330 | 371 |
| 331 virtual void notifyPageThatContentAreaWillPaint() const OVERRIDE; | 372 // FIXME(sky): Remove now that we're not a ScrollView? |
| 373 void notifyPageThatContentAreaWillPaint() const; |
| 332 | 374 |
| 333 void scrollPositionChanged(); | 375 void scrollPositionChanged(); |
| 334 void didScrollTimerFired(Timer<FrameView>*); | 376 void didScrollTimerFired(Timer<FrameView>*); |
| 335 | 377 |
| 336 void updateLayersAndCompositingAfterScrollIfNeeded(); | 378 void updateLayersAndCompositingAfterScrollIfNeeded(); |
| 337 void updateFixedElementPaintInvalidationRectsAfterScroll(); | 379 void updateFixedElementPaintInvalidationRectsAfterScroll(); |
| 338 void updateCompositedSelectionBoundsIfNeeded(); | 380 void updateCompositedSelectionBoundsIfNeeded(); |
| 339 | 381 |
| 340 void setLayoutSizeInternal(const IntSize&); | 382 void setLayoutSizeInternal(const IntSize&); |
| 341 | 383 |
| 342 bool paintInvalidationIsAllowed() const | 384 bool paintInvalidationIsAllowed() const |
| 343 { | 385 { |
| 344 return !isInPerformLayout() || canInvalidatePaintDuringPerformLayout(); | 386 return !isInPerformLayout() || canInvalidatePaintDuringPerformLayout(); |
| 345 } | 387 } |
| 346 | 388 |
| 347 static double s_currentFrameTimeStamp; // used for detecting decoded resourc
e thrash in the cache | 389 static double s_currentFrameTimeStamp; // used for detecting decoded resourc
e thrash in the cache |
| 348 static bool s_inPaintContents; | 390 static bool s_inPaintContents; |
| 349 | 391 |
| 350 LayoutSize m_size; | 392 LayoutSize m_size; |
| 351 | 393 |
| 352 // FIXME: These are just "children" of the FrameView and should be RefPtr<Wi
dget> instead. | 394 // FIXME: These are just "children" of the FrameView and should be RefPtr<Wi
dget> instead. |
| 353 WillBePersistentHeapHashSet<RefPtrWillBeMember<RenderWidget> > m_widgets; | 395 WillBePersistentHeapHashSet<RefPtrWillBeMember<RenderWidget> > m_widgets; |
| 354 | 396 |
| 355 RefPtr<LocalFrame> m_frame; | 397 RefPtr<LocalFrame> m_frame; |
| 398 HashSet<RefPtr<Widget> > m_children; |
| 356 | 399 |
| 357 bool m_doFullPaintInvalidation; | 400 bool m_doFullPaintInvalidation; |
| 358 | 401 |
| 402 // FIXME(sky): Remove |
| 359 bool m_canHaveScrollbars; | 403 bool m_canHaveScrollbars; |
| 360 unsigned m_slowRepaintObjectCount; | 404 unsigned m_slowRepaintObjectCount; |
| 361 | 405 |
| 362 bool m_hasPendingLayout; | 406 bool m_hasPendingLayout; |
| 363 RenderObject* m_layoutSubtreeRoot; | 407 RenderObject* m_layoutSubtreeRoot; |
| 364 | 408 |
| 365 bool m_layoutSchedulingEnabled; | 409 bool m_layoutSchedulingEnabled; |
| 366 bool m_inPerformLayout; | 410 bool m_inPerformLayout; |
| 367 bool m_canInvalidatePaintDuringPerformLayout; | 411 bool m_canInvalidatePaintDuringPerformLayout; |
| 368 bool m_inSynchronousPostLayout; | 412 bool m_inSynchronousPostLayout; |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 438 m_view->setCanInvalidatePaintDuringPerformLayout(m_originalValue); | 482 m_view->setCanInvalidatePaintDuringPerformLayout(m_originalValue); |
| 439 } | 483 } |
| 440 private: | 484 private: |
| 441 FrameView* m_view; | 485 FrameView* m_view; |
| 442 bool m_originalValue; | 486 bool m_originalValue; |
| 443 }; | 487 }; |
| 444 | 488 |
| 445 } // namespace blink | 489 } // namespace blink |
| 446 | 490 |
| 447 #endif // FrameView_h | 491 #endif // FrameView_h |
| OLD | NEW |