+2015-07-21 Simon Fraser <simon.fraser@apple.com>
+
+ Add logging for TiledCoreAnimationDrawingArea resizing
+ https://bugs.webkit.org/show_bug.cgi?id=147180
+
+ Reviewed by Tim Horton.
+
+ Add a "Resize" log channel for WebKit2, and use it to log data in scaleViewToFitDocumentIfNeeded().
+
+ * Platform/Logging.h:
+ * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
+ (WebKit::TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded):
+
2015-07-22 Sam Weinig <sam@webkit.org>
Encode/Decode underlying errors when serializing NSErrors
#import "DrawingAreaProxyMessages.h"
#import "LayerHostingContext.h"
#import "LayerTreeContext.h"
+#import "Logging.h"
#import "ViewGestureControllerMessages.h"
#import "WebFrame.h"
#import "WebPage.h"
if (!m_shouldScaleViewToFitDocument)
return;
+ LOG(Resize, "TiledCoreAnimationDrawingArea %p scaleViewToFitDocumentIfNeeded", this);
m_webPage.layoutIfNeeded();
int viewWidth = m_webPage.size().width();
bool documentWidthChanged = m_lastDocumentSizeForScaleToFit.width() != documentWidth;
bool viewWidthChanged = m_lastViewSizeForScaleToFit.width() != viewWidth;
+ LOG(Resize, " documentWidthChanged=%d, viewWidthChanged=%d", documentWidthChanged, viewWidthChanged);
+
if (!documentWidthChanged && !viewWidthChanged)
return;
IntSize fixedLayoutSize(documentWidth, std::ceil((m_webPage.size().height() - m_webPage.corePage()->topContentInset()) / viewScale));
m_webPage.setFixedLayoutSize(fixedLayoutSize);
m_webPage.scaleView(viewScale);
+
+ LOG(Resize, " using fixed layout at %dx%d. document width %d unchanged, scaled to %.4f to fit view width %d", fixedLayoutSize.width(), fixedLayoutSize.height(), documentWidth, viewScale, viewWidth);
return;
}
+
+ LOG(Resize, " doing unconstrained layout");
+
// Lay out at the view size.
m_webPage.setUseFixedLayout(false);
m_webPage.layoutIfNeeded();
float viewScale = 1;
+ LOG(Resize, " unscaled document size %dx%d. need to scale down: %d", documentSize.width(), documentSize.height(), documentWidth && documentWidth < maximumDocumentWidthForScaling && viewWidth < documentWidth);
+
// Avoid scaling down documents that don't fit in a certain width, to allow
// sites that want horizontal scrollbars to continue to have them.
if (documentWidth && documentWidth < maximumDocumentWidthForScaling && viewWidth < documentWidth) {
}
IntSize fixedLayoutSize(documentWidth, std::ceil((m_webPage.size().height() - m_webPage.corePage()->topContentInset()) / viewScale));
m_webPage.setFixedLayoutSize(fixedLayoutSize);
+
+ LOG(Resize, " using fixed layout at %dx%d. document width %d, scaled to %.4f to fit view width %d", fixedLayoutSize.width(), fixedLayoutSize.height(), documentWidth, viewScale, viewWidth);
}
m_webPage.scaleView(viewScale);