⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 130700 in webkit


Ignore:
Timestamp:
Oct 8, 2012, 4:20:33 PM (14 years ago)
Author:
Nate Chapin
Message:

Post-r130226 Cleanup: Comment a complicated if statement and make it a helper.
​https://bugs.webkit.org/show_bug.cgi?id=98463

Reviewed by Eric Seidel.

No new tests, refactor only.

  • rendering/RenderLayer.cpp:

(WebCore::frameElementAndViewPermitScroll):
(WebCore::RenderLayer::scrollRectToVisible):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r130699 r130700  
     12012-10-08  Nate Chapin  <japhet@chromium.org>
     2
     3        Post-r130226 Cleanup: Comment a complicated if statement and make it a helper.
     4        https://bugs.webkit.org/show_bug.cgi?id=98463
     5
     6        Reviewed by Eric Seidel.
     7
     8        No new tests, refactor only.
     9
     10        * rendering/RenderLayer.cpp:
     11        (WebCore::frameElementAndViewPermitScroll):
     12        (WebCore::RenderLayer::scrollRectToVisible):
     13
    1142012-10-06  Martin Robinson  <mrobinson@igalia.com>
    215
  • trunk/Source/WebCore/rendering/RenderLayer.cpp

    r130692 r130700  
    17561756}
    17571757
     1758static inline bool frameElementAndViewPermitScroll(HTMLFrameElement* frameElement, FrameView* frameView)
     1759{
     1760    // If scrollbars aren't explicitly forbidden, permit scrolling.
     1761    if (frameElement && frameElement->scrollingMode() != ScrollbarAlwaysOff)
     1762        return true;
     1763
     1764    // If scrollbars are forbidden, user initiated scrolls should obviously be ignored.
     1765    if (frameView->wasScrolledByUser())
     1766        return false;
     1767
     1768    // Forbid autoscrolls when scrollbars are off, but permits other programmatic scrolls,
     1769    // like navigation to an anchor.
     1770    return !frameView->frame()->eventHandler()->autoscrollInProgress();
     1771}
     1772
    17581773void RenderLayer::scrollRectToVisible(const LayoutRect& rect, const ScrollAlignment& alignX, const ScrollAlignment& alignY)
    17591774{
    … …  
    18061821                    frameElement = static_cast<HTMLFrameElement*>(ownerElement);
    18071822
    1808                 if ((frameElement && frameElement->scrollingMode() != ScrollbarAlwaysOff)
    1809                     || (!frameView->frame()->eventHandler()->autoscrollInProgress() && !frameView->wasScrolledByUser())) {
     1823                if (frameElementAndViewPermitScroll(frameElement, frameView)) {
    18101824                    LayoutRect viewRect = frameView->visibleContentRect();
    18111825                    LayoutRect exposeRect = getRectToExpose(viewRect, rect, alignX, alignY);
Note: See TracChangeset for help on using the changeset viewer.