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

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

Issue 2237433004: Adds DevTools commands for forced viewport override. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 , m_needsUpdateWidgetGeometries(false) 151 , m_needsUpdateWidgetGeometries(false)
152 , m_needsUpdateViewportIntersection(true) 152 , m_needsUpdateViewportIntersection(true)
153 , m_needsUpdateViewportIntersectionInSubtree(true) 153 , m_needsUpdateViewportIntersectionInSubtree(true)
154 #if ENABLE(ASSERT) 154 #if ENABLE(ASSERT)
155 , m_hasBeenDisposed(false) 155 , m_hasBeenDisposed(false)
156 #endif 156 #endif
157 , m_horizontalScrollbarMode(ScrollbarAuto) 157 , m_horizontalScrollbarMode(ScrollbarAuto)
158 , m_verticalScrollbarMode(ScrollbarAuto) 158 , m_verticalScrollbarMode(ScrollbarAuto)
159 , m_horizontalScrollbarLock(false) 159 , m_horizontalScrollbarLock(false)
160 , m_verticalScrollbarLock(false) 160 , m_verticalScrollbarLock(false)
161 , m_visibleContentRectForRecording(nullptr)
161 , m_scrollbarsAvoidingResizer(0) 162 , m_scrollbarsAvoidingResizer(0)
162 , m_scrollbarsSuppressed(false) 163 , m_scrollbarsSuppressed(false)
163 , m_inUpdateScrollbars(false) 164 , m_inUpdateScrollbars(false)
164 , m_frameTimingRequestsDirty(true) 165 , m_frameTimingRequestsDirty(true)
165 , m_viewportIntersectionValid(false) 166 , m_viewportIntersectionValid(false)
166 , m_hiddenForThrottling(false) 167 , m_hiddenForThrottling(false)
167 , m_crossOriginForThrottling(false) 168 , m_crossOriginForThrottling(false)
168 , m_subtreeThrottled(false) 169 , m_subtreeThrottled(false)
169 , m_currentUpdateLifecyclePhasesTargetState(DocumentLifecycle::Uninitialized ) 170 , m_currentUpdateLifecyclePhasesTargetState(DocumentLifecycle::Uninitialized )
170 , m_suppressAdjustViewSize(false) 171 , m_suppressAdjustViewSize(false)
(...skipping 3131 matching lines...) Expand 10 before | Expand all | Expand 10 after
3302 IntRect FrameView::visibleContentRect(IncludeScrollbarsInRect scrollbarInclusion ) const 3303 IntRect FrameView::visibleContentRect(IncludeScrollbarsInRect scrollbarInclusion ) const
3303 { 3304 {
3304 return IntRect(flooredIntPoint(m_scrollPosition), visibleContentSize(scrollb arInclusion)); 3305 return IntRect(flooredIntPoint(m_scrollPosition), visibleContentSize(scrollb arInclusion));
3305 } 3306 }
3306 3307
3307 IntSize FrameView::contentsSize() const 3308 IntSize FrameView::contentsSize() const
3308 { 3309 {
3309 return m_contentsSize; 3310 return m_contentsSize;
3310 } 3311 }
3311 3312
3313 IntSize FrameView::visibleContentSizeForRecording() const
3314 {
3315 return visibleContentRectForRecording().size();
3316 }
3317
3318 IntRect FrameView::visibleContentRectForRecording() const
3319 {
3320 if (m_visibleContentRectForRecording)
3321 return *m_visibleContentRectForRecording;
3322 return visibleContentRect();
3323 }
3324
3325 void FrameView::setVisibleContentRectForRecording(const IntRect& rect)
3326 {
3327 m_visibleContentRectForRecording.reset(new IntRect(rect));
3328 }
3329
3330 void FrameView::resetVisibleContentRectForRecording()
3331 {
3332 m_visibleContentRectForRecording.reset();
3333 }
3334
3312 IntPoint FrameView::minimumScrollPosition() const 3335 IntPoint FrameView::minimumScrollPosition() const
3313 { 3336 {
3314 return IntPoint(-scrollOrigin().x(), -scrollOrigin().y()); 3337 return IntPoint(-scrollOrigin().x(), -scrollOrigin().y());
3315 } 3338 }
3316 3339
3317 void FrameView::adjustScrollbarOpacity() 3340 void FrameView::adjustScrollbarOpacity()
3318 { 3341 {
3319 if (m_horizontalScrollbar && layerForHorizontalScrollbar()) { 3342 if (m_horizontalScrollbar && layerForHorizontalScrollbar()) {
3320 bool isOpaqueScrollbar = !m_horizontalScrollbar->isOverlayScrollbar(); 3343 bool isOpaqueScrollbar = !m_horizontalScrollbar->isOverlayScrollbar();
3321 layerForHorizontalScrollbar()->setContentsOpaque(isOpaqueScrollbar); 3344 layerForHorizontalScrollbar()->setContentsOpaque(isOpaqueScrollbar);
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
3379 layoutViewItem.clearHitTestCache(); 3402 layoutViewItem.clearHitTestCache();
3380 } 3403 }
3381 3404
3382 if (m_didScrollTimer.isActive()) 3405 if (m_didScrollTimer.isActive())
3383 m_didScrollTimer.stop(); 3406 m_didScrollTimer.stop();
3384 m_didScrollTimer.startOneShot(resourcePriorityUpdateDelayAfterScroll, BLINK_ FROM_HERE); 3407 m_didScrollTimer.startOneShot(resourcePriorityUpdateDelayAfterScroll, BLINK_ FROM_HERE);
3385 3408
3386 if (AXObjectCache* cache = m_frame->document()->existingAXObjectCache()) 3409 if (AXObjectCache* cache = m_frame->document()->existingAXObjectCache())
3387 cache->handleScrollPositionChanged(this); 3410 cache->handleScrollPositionChanged(this);
3388 3411
3412 frame().host()->chromeClient().mainFrameScrollOffsetChanged();
Sami 2016/08/11 10:09:07 May need to guard this with m_frame->isMainFrame()
Eric Seckler 2016/08/11 11:34:45 You're right, guarding it now. I looked into the d
3389 frame().loader().saveScrollState(); 3413 frame().loader().saveScrollState();
3390 frame().loader().client()->didChangeScrollOffset(); 3414 frame().loader().client()->didChangeScrollOffset();
3391 3415
3392 if (scrollType == CompositorScroll && m_frame->isMainFrame()) { 3416 if (scrollType == CompositorScroll && m_frame->isMainFrame()) {
3393 if (DocumentLoader* documentLoader = m_frame->loader().documentLoader()) 3417 if (DocumentLoader* documentLoader = m_frame->loader().documentLoader())
3394 documentLoader->initialScrollState().wasScrolledByUser = true; 3418 documentLoader->initialScrollState().wasScrolledByUser = true;
3395 } 3419 }
3396 3420
3397 if (scrollType != AnchoringScroll) 3421 if (scrollType != AnchoringScroll)
3398 clearScrollAnchor(); 3422 clearScrollAnchor();
(...skipping 848 matching lines...) Expand 10 before | Expand all | Expand 10 after
4247 } 4271 }
4248 4272
4249 bool FrameView::canThrottleRendering() const 4273 bool FrameView::canThrottleRendering() const
4250 { 4274 {
4251 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled()) 4275 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled())
4252 return false; 4276 return false;
4253 return m_subtreeThrottled || (m_hiddenForThrottling && m_crossOriginForThrot tling); 4277 return m_subtreeThrottled || (m_hiddenForThrottling && m_crossOriginForThrot tling);
4254 } 4278 }
4255 4279
4256 } // namespace blink 4280 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698