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 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 virtual void invalidateRect(const IntRect&) OVERRIDE; | 71 virtual void invalidateRect(const IntRect&) OVERRIDE; |
72 virtual void setFrameRect(const IntRect&) OVERRIDE; | 72 virtual void setFrameRect(const IntRect&) OVERRIDE; |
73 | 73 |
74 virtual bool scheduleAnimation() OVERRIDE; | 74 virtual bool scheduleAnimation() OVERRIDE; |
75 | 75 |
76 Frame& frame() const { return *m_frame; } | 76 Frame& frame() const { return *m_frame; } |
77 | 77 |
78 RenderView* renderView() const; | 78 RenderView* renderView() const; |
79 | 79 |
80 virtual void setCanHaveScrollbars(bool) OVERRIDE; | 80 virtual void setCanHaveScrollbars(bool) OVERRIDE; |
81 void updateCanHaveScrollbars(); | |
82 | 81 |
83 virtual PassRefPtr<Scrollbar> createScrollbar(ScrollbarOrientation) OVERRIDE
; | 82 virtual PassRefPtr<Scrollbar> createScrollbar(ScrollbarOrientation) OVERRIDE
; |
84 | 83 |
85 virtual void setContentsSize(const IntSize&) OVERRIDE; | 84 virtual void setContentsSize(const IntSize&) OVERRIDE; |
86 | 85 |
87 void layout(bool allowSubtree = true); | 86 void layout(bool allowSubtree = true); |
88 bool didFirstLayout() const; | 87 bool didFirstLayout() const; |
89 void layoutTimerFired(Timer<FrameView>*); | 88 void layoutTimerFired(Timer<FrameView>*); |
90 void scheduleRelayout(); | 89 void scheduleRelayout(); |
91 void scheduleRelayoutOfSubtree(RenderObject*); | 90 void scheduleRelayoutOfSubtree(RenderObject*); |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 // offsets from rubber-banding, and it takes zooming into account. | 169 // offsets from rubber-banding, and it takes zooming into account. |
171 LayoutRect viewportConstrainedVisibleContentRect() const; | 170 LayoutRect viewportConstrainedVisibleContentRect() const; |
172 | 171 |
173 AtomicString mediaType() const; | 172 AtomicString mediaType() const; |
174 void setMediaType(const AtomicString&); | 173 void setMediaType(const AtomicString&); |
175 void adjustMediaTypeForPrinting(bool printing); | 174 void adjustMediaTypeForPrinting(bool printing); |
176 | 175 |
177 void setCannotBlitToWindow(); | 176 void setCannotBlitToWindow(); |
178 void setIsOverlapped(bool); | 177 void setIsOverlapped(bool); |
179 bool isOverlapped() const { return m_isOverlapped; } | 178 bool isOverlapped() const { return m_isOverlapped; } |
180 bool isOverlappedIncludingAncestors() const; | |
181 void setContentIsOpaque(bool); | 179 void setContentIsOpaque(bool); |
182 | 180 |
183 void addSlowRepaintObject(); | 181 void addSlowRepaintObject(); |
184 void removeSlowRepaintObject(); | 182 void removeSlowRepaintObject(); |
185 bool hasSlowRepaintObjects() const { return m_slowRepaintObjectCount; } | 183 bool hasSlowRepaintObjects() const { return m_slowRepaintObjectCount; } |
186 | 184 |
187 // Includes fixed- and sticky-position objects. | 185 // Includes fixed- and sticky-position objects. |
188 typedef HashSet<RenderObject*> ViewportConstrainedObjectSet; | 186 typedef HashSet<RenderObject*> ViewportConstrainedObjectSet; |
189 void addViewportConstrainedObject(RenderObject*); | 187 void addViewportConstrainedObject(RenderObject*); |
190 void removeViewportConstrainedObject(RenderObject*); | 188 void removeViewportConstrainedObject(RenderObject*); |
(...skipping 20 matching lines...) Expand all Loading... |
211 void removeWidget(RenderWidget*); | 209 void removeWidget(RenderWidget*); |
212 void updateWidgetPositions(); | 210 void updateWidgetPositions(); |
213 | 211 |
214 void addWidgetToUpdate(RenderEmbeddedObject&); | 212 void addWidgetToUpdate(RenderEmbeddedObject&); |
215 | 213 |
216 virtual void paintContents(GraphicsContext*, const IntRect& damageRect) OVER
RIDE; | 214 virtual void paintContents(GraphicsContext*, const IntRect& damageRect) OVER
RIDE; |
217 void setPaintBehavior(PaintBehavior); | 215 void setPaintBehavior(PaintBehavior); |
218 PaintBehavior paintBehavior() const; | 216 PaintBehavior paintBehavior() const; |
219 bool isPainting() const; | 217 bool isPainting() const; |
220 bool hasEverPainted() const { return m_lastPaintTime; } | 218 bool hasEverPainted() const { return m_lastPaintTime; } |
221 void setLastPaintTime(double lastPaintTime) { m_lastPaintTime = lastPaintTim
e; } | |
222 void setNodeToDraw(Node*); | 219 void setNodeToDraw(Node*); |
223 | 220 |
224 virtual void paintOverhangAreas(GraphicsContext*, const IntRect& horizontalO
verhangArea, const IntRect& verticalOverhangArea, const IntRect& dirtyRect) OVER
RIDE; | 221 virtual void paintOverhangAreas(GraphicsContext*, const IntRect& horizontalO
verhangArea, const IntRect& verticalOverhangArea, const IntRect& dirtyRect) OVER
RIDE; |
225 virtual void paintScrollCorner(GraphicsContext*, const IntRect& cornerRect)
OVERRIDE; | 222 virtual void paintScrollCorner(GraphicsContext*, const IntRect& cornerRect)
OVERRIDE; |
226 virtual void paintScrollbar(GraphicsContext*, Scrollbar*, const IntRect&) OV
ERRIDE; | 223 virtual void paintScrollbar(GraphicsContext*, Scrollbar*, const IntRect&) OV
ERRIDE; |
227 | 224 |
228 Color documentBackgroundColor() const; | 225 Color documentBackgroundColor() const; |
229 | 226 |
230 static double currentFrameTimeStamp() { return s_currentFrameTimeStamp; } | 227 static double currentFrameTimeStamp() { return s_currentFrameTimeStamp; } |
231 | 228 |
232 void updateLayoutAndStyleIfNeededRecursive(); | 229 void updateLayoutAndStyleIfNeededRecursive(); |
233 | 230 |
234 void incrementVisuallyNonEmptyCharacterCount(unsigned); | 231 void incrementVisuallyNonEmptyCharacterCount(unsigned); |
235 void incrementVisuallyNonEmptyPixelCount(const IntSize&); | 232 void incrementVisuallyNonEmptyPixelCount(const IntSize&); |
236 void setIsVisuallyNonEmpty() { m_isVisuallyNonEmpty = true; } | 233 void setIsVisuallyNonEmpty() { m_isVisuallyNonEmpty = true; } |
237 bool isVisuallyNonEmpty() const { return m_isVisuallyNonEmpty; } | |
238 void enableAutoSizeMode(bool enable, const IntSize& minSize, const IntSize&
maxSize); | 234 void enableAutoSizeMode(bool enable, const IntSize& minSize, const IntSize&
maxSize); |
239 | 235 |
240 void forceLayout(bool allowSubtree = false); | 236 void forceLayout(bool allowSubtree = false); |
241 void forceLayoutForPagination(const FloatSize& pageSize, const FloatSize& or
iginalPageSize, float maximumShrinkFactor, AdjustViewSizeOrNot); | 237 void forceLayoutForPagination(const FloatSize& pageSize, const FloatSize& or
iginalPageSize, float maximumShrinkFactor, AdjustViewSizeOrNot); |
242 | 238 |
243 bool scrollToFragment(const KURL&); | 239 bool scrollToFragment(const KURL&); |
244 bool scrollToAnchor(const String&); | 240 bool scrollToAnchor(const String&); |
245 void maintainScrollPositionAtAnchor(Node*); | 241 void maintainScrollPositionAtAnchor(Node*); |
246 void scrollElementToRect(Element*, const IntRect&); | 242 void scrollElementToRect(Element*, const IntRect&); |
247 | 243 |
248 // Methods to convert points and rects between the coordinate space of the r
enderer, and this view. | 244 // Methods to convert points and rects between the coordinate space of the r
enderer, and this view. |
249 IntRect convertFromRenderer(const RenderObject*, const IntRect&) const; | 245 IntRect convertFromRenderer(const RenderObject*, const IntRect&) const; |
250 IntRect convertToRenderer(const RenderObject*, const IntRect&) const; | 246 IntRect convertToRenderer(const RenderObject*, const IntRect&) const; |
251 IntPoint convertFromRenderer(const RenderObject*, const IntPoint&) const; | 247 IntPoint convertFromRenderer(const RenderObject*, const IntPoint&) const; |
252 IntPoint convertToRenderer(const RenderObject*, const IntPoint&) const; | 248 IntPoint convertToRenderer(const RenderObject*, const IntPoint&) const; |
253 | 249 |
254 bool isFrameViewScrollCorner(RenderScrollbarPart* scrollCorner) const { retu
rn m_scrollCorner == scrollCorner; } | 250 bool isFrameViewScrollCorner(RenderScrollbarPart* scrollCorner) const { retu
rn m_scrollCorner == scrollCorner; } |
255 | 251 |
256 bool isScrollable(); | 252 bool isScrollable(); |
257 | 253 |
258 enum ScrollbarModesCalculationStrategy { RulesFromWebContentOnly, AnyRule }; | 254 enum ScrollbarModesCalculationStrategy { RulesFromWebContentOnly, AnyRule }; |
259 void calculateScrollbarModesForLayout(ScrollbarMode& hMode, ScrollbarMode& v
Mode, ScrollbarModesCalculationStrategy = AnyRule); | 255 void calculateScrollbarModesForLayout(ScrollbarMode& hMode, ScrollbarMode& v
Mode, ScrollbarModesCalculationStrategy = AnyRule); |
260 | 256 |
261 // Normal delay | |
262 static void setRepaintThrottlingDeferredRepaintDelay(double); | |
263 // Negative value would mean that first few repaints happen without a delay | |
264 static void setRepaintThrottlingnInitialDeferredRepaintDelayDuringLoading(do
uble); | |
265 // The delay grows on each repaint to this maximum value | |
266 static void setRepaintThrottlingMaxDeferredRepaintDelayDuringLoading(double)
; | |
267 // On each repaint the delay increses by this amount | |
268 static void setRepaintThrottlingDeferredRepaintDelayIncrementDuringLoading(d
ouble); | |
269 | |
270 virtual IntPoint lastKnownMousePosition() const OVERRIDE; | 257 virtual IntPoint lastKnownMousePosition() const OVERRIDE; |
271 bool shouldSetCursor() const; | 258 bool shouldSetCursor() const; |
272 | 259 |
273 void setCursor(const Cursor&); | 260 void setCursor(const Cursor&); |
274 | 261 |
275 virtual bool scrollbarsCanBeActive() const OVERRIDE; | 262 virtual bool scrollbarsCanBeActive() const OVERRIDE; |
276 | 263 |
277 // FIXME: Remove this method once plugin loading is decoupled from layout. | 264 // FIXME: Remove this method once plugin loading is decoupled from layout. |
278 void flushAnyPendingPostLayoutTasks(); | 265 void flushAnyPendingPostLayoutTasks(); |
279 | 266 |
280 virtual bool shouldSuspendScrollAnimations() const OVERRIDE; | 267 virtual bool shouldSuspendScrollAnimations() const OVERRIDE; |
281 virtual void scrollbarStyleChanged(int newStyle, bool forceUpdate) OVERRIDE; | 268 virtual void scrollbarStyleChanged(int newStyle, bool forceUpdate) OVERRIDE; |
282 | 269 |
283 void setAnimatorsAreActive(); | |
284 | |
285 RenderBox* embeddedContentBox() const; | 270 RenderBox* embeddedContentBox() const; |
286 | 271 |
287 void setTracksRepaints(bool); | 272 void setTracksRepaints(bool); |
288 bool isTrackingRepaints() const { return m_isTrackingRepaints; } | 273 bool isTrackingRepaints() const { return m_isTrackingRepaints; } |
289 void resetTrackedRepaints(); | 274 void resetTrackedRepaints(); |
290 const Vector<IntRect>& trackedRepaintRects() const { return m_trackedRepaint
Rects; } | |
291 String trackedRepaintRectsAsText() const; | 275 String trackedRepaintRectsAsText() const; |
292 | 276 |
293 typedef HashSet<ScrollableArea*> ScrollableAreaSet; | 277 typedef HashSet<ScrollableArea*> ScrollableAreaSet; |
294 // Returns whether the scrollable area has just been newly added. | 278 // Returns whether the scrollable area has just been newly added. |
295 bool addScrollableArea(ScrollableArea*); | 279 bool addScrollableArea(ScrollableArea*); |
296 // Returns whether the scrollable area has just been removed. | 280 // Returns whether the scrollable area has just been removed. |
297 bool removeScrollableArea(ScrollableArea*); | 281 bool removeScrollableArea(ScrollableArea*); |
298 bool containsScrollableArea(const ScrollableArea*) const; | 282 bool containsScrollableArea(const ScrollableArea*) const; |
299 const ScrollableAreaSet* scrollableAreas() const { return m_scrollableAreas.
get(); } | 283 const ScrollableAreaSet* scrollableAreas() const { return m_scrollableAreas.
get(); } |
300 | 284 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 protected: | 326 protected: |
343 virtual bool scrollContentsFastPath(const IntSize& scrollDelta, const IntRec
t& rectToScroll, const IntRect& clipRect) OVERRIDE; | 327 virtual bool scrollContentsFastPath(const IntSize& scrollDelta, const IntRec
t& rectToScroll, const IntRect& clipRect) OVERRIDE; |
344 virtual void scrollContentsSlowPath(const IntRect& updateRect) OVERRIDE; | 328 virtual void scrollContentsSlowPath(const IntRect& updateRect) OVERRIDE; |
345 | 329 |
346 virtual bool isVerticalDocument() const OVERRIDE; | 330 virtual bool isVerticalDocument() const OVERRIDE; |
347 virtual bool isFlippedDocument() const OVERRIDE; | 331 virtual bool isFlippedDocument() const OVERRIDE; |
348 | 332 |
349 private: | 333 private: |
350 explicit FrameView(Frame*); | 334 explicit FrameView(Frame*); |
351 | 335 |
352 void beginDeferredRepaints(); | |
353 void endDeferredRepaints(); | |
354 void flushDeferredRepaints(); | 336 void flushDeferredRepaints(); |
355 void startDeferredRepaintTimer(double delay); | 337 void startDeferredRepaintTimer(double delay); |
356 | 338 |
357 void reset(); | 339 void reset(); |
358 void init(); | 340 void init(); |
359 | 341 |
360 virtual void frameRectsChanged() OVERRIDE; | 342 virtual void frameRectsChanged() OVERRIDE; |
361 virtual bool isFrameView() const OVERRIDE { return true; } | 343 virtual bool isFrameView() const OVERRIDE { return true; } |
362 | 344 |
363 friend class RenderWidget; | 345 friend class RenderWidget; |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
454 | 436 |
455 RefPtr<Frame> m_frame; | 437 RefPtr<Frame> m_frame; |
456 | 438 |
457 bool m_doFullRepaint; | 439 bool m_doFullRepaint; |
458 | 440 |
459 bool m_canHaveScrollbars; | 441 bool m_canHaveScrollbars; |
460 bool m_cannotBlitToWindow; | 442 bool m_cannotBlitToWindow; |
461 bool m_isOverlapped; | 443 bool m_isOverlapped; |
462 bool m_contentIsOpaque; | 444 bool m_contentIsOpaque; |
463 unsigned m_slowRepaintObjectCount; | 445 unsigned m_slowRepaintObjectCount; |
464 int m_borderX; | |
465 int m_borderY; | |
466 | 446 |
467 Timer<FrameView> m_layoutTimer; | 447 Timer<FrameView> m_layoutTimer; |
468 bool m_delayedLayout; | 448 bool m_delayedLayout; |
469 RenderObject* m_layoutRoot; | 449 RenderObject* m_layoutRoot; |
470 | 450 |
471 bool m_layoutSchedulingEnabled; | 451 bool m_layoutSchedulingEnabled; |
472 bool m_inLayout; | 452 bool m_inLayout; |
473 bool m_doingPreLayoutStyleUpdate; | 453 bool m_doingPreLayoutStyleUpdate; |
474 bool m_inSynchronousPostLayout; | 454 bool m_inSynchronousPostLayout; |
475 int m_layoutCount; | 455 int m_layoutCount; |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
530 bool m_didRunAutosize; | 510 bool m_didRunAutosize; |
531 // The lower bound on the size when autosizing. | 511 // The lower bound on the size when autosizing. |
532 IntSize m_minAutoSize; | 512 IntSize m_minAutoSize; |
533 // The upper bound on the size when autosizing. | 513 // The upper bound on the size when autosizing. |
534 IntSize m_maxAutoSize; | 514 IntSize m_maxAutoSize; |
535 | 515 |
536 OwnPtr<ScrollableAreaSet> m_scrollableAreas; | 516 OwnPtr<ScrollableAreaSet> m_scrollableAreas; |
537 OwnPtr<ResizerAreaSet> m_resizerAreas; | 517 OwnPtr<ResizerAreaSet> m_resizerAreas; |
538 OwnPtr<ViewportConstrainedObjectSet> m_viewportConstrainedObjects; | 518 OwnPtr<ViewportConstrainedObjectSet> m_viewportConstrainedObjects; |
539 | 519 |
540 static double s_normalDeferredRepaintDelay; | |
541 static double s_initialDeferredRepaintDelayDuringLoading; | |
542 static double s_maxDeferredRepaintDelayDuringLoading; | |
543 static double s_deferredRepaintDelayIncrementDuringLoading; | |
544 | |
545 bool m_hasSoftwareFilters; | 520 bool m_hasSoftwareFilters; |
546 | 521 |
547 float m_visibleContentScaleFactor; | 522 float m_visibleContentScaleFactor; |
548 IntSize m_inputEventsOffsetForEmulation; | 523 IntSize m_inputEventsOffsetForEmulation; |
549 float m_inputEventsScaleFactorForEmulation; | 524 float m_inputEventsScaleFactorForEmulation; |
550 | 525 |
551 PartialLayoutState m_partialLayout; | 526 PartialLayoutState m_partialLayout; |
552 IntSize m_layoutSize; | 527 IntSize m_layoutSize; |
553 bool m_layoutSizeFixedToFrameSize; | 528 bool m_layoutSizeFixedToFrameSize; |
554 }; | 529 }; |
(...skipping 19 matching lines...) Expand all Loading... |
574 static const unsigned visualPixelThreshold = 32 * 32; | 549 static const unsigned visualPixelThreshold = 32 * 32; |
575 if (m_visuallyNonEmptyPixelCount > visualPixelThreshold) | 550 if (m_visuallyNonEmptyPixelCount > visualPixelThreshold) |
576 setIsVisuallyNonEmpty(); | 551 setIsVisuallyNonEmpty(); |
577 } | 552 } |
578 | 553 |
579 DEFINE_TYPE_CASTS(FrameView, Widget, widget, widget->isFrameView(), widget.isFra
meView()); | 554 DEFINE_TYPE_CASTS(FrameView, Widget, widget, widget->isFrameView(), widget.isFra
meView()); |
580 | 555 |
581 } // namespace WebCore | 556 } // namespace WebCore |
582 | 557 |
583 #endif // FrameView_h | 558 #endif // FrameView_h |
OLD | NEW |