Diff
Modified: branches/safari-537-branch/Source/WebKit2/ChangeLog (152244 => 152245)
--- branches/safari-537-branch/Source/WebKit2/ChangeLog 2013-07-01 20:34:40 UTC (rev 152244)
+++ branches/safari-537-branch/Source/WebKit2/ChangeLog 2013-07-01 20:36:24 UTC (rev 152245)
@@ -1,5 +1,62 @@
2013-07-01 Lucas Forschler <[email protected]>
+ Merge r152190
+
+ 2013-06-28 Tim Horton <[email protected]>
+
+ [wk2] WKView shouldn't force scrolling off if shouldClipToVisibleRect is set
+ https://bugs.webkit.org/show_bug.cgi?id=118174
+ <rdar://problem/14301175>
+
+ Reviewed by Anders Carlsson.
+
+ * UIProcess/API/mac/WKView.mm:
+ (-[WKView _updateViewExposedRect]):
+ Pass whether or not clips-to-visibleRect is enabled down to the WebPageProxy.
+
+ (-[WKView setMinimumSizeForAutoLayout:]):
+ Disable scrolling when using autolayout instead of when using clips-to-visibleRect.
+
+ (-[WKView setShouldClipToVisibleRect:]):
+ Clipping to the WKView's visibleRect does not strictly require scrolling to be disabled,
+ and in fact there are cases (RTL/TB pagination) where we *must* scroll, even when the view
+ is big enough to fit the content (the case clip-to-visibleRect was added for).
+
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::WebPageProxy):
+ * UIProcess/WebPageProxy.h:
+ * UIProcess/mac/WebPageProxyMac.mm:
+ (WebKit::WebPageProxy::viewExposedRectChanged):
+ (WebKit::WebPageProxy::exposedRectChangedTimerFired):
+ Keep track of and forward to the drawing area whether or not clips-to-visibleRect is enabled.
+
+ * WebProcess/WebPage/DrawingArea.h:
+ (WebKit::DrawingArea::setClipsToExposedRect): Added.
+ (WebKit::DrawingArea::didChangeScrollOffsetForAnyFrame): Added a missing space.
+
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::viewExposedRectChanged):
+ * WebProcess/WebPage/WebPage.h:
+ * WebProcess/WebPage/WebPage.messages.in:
+ Forward clips-to-visibleRect enabled state to the drawing area.
+
+ * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
+ Add storage for m_clipsToExposedRect.
+
+ * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
+ (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
+ (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
+ (WebKit::TiledCoreAnimationDrawingArea::setClipsToExposedRect):
+ (WebKit::TiledCoreAnimationDrawingArea::updateMainFrameClipsToExposedRect):
+ (WebKit::TiledCoreAnimationDrawingArea::createPageOverlayLayer):
+ (WebKit::TiledCoreAnimationDrawingArea::didCommitChangesForLayer):
+ Check m_clipsToExposedRect instead of the main-frame's isScrollable() to determine
+ whether we should tell our TiledBackings to clip to the exposed rect we provide.
+
+ We don't need to listen to mainFrameScrollabilityChanged anymore.
+
+2013-07-01 Lucas Forschler <[email protected]>
+
Merge r152177
2013-06-28 Tim Horton <[email protected]>
Modified: branches/safari-537-branch/Source/WebKit2/UIProcess/API/mac/WKView.mm (152244 => 152245)
--- branches/safari-537-branch/Source/WebKit2/UIProcess/API/mac/WKView.mm 2013-07-01 20:34:40 UTC (rev 152244)
+++ branches/safari-537-branch/Source/WebKit2/UIProcess/API/mac/WKView.mm 2013-07-01 20:36:24 UTC (rev 152245)
@@ -415,7 +415,7 @@
if (_data->_useContentPreparationRectForVisibleRect)
exposedRect = NSUnionRect(_data->_contentPreparationRect, exposedRect);
- _data->_page->viewExposedRectChanged(exposedRect);
+ _data->_page->viewExposedRectChanged(exposedRect, _data->_clipsToVisibleRect);
}
- (void)setFrameSize:(NSSize)size
@@ -3328,6 +3328,7 @@
BOOL expandsToFit = minimumSizeForAutoLayout.width > 0;
_data->_page->setMinimumLayoutSize(IntSize(minimumSizeForAutoLayout.width, minimumSizeForAutoLayout.height));
+ _data->_page->setMainFrameIsScrollable(!expandsToFit);
[self setShouldClipToVisibleRect:expandsToFit];
}
@@ -3340,11 +3341,7 @@
- (void)setShouldClipToVisibleRect:(BOOL)clipsToVisibleRect
{
_data->_clipsToVisibleRect = clipsToVisibleRect;
-
- if (clipsToVisibleRect)
- [self _updateViewExposedRect];
-
- _data->_page->setMainFrameIsScrollable(!clipsToVisibleRect);
+ [self _updateViewExposedRect];
}
- (NSColor *)underlayColor
Modified: branches/safari-537-branch/Source/WebKit2/UIProcess/WebPageProxy.cpp (152244 => 152245)
--- branches/safari-537-branch/Source/WebKit2/UIProcess/WebPageProxy.cpp 2013-07-01 20:34:40 UTC (rev 152244)
+++ branches/safari-537-branch/Source/WebKit2/UIProcess/WebPageProxy.cpp 2013-07-01 20:36:24 UTC (rev 152245)
@@ -312,6 +312,8 @@
, m_waitingForDidUpdateInWindowState(false)
#if PLATFORM(MAC)
, m_exposedRectChangedTimer(this, &WebPageProxy::exposedRectChangedTimerFired)
+ , m_clipsToExposedRect(false)
+ , m_lastSentClipsToExposedRect(false)
#endif
#if ENABLE(PAGE_VISIBILITY_API)
, m_visibilityState(PageVisibilityStateVisible)
Modified: branches/safari-537-branch/Source/WebKit2/UIProcess/WebPageProxy.h (152244 => 152245)
--- branches/safari-537-branch/Source/WebKit2/UIProcess/WebPageProxy.h 2013-07-01 20:34:40 UTC (rev 152244)
+++ branches/safari-537-branch/Source/WebKit2/UIProcess/WebPageProxy.h 2013-07-01 20:36:24 UTC (rev 152245)
@@ -389,7 +389,7 @@
#if PLATFORM(MAC)
void updateWindowIsVisible(bool windowIsVisible);
void windowAndViewFramesChanged(const WebCore::FloatRect& viewFrameInWindowCoordinates, const WebCore::FloatPoint& accessibilityViewCoordinates);
- void viewExposedRectChanged(const WebCore::FloatRect& exposedRect);
+ void viewExposedRectChanged(const WebCore::FloatRect& exposedRect, bool);
void exposedRectChangedTimerFired(WebCore::Timer<WebPageProxy>*);
void setMainFrameIsScrollable(bool);
@@ -1272,6 +1272,8 @@
WebCore::Timer<WebPageProxy> m_exposedRectChangedTimer;
WebCore::FloatRect m_exposedRect;
WebCore::FloatRect m_lastSentExposedRect;
+ bool m_clipsToExposedRect;
+ bool m_lastSentClipsToExposedRect;
#endif
#if PLATFORM(QT)
Modified: branches/safari-537-branch/Source/WebKit2/UIProcess/mac/WebPageProxyMac.mm (152244 => 152245)
--- branches/safari-537-branch/Source/WebKit2/UIProcess/mac/WebPageProxyMac.mm 2013-07-01 20:34:40 UTC (rev 152244)
+++ branches/safari-537-branch/Source/WebKit2/UIProcess/mac/WebPageProxyMac.mm 2013-07-01 20:36:24 UTC (rev 152245)
@@ -153,12 +153,13 @@
process()->send(Messages::WebPage::WindowAndViewFramesChanged(windowFrameInScreenCoordinates, windowFrameInUnflippedScreenCoordinates, viewFrameInWindowCoordinates, accessibilityViewCoordinates), m_pageID);
}
-void WebPageProxy::viewExposedRectChanged(const FloatRect& exposedRect)
+void WebPageProxy::viewExposedRectChanged(const FloatRect& exposedRect, bool clipsToExposedRect)
{
if (!isValid())
return;
m_exposedRect = exposedRect;
+ m_clipsToExposedRect = clipsToExposedRect;
if (!m_exposedRectChangedTimer.isActive())
m_exposedRectChangedTimer.startOneShot(0);
@@ -169,11 +170,12 @@
if (!isValid())
return;
- if (m_exposedRect == m_lastSentExposedRect)
+ if (m_exposedRect == m_lastSentExposedRect && m_clipsToExposedRect == m_lastSentClipsToExposedRect)
return;
- process()->send(Messages::WebPage::ViewExposedRectChanged(m_exposedRect), m_pageID);
+ process()->send(Messages::WebPage::ViewExposedRectChanged(m_exposedRect, m_clipsToExposedRect), m_pageID);
m_lastSentExposedRect = m_exposedRect;
+ m_lastSentClipsToExposedRect = m_clipsToExposedRect;
}
void WebPageProxy::setMainFrameIsScrollable(bool isScrollable)
Modified: branches/safari-537-branch/Source/WebKit2/WebProcess/WebPage/DrawingArea.h (152244 => 152245)
--- branches/safari-537-branch/Source/WebKit2/WebProcess/WebPage/DrawingArea.h 2013-07-01 20:34:40 UTC (rev 152244)
+++ branches/safari-537-branch/Source/WebKit2/WebProcess/WebPage/DrawingArea.h 2013-07-01 20:36:24 UTC (rev 152245)
@@ -86,9 +86,10 @@
virtual void mainFrameContentSizeChanged(const WebCore::IntSize&) { }
virtual void setExposedRect(const WebCore::FloatRect&) { }
+ virtual void setClipsToExposedRect(bool) { }
virtual void mainFrameScrollabilityChanged(bool) { }
- virtual void didChangeScrollOffsetForAnyFrame() {}
+ virtual void didChangeScrollOffsetForAnyFrame() { }
#if USE(ACCELERATED_COMPOSITING)
virtual WebCore::GraphicsLayerFactory* graphicsLayerFactory() { return 0; }
Modified: branches/safari-537-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (152244 => 152245)
--- branches/safari-537-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2013-07-01 20:34:40 UTC (rev 152244)
+++ branches/safari-537-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2013-07-01 20:36:24 UTC (rev 152245)
@@ -3106,9 +3106,10 @@
}
#endif
-void WebPage::viewExposedRectChanged(const FloatRect& exposedRect)
+void WebPage::viewExposedRectChanged(const FloatRect& exposedRect, bool clipsToExposedRect)
{
m_drawingArea->setExposedRect(exposedRect);
+ m_drawingArea->setClipsToExposedRect(clipsToExposedRect);
}
void WebPage::setMainFrameIsScrollable(bool isScrollable)
Modified: branches/safari-537-branch/Source/WebKit2/WebProcess/WebPage/WebPage.h (152244 => 152245)
--- branches/safari-537-branch/Source/WebKit2/WebProcess/WebPage/WebPage.h 2013-07-01 20:34:40 UTC (rev 152244)
+++ branches/safari-537-branch/Source/WebKit2/WebProcess/WebPage/WebPage.h 2013-07-01 20:36:24 UTC (rev 152245)
@@ -780,7 +780,7 @@
void drawPagesToPDFFromPDFDocument(CGContextRef, PDFDocument *, const PrintInfo&, uint32_t first, uint32_t count);
#endif
- void viewExposedRectChanged(const WebCore::FloatRect& exposedRect);
+ void viewExposedRectChanged(const WebCore::FloatRect& exposedRect, bool clipsToExposedRect);
void setMainFrameIsScrollable(bool);
void unapplyEditCommand(uint64_t commandID);
Modified: branches/safari-537-branch/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in (152244 => 152245)
--- branches/safari-537-branch/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in 2013-07-01 20:34:40 UTC (rev 152244)
+++ branches/safari-537-branch/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in 2013-07-01 20:36:24 UTC (rev 152245)
@@ -267,7 +267,7 @@
SetWindowIsVisible(bool windowIsVisible)
WindowAndViewFramesChanged(WebCore::FloatRect windowFrameInScreenCoordinates, WebCore::FloatRect windowFrameInUnflippedScreenCoordinates, WebCore::FloatRect viewFrameInWindowCoordinates, WebCore::FloatPoint accessibilityViewCoordinates)
- ViewExposedRectChanged(WebCore::FloatRect exposedRect)
+ ViewExposedRectChanged(WebCore::FloatRect exposedRect, bool clipsToExposedRect)
SetMainFrameIsScrollable(bool isScrollable)
RegisterUIProcessAccessibilityTokens(CoreIPC::DataReference elemenToken, CoreIPC::DataReference windowToken)
GetStringSelectionForPasteboard() -> (WTF::String stringValue)
Modified: branches/safari-537-branch/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h (152244 => 152245)
--- branches/safari-537-branch/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h 2013-07-01 20:34:40 UTC (rev 152244)
+++ branches/safari-537-branch/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h 2013-07-01 20:36:24 UTC (rev 152245)
@@ -76,7 +76,7 @@
virtual void mainFrameContentSizeChanged(const WebCore::IntSize&) OVERRIDE;
virtual void setExposedRect(const WebCore::FloatRect&) OVERRIDE;
- virtual void mainFrameScrollabilityChanged(bool) OVERRIDE;
+ virtual void setClipsToExposedRect(bool) OVERRIDE;
virtual void didChangeScrollOffsetForAnyFrame() OVERRIDE;
@@ -132,6 +132,7 @@
bool m_hasRootCompositingLayer;
WebCore::FloatRect m_exposedRect;
+ bool m_clipsToExposedRect;
WebCore::IntSize m_lastSentIntrinsicContentSize;
WebCore::Timer<TiledCoreAnimationDrawingArea> m_updateIntrinsicContentSizeTimer;
Modified: branches/safari-537-branch/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm (152244 => 152245)
--- branches/safari-537-branch/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm 2013-07-01 20:34:40 UTC (rev 152244)
+++ branches/safari-537-branch/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm 2013-07-01 20:36:24 UTC (rev 152245)
@@ -70,6 +70,7 @@
, m_layerTreeStateIsFrozen(false)
, m_layerFlushScheduler(this)
, m_isPaintingSuspended(!parameters.isVisible)
+ , m_clipsToExposedRect(false)
, m_updateIntrinsicContentSizeTimer(this, &TiledCoreAnimationDrawingArea::updateIntrinsicContentSizeTimerFired)
{
Page* page = m_webPage->corePage();
@@ -349,8 +350,9 @@
}
IntRect visibleRect = enclosingIntRect(m_rootLayer.get().frame);
- if (!m_webPage->mainFrameIsScrollable())
+ if (m_clipsToExposedRect)
visibleRect.intersect(enclosingIntRect(m_exposedRect));
+
for (PageOverlayLayerMap::iterator it = m_pageOverlayLayers.begin(), end = m_pageOverlayLayers.end(); it != end; ++it) {
GraphicsLayer* layer = it->value.get();
layer->flushCompositingState(visibleRect);
@@ -412,8 +414,9 @@
tiledBacking->setExposedRect(exposedRect);
}
-void TiledCoreAnimationDrawingArea::mainFrameScrollabilityChanged(bool)
+void TiledCoreAnimationDrawingArea::setClipsToExposedRect(bool clipsToExposedRect)
{
+ m_clipsToExposedRect = clipsToExposedRect;
updateMainFrameClipsToExposedRect();
}
@@ -524,14 +527,12 @@
void TiledCoreAnimationDrawingArea::updateMainFrameClipsToExposedRect()
{
- bool isScrollable = m_webPage->mainFrameIsScrollable();
-
if (TiledBacking* tiledBacking = mainFrameTiledBacking())
- tiledBacking->setClipsToExposedRect(!isScrollable);
+ tiledBacking->setClipsToExposedRect(m_clipsToExposedRect);
for (PageOverlayLayerMap::iterator it = m_pageOverlayLayers.begin(), end = m_pageOverlayLayers.end(); it != end; ++it)
if (TiledBacking* tiledBacking = it->value->tiledBacking())
- tiledBacking->setClipsToExposedRect(!isScrollable);
+ tiledBacking->setClipsToExposedRect(m_clipsToExposedRect);
Frame* frame = m_webPage->corePage()->mainFrame();
if (!frame)
@@ -589,7 +590,7 @@
if (TiledBacking* tiledBacking = layer->tiledBacking()) {
tiledBacking->setExposedRect(m_exposedRect);
- tiledBacking->setClipsToExposedRect(!m_webPage->mainFrameIsScrollable());
+ tiledBacking->setClipsToExposedRect(m_clipsToExposedRect);
}
[CATransaction begin];
@@ -637,7 +638,7 @@
if (TiledBacking* tiledBacking = layer->tiledBacking()) {
tiledBacking->setExposedRect(m_exposedRect);
- tiledBacking->setClipsToExposedRect(!m_webPage->mainFrameIsScrollable());
+ tiledBacking->setClipsToExposedRect(m_clipsToExposedRect);
}
m_pageOverlayPlatformLayers.set(layer, layer->platformLayer());