Title: [225449] trunk/Source
Revision
225449
Author
[email protected]
Date
2017-12-02 09:55:24 -0800 (Sat, 02 Dec 2017)

Log Message

Add a log channel for viewports
https://bugs.webkit.org/show_bug.cgi?id=180295

Reviewed by Zalan Bujtas.

Add a "Viewports" log channel to log viewport scaling information, and enhance the
WebKit "VisibleRects" channel to log additional data for the same reason.

Source/WebCore:

* dom/Document.cpp:
(WebCore::Document::processViewport):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::finishedParsing):
(WebCore::FrameLoader::completed):
* page/FrameView.cpp:
(WebCore::FrameView::resetScrollbarsAndClearContentsSize):
(WebCore::FrameView::scrollToAnchor):
(WebCore::FrameView::maintainScrollPositionAtAnchor):
(WebCore::FrameView::setScrollPosition):
(WebCore::FrameView::autoSizeIfEnabled):
(WebCore::FrameView::setWasScrolledByUser):
* page/LayoutContext.cpp:
(WebCore::LayoutContext::layout):
* page/Page.cpp:
(WebCore::Page::setPageScaleFactor):
* page/ViewportConfiguration.cpp:
(WebCore::ViewportConfiguration::setContentsSize):
(WebCore::ViewportConfiguration::setViewportArguments):
(WebCore::ViewportConfiguration::updateConfiguration):
(WebCore::operator<<):
(WebCore::ViewportConfiguration::description const):
(WebCore::ViewportConfiguration::dump const):
* page/ViewportConfiguration.h:
* platform/Logging.h:
* platform/ScrollView.cpp:
(WebCore::ScrollView::setFixedLayoutSize):

Source/WebKit:

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _didCommitLayerTree:]):
(-[WKWebView _dynamicViewportUpdateChangedTargetToScale:position:nextValidLayerTreeTransactionID:]):
(-[WKWebView _dispatchSetMinimumLayoutSize:]):
(-[WKWebView _endAnimatedResize]):
(-[WKWebView _resizeWhileHidingContentWithUpdates:]):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::setFixedLayoutSize):
(WebKit::WebPage::mainFrameDidLayout):
(WebKit::WebPage::didCommitLoad):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::scaleAfterViewportWidthChange):
(WebKit::WebPage::setViewportConfigurationMinimumLayoutSize):
(WebKit::WebPage::dynamicViewportSizeUpdate):
(WebKit::WebPage::resetViewportDefaultConfiguration):
(WebKit::WebPage::viewportConfigurationChanged):
(WebKit::WebPage::updateVisibleContentRects):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (225448 => 225449)


--- trunk/Source/WebCore/ChangeLog	2017-12-02 15:13:29 UTC (rev 225448)
+++ trunk/Source/WebCore/ChangeLog	2017-12-02 17:55:24 UTC (rev 225449)
@@ -1,3 +1,41 @@
+2017-12-02  Simon Fraser  <[email protected]>
+
+        Add a log channel for viewports
+        https://bugs.webkit.org/show_bug.cgi?id=180295
+
+        Reviewed by Zalan Bujtas.
+
+        Add a "Viewports" log channel to log viewport scaling information, and enhance the
+        WebKit "VisibleRects" channel to log additional data for the same reason.
+
+        * dom/Document.cpp:
+        (WebCore::Document::processViewport):
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::finishedParsing):
+        (WebCore::FrameLoader::completed):
+        * page/FrameView.cpp:
+        (WebCore::FrameView::resetScrollbarsAndClearContentsSize):
+        (WebCore::FrameView::scrollToAnchor):
+        (WebCore::FrameView::maintainScrollPositionAtAnchor):
+        (WebCore::FrameView::setScrollPosition):
+        (WebCore::FrameView::autoSizeIfEnabled):
+        (WebCore::FrameView::setWasScrolledByUser):
+        * page/LayoutContext.cpp:
+        (WebCore::LayoutContext::layout):
+        * page/Page.cpp:
+        (WebCore::Page::setPageScaleFactor):
+        * page/ViewportConfiguration.cpp:
+        (WebCore::ViewportConfiguration::setContentsSize):
+        (WebCore::ViewportConfiguration::setViewportArguments):
+        (WebCore::ViewportConfiguration::updateConfiguration):
+        (WebCore::operator<<):
+        (WebCore::ViewportConfiguration::description const):
+        (WebCore::ViewportConfiguration::dump const):
+        * page/ViewportConfiguration.h:
+        * platform/Logging.h:
+        * platform/ScrollView.cpp:
+        (WebCore::ScrollView::setFixedLayoutSize):
+
 2017-12-01  Alicia Boya GarcĂ­a  <[email protected]>
 
         [MSE] Use correct range end checks in sourceBufferPrivateDidReceiveSample()

