Changeset 170270 in webkit


Ignore:
Timestamp:
Jun 22, 2014 11:35:32 AM (10 years ago)
Author:
Simon Fraser
Message:

[WK2] Frameset frames are not scrollable after loading (and should be)
https://bugs.webkit.org/show_bug.cgi?id=134151
<rdar://problem/17403365>

Reviewed by Dan Bates.

Source/WebCore:
When loading a <frameset>, we could end up with an empty non-fast-scrollable
region for the main frame, because after the initial frameset document layout,
nothing updated the non-fast scrollable region as the subframes added their
scrollable areas to the the main frame's scrollable area set.

Fix by having addScrollableArea() and removeScrollableArea() trigger an update
of the non-fast scrollable region.

Test: platform/mac-wk2/tiled-drawing/scrolling/frames/frameset-frame-scrollability.html

  • page/FrameView.cpp:

(WebCore::FrameView::addScrollableArea):
(WebCore::FrameView::removeScrollableArea):
(WebCore::FrameView::scrollableAreaSetChanged):

  • page/FrameView.h:

LayoutTests:
Frameset test that dumps the scrolling tree.

  • platform/mac-wk2/tiled-drawing/scrolling/frames/frameset-frame-scrollability.html: Added.
  • platform/mac-wk2/tiled-drawing/scrolling/frames/resources/scrollable-page.html: Added.
Location:
trunk
Files:
3 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r170267 r170270  
     12014-06-20  Simon Fraser  <simon.fraser@apple.com>
     2
     3        [WK2] Frameset frames are not scrollable after loading (and should be)
     4        https://bugs.webkit.org/show_bug.cgi?id=134151
     5        <rdar://problem/17403365>
     6
     7        Reviewed by Dan Bates.
     8       
     9        Frameset test that dumps the scrolling tree.
     10
     11        * platform/mac-wk2/tiled-drawing/scrolling/frames/frameset-frame-scrollability.html: Added.
     12        * platform/mac-wk2/tiled-drawing/scrolling/frames/resources/scrollable-page.html: Added.
     13
    1142014-06-20  Simon Fraser  <simon.fraser@apple.com>
    215
  • trunk/Source/WebCore/ChangeLog

    r170268 r170270  
     12014-06-20  Simon Fraser  <simon.fraser@apple.com>
     2
     3        [WK2] Frameset frames are not scrollable after loading (and should be)
     4        https://bugs.webkit.org/show_bug.cgi?id=134151
     5        <rdar://problem/17403365>
     6
     7        Reviewed by Dan Bates.
     8       
     9        When loading a <frameset>, we could end up with an empty non-fast-scrollable
     10        region for the main frame, because after the initial frameset document layout,
     11        nothing updated the non-fast scrollable region as the subframes added their
     12        scrollable areas to the the main frame's scrollable area set.
     13       
     14        Fix by having addScrollableArea() and removeScrollableArea() trigger an update
     15        of the non-fast scrollable region.
     16
     17        Test: platform/mac-wk2/tiled-drawing/scrolling/frames/frameset-frame-scrollability.html
     18
     19        * page/FrameView.cpp:
     20        (WebCore::FrameView::addScrollableArea):
     21        (WebCore::FrameView::removeScrollableArea):
     22        (WebCore::FrameView::scrollableAreaSetChanged):
     23        * page/FrameView.h:
     24
    1252014-06-22  Commit Queue  <commit-queue@webkit.org>
    226
  • trunk/Source/WebCore/page/FrameView.cpp

    r170024 r170270  
    40464046    if (!m_scrollableAreas)
    40474047        m_scrollableAreas = std::make_unique<ScrollableAreaSet>();
    4048     return m_scrollableAreas->add(scrollableArea).isNewEntry;
     4048   
     4049    if (m_scrollableAreas->add(scrollableArea).isNewEntry) {
     4050        scrollableAreaSetChanged();
     4051        return true;
     4052    }
     4053
     4054    return false;
    40494055}
    40504056
    40514057bool FrameView::removeScrollableArea(ScrollableArea* scrollableArea)
    40524058{
    4053     return m_scrollableAreas && m_scrollableAreas->remove(scrollableArea);
     4059    if (m_scrollableAreas && m_scrollableAreas->remove(scrollableArea)) {
     4060        scrollableAreaSetChanged();
     4061        return true;
     4062    }
     4063    return false;
    40544064}
    40554065
     
    40574067{
    40584068    return m_scrollableAreas && m_scrollableAreas->contains(scrollableArea);
     4069}
     4070
     4071void FrameView::scrollableAreaSetChanged()
     4072{
     4073    if (auto* page = frame().page()) {
     4074        if (auto* scrollingCoordinator = page->scrollingCoordinator())
     4075            scrollingCoordinator->frameViewNonFastScrollableRegionChanged(this);
     4076    }
    40594077}
    40604078
  • trunk/Source/WebCore/page/FrameView.h

    r169852 r170270  
    594594    void scrollToAnchor();
    595595    void scrollPositionChanged(const IntPoint& oldPosition, const IntPoint& newPosition);
     596    void scrollableAreaSetChanged();
    596597
    597598    bool hasCustomScrollbars() const;
Note: See TracChangeset for help on using the changeset viewer.