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

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

Issue 699183004: Main-thread scroll if we have fixed-pos children and overflow:hidden. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « Source/core/frame/FrameView.h ('k') | Source/core/page/scrolling/ScrollingCoordinator.cpp » ('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 2248 matching lines...) Expand 10 before | Expand all | Expand 10 after
2259 2259
2260 IntRect FrameView::scrollableAreaBoundingBox() const 2260 IntRect FrameView::scrollableAreaBoundingBox() const
2261 { 2261 {
2262 RenderPart* ownerRenderer = frame().ownerRenderer(); 2262 RenderPart* ownerRenderer = frame().ownerRenderer();
2263 if (!ownerRenderer) 2263 if (!ownerRenderer)
2264 return frameRect(); 2264 return frameRect();
2265 2265
2266 return ownerRenderer->absoluteContentQuad().enclosingBoundingBox(); 2266 return ownerRenderer->absoluteContentQuad().enclosingBoundingBox();
2267 } 2267 }
2268 2268
2269
2269 bool FrameView::isScrollable() 2270 bool FrameView::isScrollable()
2270 { 2271 {
2272 return scrollingReasons() == Scrollable;
2273 }
2274
2275 FrameView::ScrollingReasons FrameView::scrollingReasons()
2276 {
2271 // Check for: 2277 // Check for:
2272 // 1) If there an actual overflow. 2278 // 1) If there an actual overflow.
2273 // 2) display:none or visibility:hidden set to self or inherited. 2279 // 2) display:none or visibility:hidden set to self or inherited.
2274 // 3) overflow{-x,-y}: hidden; 2280 // 3) overflow{-x,-y}: hidden;
2275 // 4) scrolling: no; 2281 // 4) scrolling: no;
2276 2282
2277 // Covers #1 2283 // Covers #1
2278 IntSize contentsSize = this->contentsSize(); 2284 IntSize contentsSize = this->contentsSize();
2279 IntSize visibleContentSize = visibleContentRect().size(); 2285 IntSize visibleContentSize = visibleContentRect().size();
2280 if ((contentsSize.height() <= visibleContentSize.height() && contentsSize.wi dth() <= visibleContentSize.width())) 2286 if ((contentsSize.height() <= visibleContentSize.height() && contentsSize.wi dth() <= visibleContentSize.width()))
2281 return false; 2287 return NotScrollableNoOverflow;
2282 2288
2283 // Covers #2. 2289 // Covers #2.
2284 // FIXME: Do we need to fix this for OOPI? 2290 // FIXME: Do we need to fix this for OOPI?
2285 HTMLFrameOwnerElement* owner = m_frame->deprecatedLocalOwner(); 2291 HTMLFrameOwnerElement* owner = m_frame->deprecatedLocalOwner();
2286 if (owner && (!owner->renderer() || !owner->renderer()->visibleToHitTesting( ))) 2292 if (owner && (!owner->renderer() || !owner->renderer()->visibleToHitTesting( )))
2287 return false; 2293 return NotScrollableNotVisible;
2288 2294
2289 // Cover #3 and #4. 2295 // Cover #3 and #4.
2290 ScrollbarMode horizontalMode; 2296 ScrollbarMode horizontalMode;
2291 ScrollbarMode verticalMode; 2297 ScrollbarMode verticalMode;
2292 calculateScrollbarModesForLayoutAndSetViewportRenderer(horizontalMode, verti calMode, RulesFromWebContentOnly); 2298 calculateScrollbarModesForLayoutAndSetViewportRenderer(horizontalMode, verti calMode, RulesFromWebContentOnly);
2293 if (horizontalMode == ScrollbarAlwaysOff && verticalMode == ScrollbarAlwaysO ff) 2299 if (horizontalMode == ScrollbarAlwaysOff && verticalMode == ScrollbarAlwaysO ff)
2294 return false; 2300 return NotScrollableExplicitlyDisabled;
2295 2301
2296 return true; 2302 return Scrollable;
2297 } 2303 }
2298 2304
2299 void FrameView::updateScrollableAreaSet() 2305 void FrameView::updateScrollableAreaSet()
2300 { 2306 {
2301 // That ensures that only inner frames are cached. 2307 // That ensures that only inner frames are cached.
2302 FrameView* parentFrameView = this->parentFrameView(); 2308 FrameView* parentFrameView = this->parentFrameView();
2303 if (!parentFrameView) 2309 if (!parentFrameView)
2304 return; 2310 return;
2305 2311
2306 if (!isScrollable()) { 2312 if (!isScrollable()) {
(...skipping 1622 matching lines...) Expand 10 before | Expand all | Expand 10 after
3929 return; 3935 return;
3930 3936
3931 ScrollableArea::setScrollOrigin(origin); 3937 ScrollableArea::setScrollOrigin(origin);
3932 3938
3933 // Update if the scroll origin changes, since our position will be different if the content size did not change. 3939 // Update if the scroll origin changes, since our position will be different if the content size did not change.
3934 if (updatePositionAtAll && updatePositionSynchronously) 3940 if (updatePositionAtAll && updatePositionSynchronously)
3935 updateScrollbars(scrollOffsetDouble()); 3941 updateScrollbars(scrollOffsetDouble());
3936 } 3942 }
3937 3943
3938 } // namespace blink 3944 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/frame/FrameView.h ('k') | Source/core/page/scrolling/ScrollingCoordinator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698