Changeset 114170 in webkit


Ignore:
Timestamp:
Apr 13, 2012 2:32:53 PM (12 years ago)
Author:
tonikitoo@webkit.org
Message:

Be more restrictive when adding ScrollableArea's to FrameView's ScrollableArea's map
https://bugs.webkit.org/show_bug.cgi?id=79611

Reviewed by James Robinson.
Patch by Antonio Gomes <agomes@rim.com>

Source/WebCore:

As of today, any FrameView attached to the Widget-tree or any
RenderLayer whose corresponding RenderBox's style has a 'overflow'
property set to 'auto' is cached in its containing scrollable areas set.
We could be more restrictive about what we in fact want to
cache as scrollable areas, by checking if the element as an overflow
(i.e. more content than its viewport).

  • page/FrameView.cpp:

(WebCore::FrameView::setFrameRect):

Whenever the viewport changes, check if we have an scrollable/overflowed
content, and update the cache accordingly.

(WebCore::FrameView::setContentsSize):

Whenever the contents size changes, check if we have a scrollable/overflowed
content, and update the cache accordingly.

(WebCore::FrameView::calculateScrollbarModesForLayout):

Introduces a way to query for the scrollbars by only
taking into account the "rules" set by the web author.
For that, a new enum was added called SrollbarModesCalculationStrategy,
which allows callers to discard for example client-side scrollbar policies
in order to verify if a given frameview is scrollable or not.

(WebCore::FrameView::updateScrollableAreaSet):

Take into account various factors before considering a FrameView as
scrollable. If in the end it is, it gets added to its parent FrameView
scrollable areas map, otherwise removed.

(WebCore):
(WebCore::FrameView::addScrollableArea):

Became unneeded, thus removed.

(WebCore::FrameView::removeScrollableArea):

Whenever a FrameView is removed from the Widget-tree,
remove it from the cache.

  • page/FrameView.h:

(FrameView):

  • rendering/RenderLayer.cpp:

(WebCore::RenderLayer::updateScrollbarsAfterLayout):

Update scrollable area set after layout.

(WebCore::RenderLayer::updateScrollbarsAfterStyleChange):

Update scrollable area set after style changes.

(WebCore::RenderLayer::styleChanged):

Removed the scrollable areas logic detection from it.

(WebCore::RenderLayer::updateScrollableAreaSet):

Updates the containing FrameView scrollable areas cache
only when needed (i.e. an overflow exists).

(WebCore):

  • rendering/RenderLayer.h:

(RenderLayer):

  • testing/Internals.cpp:

(WebCore::Internals::numberOfScrollableAreas):
(WebCore):

  • testing/Internals.h:

(Internals):

  • testing/Internals.idl:

Tests: fast/scrolling/scrollable-area-frame-inherited-visibility-hidden.html

fast/scrolling/scrollable-area-frame-overflow-hidden.html
fast/scrolling/scrollable-area-frame-overried-inherited-visibility-hidden.html
fast/scrolling/scrollable-area-frame-scrolling-no-overried-inherited-visibility-hidden.html
fast/scrolling/scrollable-area-frame-scrolling-no-visibility-hidden-child.html
fast/scrolling/scrollable-area-frame-scrolling-no.html
fast/scrolling/scrollable-area-frame-scrolling-yes-display-none.html
fast/scrolling/scrollable-area-frame-scrolling-yes.html
fast/scrolling/scrollable-area-frame-visibility-hidden-child.html
fast/scrolling/scrollable-area-frame-zero-size-and-border.html
fast/scrolling/scrollable-area-frame.html
fast/scrolling/scrollable-area-overflow-auto-display-none-in-parent.html
fast/scrolling/scrollable-area-overflow-auto-display-none.html
fast/scrolling/scrollable-area-overflow-auto-visibility-hidden-in-parent.html
fast/scrolling/scrollable-area-overflow-auto-visibility-hidden.html
fast/scrolling/scrollable-area-overflow-auto-visibility-override.html
fast/scrolling/scrollable-area-overflow-auto-visibility-visible.html
fast/scrolling/scrollable-area-overflow-auto.html
fast/scrolling/scrollable-area-overflow-not-set.html
fast/scrolling/scrollable-area-overflow-visible.html

