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

Side by Side Diff: Source/web/WebViewImpl.cpp

Issue 22419002: Set up clip and scroll parents on the blink side. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 4 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, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Google 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 3913 matching lines...) Expand 10 before | Expand all | Expand 10 after
3924 m_client->didDeactivateCompositor(); 3924 m_client->didDeactivateCompositor();
3925 m_compositorCreationFailed = true; 3925 m_compositorCreationFailed = true;
3926 } 3926 }
3927 } 3927 }
3928 if (page()) 3928 if (page())
3929 page()->mainFrame()->view()->setClipsRepaints(!m_isAcceleratedCompositin gActive); 3929 page()->mainFrame()->view()->setClipsRepaints(!m_isAcceleratedCompositin gActive);
3930 } 3930 }
3931 3931
3932 void WebViewImpl::updateMainFrameScrollPosition(const IntPoint& scrollPosition, bool programmaticScroll) 3932 void WebViewImpl::updateMainFrameScrollPosition(const IntPoint& scrollPosition, bool programmaticScroll)
3933 { 3933 {
3934 TRACE_EVENT1("impl-scroll",
3935 "WebViewImpl::updateMainFrameScrollPosition",
3936 "programmatic", programmaticScroll);
3937
3934 FrameView* frameView = page()->mainFrame()->view(); 3938 FrameView* frameView = page()->mainFrame()->view();
3935 if (!frameView) 3939 if (!frameView)
3936 return; 3940 return;
3937 3941
3938 if (frameView->scrollPosition() == scrollPosition) 3942 if (frameView->scrollPosition() == scrollPosition)
3939 return; 3943 return;
3940 3944
3941 bool oldProgrammaticScroll = frameView->inProgrammaticScroll(); 3945 bool oldProgrammaticScroll = frameView->inProgrammaticScroll();
3942 frameView->setInProgrammaticScroll(programmaticScroll); 3946 frameView->setInProgrammaticScroll(programmaticScroll);
3943 frameView->notifyScrollPositionChanged(scrollPosition); 3947 frameView->notifyScrollPositionChanged(scrollPosition);
3944 frameView->setInProgrammaticScroll(oldProgrammaticScroll); 3948 frameView->setInProgrammaticScroll(oldProgrammaticScroll);
3945 } 3949 }
3946 3950
3947 void WebViewImpl::applyScrollAndScale(const WebSize& scrollDelta, float pageScal eDelta) 3951 void WebViewImpl::applyScrollAndScale(const WebSize& scrollDelta, float pageScal eDelta)
3948 { 3952 {
3949 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) 3953 if (!mainFrameImpl() || !mainFrameImpl()->frameView())
3950 return; 3954 return;
3951 3955
3952 if (pageScaleDelta == 1) { 3956 if (pageScaleDelta == 1) {
3953 TRACE_EVENT_INSTANT2("webkit", "WebViewImpl::applyScrollAndScale::scroll By", "x", scrollDelta.width, "y", scrollDelta.height); 3957 TRACE_EVENT_INSTANT2("webkit,impl-scroll", "WebViewImpl::applyScrollAndS cale::scrollBy", "x", scrollDelta.width, "y", scrollDelta.height);
3954 WebSize webScrollOffset = mainFrame()->scrollOffset(); 3958 WebSize webScrollOffset = mainFrame()->scrollOffset();
3955 IntPoint scrollOffset(webScrollOffset.width + scrollDelta.width, webScro llOffset.height + scrollDelta.height); 3959 IntPoint scrollOffset(webScrollOffset.width + scrollDelta.width, webScro llOffset.height + scrollDelta.height);
3956 updateMainFrameScrollPosition(scrollOffset, false); 3960 updateMainFrameScrollPosition(scrollOffset, false);
3957 } else { 3961 } else {
3958 // The page scale changed, so apply a scale and scroll in a single 3962 // The page scale changed, so apply a scale and scroll in a single
3959 // operation. 3963 // operation.
3960 WebSize scrollOffset = mainFrame()->scrollOffset(); 3964 WebSize scrollOffset = mainFrame()->scrollOffset();
3961 scrollOffset.width += scrollDelta.width; 3965 scrollOffset.width += scrollDelta.width;
3962 scrollOffset.height += scrollDelta.height; 3966 scrollOffset.height += scrollDelta.height;
3963 3967
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
4085 } 4089 }
4086 4090
4087 bool WebViewImpl::shouldDisableDesktopWorkarounds() 4091 bool WebViewImpl::shouldDisableDesktopWorkarounds()
4088 { 4092 {
4089 ViewportArguments arguments = mainFrameImpl()->frame()->document()->viewport Arguments(); 4093 ViewportArguments arguments = mainFrameImpl()->frame()->document()->viewport Arguments();
4090 return arguments.width == ViewportArguments::ValueDeviceWidth || !arguments. userZoom 4094 return arguments.width == ViewportArguments::ValueDeviceWidth || !arguments. userZoom
4091 || (arguments.minZoom == arguments.maxZoom && arguments.minZoom != Viewp ortArguments::ValueAuto); 4095 || (arguments.minZoom == arguments.maxZoom && arguments.minZoom != Viewp ortArguments::ValueAuto);
4092 } 4096 }
4093 4097
4094 } // namespace WebKit 4098 } // namespace WebKit
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698