Title: [165422] trunk/Source
Revision
165422
Author
[email protected]
Date
2014-03-10 18:34:42 -0700 (Mon, 10 Mar 2014)

Log Message

[iOS][WebKit 2] Wire the unobscured rect in the WebProcess
https://bugs.webkit.org/show_bug.cgi?id=130058

Patch by Benjamin Poulain <[email protected]> on 2014-03-10
Reviewed by Simon Fraser.

Source/WebCore: 

* WebCore.exp.in:
* platform/ScrollView.h:
* platform/ios/ScrollViewIOS.mm:
(WebCore::ScrollView::unobscuredContentRect):
(WebCore::ScrollView::setUnobscuredContentRect):

Source/WebKit2: 

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::updateVisibleContentRects):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (165421 => 165422)


--- trunk/Source/WebCore/ChangeLog	2014-03-11 00:40:34 UTC (rev 165421)
+++ trunk/Source/WebCore/ChangeLog	2014-03-11 01:34:42 UTC (rev 165422)
@@ -1,5 +1,18 @@
 2014-03-10  Benjamin Poulain  <[email protected]>
 
+        [iOS][WebKit 2] Wire the unobscured rect in the WebProcess
+        https://bugs.webkit.org/show_bug.cgi?id=130058
+
+        Reviewed by Simon Fraser.
+
+        * WebCore.exp.in:
+        * platform/ScrollView.h:
+        * platform/ios/ScrollViewIOS.mm:
+        (WebCore::ScrollView::unobscuredContentRect):
+        (WebCore::ScrollView::setUnobscuredContentRect):
+
+2014-03-10  Benjamin Poulain  <[email protected]>
+
         makeSelectorPseudoTypeMap.py should not be copied in the WebCore bundle
 
         * WebCore.xcodeproj/project.pbxproj:

Modified: trunk/Source/WebCore/WebCore.exp.in (165421 => 165422)


--- trunk/Source/WebCore/WebCore.exp.in	2014-03-11 00:40:34 UTC (rev 165421)
+++ trunk/Source/WebCore/WebCore.exp.in	2014-03-11 01:34:42 UTC (rev 165422)
@@ -2395,6 +2395,7 @@
 __ZN7WebCore10FloatPointC1ERK7CGPoint
 __ZN7WebCore10ScrollView15setScrollOffsetERKNS_8IntPointE
 __ZN7WebCore10ScrollView21setExposedContentRectERKNS_7IntRectE
+__ZN7WebCore10ScrollView24setUnobscuredContentRectERKNS_7IntRectE
 __ZN7WebCore10XLinkNames4initEv
 __ZN7WebCore10inSameLineERKNS_15VisiblePositionES2_
 __ZN7WebCore11BidiContext41copyStackRemovingUnicodeEmbeddingContextsEv

Modified: trunk/Source/WebCore/platform/ScrollView.h (165421 => 165422)


--- trunk/Source/WebCore/platform/ScrollView.h	2014-03-11 00:40:34 UTC (rev 165421)
+++ trunk/Source/WebCore/platform/ScrollView.h	2014-03-11 01:34:42 UTC (rev 165422)
@@ -180,7 +180,10 @@
 #if PLATFORM(IOS)
     // This is the area that is partially or fully exposed, and may extend under overlapping UI elements.
     IntRect exposedContentRect() const;
+
+    // The given rects are only used if there is no platform widget.
     void setExposedContentRect(const IntRect&);
+    void setUnobscuredContentRect(const IntRect&);
 
     void setActualScrollPosition(const IntPoint&);
     TileCache* tileCache();
@@ -406,6 +409,7 @@
     // between exposed rect and unobscuredRects. The two attributes should eventually be merged.
 #if PLATFORM(IOS)
     IntRect m_exposedContentRect;
+    IntRect m_unobscuredContentRect;
 #else
     IntRect m_fixedVisibleContentRect;
 #endif

Modified: trunk/Source/WebCore/platform/ios/ScrollViewIOS.mm (165421 => 165422)