LayoutTests:

Reviewed by NOBODY (OOPS!).

Added scrollable area set count tests to many situations observed
in real world sites.

  • fast/scrolling/resources/generic-scrollable-content.html: Added.
  • fast/scrolling/resources/hidden-generic-scrollable-content.html: Added.
  • fast/scrolling/resources/scrollable-area.js: Added.

(runTest):
(end):

  • fast/scrolling/resources/scrollable-style.css: Added.

(.inner):
(.offscreen):

  • fast/scrolling/scrollable-area-frame-expected.txt: Added.
  • fast/scrolling/scrollable-area-frame-inherited-visibility-hidden-expected.txt: Added.
  • fast/scrolling/scrollable-area-frame-inherited-visibility-hidden.html: Added.
  • fast/scrolling/scrollable-area-frame-overflow-hidden-expected.txt: Added.
  • fast/scrolling/scrollable-area-frame-overflow-hidden.html: Added.
  • fast/scrolling/scrollable-area-frame-overried-inherited-visibility-hidden-expected.txt: Added.
  • fast/scrolling/scrollable-area-frame-overried-inherited-visibility-hidden.html: Added.
  • fast/scrolling/scrollable-area-frame-scrolling-no-expected.txt: Added.
  • fast/scrolling/scrollable-area-frame-scrolling-no-overried-inherited-visibility-hidden-expected.txt: Added.
  • fast/scrolling/scrollable-area-frame-scrolling-no-overried-inherited-visibility-hidden.html: Added.
  • fast/scrolling/scrollable-area-frame-scrolling-no-visibility-hidden-child-expected.txt: Added.
  • fast/scrolling/scrollable-area-frame-scrolling-no-visibility-hidden-child.html: Added.
  • fast/scrolling/scrollable-area-frame-scrolling-no.html: Added.
  • fast/scrolling/scrollable-area-frame-scrolling-yes-display-none-expected.txt: Added.
  • fast/scrolling/scrollable-area-frame-scrolling-yes-display-none.html: Added.
  • fast/scrolling/scrollable-area-frame-scrolling-yes-expected.txt: Added.
  • fast/scrolling/scrollable-area-frame-scrolling-yes.html: Added.
  • fast/scrolling/scrollable-area-frame-visibility-hidden-child-expected.txt: Added.
  • fast/scrolling/scrollable-area-frame-visibility-hidden-child.html: Added.
  • fast/scrolling/scrollable-area-frame-zero-size-and-border-expected.txt: Added.
  • fast/scrolling/scrollable-area-frame-zero-size-and-border.html: Added.
  • fast/scrolling/scrollable-area-frame.html: Added.
  • fast/scrolling/scrollable-area-overflow-auto-display-none-expected.txt: Added.
  • fast/scrolling/scrollable-area-overflow-auto-display-none-in-parent-expected.txt: Added.
  • fast/scrolling/scrollable-area-overflow-auto-display-none-in-parent.html: Added.
  • fast/scrolling/scrollable-area-overflow-auto-display-none.html: Added.
  • fast/scrolling/scrollable-area-overflow-auto-expected.txt: Added.
  • fast/scrolling/scrollable-area-overflow-auto-visibility-hidden-expected.txt: Added.
  • fast/scrolling/scrollable-area-overflow-auto-visibility-hidden-in-parent-expected.txt: Added.
  • fast/scrolling/scrollable-area-overflow-auto-visibility-hidden-in-parent.html: Added.
  • fast/scrolling/scrollable-area-overflow-auto-visibility-hidden.html: Added.
  • fast/scrolling/scrollable-area-overflow-auto-visibility-override-expected.txt: Added.
  • fast/scrolling/scrollable-area-overflow-auto-visibility-override.html: Added.
  • fast/scrolling/scrollable-area-overflow-auto-visibility-visible-expected.txt: Added.
  • fast/scrolling/scrollable-area-overflow-auto-visibility-visible.html: Added.
  • fast/scrolling/scrollable-area-overflow-auto.html: Added.
  • fast/scrolling/scrollable-area-overflow-not-set-expected.txt: Added.
  • fast/scrolling/scrollable-area-overflow-not-set.html: Added.
  • fast/scrolling/scrollable-area-overflow-visible-expected.txt: Added.
  • fast/scrolling/scrollable-area-overflow-visible.html: Added.
