| 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 | 74 |
| 75 class CORE_EXPORT FrameView final : public Widget, public ScrollableArea { | 75 class CORE_EXPORT FrameView final : public Widget, public ScrollableArea { |
| 76 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(FrameView); | 76 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(FrameView); |
| 77 public: | 77 public: |
| 78 friend class LayoutView; | 78 friend class LayoutView; |
| 79 friend class Internals; | 79 friend class Internals; |
| 80 | 80 |
| 81 static PassRefPtrWillBeRawPtr<FrameView> create(LocalFrame*); | 81 static PassRefPtrWillBeRawPtr<FrameView> create(LocalFrame*); |
| 82 static PassRefPtrWillBeRawPtr<FrameView> create(LocalFrame*, const IntSize&
initialSize); | 82 static PassRefPtrWillBeRawPtr<FrameView> create(LocalFrame*, const IntSize&
initialSize); |
| 83 | 83 |
| 84 virtual ~FrameView(); | 84 ~FrameView() override; |
| 85 | 85 |
| 86 virtual void invalidateRect(const IntRect&) override; | 86 void invalidateRect(const IntRect&) override; |
| 87 virtual void setFrameRect(const IntRect&) override; | 87 void setFrameRect(const IntRect&) override; |
| 88 | 88 |
| 89 LocalFrame& frame() const | 89 LocalFrame& frame() const |
| 90 { | 90 { |
| 91 ASSERT(m_frame); | 91 ASSERT(m_frame); |
| 92 return *m_frame; | 92 return *m_frame; |
| 93 } | 93 } |
| 94 | 94 |
| 95 Page* page() const; | 95 Page* page() const; |
| 96 | 96 |
| 97 LayoutView* layoutView() const; | 97 LayoutView* layoutView() const; |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 // |unobscuredRect| receives the clip rect that is not clipped to the root w
indow. It may be nullptr. | 164 // |unobscuredRect| receives the clip rect that is not clipped to the root w
indow. It may be nullptr. |
| 165 IntRect clipRectsForFrameOwner(const HTMLFrameOwnerElement*, IntRect* unobsc
uredRect) const; | 165 IntRect clipRectsForFrameOwner(const HTMLFrameOwnerElement*, IntRect* unobsc
uredRect) const; |
| 166 | 166 |
| 167 // Scale used to convert incoming input events. | 167 // Scale used to convert incoming input events. |
| 168 float inputEventsScaleFactor() const; | 168 float inputEventsScaleFactor() const; |
| 169 | 169 |
| 170 // Offset used to convert incoming input events while emulating device metic
s. | 170 // Offset used to convert incoming input events while emulating device metic
s. |
| 171 IntSize inputEventsOffsetForEmulation() const; | 171 IntSize inputEventsOffsetForEmulation() const; |
| 172 void setInputEventsTransformForEmulation(const IntSize&, float); | 172 void setInputEventsTransformForEmulation(const IntSize&, float); |
| 173 | 173 |
| 174 virtual void setScrollPosition(const DoublePoint&, ScrollType, ScrollBehavio
r = ScrollBehaviorInstant) override; | 174 void setScrollPosition(const DoublePoint&, ScrollType, ScrollBehavior = Scro
llBehaviorInstant) override; |
| 175 | 175 |
| 176 FloatSize elasticOverscroll() const { return m_elasticOverscroll; } | 176 FloatSize elasticOverscroll() const { return m_elasticOverscroll; } |
| 177 void setElasticOverscroll(const FloatSize&); | 177 void setElasticOverscroll(const FloatSize&); |
| 178 | 178 |
| 179 void viewportSizeChanged(bool widthChanged, bool heightChanged); | 179 void viewportSizeChanged(bool widthChanged, bool heightChanged); |
| 180 | 180 |
| 181 AtomicString mediaType() const; | 181 AtomicString mediaType() const; |
| 182 void setMediaType(const AtomicString&); | 182 void setMediaType(const AtomicString&); |
| 183 void adjustMediaTypeForPrinting(bool printing); | 183 void adjustMediaTypeForPrinting(bool printing); |
| 184 | 184 |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 bool isFrameViewScrollCorner(LayoutScrollbarPart* scrollCorner) const { retu
rn m_scrollCorner == scrollCorner; } | 260 bool isFrameViewScrollCorner(LayoutScrollbarPart* scrollCorner) const { retu
rn m_scrollCorner == scrollCorner; } |
| 261 | 261 |
| 262 enum ScrollingReasons { | 262 enum ScrollingReasons { |
| 263 Scrollable, | 263 Scrollable, |
| 264 NotScrollableNoOverflow, | 264 NotScrollableNoOverflow, |
| 265 NotScrollableNotVisible, | 265 NotScrollableNotVisible, |
| 266 NotScrollableExplicitlyDisabled | 266 NotScrollableExplicitlyDisabled |
| 267 }; | 267 }; |
| 268 | 268 |
| 269 ScrollingReasons scrollingReasons(); | 269 ScrollingReasons scrollingReasons(); |
| 270 virtual bool isScrollable() override; | 270 bool isScrollable() override; |
| 271 virtual bool isProgrammaticallyScrollable() override; | 271 bool isProgrammaticallyScrollable() override; |
| 272 | 272 |
| 273 enum ScrollbarModesCalculationStrategy { RulesFromWebContentOnly, AnyRule }; | 273 enum ScrollbarModesCalculationStrategy { RulesFromWebContentOnly, AnyRule }; |
| 274 void calculateScrollbarModesForLayout(ScrollbarMode& hMode, ScrollbarMode& v
Mode, ScrollbarModesCalculationStrategy = AnyRule); | 274 void calculateScrollbarModesForLayout(ScrollbarMode& hMode, ScrollbarMode& v
Mode, ScrollbarModesCalculationStrategy = AnyRule); |
| 275 | 275 |
| 276 virtual IntPoint lastKnownMousePosition() const override; | 276 IntPoint lastKnownMousePosition() const override; |
| 277 bool shouldSetCursor() const; | 277 bool shouldSetCursor() const; |
| 278 | 278 |
| 279 void setCursor(const Cursor&); | 279 void setCursor(const Cursor&); |
| 280 | 280 |
| 281 virtual bool scrollbarsCanBeActive() const override; | 281 bool scrollbarsCanBeActive() const override; |
| 282 | 282 |
| 283 // FIXME: Remove this method once plugin loading is decoupled from layout. | 283 // FIXME: Remove this method once plugin loading is decoupled from layout. |
| 284 void flushAnyPendingPostLayoutTasks(); | 284 void flushAnyPendingPostLayoutTasks(); |
| 285 | 285 |
| 286 virtual bool shouldSuspendScrollAnimations() const override; | 286 bool shouldSuspendScrollAnimations() const override; |
| 287 virtual void scrollbarStyleChanged() override; | 287 void scrollbarStyleChanged() override; |
| 288 | 288 |
| 289 LayoutBox* embeddedContentBox() const; | 289 LayoutBox* embeddedContentBox() const; |
| 290 | 290 |
| 291 void setTracksPaintInvalidations(bool); | 291 void setTracksPaintInvalidations(bool); |
| 292 bool isTrackingPaintInvalidations() const { return m_isTrackingPaintInvalida
tions; } | 292 bool isTrackingPaintInvalidations() const { return m_isTrackingPaintInvalida
tions; } |
| 293 void resetTrackedPaintInvalidations(); | 293 void resetTrackedPaintInvalidations(); |
| 294 | 294 |
| 295 String trackedPaintInvalidationRectsAsText() const; | 295 String trackedPaintInvalidationRectsAsText() const; |
| 296 | 296 |
| 297 using ScrollableAreaSet = WillBeHeapHashSet<RawPtrWillBeMember<ScrollableAre
a>>; | 297 using ScrollableAreaSet = WillBeHeapHashSet<RawPtrWillBeMember<ScrollableAre
a>>; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 309 typedef HashSet<LayoutBox*> ResizerAreaSet; | 309 typedef HashSet<LayoutBox*> ResizerAreaSet; |
| 310 void addResizerArea(LayoutBox&); | 310 void addResizerArea(LayoutBox&); |
| 311 void removeResizerArea(LayoutBox&); | 311 void removeResizerArea(LayoutBox&); |
| 312 const ResizerAreaSet* resizerAreas() const { return m_resizerAreas.get(); } | 312 const ResizerAreaSet* resizerAreas() const { return m_resizerAreas.get(); } |
| 313 | 313 |
| 314 // This function exists for ports that need to handle wheel events manually. | 314 // This function exists for ports that need to handle wheel events manually. |
| 315 // On Mac WebKit1 the underlying NSScrollView just does the scrolling, but o
n most other platforms | 315 // On Mac WebKit1 the underlying NSScrollView just does the scrolling, but o
n most other platforms |
| 316 // we need this function in order to do the scroll ourselves. | 316 // we need this function in order to do the scroll ourselves. |
| 317 ScrollResult wheelEvent(const PlatformWheelEvent&); | 317 ScrollResult wheelEvent(const PlatformWheelEvent&); |
| 318 | 318 |
| 319 virtual bool shouldUseIntegerScrollOffset() const override; | 319 bool shouldUseIntegerScrollOffset() const override; |
| 320 | 320 |
| 321 virtual bool isActive() const override; | 321 bool isActive() const override; |
| 322 | 322 |
| 323 // Override scrollbar notifications to update the AXObject cache. | 323 // Override scrollbar notifications to update the AXObject cache. |
| 324 virtual void didAddScrollbar(Scrollbar*, ScrollbarOrientation) override; | 324 void didAddScrollbar(Scrollbar*, ScrollbarOrientation) override; |
| 325 | 325 |
| 326 // FIXME: This should probably be renamed as the 'inSubtreeLayout' parameter | 326 // FIXME: This should probably be renamed as the 'inSubtreeLayout' parameter |
| 327 // passed around the FrameView layout methods can be true while this returns | 327 // passed around the FrameView layout methods can be true while this returns |
| 328 // false. | 328 // false. |
| 329 bool isSubtreeLayout() const { return !m_layoutSubtreeRoots.isEmpty(); } | 329 bool isSubtreeLayout() const { return !m_layoutSubtreeRoots.isEmpty(); } |
| 330 | 330 |
| 331 // Sets the tickmarks for the FrameView, overriding the default behavior | 331 // Sets the tickmarks for the FrameView, overriding the default behavior |
| 332 // which is to display the tickmarks corresponding to find results. | 332 // which is to display the tickmarks corresponding to find results. |
| 333 // If |m_tickmarks| is empty, the default behavior is restored. | 333 // If |m_tickmarks| is empty, the default behavior is restored. |
| 334 void setTickmarks(const Vector<IntRect>& tickmarks) | 334 void setTickmarks(const Vector<IntRect>& tickmarks) |
| 335 { | 335 { |
| 336 m_tickmarks = tickmarks; | 336 m_tickmarks = tickmarks; |
| 337 invalidatePaintForTickmarks(); | 337 invalidatePaintForTickmarks(); |
| 338 } | 338 } |
| 339 | 339 |
| 340 void invalidatePaintForTickmarks() const; | 340 void invalidatePaintForTickmarks() const; |
| 341 | 341 |
| 342 // Since the compositor can resize the viewport due to top controls and | 342 // Since the compositor can resize the viewport due to top controls and |
| 343 // commit scroll offsets before a WebView::resize occurs, we need to adjust | 343 // commit scroll offsets before a WebView::resize occurs, we need to adjust |
| 344 // our scroll extents to prevent clamping the scroll offsets. | 344 // our scroll extents to prevent clamping the scroll offsets. |
| 345 void setTopControlsViewportAdjustment(float); | 345 void setTopControlsViewportAdjustment(float); |
| 346 | 346 |
| 347 virtual IntPoint maximumScrollPosition() const override; | 347 IntPoint maximumScrollPosition() const override; |
| 348 | 348 |
| 349 // ScrollableArea interface | 349 // ScrollableArea interface |
| 350 virtual void invalidateScrollbarRect(Scrollbar*, const IntRect&) override; | 350 void invalidateScrollbarRect(Scrollbar*, const IntRect&) override; |
| 351 virtual void getTickmarks(Vector<IntRect>&) const override; | 351 void getTickmarks(Vector<IntRect>&) const override; |
| 352 void scrollTo(const DoublePoint&); | 352 void scrollTo(const DoublePoint&); |
| 353 virtual IntRect scrollableAreaBoundingBox() const override; | 353 IntRect scrollableAreaBoundingBox() const override; |
| 354 virtual bool scrollAnimatorEnabled() const override; | 354 bool scrollAnimatorEnabled() const override; |
| 355 virtual bool usesCompositedScrolling() const override; | 355 bool usesCompositedScrolling() const override; |
| 356 virtual GraphicsLayer* layerForScrolling() const override; | 356 GraphicsLayer* layerForScrolling() const override; |
| 357 virtual GraphicsLayer* layerForHorizontalScrollbar() const override; | 357 GraphicsLayer* layerForHorizontalScrollbar() const override; |
| 358 virtual GraphicsLayer* layerForVerticalScrollbar() const override; | 358 GraphicsLayer* layerForVerticalScrollbar() const override; |
| 359 virtual GraphicsLayer* layerForScrollCorner() const override; | 359 GraphicsLayer* layerForScrollCorner() const override; |
| 360 virtual int scrollSize(ScrollbarOrientation) const override; | 360 int scrollSize(ScrollbarOrientation) const override; |
| 361 virtual bool isScrollCornerVisible() const override; | 361 bool isScrollCornerVisible() const override; |
| 362 virtual bool userInputScrollable(ScrollbarOrientation) const override; | 362 bool userInputScrollable(ScrollbarOrientation) const override; |
| 363 virtual bool shouldPlaceVerticalScrollbarOnLeft() const override; | 363 bool shouldPlaceVerticalScrollbarOnLeft() const override; |
| 364 virtual LayoutRect scrollIntoView( | 364 virtual LayoutRect scrollIntoView( |
| 365 const LayoutRect& rectInContent, | 365 const LayoutRect& rectInContent, |
| 366 const ScrollAlignment& alignX, | 366 const ScrollAlignment& alignX, |
| 367 const ScrollAlignment& alignY) override; | 367 const ScrollAlignment& alignY) override; |
| 368 | 368 |
| 369 // The window that hosts the FrameView. The FrameView will communicate scrol
ls and repaints to the | 369 // The window that hosts the FrameView. The FrameView will communicate scrol
ls and repaints to the |
| 370 // host window in the window's coordinate space. | 370 // host window in the window's coordinate space. |
| 371 HostWindow* hostWindow() const override; | 371 HostWindow* hostWindow() const override; |
| 372 | 372 |
| 373 // Returns a clip rect in host window coordinates. Used to clip the blit on
a scroll. | 373 // Returns a clip rect in host window coordinates. Used to clip the blit on
a scroll. |
| 374 IntRect windowClipRect(IncludeScrollbarsInRect = ExcludeScrollbars) const; | 374 IntRect windowClipRect(IncludeScrollbarsInRect = ExcludeScrollbars) const; |
| 375 | 375 |
| 376 typedef WillBeHeapHashSet<RefPtrWillBeMember<Widget>> ChildrenWidgetSet; | 376 typedef WillBeHeapHashSet<RefPtrWillBeMember<Widget>> ChildrenWidgetSet; |
| 377 | 377 |
| 378 // Functions for child manipulation and inspection. | 378 // Functions for child manipulation and inspection. |
| 379 virtual void setParent(Widget*) override; | 379 void setParent(Widget*) override; |
| 380 void removeChild(Widget*); | 380 void removeChild(Widget*); |
| 381 void addChild(PassRefPtrWillBeRawPtr<Widget>); | 381 void addChild(PassRefPtrWillBeRawPtr<Widget>); |
| 382 const ChildrenWidgetSet* children() const { return &m_children; } | 382 const ChildrenWidgetSet* children() const { return &m_children; } |
| 383 | 383 |
| 384 // If the scroll view does not use a native widget, then it will have cross-
platform Scrollbars. These functions | 384 // If the scroll view does not use a native widget, then it will have cross-
platform Scrollbars. These functions |
| 385 // can be used to obtain those scrollbars. | 385 // can be used to obtain those scrollbars. |
| 386 virtual Scrollbar* horizontalScrollbar() const override { return m_horizonta
lScrollbar.get(); } | 386 Scrollbar* horizontalScrollbar() const override { return m_horizontalScrollb
ar.get(); } |
| 387 virtual Scrollbar* verticalScrollbar() const override { return m_verticalScr
ollbar.get(); } | 387 Scrollbar* verticalScrollbar() const override { return m_verticalScrollbar.g
et(); } |
| 388 LayoutScrollbarPart* scrollCorner() { return m_scrollCorner; } | 388 LayoutScrollbarPart* scrollCorner() { return m_scrollCorner; } |
| 389 | 389 |
| 390 void positionScrollbarLayers(); | 390 void positionScrollbarLayers(); |
| 391 | 391 |
| 392 // Functions for setting and retrieving the scrolling mode in each axis (hor
izontal/vertical). The mode has values of | 392 // Functions for setting and retrieving the scrolling mode in each axis (hor
izontal/vertical). The mode has values of |
| 393 // AlwaysOff, AlwaysOn, and Auto. AlwaysOff means never show a scrollbar, Al
waysOn means always show a scrollbar. | 393 // AlwaysOff, AlwaysOn, and Auto. AlwaysOff means never show a scrollbar, Al
waysOn means always show a scrollbar. |
| 394 // Auto means show a scrollbar only when one is needed. | 394 // Auto means show a scrollbar only when one is needed. |
| 395 // Note that for platforms with native widgets, these modes are considered a
dvisory. In other words the underlying native | 395 // Note that for platforms with native widgets, these modes are considered a
dvisory. In other words the underlying native |
| 396 // widget may choose not to honor the requested modes. | 396 // widget may choose not to honor the requested modes. |
| 397 void setScrollbarModes(ScrollbarMode horizontalMode, ScrollbarMode verticalM
ode, bool horizontalLock = false, bool verticalLock = false); | 397 void setScrollbarModes(ScrollbarMode horizontalMode, ScrollbarMode verticalM
ode, bool horizontalLock = false, bool verticalLock = false); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 411 | 411 |
| 412 // By default, paint events are clipped to the visible area. If set to | 412 // By default, paint events are clipped to the visible area. If set to |
| 413 // false, paint events are no longer clipped. | 413 // false, paint events are no longer clipped. |
| 414 bool clipsPaintInvalidations() const { return m_clipsRepaints; } | 414 bool clipsPaintInvalidations() const { return m_clipsRepaints; } |
| 415 void setClipsRepaints(bool); | 415 void setClipsRepaints(bool); |
| 416 | 416 |
| 417 // The visible content rect has a location that is the scrolled offset of | 417 // The visible content rect has a location that is the scrolled offset of |
| 418 // the document. The width and height are the layout viewport width and | 418 // the document. The width and height are the layout viewport width and |
| 419 // height. By default the scrollbars themselves are excluded from this | 419 // height. By default the scrollbars themselves are excluded from this |
| 420 // rectangle, but an optional boolean argument allows them to be included. | 420 // rectangle, but an optional boolean argument allows them to be included. |
| 421 virtual IntRect visibleContentRect(IncludeScrollbarsInRect = ExcludeScrollba
rs) const override; | 421 IntRect visibleContentRect(IncludeScrollbarsInRect = ExcludeScrollbars) cons
t override; |
| 422 IntSize visibleContentSize(IncludeScrollbarsInRect = ExcludeScrollbars) cons
t; | 422 IntSize visibleContentSize(IncludeScrollbarsInRect = ExcludeScrollbars) cons
t; |
| 423 | 423 |
| 424 // Functions for getting/setting the size of the document contained inside t
he FrameView (as an IntSize or as individual width and height | 424 // Functions for getting/setting the size of the document contained inside t
he FrameView (as an IntSize or as individual width and height |
| 425 // values). | 425 // values). |
| 426 virtual IntSize contentsSize() const override; // Always at least as big as
the visibleWidth()/visibleHeight(). | 426 IntSize contentsSize() const override; // Always at least as big as the visi
bleWidth()/visibleHeight(). |
| 427 int contentsWidth() const { return contentsSize().width(); } | 427 int contentsWidth() const { return contentsSize().width(); } |
| 428 int contentsHeight() const { return contentsSize().height(); } | 428 int contentsHeight() const { return contentsSize().height(); } |
| 429 | 429 |
| 430 // Functions for querying the current scrolled position (both as a point, a
size, or as individual X and Y values). | 430 // Functions for querying the current scrolled position (both as a point, a
size, or as individual X and Y values). |
| 431 // Be careful in using the Double version scrollPositionDouble() and scrollO
ffsetDouble(). They are meant to be | 431 // Be careful in using the Double version scrollPositionDouble() and scrollO
ffsetDouble(). They are meant to be |
| 432 // used to communicate the fractional scroll position/offset with chromium c
ompositor which can do sub-pixel positioning. | 432 // used to communicate the fractional scroll position/offset with chromium c
ompositor which can do sub-pixel positioning. |
| 433 // Do not call these if the scroll position/offset is used in Blink for posi
tioning. Use the Int version instead. | 433 // Do not call these if the scroll position/offset is used in Blink for posi
tioning. Use the Int version instead. |
| 434 virtual IntPoint scrollPosition() const override { return visibleContentRect
().location(); } | 434 IntPoint scrollPosition() const override { return visibleContentRect().locat
ion(); } |
| 435 virtual DoublePoint scrollPositionDouble() const override { return m_scrollP
osition; } | 435 DoublePoint scrollPositionDouble() const override { return m_scrollPosition;
} |
| 436 IntSize scrollOffset() const { return toIntSize(visibleContentRect().locatio
n()); } // Gets the scrolled position as an IntSize. Convenient for adding to ot
her sizes. | 436 IntSize scrollOffset() const { return toIntSize(visibleContentRect().locatio
n()); } // Gets the scrolled position as an IntSize. Convenient for adding to ot
her sizes. |
| 437 DoubleSize scrollOffsetDouble() const { return DoubleSize(m_scrollPosition.x
(), m_scrollPosition.y()); } | 437 DoubleSize scrollOffsetDouble() const { return DoubleSize(m_scrollPosition.x
(), m_scrollPosition.y()); } |
| 438 DoubleSize pendingScrollDelta() const { return m_pendingScrollDelta; } | 438 DoubleSize pendingScrollDelta() const { return m_pendingScrollDelta; } |
| 439 virtual IntPoint minimumScrollPosition() const override; // The minimum posi
tion we can be scrolled to. | 439 IntPoint minimumScrollPosition() const override; // The minimum position we
can be scrolled to. |
| 440 int scrollX() const { return scrollPosition().x(); } | 440 int scrollX() const { return scrollPosition().x(); } |
| 441 int scrollY() const { return scrollPosition().y(); } | 441 int scrollY() const { return scrollPosition().y(); } |
| 442 | 442 |
| 443 void cacheCurrentScrollPosition() { m_cachedScrollPosition = scrollPositionD
ouble(); } | 443 void cacheCurrentScrollPosition() { m_cachedScrollPosition = scrollPositionD
ouble(); } |
| 444 DoublePoint cachedScrollPosition() const { return m_cachedScrollPosition; } | 444 DoublePoint cachedScrollPosition() const { return m_cachedScrollPosition; } |
| 445 | 445 |
| 446 // Scroll the actual contents of the view (either blitting or invalidating a
s needed). | 446 // Scroll the actual contents of the view (either blitting or invalidating a
s needed). |
| 447 void scrollContents(const IntSize& scrollDelta); | 447 void scrollContents(const IntSize& scrollDelta); |
| 448 | 448 |
| 449 // This gives us a means of blocking painting on our scrollbars until the fi
rst layout has occurred. | 449 // This gives us a means of blocking painting on our scrollbars until the fi
rst layout has occurred. |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 488 // This happens only on Mac OS X 10.6. | 488 // This happens only on Mac OS X 10.6. |
| 489 IntRect windowResizerRect() const; | 489 IntRect windowResizerRect() const; |
| 490 bool containsScrollbarsAvoidingResizer() const; | 490 bool containsScrollbarsAvoidingResizer() const; |
| 491 void adjustScrollbarsAvoidingResizerCount(int overlapDelta); | 491 void adjustScrollbarsAvoidingResizerCount(int overlapDelta); |
| 492 void windowResizerRectChanged(); | 492 void windowResizerRectChanged(); |
| 493 | 493 |
| 494 // For platforms that need to hit test scrollbars from within the engine's e
vent handlers (like Win32). | 494 // For platforms that need to hit test scrollbars from within the engine's e
vent handlers (like Win32). |
| 495 Scrollbar* scrollbarAtRootFramePoint(const IntPoint&); | 495 Scrollbar* scrollbarAtRootFramePoint(const IntPoint&); |
| 496 Scrollbar* scrollbarAtFramePoint(const IntPoint&); | 496 Scrollbar* scrollbarAtFramePoint(const IntPoint&); |
| 497 | 497 |
| 498 virtual IntPoint convertChildToSelf(const Widget* child, const IntPoint& poi
nt) const override | 498 IntPoint convertChildToSelf(const Widget* child, const IntPoint& point) cons
t override |
| 499 { | 499 { |
| 500 IntPoint newPoint = point; | 500 IntPoint newPoint = point; |
| 501 if (!isFrameViewScrollbar(child)) | 501 if (!isFrameViewScrollbar(child)) |
| 502 newPoint = contentsToFrame(point); | 502 newPoint = contentsToFrame(point); |
| 503 newPoint.moveBy(child->location()); | 503 newPoint.moveBy(child->location()); |
| 504 return newPoint; | 504 return newPoint; |
| 505 } | 505 } |
| 506 | 506 |
| 507 virtual IntPoint convertSelfToChild(const Widget* child, const IntPoint& poi
nt) const override | 507 IntPoint convertSelfToChild(const Widget* child, const IntPoint& point) cons
t override |
| 508 { | 508 { |
| 509 IntPoint newPoint = point; | 509 IntPoint newPoint = point; |
| 510 if (!isFrameViewScrollbar(child)) | 510 if (!isFrameViewScrollbar(child)) |
| 511 newPoint = frameToContents(point); | 511 newPoint = frameToContents(point); |
| 512 newPoint.moveBy(-child->location()); | 512 newPoint.moveBy(-child->location()); |
| 513 return newPoint; | 513 return newPoint; |
| 514 } | 514 } |
| 515 | 515 |
| 516 // Widget override. Handles painting of the contents of the view as well as
the scrollbars. | 516 // Widget override. Handles painting of the contents of the view as well as
the scrollbars. |
| 517 virtual void paint(GraphicsContext*, const IntRect&) override; | 517 void paint(GraphicsContext*, const IntRect&) override; |
| 518 void paintContents(GraphicsContext*, const IntRect& damageRect); | 518 void paintContents(GraphicsContext*, const IntRect& damageRect); |
| 519 | 519 |
| 520 // Widget overrides to ensure that our children's visibility status is kept
up to date when we get shown and hidden. | 520 // Widget overrides to ensure that our children's visibility status is kept
up to date when we get shown and hidden. |
| 521 virtual void show() override; | 521 void show() override; |
| 522 virtual void hide() override; | 522 void hide() override; |
| 523 virtual void setParentVisible(bool) override; | 523 void setParentVisible(bool) override; |
| 524 | 524 |
| 525 bool isPointInScrollbarCorner(const IntPoint&); | 525 bool isPointInScrollbarCorner(const IntPoint&); |
| 526 bool scrollbarCornerPresent() const; | 526 bool scrollbarCornerPresent() const; |
| 527 virtual IntRect scrollCornerRect() const override; | 527 IntRect scrollCornerRect() const override; |
| 528 | 528 |
| 529 virtual IntRect convertFromScrollbarToContainingView(const Scrollbar*, const
IntRect&) const override; | 529 IntRect convertFromScrollbarToContainingView(const Scrollbar*, const IntRect
&) const override; |
| 530 virtual IntRect convertFromContainingViewToScrollbar(const Scrollbar*, const
IntRect&) const override; | 530 IntRect convertFromContainingViewToScrollbar(const Scrollbar*, const IntRect
&) const override; |
| 531 virtual IntPoint convertFromScrollbarToContainingView(const Scrollbar*, cons
t IntPoint&) const override; | 531 IntPoint convertFromScrollbarToContainingView(const Scrollbar*, const IntPoi
nt&) const override; |
| 532 virtual IntPoint convertFromContainingViewToScrollbar(const Scrollbar*, cons
t IntPoint&) const override; | 532 IntPoint convertFromContainingViewToScrollbar(const Scrollbar*, const IntPoi
nt&) const override; |
| 533 | 533 |
| 534 virtual bool isFrameView() const override { return true; } | 534 bool isFrameView() const override { return true; } |
| 535 | 535 |
| 536 DECLARE_VIRTUAL_TRACE(); | 536 DECLARE_VIRTUAL_TRACE(); |
| 537 void notifyPageThatContentAreaWillPaint() const; | 537 void notifyPageThatContentAreaWillPaint() const; |
| 538 FrameView* parentFrameView() const; | 538 FrameView* parentFrameView() const; |
| 539 | 539 |
| 540 // Returns the scrollable area for the frame. For the root frame, this will | 540 // Returns the scrollable area for the frame. For the root frame, this will |
| 541 // be the RootFrameViewport, which adds pinch-zoom semantics to scrolling. | 541 // be the RootFrameViewport, which adds pinch-zoom semantics to scrolling. |
| 542 // For non-root frames, this will be the the ScrollableArea used by the | 542 // For non-root frames, this will be the the ScrollableArea used by the |
| 543 // FrameView, depending on whether root-layer-scrolls is enabled. | 543 // FrameView, depending on whether root-layer-scrolls is enabled. |
| 544 ScrollableArea* scrollableArea(); | 544 ScrollableArea* scrollableArea(); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 567 void scrollContentsSlowPath(const IntRect& updateRect); | 567 void scrollContentsSlowPath(const IntRect& updateRect); |
| 568 | 568 |
| 569 // Prevents creation of scrollbars. Used to prevent drawing two sets of | 569 // Prevents creation of scrollbars. Used to prevent drawing two sets of |
| 570 // overlay scrollbars in the case of the pinch viewport. | 570 // overlay scrollbars in the case of the pinch viewport. |
| 571 bool scrollbarsDisabled() const; | 571 bool scrollbarsDisabled() const; |
| 572 | 572 |
| 573 // These functions are used to create/destroy scrollbars. | 573 // These functions are used to create/destroy scrollbars. |
| 574 void setHasHorizontalScrollbar(bool); | 574 void setHasHorizontalScrollbar(bool); |
| 575 void setHasVerticalScrollbar(bool); | 575 void setHasVerticalScrollbar(bool); |
| 576 | 576 |
| 577 virtual void invalidateScrollCornerRect(const IntRect&) override; | 577 void invalidateScrollCornerRect(const IntRect&) override; |
| 578 virtual ScrollBehavior scrollBehaviorStyle() const override; | 578 ScrollBehavior scrollBehaviorStyle() const override; |
| 579 | 579 |
| 580 void scrollContentsIfNeeded(); | 580 void scrollContentsIfNeeded(); |
| 581 | 581 |
| 582 void setScrollOrigin(const IntPoint&, bool updatePositionAtAll, bool updateP
ositionSynchronously); | 582 void setScrollOrigin(const IntPoint&, bool updatePositionAtAll, bool updateP
ositionSynchronously); |
| 583 | 583 |
| 584 enum ComputeScrollbarExistenceOption { | 584 enum ComputeScrollbarExistenceOption { |
| 585 FirstPass, | 585 FirstPass, |
| 586 Incremental | 586 Incremental |
| 587 }; | 587 }; |
| 588 void computeScrollbarExistence(bool& newHasHorizontalScrollbar, bool& newHas
VerticalScrollbar, const IntSize& docSize, ComputeScrollbarExistenceOption = Fir
stPass) const; | 588 void computeScrollbarExistence(bool& newHasHorizontalScrollbar, bool& newHas
VerticalScrollbar, const IntSize& docSize, ComputeScrollbarExistenceOption = Fir
stPass) const; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 600 private: | 600 private: |
| 601 TemporaryChange<bool> m_scope; | 601 TemporaryChange<bool> m_scope; |
| 602 }; | 602 }; |
| 603 | 603 |
| 604 // Only for LayoutPart to traverse into sub frames during paint invalidation
. | 604 // Only for LayoutPart to traverse into sub frames during paint invalidation
. |
| 605 void invalidateTreeIfNeeded(PaintInvalidationState&); | 605 void invalidateTreeIfNeeded(PaintInvalidationState&); |
| 606 | 606 |
| 607 private: | 607 private: |
| 608 explicit FrameView(LocalFrame*); | 608 explicit FrameView(LocalFrame*); |
| 609 | 609 |
| 610 virtual void setScrollOffset(const IntPoint&, ScrollType) override; | 610 void setScrollOffset(const IntPoint&, ScrollType) override; |
| 611 virtual void setScrollOffset(const DoublePoint&, ScrollType) override; | 611 void setScrollOffset(const DoublePoint&, ScrollType) override; |
| 612 | 612 |
| 613 void updateAllLifecyclePhasesInternal(); | 613 void updateAllLifecyclePhasesInternal(); |
| 614 void invalidateTreeIfNeededRecursive(); | 614 void invalidateTreeIfNeededRecursive(); |
| 615 void scrollContentsIfNeededRecursive(); | 615 void scrollContentsIfNeededRecursive(); |
| 616 void updateStyleAndLayoutIfNeededRecursive(); | 616 void updateStyleAndLayoutIfNeededRecursive(); |
| 617 void updatePostLifecycleData(); | 617 void updatePostLifecycleData(); |
| 618 | 618 |
| 619 void reset(); | 619 void reset(); |
| 620 void init(); | 620 void init(); |
| 621 | 621 |
| 622 void clearLayoutSubtreeRootsAndMarkContainingBlocks(); | 622 void clearLayoutSubtreeRootsAndMarkContainingBlocks(); |
| 623 | 623 |
| 624 // Called when our frame rect changes (or the rect/scroll position of an anc
estor changes). | 624 // Called when our frame rect changes (or the rect/scroll position of an anc
estor changes). |
| 625 virtual void frameRectsChanged() override; | 625 void frameRectsChanged() override; |
| 626 | 626 |
| 627 friend class LayoutPart; | 627 friend class LayoutPart; |
| 628 | 628 |
| 629 bool contentsInCompositedLayer() const; | 629 bool contentsInCompositedLayer() const; |
| 630 | 630 |
| 631 void applyOverflowToViewport(LayoutObject*, ScrollbarMode& hMode, ScrollbarM
ode& vMode); | 631 void applyOverflowToViewport(LayoutObject*, ScrollbarMode& hMode, ScrollbarM
ode& vMode); |
| 632 | 632 |
| 633 void updateCounters(); | 633 void updateCounters(); |
| 634 void forceLayoutParentViewIfNeeded(); | 634 void forceLayoutParentViewIfNeeded(); |
| 635 void performPreLayoutTasks(); | 635 void performPreLayoutTasks(); |
| 636 void performLayout(bool inSubtreeLayout); | 636 void performLayout(bool inSubtreeLayout); |
| 637 void scheduleOrPerformPostLayoutTasks(); | 637 void scheduleOrPerformPostLayoutTasks(); |
| 638 void performPostLayoutTasks(); | 638 void performPostLayoutTasks(); |
| 639 | 639 |
| 640 DocumentLifecycle& lifecycle() const; | 640 DocumentLifecycle& lifecycle() const; |
| 641 | 641 |
| 642 void contentRectangleForPaintInvalidation(const IntRect&); | 642 void contentRectangleForPaintInvalidation(const IntRect&); |
| 643 virtual void contentsResized() override; | 643 void contentsResized() override; |
| 644 void scrollbarExistenceDidChange(); | 644 void scrollbarExistenceDidChange(); |
| 645 | 645 |
| 646 // Override Widget methods to do point conversion via layoutObjects, in orde
r to | 646 // Override Widget methods to do point conversion via layoutObjects, in orde
r to |
| 647 // take transforms into account. | 647 // take transforms into account. |
| 648 virtual IntRect convertToContainingView(const IntRect&) const override; | 648 IntRect convertToContainingView(const IntRect&) const override; |
| 649 virtual IntRect convertFromContainingView(const IntRect&) const override; | 649 IntRect convertFromContainingView(const IntRect&) const override; |
| 650 virtual IntPoint convertToContainingView(const IntPoint&) const override; | 650 IntPoint convertToContainingView(const IntPoint&) const override; |
| 651 virtual IntPoint convertFromContainingView(const IntPoint&) const override; | 651 IntPoint convertFromContainingView(const IntPoint&) const override; |
| 652 | 652 |
| 653 void updateWidgetPositionsIfNeeded(); | 653 void updateWidgetPositionsIfNeeded(); |
| 654 | 654 |
| 655 bool wasViewportResized(); | 655 bool wasViewportResized(); |
| 656 void sendResizeEventIfNeeded(); | 656 void sendResizeEventIfNeeded(); |
| 657 | 657 |
| 658 void updateScrollableAreaSet(); | 658 void updateScrollableAreaSet(); |
| 659 | 659 |
| 660 void scheduleUpdateWidgetsIfNecessary(); | 660 void scheduleUpdateWidgetsIfNecessary(); |
| 661 void updateWidgetsTimerFired(Timer<FrameView>*); | 661 void updateWidgetsTimerFired(Timer<FrameView>*); |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 865 static const unsigned visualPixelThreshold = 32 * 32; | 865 static const unsigned visualPixelThreshold = 32 * 32; |
| 866 if (m_visuallyNonEmptyPixelCount > visualPixelThreshold) | 866 if (m_visuallyNonEmptyPixelCount > visualPixelThreshold) |
| 867 setIsVisuallyNonEmpty(); | 867 setIsVisuallyNonEmpty(); |
| 868 } | 868 } |
| 869 | 869 |
| 870 DEFINE_TYPE_CASTS(FrameView, Widget, widget, widget->isFrameView(), widget.isFra
meView()); | 870 DEFINE_TYPE_CASTS(FrameView, Widget, widget, widget->isFrameView(), widget.isFra
meView()); |
| 871 | 871 |
| 872 } // namespace blink | 872 } // namespace blink |
| 873 | 873 |
| 874 #endif // FrameView_h | 874 #endif // FrameView_h |
| OLD | NEW |