Changeset 166082 in webkit


Ignore:
Timestamp:
Mar 21, 2014, 11:56:04 AM (11 years ago)
Author:
Simon Fraser
Message:

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):

Location:
trunk/Source/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r166080 r166082  
     12014-03-21  Simon Fraser  <simon.fraser@apple.com>
     2
     3        unobscuredContentRect() should have the same signature on iOS and other platforms,
     4        and should not recurse on iOS.
     5        https://bugs.webkit.org/show_bug.cgi?id=130604
     6        <rdar://problem/16392587>
     7
     8        Reviewed by Tim Horton and Beth Dakin.
     9
     10        Having different signatures on different platforms is a recipe for
     11        build breakage. Give the iOS unobscuredContentRect() an unused
     12        VisibleContentRectIncludesScrollbars parameter.
     13       
     14        Also avoid recursion via unobscuredContentRect() calling visibleContentRectInternal().
     15
     16        * WebCore.exp.in:
     17        * platform/ScrollView.cpp:
     18        (WebCore::ScrollView::unobscuredContentRect):
     19        (WebCore::ScrollView::unobscuredContentRectInternal):
     20        (WebCore::ScrollView::visibleContentRectInternal):
     21        * platform/ScrollView.h:
     22        (WebCore::ScrollView::unobscuredContentRectIncludingScrollbars):
     23        * platform/ios/ScrollViewIOS.mm:
     24        (WebCore::ScrollView::unobscuredContentRect):
     25
    1262014-03-21  Brent Fulgham  <bfulgham@apple.com>
    227
  • trunk/Source/WebCore/WebCore.exp.in

    r166057 r166082  
    26342634__ZN7WebCore9TileCache20setLayerPoolCapacityEj
    26352635__ZNK7WebCore10FloatPointcv7CGPointEv
    2636 __ZNK7WebCore10ScrollView21unobscuredContentRectEv
     2636__ZNK7WebCore10ScrollView21unobscuredContentRectENS_14ScrollableArea36VisibleContentRectIncludesScrollbarsE
    26372637__ZNK7WebCore14DocumentLoader16responseMIMETypeEv
    26382638__ZNK7WebCore14FrameSelection17wordOffsetInRangeEPKNS_5RangeE
  • trunk/Source/WebCore/platform/ScrollView.cpp

    r166042 r166082  
    236236    delegatesScrollingDidChange();
    237237}
    238    
     238
    239239#if !PLATFORM(IOS)
    240240IntRect ScrollView::unobscuredContentRect(VisibleContentRectIncludesScrollbars scrollbarInclusion) const
     241{
     242    return unobscuredContentRectInternal(scrollbarInclusion);
     243}
     244#endif
     245
     246IntRect ScrollView::unobscuredContentRectInternal(VisibleContentRectIncludesScrollbars scrollbarInclusion) const
    241247{
    242248    FloatSize visibleContentSize = unscaledUnobscuredVisibleContentSize(scrollbarInclusion);
     
    244250    return IntRect(IntPoint(m_scrollOffset), expandedIntSize(visibleContentSize));
    245251}
    246 #endif
    247    
     252
    248253IntSize ScrollView::unscaledTotalVisibleContentSize(VisibleContentRectIncludesScrollbars scrollbarInclusion) const
    249254{
     
    295300   
    296301    if (platformWidget())
    297         return unobscuredContentRect();
     302        return unobscuredContentRect(scrollbarInclusion);
    298303#else
    299304    UNUSED_PARAM(visibleContentRectBehavior);
     
    308313#endif
    309314
    310 #if PLATFORM(IOS)
    311     return unobscuredContentRect();
    312 #else
    313     return unobscuredContentRect(scrollbarInclusion);
    314 #endif
     315    return unobscuredContentRectInternal(scrollbarInclusion);
    315316}
    316317#endif
  • trunk/Source/WebCore/platform/ScrollView.h

    r166017 r166082  
    172172    // contribute to painting but not to the scrollable area.
    173173    // The unobscuredContentRect is the area that is not covered by UI elements.
     174    IntRect unobscuredContentRect(VisibleContentRectIncludesScrollbars = ExcludeScrollbars) const;
    174175#if PLATFORM(IOS)
    175     IntRect unobscuredContentRect() const;
    176     IntRect unobscuredContentRectIncludingScrollbars() const { return unobscuredContentRect(); }
     176    IntRect unobscuredContentRectIncludingScrollbars() const { return unobscuredContentRect(IncludeScrollbars); }
    177177#else
    178     IntRect unobscuredContentRect(VisibleContentRectIncludesScrollbars = ExcludeScrollbars) const;
    179178    IntRect unobscuredContentRectIncludingScrollbars() const { return visibleContentRectIncludingScrollbars(); }
    180179#endif
     
    393392private:
    394393    virtual IntRect visibleContentRectInternal(VisibleContentRectIncludesScrollbars, VisibleContentRectBehavior) const override;
     394    IntRect unobscuredContentRectInternal(VisibleContentRectIncludesScrollbars = ExcludeScrollbars) const;
    395395
    396396    RefPtr<Scrollbar> m_horizontalScrollbar;
  • trunk/Source/WebCore/platform/ios/ScrollViewIOS.mm

    r165676 r166082  
    9797}
    9898
    99 IntRect ScrollView::unobscuredContentRect() const
     99IntRect ScrollView::unobscuredContentRect(VisibleContentRectIncludesScrollbars) const
    100100{
    101101    if (WAKScrollView *view = static_cast<WAKScrollView *>(platformWidget())) {
     
    110110        return m_unobscuredContentRect;
    111111
    112     return visibleContentRectIncludingScrollbars();
     112    return unobscuredContentRectInternal();
    113113}
    114114
Note: See TracChangeset for help on using the changeset viewer.