unobscuredContentRect() should have the same signature on iOS and other platforms,
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 21 Mar 2014 18:56:04 +0000 (18:56 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 21 Mar 2014 18:56:04 +0000 (18:56 +0000)
and should not recurse on iOS.
https://bugs.webkit.org/show_bug.cgi?id=130604
<rdar://problem/16392587>

Reviewed by Tim Horton and Beth Dakin.

Having different signatures on different platforms is a recipe for
build breakage. Give the iOS unobscuredContentRect() an unused
VisibleContentRectIncludesScrollbars parameter.

Also avoid recursion via unobscuredContentRect() calling visibleContentRectInternal().

* WebCore.exp.in:
* platform/ScrollView.cpp:
(WebCore::ScrollView::unobscuredContentRect):
(WebCore::ScrollView::unobscuredContentRectInternal):
(WebCore::ScrollView::visibleContentRectInternal):
* platform/ScrollView.h:
(WebCore::ScrollView::unobscuredContentRectIncludingScrollbars):
* platform/ios/ScrollViewIOS.mm:
(WebCore::ScrollView::unobscuredContentRect):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@166082 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/platform/ScrollView.cpp
Source/WebCore/platform/ScrollView.h
Source/WebCore/platform/ios/ScrollViewIOS.mm

index 9b80e56..c9a8ce0 100644 (file)
@@ -1,3 +1,28 @@
+2014-03-21  Simon Fraser  <simon.fraser@apple.com>
+
+        unobscuredContentRect() should have the same signature on iOS and other platforms,
+        and should not recurse on iOS.
+        https://bugs.webkit.org/show_bug.cgi?id=130604
+        <rdar://problem/16392587>
+
+        Reviewed by Tim Horton and Beth Dakin.
+
+        Having different signatures on different platforms is a recipe for
+        build breakage. Give the iOS unobscuredContentRect() an unused 
+        VisibleContentRectIncludesScrollbars parameter.
+        
+        Also avoid recursion via unobscuredContentRect() calling visibleContentRectInternal().
+
+        * WebCore.exp.in:
+        * platform/ScrollView.cpp:
+        (WebCore::ScrollView::unobscuredContentRect):
+        (WebCore::ScrollView::unobscuredContentRectInternal):
+        (WebCore::ScrollView::visibleContentRectInternal):
+        * platform/ScrollView.h:
+        (WebCore::ScrollView::unobscuredContentRectIncludingScrollbars):
+        * platform/ios/ScrollViewIOS.mm:
+        (WebCore::ScrollView::unobscuredContentRect):
+
 2014-03-21  Brent Fulgham  <bfulgham@apple.com>
 
         Handle recovery on "timestamp-looking" lines in the WebVTT parser
index a0229ec..f807ab1 100644 (file)
@@ -2633,7 +2633,7 @@ __ZN7WebCore9PageGroup17removeVisitedLinkERKNS_3URLE
 __ZN7WebCore9TileCache14drainLayerPoolEv
 __ZN7WebCore9TileCache20setLayerPoolCapacityEj
 __ZNK7WebCore10FloatPointcv7CGPointEv
-__ZNK7WebCore10ScrollView21unobscuredContentRectEv
+__ZNK7WebCore10ScrollView21unobscuredContentRectENS_14ScrollableArea36VisibleContentRectIncludesScrollbarsE
 __ZNK7WebCore14DocumentLoader16responseMIMETypeEv
 __ZNK7WebCore14FrameSelection17wordOffsetInRangeEPKNS_5RangeE
 __ZNK7WebCore14FrameSelection20selectionAtWordStartEv
index e66f027..909213f 100644 (file)
@@ -235,16 +235,21 @@ void ScrollView::setDelegatesScrolling(bool delegatesScrolling)
     m_delegatesScrolling = delegatesScrolling;
     delegatesScrollingDidChange();
 }
