| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> | 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> |
| 3 * 1999 Lars Knoll <knoll@kde.org> | 3 * 1999 Lars Knoll <knoll@kde.org> |
| 4 * 1999 Antti Koivisto <koivisto@kde.org> | 4 * 1999 Antti Koivisto <koivisto@kde.org> |
| 5 * 2000 Dirk Mueller <mueller@kde.org> | 5 * 2000 Dirk Mueller <mueller@kde.org> |
| 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
| 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) | 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) |
| 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
| 9 * Copyright (C) 2009 Google Inc. All rights reserved. | 9 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 10 * | 10 * |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 m_firstLayout = true; | 144 m_firstLayout = true; |
| 145 m_firstLayoutCallbackPending = false; | 145 m_firstLayoutCallbackPending = false; |
| 146 m_wasScrolledByUser = false; | 146 m_wasScrolledByUser = false; |
| 147 m_lastViewportSize = IntSize(); | 147 m_lastViewportSize = IntSize(); |
| 148 m_lastZoomFactor = 1.0f; | 148 m_lastZoomFactor = 1.0f; |
| 149 m_isTrackingPaintInvalidations = false; | 149 m_isTrackingPaintInvalidations = false; |
| 150 m_trackedPaintInvalidationRects.clear(); | 150 m_trackedPaintInvalidationRects.clear(); |
| 151 m_lastPaintTime = 0; | 151 m_lastPaintTime = 0; |
| 152 m_paintBehavior = PaintBehaviorNormal; | 152 m_paintBehavior = PaintBehaviorNormal; |
| 153 m_isPainting = false; | 153 m_isPainting = false; |
| 154 m_viewportConstrainedObjects.clear(); | |
| 155 } | 154 } |
| 156 | 155 |
| 157 void FrameView::init() | 156 void FrameView::init() |
| 158 { | 157 { |
| 159 reset(); | 158 reset(); |
| 160 | 159 |
| 161 m_size = LayoutSize(); | 160 m_size = LayoutSize(); |
| 162 } | 161 } |
| 163 | 162 |
| 164 void FrameView::prepareForDetach() | 163 void FrameView::prepareForDetach() |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 IntRect oldRect = frameRect(); | 197 IntRect oldRect = frameRect(); |
| 199 if (newRect == oldRect) | 198 if (newRect == oldRect) |
| 200 return; | 199 return; |
| 201 | 200 |
| 202 Widget::setFrameRect(newRect); | 201 Widget::setFrameRect(newRect); |
| 203 | 202 |
| 204 if (RenderView* renderView = this->renderView()) { | 203 if (RenderView* renderView = this->renderView()) { |
| 205 if (renderView->usesCompositing()) | 204 if (renderView->usesCompositing()) |
| 206 renderView->compositor()->frameViewDidChangeSize(); | 205 renderView->compositor()->frameViewDidChangeSize(); |
| 207 } | 206 } |
| 208 | |
| 209 viewportConstrainedVisibleContentSizeChanged(newRect.width() != oldRect.widt
h(), newRect.height() != oldRect.height()); | |
| 210 } | 207 } |
| 211 | 208 |
| 212 Page* FrameView::page() const | 209 Page* FrameView::page() const |
| 213 { | 210 { |
| 214 return frame().page(); | 211 return frame().page(); |
| 215 } | 212 } |
| 216 | 213 |
| 217 RenderView* FrameView::renderView() const | 214 RenderView* FrameView::renderView() const |
| 218 { | 215 { |
| 219 return frame().contentRenderer(); | 216 return frame().contentRenderer(); |
| (...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 709 ASSERT(m_slowRepaintObjectCount > 0); | 706 ASSERT(m_slowRepaintObjectCount > 0); |
| 710 m_slowRepaintObjectCount--; | 707 m_slowRepaintObjectCount--; |
| 711 if (!m_slowRepaintObjectCount) { | 708 if (!m_slowRepaintObjectCount) { |
| 712 if (Page* page = m_frame->page()) { | 709 if (Page* page = m_frame->page()) { |
| 713 if (ScrollingCoordinator* scrollingCoordinator = page->scrollingCoor
dinator()) | 710 if (ScrollingCoordinator* scrollingCoordinator = page->scrollingCoor
dinator()) |
| 714 scrollingCoordinator->frameViewHasSlowRepaintObjectsDidChange(th
is); | 711 scrollingCoordinator->frameViewHasSlowRepaintObjectsDidChange(th
is); |
| 715 } | 712 } |
| 716 } | 713 } |
| 717 } | 714 } |
| 718 | 715 |
| 719 void FrameView::addViewportConstrainedObject(RenderObject* object) | |
| 720 { | |
| 721 if (!m_viewportConstrainedObjects) | |
| 722 m_viewportConstrainedObjects = adoptPtr(new ViewportConstrainedObjectSet
); | |
| 723 | |
| 724 if (!m_viewportConstrainedObjects->contains(object)) { | |
| 725 m_viewportConstrainedObjects->add(object); | |
| 726 | |
| 727 if (Page* page = m_frame->page()) { | |
| 728 if (ScrollingCoordinator* scrollingCoordinator = page->scrollingCoor
dinator()) | |
| 729 scrollingCoordinator->frameViewFixedObjectsDidChange(this); | |
| 730 } | |
| 731 } | |
| 732 } | |
| 733 | |
| 734 void FrameView::removeViewportConstrainedObject(RenderObject* object) | |
| 735 { | |
| 736 if (m_viewportConstrainedObjects && m_viewportConstrainedObjects->contains(o
bject)) { | |
| 737 m_viewportConstrainedObjects->remove(object); | |
| 738 | |
| 739 if (Page* page = m_frame->page()) { | |
| 740 if (ScrollingCoordinator* scrollingCoordinator = page->scrollingCoor
dinator()) | |
| 741 scrollingCoordinator->frameViewFixedObjectsDidChange(this); | |
| 742 } | |
| 743 } | |
| 744 } | |
| 745 | |
| 746 void FrameView::viewportConstrainedVisibleContentSizeChanged(bool widthChanged,
bool heightChanged) | |
| 747 { | |
| 748 // FIXME(sky): Remove | |
| 749 } | |
| 750 | |
| 751 IntPoint FrameView::lastKnownMousePosition() const | 716 IntPoint FrameView::lastKnownMousePosition() const |
| 752 { | 717 { |
| 753 return m_frame->eventHandler().lastKnownMousePosition(); | 718 return m_frame->eventHandler().lastKnownMousePosition(); |
| 754 } | 719 } |
| 755 | 720 |
| 756 bool FrameView::shouldSetCursor() const | 721 bool FrameView::shouldSetCursor() const |
| 757 { | 722 { |
| 758 Page* page = frame().page(); | 723 Page* page = frame().page(); |
| 759 return page && page->visibilityState() != PageVisibilityStateHidden && page-
>focusController().isActive() && page->settings().deviceSupportsMouse(); | 724 return page && page->visibilityState() != PageVisibilityStateHidden && page-
>focusController().isActive() && page->settings().deviceSupportsMouse(); |
| 760 } | 725 } |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 817 m_didScrollTimer.startOneShot(resourcePriorityUpdateDelayAfterScroll, FROM_H
ERE); | 782 m_didScrollTimer.startOneShot(resourcePriorityUpdateDelayAfterScroll, FROM_H
ERE); |
| 818 } | 783 } |
| 819 | 784 |
| 820 void FrameView::didScrollTimerFired(Timer<FrameView>*) | 785 void FrameView::didScrollTimerFired(Timer<FrameView>*) |
| 821 { | 786 { |
| 822 if (m_frame->document() && m_frame->document()->renderView()) { | 787 if (m_frame->document() && m_frame->document()->renderView()) { |
| 823 ResourceLoadPriorityOptimizer::resourceLoadPriorityOptimizer()->updateAl
lImageResourcePriorities(); | 788 ResourceLoadPriorityOptimizer::resourceLoadPriorityOptimizer()->updateAl
lImageResourcePriorities(); |
| 824 } | 789 } |
| 825 } | 790 } |
| 826 | 791 |
| 827 void FrameView::updateLayersAndCompositingAfterScrollIfNeeded() | |
| 828 { | |
| 829 // Nothing to do after scrolling if there are no fixed position elements. | |
| 830 if (!hasViewportConstrainedObjects()) | |
| 831 return; | |
| 832 | |
| 833 RefPtr<FrameView> protect(this); | |
| 834 | |
| 835 // If there fixed position elements, scrolling may cause compositing layers
to change. | |
| 836 // Update widget and layer positions after scrolling, but only if we're not
inside of | |
| 837 // layout. | |
| 838 if (!m_nestedLayoutCount) { | |
| 839 updateWidgetPositions(); | |
| 840 if (RenderView* renderView = this->renderView()) | |
| 841 renderView->layer()->setNeedsCompositingInputsUpdate(); | |
| 842 } | |
| 843 } | |
| 844 | |
| 845 void FrameView::updateFixedElementPaintInvalidationRectsAfterScroll() | |
| 846 { | |
| 847 // FIXME(sky): Remove | |
| 848 } | |
| 849 | |
| 850 void FrameView::updateCompositedSelectionBoundsIfNeeded() | 792 void FrameView::updateCompositedSelectionBoundsIfNeeded() |
| 851 { | 793 { |
| 852 if (!RuntimeEnabledFeatures::compositedSelectionUpdatesEnabled()) | 794 if (!RuntimeEnabledFeatures::compositedSelectionUpdatesEnabled()) |
| 853 return; | 795 return; |
| 854 | 796 |
| 855 Page* page = frame().page(); | 797 Page* page = frame().page(); |
| 856 ASSERT(page); | 798 ASSERT(page); |
| 857 | 799 |
| 858 LocalFrame* frame = page->focusController().focusedOrMainFrame(); | 800 LocalFrame* frame = page->focusController().focusedOrMainFrame(); |
| 859 if (!frame || !frame->selection().isCaretOrRange()) { | 801 if (!frame || !frame->selection().isCaretOrRange()) { |
| (...skipping 756 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1616 void FrameView::setLayoutSizeInternal(const IntSize& size) | 1558 void FrameView::setLayoutSizeInternal(const IntSize& size) |
| 1617 { | 1559 { |
| 1618 if (m_layoutSize == size) | 1560 if (m_layoutSize == size) |
| 1619 return; | 1561 return; |
| 1620 | 1562 |
| 1621 m_layoutSize = size; | 1563 m_layoutSize = size; |
| 1622 contentsResized(); | 1564 contentsResized(); |
| 1623 } | 1565 } |
| 1624 | 1566 |
| 1625 } // namespace blink | 1567 } // namespace blink |
| OLD | NEW |