Title: [169324] trunk/Source
- Revision
- 169324
- Author
- [email protected]
- Date
- 2014-05-25 15:17:43 -0700 (Sun, 25 May 2014)
Log Message
[iOS][WK2] Use ScrollView's scrollOffset as the unobscuredContentRect
https://bugs.webkit.org/show_bug.cgi?id=133262
Patch by Benjamin Poulain <[email protected]> on 2014-05-25
Reviewed by Simon Fraser.
Source/WebCore:
Since VisibleContentRect was fixed, we were no longer sending scroll events when updating the scrollOffset
when updating the visible content rects. The reason is that the scrollOffset was defined as the top left of the
VisibleContentRect, and as such was already at the end position after updating the unobscured rect.
This patch split the unobscuredContentRect in unobscuredContentSize (updated live on zoom) and the position defined
by the ScrollView's scrollOffset (updated when scrolling).
* WebCore.exp.in:
* platform/ScrollView.h:
* platform/ios/ScrollViewIOS.mm:
(WebCore::ScrollView::unobscuredContentRect):
(WebCore::ScrollView::setUnobscuredContentSize):
(WebCore::ScrollView::setUnobscuredContentRect): Deleted.
Source/WebKit2:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::dynamicViewportSizeUpdate):
(WebKit::WebPage::viewportConfigurationChanged):
(WebKit::WebPage::updateVisibleContentRects):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (169323 => 169324)
--- trunk/Source/WebCore/ChangeLog 2014-05-25 19:54:54 UTC (rev 169323)
+++ trunk/Source/WebCore/ChangeLog 2014-05-25 22:17:43 UTC (rev 169324)
@@ -1,3 +1,24 @@
+2014-05-25 Benjamin Poulain <[email protected]>
+
+ [iOS][WK2] Use ScrollView's scrollOffset as the unobscuredContentRect
+ https://bugs.webkit.org/show_bug.cgi?id=133262
+
+ Reviewed by Simon Fraser.
+
+ Since VisibleContentRect was fixed, we were no longer sending scroll events when updating the scrollOffset
+ when updating the visible content rects. The reason is that the scrollOffset was defined as the top left of the
+ VisibleContentRect, and as such was already at the end position after updating the unobscured rect.
+
+ This patch split the unobscuredContentRect in unobscuredContentSize (updated live on zoom) and the position defined
+ by the ScrollView's scrollOffset (updated when scrolling).
+
+ * WebCore.exp.in:
+ * platform/ScrollView.h:
+ * platform/ios/ScrollViewIOS.mm:
+ (WebCore::ScrollView::unobscuredContentRect):
+ (WebCore::ScrollView::setUnobscuredContentSize):
+ (WebCore::ScrollView::setUnobscuredContentRect): Deleted.
+
2014-05-25 David Kilzer <[email protected]>
Add type-checked casts for TransformOperations
Modified: trunk/Source/WebCore/WebCore.exp.in (169323 => 169324)
--- trunk/Source/WebCore/WebCore.exp.in 2014-05-25 19:54:54 UTC (rev 169323)
+++ trunk/Source/WebCore/WebCore.exp.in 2014-05-25 22:17:43 UTC (rev 169324)
@@ -2477,7 +2477,7 @@
__ZN7WebCore10RenderView35resumePausedImageAnimationsIfNeededEv
__ZN7WebCore10ScrollView15setScrollOffsetERKNS_8IntPointE
__ZN7WebCore10ScrollView21setExposedContentRectERKNS_7IntRectE
-__ZN7WebCore10ScrollView24setUnobscuredContentRectERKNS_7IntRectE
+__ZN7WebCore10ScrollView24setUnobscuredContentSizeERKNS_7IntSizeE
__ZN7WebCore10XLinkNames4initEv
__ZN7WebCore10inSameLineERKNS_15VisiblePositionES2_
__ZN7WebCore11BidiContext41copyStackRemovingUnicodeEmbeddingContextsEv
Modified: trunk/Source/WebCore/platform/ScrollView.h (169323 => 169324)
--- trunk/Source/WebCore/platform/ScrollView.h 2014-05-25 19:54:54 UTC (rev 169323)
+++ trunk/Source/WebCore/platform/ScrollView.h 2014-05-25 22:17:43 UTC (rev 169324)
@@ -186,7 +186,7 @@
// The given rects are only used if there is no platform widget.
void setExposedContentRect(const IntRect&);
- void setUnobscuredContentRect(const IntRect&);
+ void setUnobscuredContentSize(const IntSize&);
void setActualScrollPosition(const IntPoint&);
LegacyTileCache* legacyTileCache();
@@ -427,10 +427,10 @@
bool m_canBlitOnScroll;
// FIXME: exposedContentRect is a very similar concept to fixedVisibleContentRect except it does not differentiate
- // between exposed rect and unobscuredRects. The two attributes should eventually be merged.
+ // between exposed and unobscured areas. The two attributes should eventually be merged.
#if PLATFORM(IOS)
IntRect m_exposedContentRect;
- IntRect m_unobscuredContentRect;
+ IntSize m_unobscuredContentSize;
#else
IntRect m_fixedVisibleContentRect;
#endif
Modified: trunk/Source/WebCore/platform/ios/ScrollViewIOS.mm (169323 => 169324)
--- trunk/Source/WebCore/platform/ios/ScrollViewIOS.mm 2014-05-25 19:54:54 UTC (rev 169323)
+++ trunk/Source/WebCore/platform/ios/ScrollViewIOS.mm 2014-05-25 22:17:43 UTC (rev 169324)
@@ -107,16 +107,16 @@
return enclosingIntRect(r);
}
- if (!m_unobscuredContentRect.isEmpty())
- return m_unobscuredContentRect;
+ if (!m_unobscuredContentSize.isEmpty())
+ return IntRect(IntPoint(m_scrollOffset), m_unobscuredContentSize);
return unobscuredContentRectInternal();
}
-void ScrollView::setUnobscuredContentRect(const IntRect& rect)
+void ScrollView::setUnobscuredContentSize(const IntSize& size)
{
ASSERT(!platformWidget());
- m_unobscuredContentRect = rect;
+ m_unobscuredContentSize = size;
}
IntRect ScrollView::exposedContentRect() const
Modified: trunk/Source/WebKit2/ChangeLog (169323 => 169324)
--- trunk/Source/WebKit2/ChangeLog 2014-05-25 19:54:54 UTC (rev 169323)
+++ trunk/Source/WebKit2/ChangeLog 2014-05-25 22:17:43 UTC (rev 169324)
@@ -1,3 +1,15 @@
+2014-05-25 Benjamin Poulain <[email protected]>
+
+ [iOS][WK2] Use ScrollView's scrollOffset as the unobscuredContentRect
+ https://bugs.webkit.org/show_bug.cgi?id=133262
+
+ Reviewed by Simon Fraser.
+
+ * WebProcess/WebPage/ios/WebPageIOS.mm:
+ (WebKit::WebPage::dynamicViewportSizeUpdate):
+ (WebKit::WebPage::viewportConfigurationChanged):
+ (WebKit::WebPage::updateVisibleContentRects):
+
2014-05-25 Sam Weinig <[email protected]>
Build fix 2.
Modified: trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm (169323 => 169324)
--- trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm 2014-05-25 19:54:54 UTC (rev 169323)
+++ trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm 2014-05-25 22:17:43 UTC (rev 169324)
@@ -2129,7 +2129,7 @@
frameView.setScrollVelocity(0, 0, 0, monotonicallyIncreasingTime());
IntRect roundedUnobscuredContentRect = roundedIntRect(newUnobscuredContentRect);
- frameView.setUnobscuredContentRect(roundedUnobscuredContentRect);
+ frameView.setUnobscuredContentSize(roundedUnobscuredContentRect.size());
m_drawingArea->setExposedContentRect(newExposedContentRect);
scalePage(scale, roundedUnobscuredContentRect.location());
@@ -2184,13 +2184,12 @@
FloatSize minimumLayoutSizeInScrollViewCoordinates = m_viewportConfiguration.activeMinimumLayoutSizeInScrollViewCoordinates();
minimumLayoutSizeInScrollViewCoordinates.scale(1 / scale);
IntSize minimumLayoutSizeInDocumentCoordinates = roundedIntSize(minimumLayoutSizeInScrollViewCoordinates);
- IntRect unobscuredContentRect(scrollPosition, minimumLayoutSizeInDocumentCoordinates);
- frameView.setUnobscuredContentRect(unobscuredContentRect);
+ frameView.setUnobscuredContentSize(minimumLayoutSizeInDocumentCoordinates);
frameView.setScrollVelocity(0, 0, 0, monotonicallyIncreasingTime());
// FIXME: We could send down the obscured margins to find a better exposed rect and unobscured rect.
// It is not a big deal at the moment because the tile coverage will always extend past the obscured bottom inset.
- m_drawingArea->setExposedContentRect(unobscuredContentRect);
+ m_drawingArea->setExposedContentRect(IntRect(scrollPosition, minimumLayoutSizeInDocumentCoordinates));
}
scalePage(scale, scrollPosition);
@@ -2297,10 +2296,10 @@
}
FrameView& frameView = *m_page->mainFrame().view();
- if (scrollPosition != IntPoint(frameView.scrollOffset()))
+ if (scrollPosition != frameView.scrollPosition())
m_dynamicSizeUpdateHistory.clear();
- frameView.setUnobscuredContentRect(roundedUnobscuredRect);
+ frameView.setUnobscuredContentSize(roundedUnobscuredRect.size());
double horizontalVelocity = visibleContentRectUpdateInfo.horizontalVelocity();
double verticalVelocity = visibleContentRectUpdateInfo.verticalVelocity();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes