Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Side by Side Diff: Source/core/frame/FrameView.cpp

Issue 1075393002: Implement Document.scrollingElement API behind experimental feature flag (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Minor fix and comment tweak Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/Element.cpp ('k') | Source/core/html/HTMLBodyElement.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
3 * 1999 Lars Knoll <knoll@kde.org> 3 * 1999 Lars Knoll <knoll@kde.org>
4 * 1999 Antti Koivisto <koivisto@kde.org> 4 * 1999 Antti Koivisto <koivisto@kde.org>
5 * 2000 Dirk Mueller <mueller@kde.org> 5 * 2000 Dirk Mueller <mueller@kde.org>
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com)
8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com)
9 * Copyright (C) 2009 Google Inc. All rights reserved. 9 * Copyright (C) 2009 Google Inc. All rights reserved.
10 * 10 *
(...skipping 1556 matching lines...) Expand 10 before | Expand all | Expand 10 after
1567 { 1567 {
1568 cancelProgrammaticScrollAnimation(); 1568 cancelProgrammaticScrollAnimation();
1569 TemporaryChange<bool> changeInProgrammaticScroll(m_inProgrammaticScroll, tru e); 1569 TemporaryChange<bool> changeInProgrammaticScroll(m_inProgrammaticScroll, tru e);
1570 m_maintainScrollPositionAnchor = nullptr; 1570 m_maintainScrollPositionAnchor = nullptr;
1571 1571
1572 DoublePoint newScrollPosition = adjustScrollPositionWithinRange(scrollPoint) ; 1572 DoublePoint newScrollPosition = adjustScrollPositionWithinRange(scrollPoint) ;
1573 if (newScrollPosition == scrollPositionDouble()) 1573 if (newScrollPosition == scrollPositionDouble())
1574 return; 1574 return;
1575 1575
1576 if (scrollBehavior == ScrollBehaviorAuto) { 1576 if (scrollBehavior == ScrollBehaviorAuto) {
1577 Element* scrollElement = RuntimeEnabledFeatures::scrollTopLeftInteropEna bled() ? m_frame->document()->documentElement() : m_frame->document()->body(); 1577 Element* scrollElement = m_frame->document()->scrollingElement();
1578 LayoutObject* renderer = scrollElement ? scrollElement->layoutObject() : nullptr; 1578 LayoutObject* renderer = scrollElement ? scrollElement->layoutObject() : nullptr;
1579 if (renderer && renderer->style()->scrollBehavior() == ScrollBehaviorSmo oth) 1579 if (renderer && renderer->style()->scrollBehavior() == ScrollBehaviorSmo oth)
1580 scrollBehavior = ScrollBehaviorSmooth; 1580 scrollBehavior = ScrollBehaviorSmooth;
1581 else 1581 else
1582 scrollBehavior = ScrollBehaviorInstant; 1582 scrollBehavior = ScrollBehaviorInstant;
1583 } 1583 }
1584 1584
1585 if (scrollBehavior == ScrollBehaviorInstant) { 1585 if (scrollBehavior == ScrollBehaviorInstant) {
1586 DoubleSize newOffset(newScrollPosition.x(), newScrollPosition.y()); 1586 DoubleSize newOffset(newScrollPosition.x(), newScrollPosition.y());
1587 updateScrollbars(newOffset); 1587 updateScrollbars(newOffset);
(...skipping 2516 matching lines...) Expand 10 before | Expand all | Expand 10 after
4104 { 4104 {
4105 Settings* settings = frame().settings(); 4105 Settings* settings = frame().settings();
4106 if (!settings || !settings->rootLayerScrolls()) 4106 if (!settings || !settings->rootLayerScrolls())
4107 return this; 4107 return this;
4108 4108
4109 LayoutView* layoutView = this->layoutView(); 4109 LayoutView* layoutView = this->layoutView();
4110 return layoutView ? layoutView->scrollableArea() : nullptr; 4110 return layoutView ? layoutView->scrollableArea() : nullptr;
4111 } 4111 }
4112 4112
4113 } // namespace blink 4113 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/dom/Element.cpp ('k') | Source/core/html/HTMLBodyElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698