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