Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(858)

Side by Side Diff: Source/core/frame/FrameView.cpp

Issue 109153003: Raise the loading priority of in-viewport images. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Changes from review. Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 19 matching lines...) Expand all
30 #include "HTMLNames.h" 30 #include "HTMLNames.h"
31 #include "RuntimeEnabledFeatures.h" 31 #include "RuntimeEnabledFeatures.h"
32 #include "core/accessibility/AXObjectCache.h" 32 #include "core/accessibility/AXObjectCache.h"
33 #include "core/animation/DocumentAnimations.h" 33 #include "core/animation/DocumentAnimations.h"
34 #include "core/css/FontFaceSet.h" 34 #include "core/css/FontFaceSet.h"
35 #include "core/css/resolver/StyleResolver.h" 35 #include "core/css/resolver/StyleResolver.h"
36 #include "core/dom/DocumentMarkerController.h" 36 #include "core/dom/DocumentMarkerController.h"
37 #include "core/editing/FrameSelection.h" 37 #include "core/editing/FrameSelection.h"
38 #include "core/events/OverflowEvent.h" 38 #include "core/events/OverflowEvent.h"
39 #include "core/fetch/ResourceFetcher.h" 39 #include "core/fetch/ResourceFetcher.h"
40 #include "core/fetch/ResourceLoadPriorityOptimizer.h"
40 #include "core/fetch/TextResourceDecoder.h" 41 #include "core/fetch/TextResourceDecoder.h"
41 #include "core/html/HTMLFrameElement.h" 42 #include "core/html/HTMLFrameElement.h"
42 #include "core/html/HTMLHtmlElement.h" 43 #include "core/html/HTMLHtmlElement.h"
43 #include "core/html/HTMLPlugInElement.h" 44 #include "core/html/HTMLPlugInElement.h"
44 #include "core/inspector/InspectorInstrumentation.h" 45 #include "core/inspector/InspectorInstrumentation.h"
45 #include "core/loader/FrameLoader.h" 46 #include "core/loader/FrameLoader.h"
46 #include "core/loader/FrameLoaderClient.h" 47 #include "core/loader/FrameLoaderClient.h"
47 #include "core/page/Chrome.h" 48 #include "core/page/Chrome.h"
48 #include "core/page/ChromeClient.h" 49 #include "core/page/ChromeClient.h"
49 #include "core/page/EventHandler.h" 50 #include "core/page/EventHandler.h"
(...skipping 836 matching lines...) Expand 10 before | Expand all | Expand 10 after
886 forceLayoutParentViewIfNeeded(); 887 forceLayoutParentViewIfNeeded();
887 888
888 // Text Autosizing requires two-pass layout which is incompatible with p artial layout. 889 // Text Autosizing requires two-pass layout which is incompatible with p artial layout.
889 // If enabled, only do partial layout for the second layout. 890 // If enabled, only do partial layout for the second layout.
890 // FIXME (crbug.com/256657): Do not do two layouts for text autosizing. 891 // FIXME (crbug.com/256657): Do not do two layouts for text autosizing.
891 PartialLayoutDisabler partialLayoutDisabler(partialLayout(), m_frame->se ttings() && m_frame->settings()->textAutosizingEnabled()); 892 PartialLayoutDisabler partialLayoutDisabler(partialLayout(), m_frame->se ttings() && m_frame->settings()->textAutosizingEnabled());
892 893
893 LayoutIndicator layoutIndicator; 894 LayoutIndicator layoutIndicator;
894 rootForThisLayout->layout(); 895 rootForThisLayout->layout();
895 gatherDebugLayoutRects(rootForThisLayout); 896 gatherDebugLayoutRects(rootForThisLayout);
897
898 ResourceLoadPriorityOptimizer modifier;
899 rootForThisLayout->didLayout(modifier);
896 } 900 }
897 901
898 TextAutosizer* textAutosizer = frame().document()->textAutosizer(); 902 TextAutosizer* textAutosizer = frame().document()->textAutosizer();
899 bool autosized = textAutosizer && textAutosizer->processSubtree(rootForThisL ayout); 903 bool autosized = textAutosizer && textAutosizer->processSubtree(rootForThisL ayout);
900 if (autosized && rootForThisLayout->needsLayout()) { 904 if (autosized && rootForThisLayout->needsLayout()) {
901 TRACE_EVENT0("webkit", "2nd layout due to Text Autosizing"); 905 TRACE_EVENT0("webkit", "2nd layout due to Text Autosizing");
902 LayoutIndicator layoutIndicator; 906 LayoutIndicator layoutIndicator;
903 rootForThisLayout->layout(); 907 rootForThisLayout->layout();
904 gatherDebugLayoutRects(rootForThisLayout); 908 gatherDebugLayoutRects(rootForThisLayout);
909
910 ResourceLoadPriorityOptimizer modifier;
911 rootForThisLayout->didLayout(modifier);
905 } 912 }
906 913
907 m_inLayout = false; 914 m_inLayout = false;
908 915
909 if (inSubtreeLayout) 916 if (inSubtreeLayout)
910 rootForThisLayout->view()->popLayoutState(rootForThisLayout); 917 rootForThisLayout->view()->popLayoutState(rootForThisLayout);
911 } 918 }
912 919
913 void FrameView::scheduleOrPerformPostLayoutTasks() 920 void FrameView::scheduleOrPerformPostLayoutTasks()
914 { 921 {
(...skipping 748 matching lines...) Expand 10 before | Expand all | Expand 10 after
1663 1670
1664 void FrameView::scrollPositionChanged() 1671 void FrameView::scrollPositionChanged()
1665 { 1672 {
1666 m_frame->eventHandler().sendScrollEvent(); 1673 m_frame->eventHandler().sendScrollEvent();
1667 m_frame->eventHandler().dispatchFakeMouseMoveEventSoon(); 1674 m_frame->eventHandler().dispatchFakeMouseMoveEventSoon();
1668 1675
1669 if (RenderView* renderView = this->renderView()) { 1676 if (RenderView* renderView = this->renderView()) {
1670 if (renderView->usesCompositing()) 1677 if (renderView->usesCompositing())
1671 renderView->compositor()->frameViewDidScroll(); 1678 renderView->compositor()->frameViewDidScroll();
1672 } 1679 }
1680
1681 if (m_frame->document() && m_frame->document()->renderer()) {
1682 ResourceLoadPriorityOptimizer modifier;
1683 m_frame->document()->renderer()->didScroll(modifier);
1684 }
1673 } 1685 }
1674 1686
1675 void FrameView::repaintFixedElementsAfterScrolling() 1687 void FrameView::repaintFixedElementsAfterScrolling()
1676 { 1688 {
1677 // For fixed position elements, update widget positions and compositing laye rs after scrolling, 1689 // For fixed position elements, update widget positions and compositing laye rs after scrolling,
1678 // but only if we're not inside of layout. 1690 // but only if we're not inside of layout.
1679 if (!m_nestedLayoutCount && hasViewportConstrainedObjects()) { 1691 if (!m_nestedLayoutCount && hasViewportConstrainedObjects()) {
1680 if (RenderView* renderView = this->renderView()) { 1692 if (RenderView* renderView = this->renderView()) {
1681 renderView->updateWidgetPositions(); 1693 renderView->updateWidgetPositions();
1682 renderView->layer()->updateLayerPositionsAfterDocumentScroll(); 1694 renderView->layer()->updateLayerPositionsAfterDocumentScroll();
(...skipping 1797 matching lines...) Expand 10 before | Expand all | Expand 10 after
3480 void FrameView::willRemoveScrollbar(Scrollbar* scrollbar, ScrollbarOrientation o rientation) 3492 void FrameView::willRemoveScrollbar(Scrollbar* scrollbar, ScrollbarOrientation o rientation)
3481 { 3493 {
3482 ScrollableArea::willRemoveScrollbar(scrollbar, orientation); 3494 ScrollableArea::willRemoveScrollbar(scrollbar, orientation);
3483 if (AXObjectCache* cache = axObjectCache()) { 3495 if (AXObjectCache* cache = axObjectCache()) {
3484 cache->remove(scrollbar); 3496 cache->remove(scrollbar);
3485 cache->handleScrollbarUpdate(this); 3497 cache->handleScrollbarUpdate(this);
3486 } 3498 }
3487 } 3499 }
3488 3500
3489 } // namespace WebCore 3501 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/fetch/ResourceLoadPriorityOptimizer.cpp ('k') | Source/core/rendering/RenderBlock.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698