-    
+
 #if !PLATFORM(IOS)
 IntRect ScrollView::unobscuredContentRect(VisibleContentRectIncludesScrollbars scrollbarInclusion) const
 {
+    return unobscuredContentRectInternal(scrollbarInclusion);
+}
+#endif
+
+IntRect ScrollView::unobscuredContentRectInternal(VisibleContentRectIncludesScrollbars scrollbarInclusion) const
+{
     FloatSize visibleContentSize = unscaledUnobscuredVisibleContentSize(scrollbarInclusion);
     visibleContentSize.scale(1 / visibleContentScaleFactor());
     return IntRect(IntPoint(m_scrollOffset), expandedIntSize(visibleContentSize));
 }
-#endif
-    
+
 IntSize ScrollView::unscaledTotalVisibleContentSize(VisibleContentRectIncludesScrollbars scrollbarInclusion) const
 {
     if (platformWidget())
@@ -294,7 +299,7 @@ IntRect ScrollView::visibleContentRectInternal(VisibleContentRectIncludesScrollb
     }
     
     if (platformWidget())
-        return unobscuredContentRect();
+        return unobscuredContentRect(scrollbarInclusion);
 #else
     UNUSED_PARAM(visibleContentRectBehavior);
 #endif
@@ -307,11 +312,7 @@ IntRect ScrollView::visibleContentRectInternal(VisibleContentRectIncludesScrollb
         return m_fixedVisibleContentRect;
 #endif
 
-#if PLATFORM(IOS)
-    return unobscuredContentRect();
-#else
-    return unobscuredContentRect(scrollbarInclusion);
-#endif
+    return unobscuredContentRectInternal(scrollbarInclusion);
 }
 #endif
 
index d5c97f6..acbc561 100644 (file)
@@ -171,11 +171,10 @@ public:
     // Parts of the document can be visible through transparent or blured UI widgets of the chrome. Those parts
     // contribute to painting but not to the scrollable area.
     // The unobscuredContentRect is the area that is not covered by UI elements.
+    IntRect unobscuredContentRect(VisibleContentRectIncludesScrollbars = ExcludeScrollbars) const;
 #if PLATFORM(IOS)
-    IntRect unobscuredContentRect() const;
-    IntRect unobscuredContentRectIncludingScrollbars() const { return unobscuredContentRect(); }
+    IntRect unobscuredContentRectIncludingScrollbars() const { return unobscuredContentRect(IncludeScrollbars); }
 #else
-    IntRect unobscuredContentRect(VisibleContentRectIncludesScrollbars = ExcludeScrollbars) const;
     IntRect unobscuredContentRectIncludingScrollbars() const { return visibleContentRectIncludingScrollbars(); }
 #endif
 
@@ -392,6 +391,7 @@ protected:
 
 private:
     virtual IntRect visibleContentRectInternal(VisibleContentRectIncludesScrollbars, VisibleContentRectBehavior) const override;
+    IntRect unobscuredContentRectInternal(VisibleContentRectIncludesScrollbars = ExcludeScrollbars) const;
 
     RefPtr<Scrollbar> m_horizontalScrollbar;
     RefPtr<Scrollbar> m_verticalScrollbar;
index 3892a9c..364847b 100644 (file)
@@ -96,7 +96,7 @@ bool ScrollView::platformCanBlitOnScroll() const
     return [[scrollView() contentView] copiesOnScroll];
 }
 
-IntRect ScrollView::unobscuredContentRect() const
+IntRect ScrollView::unobscuredContentRect(VisibleContentRectIncludesScrollbars) const
 {
     if (WAKScrollView *view = static_cast<WAKScrollView *>(platformWidget())) {
         CGRect r = CGRectZero;
@@ -109,7 +109,7 @@ IntRect ScrollView::unobscuredContentRect() const
     if (!m_unobscuredContentRect.isEmpty())
         return m_unobscuredContentRect;
 
-    return visibleContentRectIncludingScrollbars();
+    return unobscuredContentRectInternal();
 }
 
 void ScrollView::setUnobscuredContentRect(const IntRect& rect)