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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 | 104 |
105 // Methods for getting/setting the size Blink should use to layout the conte
nts. | 105 // Methods for getting/setting the size Blink should use to layout the conte
nts. |
106 IntSize layoutSize(IncludeScrollbarsInRect = ExcludeScrollbars) const; | 106 IntSize layoutSize(IncludeScrollbarsInRect = ExcludeScrollbars) const; |
107 void setLayoutSize(const IntSize&); | 107 void setLayoutSize(const IntSize&); |
108 | 108 |
109 // If this is set to false, the layout size will need to be explicitly set b
y the owner. | 109 // If this is set to false, the layout size will need to be explicitly set b
y the owner. |
110 // E.g. WebViewImpl sets its mainFrame's layout size manually | 110 // E.g. WebViewImpl sets its mainFrame's layout size manually |
111 void setLayoutSizeFixedToFrameSize(bool isFixed) { m_layoutSizeFixedToFrameS
ize = isFixed; } | 111 void setLayoutSizeFixedToFrameSize(bool isFixed) { m_layoutSizeFixedToFrameS
ize = isFixed; } |
112 bool layoutSizeFixedToFrameSize() { return m_layoutSizeFixedToFrameSize; } | 112 bool layoutSizeFixedToFrameSize() { return m_layoutSizeFixedToFrameSize; } |
113 | 113 |
114 bool needsFullRepaint() const { return m_doFullRepaint; } | 114 bool needsFullPaintInvalidation() const { return m_doFullPaintInvalidation;
} |
115 | 115 |
116 void updateAcceleratedCompositingSettings(); | 116 void updateAcceleratedCompositingSettings(); |
117 | 117 |
118 void recalcOverflowAfterStyleChange(); | 118 void recalcOverflowAfterStyleChange(); |
119 void updateCompositingLayersAfterStyleChange(); | 119 void updateCompositingLayersAfterStyleChange(); |
120 | 120 |
121 bool hasCompositedContent() const; | 121 bool hasCompositedContent() const; |
122 bool isEnclosedInCompositingLayer() const; | 122 bool isEnclosedInCompositingLayer() const; |
123 | 123 |
124 void resetScrollbars(); | 124 void resetScrollbars(); |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 virtual bool scrollbarsCanBeActive() const OVERRIDE; | 255 virtual bool scrollbarsCanBeActive() const OVERRIDE; |
256 | 256 |
257 // FIXME: Remove this method once plugin loading is decoupled from layout. | 257 // FIXME: Remove this method once plugin loading is decoupled from layout. |
258 void flushAnyPendingPostLayoutTasks(); | 258 void flushAnyPendingPostLayoutTasks(); |
259 | 259 |
260 virtual bool shouldSuspendScrollAnimations() const OVERRIDE; | 260 virtual bool shouldSuspendScrollAnimations() const OVERRIDE; |
261 virtual void scrollbarStyleChanged() OVERRIDE; | 261 virtual void scrollbarStyleChanged() OVERRIDE; |
262 | 262 |
263 RenderBox* embeddedContentBox() const; | 263 RenderBox* embeddedContentBox() const; |
264 | 264 |
265 void setTracksRepaints(bool); | 265 void setTracksPaintInvalidations(bool); |
266 bool isTrackingRepaints() const { return m_isTrackingRepaints; } | 266 bool isTrackingPaintInvalidations() const { return m_isTrackingPaintInvalida
tions; } |
267 void resetTrackedRepaints(); | 267 void resetTrackedPaintInvalidations(); |
268 String trackedRepaintRectsAsText() const; | 268 String trackedPaintInvalidationRectsAsText() const; |
269 | 269 |
270 typedef HashSet<ScrollableArea*> ScrollableAreaSet; | 270 typedef HashSet<ScrollableArea*> ScrollableAreaSet; |
271 void addScrollableArea(ScrollableArea*); | 271 void addScrollableArea(ScrollableArea*); |
272 void removeScrollableArea(ScrollableArea*); | 272 void removeScrollableArea(ScrollableArea*); |
273 const ScrollableAreaSet* scrollableAreas() const { return m_scrollableAreas.
get(); } | 273 const ScrollableAreaSet* scrollableAreas() const { return m_scrollableAreas.
get(); } |
274 | 274 |
275 // With CSS style "resize:" enabled, a little resizer handle will appear at
the bottom | 275 // With CSS style "resize:" enabled, a little resizer handle will appear at
the bottom |
276 // right of the object. We keep track of these resizer areas for checking if
touches | 276 // right of the object. We keep track of these resizer areas for checking if
touches |
277 // (implemented using Scroll gesture) are targeting the resizer. | 277 // (implemented using Scroll gesture) are targeting the resizer. |
278 typedef HashSet<RenderBox*> ResizerAreaSet; | 278 typedef HashSet<RenderBox*> ResizerAreaSet; |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 void performLayout(RenderObject* rootForThisLayout, bool inSubtreeLayout); | 360 void performLayout(RenderObject* rootForThisLayout, bool inSubtreeLayout); |
361 void scheduleOrPerformPostLayoutTasks(); | 361 void scheduleOrPerformPostLayoutTasks(); |
362 void performPostLayoutTasks(); | 362 void performPostLayoutTasks(); |
363 | 363 |
364 void invalidateTree(RenderObject* root); | 364 void invalidateTree(RenderObject* root); |
365 | 365 |
366 void gatherDebugLayoutRects(RenderObject* layoutRoot); | 366 void gatherDebugLayoutRects(RenderObject* layoutRoot); |
367 | 367 |
368 DocumentLifecycle& lifecycle() const; | 368 DocumentLifecycle& lifecycle() const; |
369 | 369 |
370 virtual void repaintContentRectangle(const IntRect&) OVERRIDE; | 370 virtual void contentRectangleForPaintInvalidation(const IntRect&) OVERRIDE; |
371 virtual void contentsResized() OVERRIDE; | 371 virtual void contentsResized() OVERRIDE; |
372 virtual void scrollbarExistenceDidChange() OVERRIDE; | 372 virtual void scrollbarExistenceDidChange() OVERRIDE; |
373 | 373 |
374 // Override ScrollView methods to do point conversion via renderers, in orde
r to | 374 // Override ScrollView methods to do point conversion via renderers, in orde
r to |
375 // take transforms into account. | 375 // take transforms into account. |
376 virtual IntRect convertToContainingView(const IntRect&) const OVERRIDE; | 376 virtual IntRect convertToContainingView(const IntRect&) const OVERRIDE; |
377 virtual IntRect convertFromContainingView(const IntRect&) const OVERRIDE; | 377 virtual IntRect convertFromContainingView(const IntRect&) const OVERRIDE; |
378 virtual IntPoint convertToContainingView(const IntPoint&) const OVERRIDE; | 378 virtual IntPoint convertToContainingView(const IntPoint&) const OVERRIDE; |
379 virtual IntPoint convertFromContainingView(const IntPoint&) const OVERRIDE; | 379 virtual IntPoint convertFromContainingView(const IntPoint&) const OVERRIDE; |
380 | 380 |
381 void sendResizeEventIfNeeded(); | 381 void sendResizeEventIfNeeded(); |
382 | 382 |
383 void updateScrollableAreaSet(); | 383 void updateScrollableAreaSet(); |
384 | 384 |
385 virtual void notifyPageThatContentAreaWillPaint() const OVERRIDE; | 385 virtual void notifyPageThatContentAreaWillPaint() const OVERRIDE; |
386 | 386 |
387 void scheduleUpdateWidgetsIfNecessary(); | 387 void scheduleUpdateWidgetsIfNecessary(); |
388 void updateWidgetsTimerFired(Timer<FrameView>*); | 388 void updateWidgetsTimerFired(Timer<FrameView>*); |
389 bool updateWidgets(); | 389 bool updateWidgets(); |
390 | 390 |
391 void scrollToAnchor(); | 391 void scrollToAnchor(); |
392 void scrollPositionChanged(); | 392 void scrollPositionChanged(); |
393 void didScrollTimerFired(Timer<FrameView>*); | 393 void didScrollTimerFired(Timer<FrameView>*); |
394 | 394 |
395 void updateLayersAndCompositingAfterScrollIfNeeded(); | 395 void updateLayersAndCompositingAfterScrollIfNeeded(); |
396 void updateFixedElementRepaintRectsAfterScroll(); | 396 void updateFixedElementPaintInvalidationRectsAfterScroll(); |
397 | 397 |
398 bool hasCustomScrollbars() const; | 398 bool hasCustomScrollbars() const; |
399 bool shouldUseCustomScrollbars(Element*& customScrollbarElement, LocalFrame*
& customScrollbarFrame); | 399 bool shouldUseCustomScrollbars(Element*& customScrollbarElement, LocalFrame*
& customScrollbarFrame); |
400 | 400 |
401 virtual void updateScrollCorner() OVERRIDE; | 401 virtual void updateScrollCorner() OVERRIDE; |
402 | 402 |
403 FrameView* parentFrameView() const; | 403 FrameView* parentFrameView() const; |
404 | 404 |
405 AXObjectCache* axObjectCache() const; | 405 AXObjectCache* axObjectCache() const; |
406 void removeFromAXObjectCache(); | 406 void removeFromAXObjectCache(); |
407 | 407 |
408 void setLayoutSizeInternal(const IntSize&); | 408 void setLayoutSizeInternal(const IntSize&); |
409 | 409 |
410 bool repaintAllowed() const | 410 bool paintInvalidationIsAllowed() const |
411 { | 411 { |
412 if (!RuntimeEnabledFeatures::repaintAfterLayoutEnabled()) | 412 if (!RuntimeEnabledFeatures::repaintAfterLayoutEnabled()) |
413 return true; | 413 return true; |
414 | 414 |
415 return !isInPerformLayout() || canInvalidatePaintDuringPerformLayout(); | 415 return !isInPerformLayout() || canInvalidatePaintDuringPerformLayout(); |
416 } | 416 } |
417 | 417 |
418 static double s_currentFrameTimeStamp; // used for detecting decoded resourc
e thrash in the cache | 418 static double s_currentFrameTimeStamp; // used for detecting decoded resourc
e thrash in the cache |
419 static bool s_inPaintContents; | 419 static bool s_inPaintContents; |
420 | 420 |
421 LayoutSize m_size; | 421 LayoutSize m_size; |
422 | 422 |
423 typedef HashSet<RefPtr<RenderEmbeddedObject> > EmbeddedObjectSet; | 423 typedef HashSet<RefPtr<RenderEmbeddedObject> > EmbeddedObjectSet; |
424 EmbeddedObjectSet m_widgetUpdateSet; | 424 EmbeddedObjectSet m_widgetUpdateSet; |
425 | 425 |
426 // FIXME: These are just "children" of the FrameView and should be RefPtr<Wi
dget> instead. | 426 // FIXME: These are just "children" of the FrameView and should be RefPtr<Wi
dget> instead. |
427 HashSet<RefPtr<RenderWidget> > m_widgets; | 427 HashSet<RefPtr<RenderWidget> > m_widgets; |
428 | 428 |
429 RefPtr<LocalFrame> m_frame; | 429 RefPtr<LocalFrame> m_frame; |
430 | 430 |
431 bool m_doFullRepaint; | 431 bool m_doFullPaintInvalidation; |
432 | 432 |
433 bool m_canHaveScrollbars; | 433 bool m_canHaveScrollbars; |
434 bool m_cannotBlitToWindow; | 434 bool m_cannotBlitToWindow; |
435 bool m_isOverlapped; | 435 bool m_isOverlapped; |
436 bool m_contentIsOpaque; | 436 bool m_contentIsOpaque; |
437 unsigned m_slowRepaintObjectCount; | 437 unsigned m_slowRepaintObjectCount; |
438 | 438 |
439 bool m_hasPendingLayout; | 439 bool m_hasPendingLayout; |
440 RenderObject* m_layoutSubtreeRoot; | 440 RenderObject* m_layoutSubtreeRoot; |
441 | 441 |
(...skipping 20 matching lines...) Expand all Loading... |
462 bool m_horizontalOverflow; | 462 bool m_horizontalOverflow; |
463 bool m_verticalOverflow; | 463 bool m_verticalOverflow; |
464 RenderObject* m_viewportRenderer; | 464 RenderObject* m_viewportRenderer; |
465 | 465 |
466 bool m_wasScrolledByUser; | 466 bool m_wasScrolledByUser; |
467 bool m_inProgrammaticScroll; | 467 bool m_inProgrammaticScroll; |
468 bool m_safeToPropagateScrollToParent; | 468 bool m_safeToPropagateScrollToParent; |
469 | 469 |
470 double m_lastPaintTime; | 470 double m_lastPaintTime; |
471 | 471 |
472 bool m_isTrackingRepaints; // Used for testing. | 472 bool m_isTrackingPaintInvalidations; // Used for testing. |
473 Vector<IntRect> m_trackedRepaintRects; | 473 Vector<IntRect> m_trackedPaintInvalidationRects; |
474 | 474 |
475 RefPtrWillBePersistent<Node> m_nodeToDraw; | 475 RefPtrWillBePersistent<Node> m_nodeToDraw; |
476 PaintBehavior m_paintBehavior; | 476 PaintBehavior m_paintBehavior; |
477 bool m_isPainting; | 477 bool m_isPainting; |
478 | 478 |
479 unsigned m_visuallyNonEmptyCharacterCount; | 479 unsigned m_visuallyNonEmptyCharacterCount; |
480 unsigned m_visuallyNonEmptyPixelCount; | 480 unsigned m_visuallyNonEmptyPixelCount; |
481 bool m_isVisuallyNonEmpty; | 481 bool m_isVisuallyNonEmpty; |
482 bool m_firstVisuallyNonEmptyLayoutCallbackPending; | 482 bool m_firstVisuallyNonEmptyLayoutCallbackPending; |
483 | 483 |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
559 m_view->setCanInvalidatePaintDuringPerformLayout(m_originalValue); | 559 m_view->setCanInvalidatePaintDuringPerformLayout(m_originalValue); |
560 } | 560 } |
561 private: | 561 private: |
562 FrameView* m_view; | 562 FrameView* m_view; |
563 bool m_originalValue; | 563 bool m_originalValue; |
564 }; | 564 }; |
565 | 565 |
566 } // namespace WebCore | 566 } // namespace WebCore |
567 | 567 |
568 #endif // FrameView_h | 568 #endif // FrameView_h |
OLD | NEW |