Modified: trunk/Source/WebCore/dom/Document.cpp (225448 => 225449)


--- trunk/Source/WebCore/dom/Document.cpp	2017-12-02 15:13:29 UTC (rev 225448)
+++ trunk/Source/WebCore/dom/Document.cpp	2017-12-02 17:55:24 UTC (rev 225449)
@@ -220,6 +220,7 @@
 #include <wtf/SystemTracing.h>
 #include <wtf/UUID.h>
 #include <wtf/text/StringBuffer.h>
+#include <wtf/text/TextStream.h>
 #include <yarr/RegularExpression.h>
 
 #if ENABLE(DEVICE_ORIENTATION)
@@ -3381,11 +3382,15 @@
 {
     ASSERT(!features.isNull());
 
+    LOG_WITH_STREAM(Viewports, stream << "Document::processViewport " << features);
+
     if (origin < m_viewportArguments.type)
         return;
 
     m_viewportArguments = ViewportArguments(origin);
 
+    LOG_WITH_STREAM(Viewports, stream  << " resolved to " << m_viewportArguments);
+
     processFeaturesString(features, FeatureMode::Viewport, [this](StringView key, StringView value) {
         setViewportFeature(m_viewportArguments, *this, key, value);
     });

Modified: trunk/Source/WebCore/loader/FrameLoader.cpp (225448 => 225449)


--- trunk/Source/WebCore/loader/FrameLoader.cpp	2017-12-02 15:13:29 UTC (rev 225448)
+++ trunk/Source/WebCore/loader/FrameLoader.cpp	2017-12-02 17:55:24 UTC (rev 225449)
@@ -744,6 +744,8 @@
 
 void FrameLoader::finishedParsing()
 {
+    LOG(Loading, "WebCoreLoading %s: Finished parsing", m_frame.tree().uniqueName().string().utf8().data());
+
     m_frame.injectUserScripts(InjectAtDocumentEnd);
 
     if (m_stateMachine.creatingInitialEmptyDocument())

Modified: trunk/Source/WebCore/page/FrameView.cpp (225448 => 225449)


--- trunk/Source/WebCore/page/FrameView.cpp	2017-12-02 15:13:29 UTC (rev 225448)
+++ trunk/Source/WebCore/page/FrameView.cpp	2017-12-02 17:55:24 UTC (rev 225449)
@@ -301,6 +301,8 @@
 {
     resetScrollbars();
 
+    LOG(Layout, "FrameView %p resetScrollbarsAndClearContentsSize", this);
+
     setScrollbarsSuppressed(true);
     setContentsSize(IntSize());
     setScrollbarsSuppressed(false);
@@ -2103,6 +2105,8 @@
 
 bool FrameView::scrollToAnchor(const String& fragmentIdentifier)
 {
+    LOG(Scrolling, "FrameView::scrollToAnchor %s", fragmentIdentifier.utf8().data());
+
     // If our URL has no ref, then we have no place we need to jump to.
     if (fragmentIdentifier.isNull())
         return false;
@@ -2119,6 +2123,8 @@
 
     Element* anchorElement = document.findAnchor(fragmentIdentifier);
 
+    LOG(Scrolling, " anchorElement is %p", anchorElement);
+
     // Setting to null will clear the current target.
     document.setCSSTarget(anchorElement);
 
@@ -2157,6 +2163,8 @@
 
 void FrameView::maintainScrollPositionAtAnchor(ContainerNode* anchorNode)
 {
+    LOG(Scrolling, "FrameView::maintainScrollPositionAtAnchor at %p", anchorNode);
+
     m_maintainScrollPositionAnchor = anchorNode;
     if (!m_maintainScrollPositionAnchor)
         return;
@@ -2186,6 +2194,8 @@
 
 void FrameView::setScrollPosition(const ScrollPosition& scrollPosition)
 {
+    LOG_WITH_STREAM(Scrolling, stream << "FrameView::setScrollPosition " << scrollPosition << " , clearing anchor");
+
     SetForScope<bool> changeInProgrammaticScroll(m_inProgrammaticScroll, true);
     m_maintainScrollPositionAnchor = nullptr;
     Page* page = frame().page();
@@ -2949,6 +2959,9 @@
 void FrameView::scrollToAnchor()
 {
     RefPtr<ContainerNode> anchorNode = m_maintainScrollPositionAnchor;
+
+    LOG_WITH_STREAM(Scrolling, stream << "FrameView::scrollToAnchor() " << anchorNode.get());
+
     if (!anchorNode)
         return;
 
@@ -2960,6 +2973,8 @@
     if (anchorNode != frame().document() && anchorNode->renderer())
         rect = anchorNode->renderer()->absoluteAnchorRect(&insideFixed);
 
+    LOG_WITH_STREAM(Scrolling, stream << " anchor node rect " << rect);
+
     // Scroll nested layers and frames to reveal the anchor.
     // Align to the top and to the closest side (this matches other browsers).
     if (anchorNode->renderer()->style().isHorizontalWritingMode())
@@ -2973,6 +2988,7 @@
         cache->handleScrolledToAnchor(anchorNode.get());
 
     // scrollRectToVisible can call into setScrollPosition(), which resets m_maintainScrollPositionAnchor.
+    LOG_WITH_STREAM(Scrolling, stream << " restoring anchor node to " << anchorNode.get());
     m_maintainScrollPositionAnchor = anchorNode;
 }
 
@@ -3305,6 +3321,8 @@
         document->updateLayoutIgnorePendingStylesheets();
     }
     m_didRunAutosize = true;
+
+    LOG_WITH_STREAM(Layout, stream << "FrameView " << this << " autoSizeIfEnabled() changed size from " << size << " to " << frameRect().size());
 }
 
 void FrameView::setAutoSizeFixedMinimumHeight(int fixedMinimumHeight)
@@ -3882,6 +3900,8 @@
 
 void FrameView::setWasScrolledByUser(bool wasScrolledByUser)
 {
+    LOG(Scrolling, "FrameView::setWasScrolledByUser at %d", wasScrolledByUser);
+
     if (m_inProgrammaticScroll)
         return;
     m_maintainScrollPositionAnchor = nullptr;

Modified: trunk/Source/WebCore/page/LayoutContext.cpp (225448 => 225449)


--- trunk/Source/WebCore/page/LayoutContext.cpp	2017-12-02 15:13:29 UTC (rev 225448)
+++ trunk/Source/WebCore/page/LayoutContext.cpp	2017-12-02 17:55:24 UTC (rev 225449)
@@ -119,6 +119,8 @@
 
 void LayoutContext::layout()
 {
+    LOG_WITH_STREAM(Layout, stream << "FrameView " << &view() << " LayoutContext::layout() with size " << view().layoutSize());
+
     RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(!frame().document()->inRenderTreeUpdate());
     ASSERT(!view().isPainting());
     ASSERT(frame().view() == &view());
@@ -142,7 +144,7 @@
 
 #if !LOG_DISABLED
     if (m_firstLayout && !frame().ownerElement())
-        LOG(Layout, "FrameView %p elapsed time before first layout: %.3fs\n", this, document()->timeSinceDocumentCreation().value());
+        LOG(Layout, "FrameView %p elapsed time before first layout: %.3fs", this, document()->timeSinceDocumentCreation().value());
 #endif
 #if PLATFORM(IOS)
     if (view().updateFixedPositionLayoutRect() && subtreeLayoutRoot())

Modified: trunk/Source/WebCore/page/Page.cpp (225448 => 225449)


--- trunk/Source/WebCore/page/Page.cpp	2017-12-02 15:13:29 UTC (rev 225448)
+++ trunk/Source/WebCore/page/Page.cpp	2017-12-02 17:55:24 UTC (rev 225449)
@@ -797,6 +797,8 @@
 
 void Page::setPageScaleFactor(float scale, const IntPoint& origin, bool inStableState)
 {
+    LOG(Viewports, "Page::setPageScaleFactor %.2f - inStableState %d", scale, inStableState);
+
     Document* document = mainFrame().document();
     FrameView* view = document->view();
 

Modified: trunk/Source/WebCore/page/ViewportConfiguration.cpp (225448 => 225449)


--- trunk/Source/WebCore/page/ViewportConfiguration.cpp	2017-12-02 15:13:29 UTC (rev 225448)
+++ trunk/Source/WebCore/page/ViewportConfiguration.cpp	2017-12-02 17:55:24 UTC (rev 225449)
@@ -26,6 +26,7 @@
 #include "config.h"
 #include "ViewportConfiguration.h"
 
+#include "Logging.h"
 #include <wtf/Assertions.h>
 #include <wtf/MathExtras.h>
 #include <wtf/text/CString.h>
@@ -74,6 +75,8 @@
     if (m_contentSize == contentSize)
         return false;
 
+    LOG_WITH_STREAM(Viewports, stream << "ViewportConfiguration::setContentsSize " << contentSize << " (was " << m_contentSize << ")");
+
     m_contentSize = contentSize;
     updateConfiguration();
     return true;
@@ -94,6 +97,7 @@
     if (m_viewportArguments == viewportArguments)
         return false;
 
+    LOG_WITH_STREAM(Viewports, stream << "ViewportConfiguration::setViewportArguments " << viewportArguments);
     m_viewportArguments = viewportArguments;
     updateConfiguration();
     return true;
@@ -341,6 +345,8 @@
         m_configuration.allowsShrinkToFit = m_viewportArguments.shrinkToFit != 0.;
 
     m_configuration.avoidsUnsafeArea = m_viewportArguments.viewportFit != ViewportFit::Cover;
+
+    LOG_WITH_STREAM(Viewports, stream << "ViewportConfiguration " << this << " updateConfiguration " << *this << " gives initial scale " << initialScale() << " based on contentSize " << m_contentSize << " and layout size " << layoutWidth() << "x" << layoutHeight());
 }
 
 double ViewportConfiguration::viewportArgumentsLength(double length) const
@@ -449,8 +455,13 @@
     return ts;
 }
 
-CString ViewportConfiguration::description() const
+TextStream& operator<<(TextStream& ts, const ViewportConfiguration& config)
 {
+    return ts << config.description();
+}
+
+String ViewportConfiguration::description() const
+{
     TextStream ts;
 
     ts.startGroup();
@@ -482,12 +493,12 @@
     
     ts.endGroup();
 
-    return ts.release().utf8();
+    return ts.release();
 }
 
 void ViewportConfiguration::dump() const
 {
-    WTFLogAlways("%s", description().data());
+    WTFLogAlways("%s", description().utf8().data());
 }
 
 #endif

Modified: trunk/Source/WebCore/page/ViewportConfiguration.h (225448 => 225449)


--- trunk/Source/WebCore/page/ViewportConfiguration.h	2017-12-02 15:13:29 UTC (rev 225448)
+++ trunk/Source/WebCore/page/ViewportConfiguration.h	2017-12-02 17:55:24 UTC (rev 225449)
@@ -101,7 +101,7 @@
     WEBCORE_EXPORT static Parameters testingParameters();
     
 #ifndef NDEBUG
-    WTF::CString description() const;
+    String description() const;
     WEBCORE_EXPORT void dump() const;
 #endif
 
@@ -127,5 +127,6 @@
 };
 
 WTF::TextStream& operator<<(WTF::TextStream&, const ViewportConfiguration::Parameters&);
+WTF::TextStream& operator<<(WTF::TextStream&, const ViewportConfiguration&);
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/platform/Logging.h (225448 => 225449)


--- trunk/Source/WebCore/platform/Logging.h	2017-12-02 15:13:29 UTC (rev 225448)
+++ trunk/Source/WebCore/platform/Logging.h	2017-12-02 17:55:24 UTC (rev 225449)
@@ -92,6 +92,7 @@
     M(Tiling) \
     M(Threading) \
     M(URLParser) \
+    M(Viewports) \
     M(WebAudio) \
     M(WebGL) \
     M(WebGPU) \

Modified: trunk/Source/WebCore/platform/ScrollView.cpp (225448 => 225449)


--- trunk/Source/WebCore/platform/ScrollView.cpp	2017-12-02 15:13:29 UTC (rev 225448)
+++ trunk/Source/WebCore/platform/ScrollView.cpp	2017-12-02 17:55:24 UTC (rev 225449)
@@ -301,6 +301,8 @@
 {
     if (fixedLayoutSize() == newSize)
         return;
+
+    LOG_WITH_STREAM(Layout, stream << "ScrollView " << this << " setFixedLayoutSize " << newSize);
     m_fixedLayoutSize = newSize;
     if (m_useFixedLayout)
         availableContentSizeChanged(AvailableSizeChangeReason::AreaSizeChanged);

Modified: trunk/Source/WebKit/ChangeLog (225448 => 225449)


--- trunk/Source/WebKit/ChangeLog	2017-12-02 15:13:29 UTC (rev 225448)
+++ trunk/Source/WebKit/ChangeLog	2017-12-02 17:55:24 UTC (rev 225449)
@@ -1,3 +1,31 @@
+2017-12-02  Simon Fraser  <[email protected]>
+
+        Add a log channel for viewports
+        https://bugs.webkit.org/show_bug.cgi?id=180295
+
+        Reviewed by Zalan Bujtas.
+
+        Add a "Viewports" log channel to log viewport scaling information, and enhance the
+        WebKit "VisibleRects" channel to log additional data for the same reason.
+
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (-[WKWebView _didCommitLayerTree:]):
+        (-[WKWebView _dynamicViewportUpdateChangedTargetToScale:position:nextValidLayerTreeTransactionID:]):
+        (-[WKWebView _dispatchSetMinimumLayoutSize:]):
+        (-[WKWebView _endAnimatedResize]):
+        (-[WKWebView _resizeWhileHidingContentWithUpdates:]):
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::setFixedLayoutSize):
+        (WebKit::WebPage::mainFrameDidLayout):
+        (WebKit::WebPage::didCommitLoad):
+        * WebProcess/WebPage/ios/WebPageIOS.mm:
+        (WebKit::scaleAfterViewportWidthChange):
+        (WebKit::WebPage::setViewportConfigurationMinimumLayoutSize):
+        (WebKit::WebPage::dynamicViewportSizeUpdate):
+        (WebKit::WebPage::resetViewportDefaultConfiguration):
+        (WebKit::WebPage::viewportConfigurationChanged):
+        (WebKit::WebPage::updateVisibleContentRects):
+
 2017-12-02  Carlos Garcia Campos  <[email protected]>
 
         WebDriver: handle user prompts shown while executing scripts

Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm (225448 => 225449)


--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm	2017-12-02 15:13:29 UTC (rev 225448)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm	2017-12-02 17:55:24 UTC (rev 225449)
@@ -1661,7 +1661,7 @@
     if (![self usesStandardContentView])
         return;
 
-    LOG_WITH_STREAM(VisibleRects, stream << "-[WKWebView _didCommitLayerTree:] transactionID " <<  layerTreeTransaction.transactionID() << " _dynamicViewportUpdateMode " << (int)_dynamicViewportUpdateMode);
+    LOG_WITH_STREAM(VisibleRects, stream << "-[WKWebView " << _page->pageID() << " _didCommitLayerTree:] transactionID " <<  layerTreeTransaction.transactionID() << " _dynamicViewportUpdateMode " << (int)_dynamicViewportUpdateMode);
 
     bool needUpdateVisibleContentRects = _page->updateLayoutViewportParameters(layerTreeTransaction);
 
@@ -1686,8 +1686,10 @@
     [_scrollView setMinimumZoomScale:layerTreeTransaction.minimumScaleFactor()];
     [_scrollView setMaximumZoomScale:layerTreeTransaction.maximumScaleFactor()];
     [_scrollView setZoomEnabled:layerTreeTransaction.allowsUserScaling()];
-    if (!layerTreeTransaction.scaleWasSetByUIProcess() && ![_scrollView isZooming] && ![_scrollView isZoomBouncing] && ![_scrollView _isAnimatingZoom] && [_scrollView zoomScale] != layerTreeTransaction.pageScaleFactor())
+    if (!layerTreeTransaction.scaleWasSetByUIProcess() && ![_scrollView isZooming] && ![_scrollView isZoomBouncing] && ![_scrollView _isAnimatingZoom] && [_scrollView zoomScale] != layerTreeTransaction.pageScaleFactor()) {
+        LOG_WITH_STREAM(VisibleRects, stream << " updating scroll view with pageScaleFactor " << layerTreeTransaction.pageScaleFactor());
         [_scrollView setZoomScale:layerTreeTransaction.pageScaleFactor()];
+    }
 
     _viewportMetaTagWidth = layerTreeTransaction.viewportMetaTagWidth();
     _viewportMetaTagWidthWasExplicit = layerTreeTransaction.viewportMetaTagWidthWasExplicit();
@@ -1776,6 +1778,8 @@
 
 - (void)_dynamicViewportUpdateChangedTargetToScale:(double)newScale position:(CGPoint)newScrollPosition nextValidLayerTreeTransactionID:(uint64_t)nextValidLayerTreeTransactionID
 {
+    LOG_WITH_STREAM(VisibleRects, stream << "-[WKWebView " << _page->pageID() << " _dynamicViewportUpdateChangedTargetToScale:] " <<  newScale << " _dynamicViewportUpdateMode " << (int)_dynamicViewportUpdateMode);
+
     if (_dynamicViewportUpdateMode != DynamicViewportUpdateMode::NotResizing) {
         CGFloat animatingScaleTarget = [[_resizeAnimationView layer] transform].m11;
         double currentTargetScale = animatingScaleTarget * [[_contentView layer] transform].m11;
@@ -2452,6 +2456,7 @@
     if (_lastSentMinimumLayoutSize && CGSizeEqualToSize(_lastSentMinimumLayoutSize.value(), minimumLayoutSize))
         return;
 
+    LOG_WITH_STREAM(VisibleRects, stream << "-[WKWebView " << _page->pageID() << " _dispatchSetMinimumLayoutSize:] " << minimumLayoutSize << " contentZoomScale " << contentZoomScale(self));
     _page->setViewportConfigurationMinimumLayoutSize(minimumLayoutSize);
     _lastSentMinimumLayoutSize = minimumLayoutSize;
 }
@@ -5096,6 +5101,8 @@
 
 - (void)_endAnimatedResize
 {
+    LOG_WITH_STREAM(VisibleRects, stream << "-[WKWebView " << _page->pageID() << " _endAnimatedResize:] " << " _dynamicViewportUpdateMode " << (int)_dynamicViewportUpdateMode);
+
     if (_dynamicViewportUpdateMode == DynamicViewportUpdateMode::NotResizing)
         return;
 
@@ -5169,6 +5176,7 @@
 
 - (void)_resizeWhileHidingContentWithUpdates:(void (^)(void))updateBlock
 {
+    LOG_WITH_STREAM(VisibleRects, stream << "-[WKWebView " << _page->pageID() << " _resizeWhileHidingContentWithUpdates:]");
     [self _beginAnimatedResizeWithUpdates:updateBlock];
     if (_dynamicViewportUpdateMode == DynamicViewportUpdateMode::ResizingWithAnimation) {
         [_contentView setHidden:YES];

Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp (225448 => 225449)


--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp	2017-12-02 15:13:29 UTC (rev 225448)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp	2017-12-02 17:55:24 UTC (rev 225449)
@@ -208,6 +208,7 @@
 #include <runtime/SamplingProfiler.h>
 #include <wtf/RunLoop.h>
 #include <wtf/SetForScope.h>
+#include <wtf/text/TextStream.h>
 
 #if ENABLE(DATA_DETECTION)
 #include "DataDetectionResult.h"
@@ -1746,6 +1747,7 @@
     if (!view || view->fixedLayoutSize() == size)
         return false;
 
+    LOG_WITH_STREAM(VisibleRects, stream << "WebPage " << m_pageID << " setFixedLayoutSize " << size);
     view->setFixedLayoutSize(size);
 
     send(Messages::WebPageProxy::FixedLayoutSizeDidChange(size));
@@ -3781,6 +3783,7 @@
 #if PLATFORM(IOS)
     if (FrameView* frameView = mainFrameView()) {
         IntSize newContentSize = frameView->contentsSize();
+        LOG_WITH_STREAM(VisibleRects, stream << "WebPage " << m_pageID << " mainFrameDidLayout setting content size to " << newContentSize);
         if (m_viewportConfiguration.setContentsSize(newContentSize))
             viewportConfigurationChanged();
     }
@@ -5085,6 +5088,8 @@
     const Frame* coreFrame = frame->coreFrame();
     
     bool viewportChanged = false;
+
+    LOG_WITH_STREAM(VisibleRects, stream << "WebPage " << m_pageID << " didCommitLoad setting content size to " << coreFrame->view()->contentsSize());
     if (m_viewportConfiguration.setContentsSize(coreFrame->view()->contentsSize()))
         viewportChanged = true;
 

Modified: trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm (225448 => 225449)


--- trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm	2017-12-02 15:13:29 UTC (rev 225448)
+++ trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm	2017-12-02 17:55:24 UTC (rev 225449)
@@ -270,6 +270,8 @@
     else
         scale = std::max(std::min(currentScale, viewportConfiguration.maximumScale()), viewportConfiguration.minimumScale());
 
+    LOG(VisibleRects, "scaleAfterViewportWidthChange getting scale %.2f", scale);
+
     if (userHasChangedPageScaleFactor) {
         // When the content size changes, we keep the same relative horizontal content width in view, otherwise we would
         // end up zoomed too far in landscape->portrait, and too close in portrait->landscape.
@@ -2373,6 +2375,7 @@
 
 void WebPage::setViewportConfigurationMinimumLayoutSize(const FloatSize& size)
 {
+    LOG_WITH_STREAM(VisibleRects, stream << "WebPage " << m_pageID << " setViewportConfigurationMinimumLayoutSize " << size);
     if (m_viewportConfiguration.setMinimumLayoutSize(size))
         viewportConfigurationChanged();
 }
@@ -2413,7 +2416,7 @@
     SetForScope<bool> dynamicSizeUpdateGuard(m_inDynamicSizeUpdate, true);
     // FIXME: this does not handle the cases where the content would change the content size or scroll position from _javascript_.
     // To handle those cases, we would need to redo this computation on every change until the next visible content rect update.
-    LOG_WITH_STREAM(VisibleRects, stream << "\nWebPage::dynamicViewportSizeUpdate - targetUnobscuredRect " << targetUnobscuredRect << " targetExposedContentRect " << targetExposedContentRect << " targetScale " << targetScale);
+    LOG_WITH_STREAM(VisibleRects, stream << "\nWebPage::dynamicViewportSizeUpdate - minimumLayoutSize " << minimumLayoutSize << " targetUnobscuredRect " << targetUnobscuredRect << " targetExposedContentRect " << targetExposedContentRect << " targetScale " << targetScale);
 
     FrameView& frameView = *m_page->mainFrame().view();
     IntSize oldContentSize = frameView.contentsSize();
@@ -2445,6 +2448,7 @@
         }
     }
 
+    LOG_WITH_STREAM(VisibleRects, stream << "WebPage::dynamicViewportSizeUpdate setting minimum layout size to " << minimumLayoutSize);
     m_viewportConfiguration.setMinimumLayoutSize(minimumLayoutSize);
     IntSize newLayoutSize = m_viewportConfiguration.layoutSize();
 
@@ -2594,6 +2598,7 @@
 
 void WebPage::resetViewportDefaultConfiguration(WebFrame* frame, bool hasMobileDocType)
 {
+    LOG_WITH_STREAM(VisibleRects, stream << "WebPage " << m_pageID << " resetViewportDefaultConfiguration");
     if (m_useTestingViewportConfiguration) {
         m_viewportConfiguration.setDefaultConfiguration(ViewportConfiguration::testingParameters());
         return;
@@ -2630,6 +2635,8 @@
     else
         scale = initialScale;
 
+    LOG_WITH_STREAM(VisibleRects, stream << "WebPage " << m_pageID << " viewportConfigurationChanged - setting zoomedOutPageScaleFactor to " << m_viewportConfiguration.minimumScale() << " and scale to " << scale);
+
     m_page->setZoomedOutPageScaleFactor(m_viewportConfiguration.minimumScale());
 
     updateViewportSizeForCSSViewportUnits();
@@ -2769,7 +2776,7 @@
 
 void WebPage::updateVisibleContentRects(const VisibleContentRectUpdateInfo& visibleContentRectUpdateInfo, MonotonicTime oldestTimestamp)
 {
-    LOG_WITH_STREAM(VisibleRects, stream << "\nWebPage::updateVisibleContentRects " << visibleContentRectUpdateInfo);
+    LOG_WITH_STREAM(VisibleRects, stream << "\nWebPage " << m_pageID << " updateVisibleContentRects " << visibleContentRectUpdateInfo);
 
     // Skip any VisibleContentRectUpdate that have been queued before DidCommitLoad suppresses the updates in the UIProcess.
     if (visibleContentRectUpdateInfo.lastLayerTreeTransactionID() < m_mainFrame->firstLayerTreeTransactionIDAfterDidCommitLoad() && !visibleContentRectUpdateInfo.isFirstUpdateForNewViewSize())
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to