--- trunk/Source/WebCore/platform/ios/ScrollViewIOS.mm	2014-03-11 00:40:34 UTC (rev 165421)
+++ trunk/Source/WebCore/platform/ios/ScrollViewIOS.mm	2014-03-11 01:34:42 UTC (rev 165422)
@@ -98,14 +98,26 @@
 
 IntRect ScrollView::unobscuredContentRect() const
 {
-    CGRect r = CGRectZero;
-    BEGIN_BLOCK_OBJC_EXCEPTIONS;
-    WAKScrollView *view = static_cast<WAKScrollView *>(platformWidget());
-    r = [view unobscuredContentRect];
-    END_BLOCK_OBJC_EXCEPTIONS;
-    return enclosingIntRect(r);
+    if (WAKScrollView *view = static_cast<WAKScrollView *>(platformWidget())) {
+        CGRect r = CGRectZero;
+        BEGIN_BLOCK_OBJC_EXCEPTIONS;
+        r = [view unobscuredContentRect];
+        END_BLOCK_OBJC_EXCEPTIONS;
+        return enclosingIntRect(r);
+    }
+
+    if (!m_unobscuredContentRect.isEmpty())
+        return m_unobscuredContentRect;
+
+    return visibleContentRectIncludingScrollbars();
 }
 
+void ScrollView::setUnobscuredContentRect(const IntRect& rect)
+{
+    ASSERT(!platformWidget());
+    m_unobscuredContentRect = rect;
+}
+
 IntRect ScrollView::exposedContentRect() const
 {
     if (NSScrollView *view = static_cast<NSScrollView *>(platformWidget())) {

Modified: trunk/Source/WebKit2/ChangeLog (165421 => 165422)


--- trunk/Source/WebKit2/ChangeLog	2014-03-11 00:40:34 UTC (rev 165421)
+++ trunk/Source/WebKit2/ChangeLog	2014-03-11 01:34:42 UTC (rev 165422)
@@ -1,3 +1,13 @@
+2014-03-10  Benjamin Poulain  <[email protected]>
+
+        [iOS][WebKit 2] Wire the unobscured rect in the WebProcess
+        https://bugs.webkit.org/show_bug.cgi?id=130058
+
+        Reviewed by Simon Fraser.
+
+        * WebProcess/WebPage/ios/WebPageIOS.mm:
+        (WebKit::WebPage::updateVisibleContentRects):
+
 2014-03-10  Simon Fraser  <[email protected]>
 
         Fix three leaks

Modified: trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm (165421 => 165422)


--- trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm	2014-03-11 00:40:34 UTC (rev 165421)
+++ trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm	2014-03-11 01:34:42 UTC (rev 165422)
@@ -1734,7 +1734,8 @@
     FloatRect exposedRect = visibleContentRectUpdateInfo.exposedRect();
     m_drawingArea->setExposedContentRect(enclosingIntRect(exposedRect));
 
-    IntPoint scrollPosition = roundedIntPoint(visibleContentRectUpdateInfo.unobscuredRect().location());
+    IntRect roundedUnobscuredRect = roundedIntRect(visibleContentRectUpdateInfo.unobscuredRect());
+    IntPoint scrollPosition = roundedUnobscuredRect.location();
 
     double boundedScale = std::min(m_viewportConfiguration.maximumScale(), std::max(m_viewportConfiguration.minimumScale(), visibleContentRectUpdateInfo.scale()));
     float floatBoundedScale = boundedScale;
@@ -1748,11 +1749,10 @@
     }
 
     m_page->mainFrame().view()->setScrollOffset(scrollPosition);
-    
+    m_page->mainFrame().view()->setUnobscuredContentRect(roundedUnobscuredRect);
+
     if (visibleContentRectUpdateInfo.inStableState())
         m_page->mainFrame().view()->setCustomFixedPositionLayoutRect(enclosingIntRect(visibleContentRectUpdateInfo.customFixedPositionRect()));
-
-    // FIXME: we should also update the frame view from unobscured rect. Altenatively, we can have it pull the values from ScrollView.
 }
 
 void WebPage::willStartUserTriggeredZooming()
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to