Location:
trunk
Files:
48 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r114167 r114170  
     12012-04-11  Antonio Gomes  <agomes@rim.com>
     2
     3        Be more restrictive when adding ScrollableArea's to FrameView's ScrollableArea's map
     4        https://bugs.webkit.org/show_bug.cgi?id=79611
     5
     6        Reviewed by James Robinson.
     7
     8        Added scrollable area set count tests to many situations observed
     9        in real world sites.
     10
     11        * fast/scrolling/resources/generic-scrollable-content.html: Added.
     12        * fast/scrolling/resources/hidden-generic-scrollable-content.html: Added.
     13        * fast/scrolling/resources/scrollable-area.js: Added.
     14        (runTest):
     15        (end):
     16        * fast/scrolling/resources/scrollable-style.css: Added.
     17        (.inner):
     18        (.offscreen):
     19        * fast/scrolling/scrollable-area-frame-expected.txt: Added.
     20        * fast/scrolling/scrollable-area-frame-inherited-visibility-hidden-expected.txt: Added.
     21        * fast/scrolling/scrollable-area-frame-inherited-visibility-hidden.html: Added.
     22        * fast/scrolling/scrollable-area-frame-overflow-hidden-expected.txt: Added.
     23        * fast/scrolling/scrollable-area-frame-overflow-hidden.html: Added.
     24        * fast/scrolling/scrollable-area-frame-overried-inherited-visibility-hidden-expected.txt: Added.
     25        * fast/scrolling/scrollable-area-frame-overried-inherited-visibility-hidden.html: Added.
     26        * fast/scrolling/scrollable-area-frame-scrolling-no-expected.txt: Added.
     27        * fast/scrolling/scrollable-area-frame-scrolling-no-overried-inherited-visibility-hidden-expected.txt: Added.
     28        * fast/scrolling/scrollable-area-frame-scrolling-no-overried-inherited-visibility-hidden.html: Added.
     29        * fast/scrolling/scrollable-area-frame-scrolling-no-visibility-hidden-child-expected.txt: Added.
     30        * fast/scrolling/scrollable-area-frame-scrolling-no-visibility-hidden-child.html: Added.
     31        * fast/scrolling/scrollable-area-frame-scrolling-no.html: Added.
     32        * fast/scrolling/scrollable-area-frame-scrolling-yes-display-none-expected.txt: Added.
     33        * fast/scrolling/scrollable-area-frame-scrolling-yes-display-none.html: Added.
     34        * fast/scrolling/scrollable-area-frame-scrolling-yes-expected.txt: Added.
     35        * fast/scrolling/scrollable-area-frame-scrolling-yes.html: Added.
     36        * fast/scrolling/scrollable-area-frame-visibility-hidden-child-expected.txt: Added.
     37        * fast/scrolling/scrollable-area-frame-visibility-hidden-child.html: Added.
     38        * fast/scrolling/scrollable-area-frame-zero-size-and-border-expected.txt: Added.
     39        * fast/scrolling/scrollable-area-frame-zero-size-and-border.html: Added.
     40        * fast/scrolling/scrollable-area-frame.html: Added.
     41        * fast/scrolling/scrollable-area-overflow-auto-display-none-expected.txt: Added.
     42        * fast/scrolling/scrollable-area-overflow-auto-display-none-in-parent-expected.txt: Added.
     43        * fast/scrolling/scrollable-area-overflow-auto-display-none-in-parent.html: Added.
     44        * fast/scrolling/scrollable-area-overflow-auto-display-none.html: Added.
     45        * fast/scrolling/scrollable-area-overflow-auto-expected.txt: Added.
     46        * fast/scrolling/scrollable-area-overflow-auto-visibility-hidden-expected.txt: Added.
     47        * fast/scrolling/scrollable-area-overflow-auto-visibility-hidden-in-parent-expected.txt: Added.
     48        * fast/scrolling/scrollable-area-overflow-auto-visibility-hidden-in-parent.html: Added.
     49        * fast/scrolling/scrollable-area-overflow-auto-visibility-hidden.html: Added.
     50        * fast/scrolling/scrollable-area-overflow-auto-visibility-override-expected.txt: Added.
     51        * fast/scrolling/scrollable-area-overflow-auto-visibility-override.html: Added.
     52        * fast/scrolling/scrollable-area-overflow-auto-visibility-visible-expected.txt: Added.
     53        * fast/scrolling/scrollable-area-overflow-auto-visibility-visible.html: Added.
     54        * fast/scrolling/scrollable-area-overflow-auto.html: Added.
     55        * fast/scrolling/scrollable-area-overflow-not-set-expected.txt: Added.
     56        * fast/scrolling/scrollable-area-overflow-not-set.html: Added.
     57        * fast/scrolling/scrollable-area-overflow-visible-expected.txt: Added.
     58        * fast/scrolling/scrollable-area-overflow-visible.html: Added.
     59
    1602012-04-13  Vincent Scheib  <scheib@chromium.org>
    261
  • trunk/Source/WebCore/ChangeLog

    r114168 r114170  
     12012-04-11  Antonio Gomes  <agomes@rim.com>
     2
     3        Be more restrictive when adding ScrollableArea's to FrameView's ScrollableArea's map
     4        https://bugs.webkit.org/show_bug.cgi?id=79611
     5
     6        Reviewed by James Robinson.
     7
     8        Source/WebCore:
     9
     10        As of today, any FrameView attached to the Widget-tree or any
     11        RenderLayer whose corresponding RenderBox's style has a 'overflow'
     12        property set to 'auto' is cached in its containing scrollable areas set.
     13        We could be more restrictive about what we in fact want to
     14        cache as scrollable areas, by checking if the element as an overflow
     15        (i.e. more content than its viewport).
     16
     17        * page/FrameView.cpp:
     18        (WebCore::FrameView::setFrameRect):
     19
     20        Whenever the viewport changes, check if we have an scrollable/overflowed
     21        content, and update the cache accordingly.
     22
     23        (WebCore::FrameView::setContentsSize):
     24
     25        Whenever the contents size changes, check if we have a scrollable/overflowed
     26        content, and update the cache accordingly.
     27
     28        (WebCore::FrameView::calculateScrollbarModesForLayout):
     29
     30        Introduces a way to query for the scrollbars by only
     31        taking into account the "rules" set by the web author.
     32        For that, a new enum was added called SrollbarModesCalculationStrategy,
     33        which allows callers to discard for example client-side scrollbar policies
     34        in order to verify if a given frameview is scrollable or not.
     35
     36        (WebCore::FrameView::updateScrollableAreaSet):
     37
     38        Take into account various factors before considering a FrameView as
     39        scrollable. If in the end it is, it gets added to its parent FrameView
     40        scrollable areas map, otherwise removed.
     41
     42        (WebCore):
     43        (WebCore::FrameView::addScrollableArea):
     44
     45        Became unneeded, thus removed.
     46
     47        (WebCore::FrameView::removeScrollableArea):
     48
     49        Whenever a FrameView is removed from the Widget-tree,
     50        remove it from the cache.
     51
     52        * page/FrameView.h:
     53        (FrameView):
     54        * rendering/RenderLayer.cpp:
     55        (WebCore::RenderLayer::updateScrollbarsAfterLayout):
     56
     57        Update scrollable area set after layout.
     58
     59        (WebCore::RenderLayer::updateScrollbarsAfterStyleChange):
     60
     61        Update scrollable area set after style changes.
     62
     63        (WebCore::RenderLayer::styleChanged):
     64
     65        Removed the scrollable areas logic detection from it.
     66
     67        (WebCore::RenderLayer::updateScrollableAreaSet):
     68
     69        Updates the containing FrameView scrollable areas cache
     70        only when needed (i.e. an overflow exists).
     71
     72        (WebCore):
     73        * rendering/RenderLayer.h:
     74        (RenderLayer):
     75        * testing/Internals.cpp:
     76        (WebCore::Internals::numberOfScrollableAreas):
     77        (WebCore):
     78        * testing/Internals.h:
     79        (Internals):
     80        * testing/Internals.idl:
     81
     82        Tests: fast/scrolling/scrollable-area-frame-inherited-visibility-hidden.html
     83               fast/scrolling/scrollable-area-frame-overflow-hidden.html
     84               fast/scrolling/scrollable-area-frame-overried-inherited-visibility-hidden.html
     85               fast/scrolling/scrollable-area-frame-scrolling-no-overried-inherited-visibility-hidden.html
     86               fast/scrolling/scrollable-area-frame-scrolling-no-visibility-hidden-child.html
     87               fast/scrolling/scrollable-area-frame-scrolling-no.html
     88               fast/scrolling/scrollable-area-frame-scrolling-yes-display-none.html
     89               fast/scrolling/scrollable-area-frame-scrolling-yes.html
     90               fast/scrolling/scrollable-area-frame-visibility-hidden-child.html
     91               fast/scrolling/scrollable-area-frame-zero-size-and-border.html
     92               fast/scrolling/scrollable-area-frame.html
     93               fast/scrolling/scrollable-area-overflow-auto-display-none-in-parent.html
     94               fast/scrolling/scrollable-area-overflow-auto-display-none.html
     95               fast/scrolling/scrollable-area-overflow-auto-visibility-hidden-in-parent.html
     96               fast/scrolling/scrollable-area-overflow-auto-visibility-hidden.html
     97               fast/scrolling/scrollable-area-overflow-auto-visibility-override.html
     98               fast/scrolling/scrollable-area-overflow-auto-visibility-visible.html
     99               fast/scrolling/scrollable-area-overflow-auto.html
     100               fast/scrolling/scrollable-area-overflow-not-set.html
     101               fast/scrolling/scrollable-area-overflow-visible.html
     102
    11032012-04-13  Antti Koivisto  <antti@apple.com>
    2104
  • trunk/Source/WebCore/page/FrameView.cpp

    r114109 r114170  
    406406    ScrollView::setFrameRect(newRect);
    407407
     408    updateScrollableAreaSet();
     409
    408410#if USE(ACCELERATED_COMPOSITING)
    409411    if (RenderView* root = rootRenderer(this)) {
     
    508510    if (!page)
    509511        return;
     512
     513    updateScrollableAreaSet();
    510514
    511515    page->chrome()->contentsSizeChanged(frame(), size); //notify only
     
    596600}
    597601
    598 void FrameView::calculateScrollbarModesForLayout(ScrollbarMode& hMode, ScrollbarMode& vMode)
     602void FrameView::calculateScrollbarModesForLayout(ScrollbarMode& hMode, ScrollbarMode& vMode, ScrollbarModesCalculationStrategy strategy)
    599603{
    600604    m_viewportRenderer = 0;
     
    607611    } 
    608612   
    609     if (m_canHaveScrollbars) {
     613    if (m_canHaveScrollbars || strategy == RulesFromWebContentOnly) {
    610614        hMode = ScrollbarAuto;
    611615        vMode = ScrollbarAuto;
     
    26252629}
    26262630
     2631void FrameView::updateScrollableAreaSet()
     2632{
     2633    // That ensures that only inner frames are cached.
     2634    if (!parentFrameView())
     2635        return;
     2636
     2637    // Check for:
     2638    // 1) display:none or visibility:hidden set to self or inherited.
     2639    // 2) overflow{-x,-y}: hidden;
     2640    // 3) scrolling: no;
     2641
     2642    // Covers #1.
     2643    HTMLFrameOwnerElement* owner = m_frame->ownerElement();
     2644    if (!owner || !owner->renderer() || !owner->renderer()->visibleToHitTesting()) {
     2645        parentFrameView()->removeScrollableArea(this);
     2646        return;
     2647    }
     2648
     2649    IntSize contentSize = contentsSize();
     2650    IntSize visibleContentSize = visibleContentRect().size();
     2651    if ((contentSize.height() <= visibleContentSize.height() && contentSize.width() <= visibleContentSize.width())) {
     2652        parentFrameView()->removeScrollableArea(this);
     2653        return;
     2654    }
     2655
     2656    // Cover #2 and #3.
     2657    ScrollbarMode horizontalMode;
     2658    ScrollbarMode verticalMode;
     2659    calculateScrollbarModesForLayout(horizontalMode, verticalMode, RulesFromWebContentOnly);
     2660    if (horizontalMode == ScrollbarAlwaysOff && verticalMode == ScrollbarAlwaysOff) {
     2661        parentFrameView()->removeScrollableArea(this);
     2662        return;
     2663    }
     2664
     2665    parentFrameView()->addScrollableArea(this);
     2666}
     2667
    26272668bool FrameView::shouldSuspendScrollAnimations() const
    26282669{
     
    34523493}
    34533494
    3454 void FrameView::addChild(PassRefPtr<Widget> widget)
    3455 {
    3456     if (widget->isFrameView())
    3457         addScrollableArea(static_cast<FrameView*>(widget.get()));
    3458 
    3459     ScrollView::addChild(widget);
    3460 }
    3461 
    34623495void FrameView::removeChild(Widget* widget)
    34633496{
  • trunk/Source/WebCore/page/FrameView.h

    r113287 r114170  
    292292    bool isFrameViewScrollCorner(RenderScrollbarPart* scrollCorner) const { return m_scrollCorner == scrollCorner; }
    293293
    294     void calculateScrollbarModesForLayout(ScrollbarMode& hMode, ScrollbarMode& vMode);
     294    enum ScrollbarModesCalculationStrategy { RulesFromWebContentOnly, AnyRule };
     295    void calculateScrollbarModesForLayout(ScrollbarMode& hMode, ScrollbarMode& vMode, ScrollbarModesCalculationStrategy = AnyRule);
    295296
    296297    // Normal delay
     
    328329    const ScrollableAreaSet* scrollableAreas() const { return m_scrollableAreas.get(); }
    329330
    330     virtual void addChild(PassRefPtr<Widget>) OVERRIDE;
    331331    virtual void removeChild(Widget*) OVERRIDE;
    332332
     
    389389    virtual ScrollableArea* enclosingScrollableArea() const;
    390390    virtual IntRect scrollableAreaBoundingBox() const OVERRIDE;
     391
     392    void updateScrollableAreaSet();
    391393
    392394#if USE(ACCELERATED_COMPOSITING)
  • trunk/Source/WebCore/rendering/RenderLayer.cpp

    r113883 r114170  
    22012201    if (!renderer()->isBox())
    22022202        return false;
    2203    
     2203
    22042204    return toRenderBox(renderer())->scrollsOverflow();
    22052205}
     
    24032403    RenderBox* box = renderBox();
    24042404    ASSERT(box);
    2405    
     2405
    24062406    m_scrollDimensionsDirty = false;
    24072407
     
    24902490        m_vBar->setProportion(clientHeight, m_scrollSize.height());
    24912491    }
     2492
     2493    updateScrollableAreaSet((hasHorizontalOverflow || hasVerticalOverflow) && scrollsOverflow());
    24922494}
    24932495
     
    46554657        m_vBar->setEnabled(true);
    46564658    }
     4659
     4660    if (!m_scrollDimensionsDirty)
     4661        updateScrollableAreaSet((hasHorizontalOverflow() || hasVerticalOverflow()) && scrollsOverflow());
    46574662}
    46584663
     
    46864691            createReflection();
    46874692        updateReflectionStyle();
    4688     }
    4689    
    4690     if (Frame* frame = renderer()->frame()) {
    4691         if (FrameView* frameView = frame->view()) {
    4692             if (scrollsOverflow())
    4693                 frameView->addScrollableArea(this);
    4694             else
    4695                 frameView->removeScrollableArea(this);
    4696         }
    46974693    }
    46984694   
     
    47334729    }
    47344730#endif
     4731}
     4732
     4733void RenderLayer::updateScrollableAreaSet(bool hasOverflow)
     4734{
     4735    Frame* frame = renderer()->frame();
     4736    if (!frame)
     4737        return;
     4738
     4739    FrameView* frameView = frame->view();
     4740    if (!frameView)
     4741        return;
     4742
     4743    bool isVisibleToHitTest = renderer()->visibleToHitTesting();
     4744    if (HTMLFrameOwnerElement* owner = frame->ownerElement())
     4745        isVisibleToHitTest &= owner->renderer() && owner->renderer()->visibleToHitTesting();
     4746
     4747    if (hasOverflow && isVisibleToHitTest)
     4748        frameView->addScrollableArea(this);
     4749    else
     4750        frameView->removeScrollableArea(this);
    47354751}
    47364752
  • trunk/Source/WebCore/rendering/RenderLayer.h

    r113335 r114170  
    703703    IntSize scrollbarOffset(const Scrollbar*) const;
    704704   
     705    void updateScrollableAreaSet(bool hasOverflow);
     706
    705707    void childVisibilityChanged(bool newVisibility);
    706708    void dirtyVisibleDescendantStatus();
  • trunk/Source/WebCore/testing/Internals.cpp

    r114081 r114170  
    955955}
    956956
    957 }
     957unsigned Internals::numberOfScrollableAreas(Document* document, ExceptionCode&)
     958{
     959    unsigned count = 0;
     960    Frame* frame = document->frame();
     961    if (frame->view()->scrollableAreas())
     962        count += frame->view()->scrollableAreas()->size();
     963
     964    for (Frame* child = frame->tree()->firstChild(); child; child = child->tree()->nextSibling()) {
     965        if (child->view() && child->view()->scrollableAreas())
     966            count += child->view()->scrollableAreas()->size();
     967    }
     968
     969    return count;
     970}
     971
     972}
  • trunk/Source/WebCore/testing/Internals.h

    r114081 r114170  
    151151    bool hasGrammarMarker(Document*, int from, int length, ExceptionCode&);
    152152
     153    unsigned numberOfScrollableAreas(Document*, ExceptionCode&);
     154
    153155    static const char* internalsId;
    154156
  • trunk/Source/WebCore/testing/Internals.idl

    r114081 r114170  
    126126        boolean hasGrammarMarker(in Document document, in long from, in long length) raises (DOMException);
    127127
     128        unsigned long numberOfScrollableAreas(in Document document) raises (DOMException);
     129
    128130        readonly attribute InternalSettings settings;
    129131
Note: See TracChangeset for help on using the changeset viewer.