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

Unified 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: Adress Dmitry's comments + sync. Created 4 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/frame/FrameView.cpp
diff --git a/third_party/WebKit/Source/core/frame/FrameView.cpp b/third_party/WebKit/Source/core/frame/FrameView.cpp
index 9c113fa546cb1428847a1678580544281c297372..e3e54a9d656d0aa466bcbd0d44885198f09e094f 100644
--- a/third_party/WebKit/Source/core/frame/FrameView.cpp
+++ b/third_party/WebKit/Source/core/frame/FrameView.cpp
@@ -3443,6 +3443,18 @@ IntSize FrameView::contentsSize() const
return m_contentsSize;
}
+void FrameView::clipPaintRect(FloatRect* paintRect) const
+{
+ // Paint the whole rect if "mainFrameClipsContent" is false, meaning that
+ // WebPreferences::record_whole_document is true.
+ if (!m_frame->settings()->mainFrameClipsContent())
+ return;
+
+ paintRect->intersect(
+ page()->chromeClient().visibleContentRectForPainting().value_or(
+ visibleContentRect()));
+}
+
IntPoint FrameView::minimumScrollPosition() const
{
return IntPoint(-scrollOrigin().x(), -scrollOrigin().y());
@@ -3521,7 +3533,7 @@ void FrameView::setScrollOffset(const DoublePoint& offset, ScrollType scrollType
cache->handleScrollPositionChanged(this);
frame().loader().saveScrollState();
- frame().loader().client()->didChangeScrollOffset();
+ didChangeScrollOffset();
if (scrollType == CompositorScroll && m_frame->isMainFrame()) {
if (DocumentLoader* documentLoader = m_frame->loader().documentLoader())
@@ -3532,6 +3544,13 @@ void FrameView::setScrollOffset(const DoublePoint& offset, ScrollType scrollType
clearScrollAnchor();
}
+void FrameView::didChangeScrollOffset()
+{
+ frame().loader().client()->didChangeScrollOffset();
+ if (frame().isMainFrame())
+ frame().host()->chromeClient().mainFrameScrollOffsetChanged();
+}
+
void FrameView::clearScrollAnchor()
{
if (!RuntimeEnabledFeatures::scrollAnchoringEnabled())
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameView.h ('k') | third_party/WebKit/Source/core/frame/VisualViewport.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698