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

Side by Side Diff: Source/core/page/scrolling/ScrollingCoordinator.cpp

Issue 22694003: Ignore should-scroll-on-main-thread if main frame is not scrollable (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: . Created 7 years, 3 months 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2011 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 759 matching lines...) Expand 10 before | Expand all | Expand 10 after
770 RenderLayer* layer = toRenderBoxModelObject(viewportConstrainedObject)-> layer(); 770 RenderLayer* layer = toRenderBoxModelObject(viewportConstrainedObject)-> layer();
771 // Any explicit reason that a fixed position element is not composited s houldn't cause slow scrolling. 771 // Any explicit reason that a fixed position element is not composited s houldn't cause slow scrolling.
772 if (!layer->isComposited() && layer->viewportConstrainedNotCompositedRea son() == RenderLayer::NoNotCompositedReason) 772 if (!layer->isComposited() && layer->viewportConstrainedNotCompositedRea son() == RenderLayer::NoNotCompositedReason)
773 return true; 773 return true;
774 } 774 }
775 return false; 775 return false;
776 } 776 }
777 777
778 MainThreadScrollingReasons ScrollingCoordinator::mainThreadScrollingReasons() co nst 778 MainThreadScrollingReasons ScrollingCoordinator::mainThreadScrollingReasons() co nst
779 { 779 {
780 // The main thread scrolling reasons are applicable to scrolls of the main
781 // frame. If it does not exist or if it is not scrollable, there is no
782 // reason to force main thread scrolling.
780 FrameView* frameView = m_page->mainFrame()->view(); 783 FrameView* frameView = m_page->mainFrame()->view();
781 if (!frameView) 784 if (!frameView || !frameView->isScrollable())
782 return static_cast<MainThreadScrollingReasons>(0); 785 return static_cast<MainThreadScrollingReasons>(0);
783 786
784 MainThreadScrollingReasons mainThreadScrollingReasons = (MainThreadScrolling Reasons)0; 787 MainThreadScrollingReasons mainThreadScrollingReasons = (MainThreadScrolling Reasons)0;
785 788
786 if (frameView->hasSlowRepaintObjects()) 789 if (frameView->hasSlowRepaintObjects())
787 mainThreadScrollingReasons |= HasSlowRepaintObjects; 790 mainThreadScrollingReasons |= HasSlowRepaintObjects;
788 if (hasVisibleSlowRepaintViewportConstrainedObjects(frameView)) 791 if (hasVisibleSlowRepaintViewportConstrainedObjects(frameView))
789 mainThreadScrollingReasons |= HasNonLayerViewportConstrainedObjects; 792 mainThreadScrollingReasons |= HasNonLayerViewportConstrainedObjects;
790 793
791 return mainThreadScrollingReasons; 794 return mainThreadScrollingReasons;
(...skipping 19 matching lines...) Expand all
811 stringBuilder.resize(stringBuilder.length() - 2); 814 stringBuilder.resize(stringBuilder.length() - 2);
812 return stringBuilder.toString(); 815 return stringBuilder.toString();
813 } 816 }
814 817
815 String ScrollingCoordinator::mainThreadScrollingReasonsAsText() const 818 String ScrollingCoordinator::mainThreadScrollingReasonsAsText() const
816 { 819 {
817 return mainThreadScrollingReasonsAsText(mainThreadScrollingReasons()); 820 return mainThreadScrollingReasonsAsText(mainThreadScrollingReasons());
818 } 821 }
819 822
820 } // namespace WebCore 823 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/compositing/overflow/ignore-main-thread-scroll-reasons-when-main-frame-not-scrollable-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698