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

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

Issue 2780883002: Correct overlay scrollbar check FrameView::scrollbarExistenceDidChange (Closed)
Patch Set: Rebase Created 3 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/web/tests/ScrollbarsTest.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 2103 matching lines...) Expand 10 before | Expand all | Expand 10 after
2114 2114
2115 void FrameView::scrollbarExistenceDidChange() { 2115 void FrameView::scrollbarExistenceDidChange() {
2116 // We check to make sure the view is attached to a frame() as this method can 2116 // We check to make sure the view is attached to a frame() as this method can
2117 // be triggered before the view is attached by LocalFrame::createView(...) 2117 // be triggered before the view is attached by LocalFrame::createView(...)
2118 // setting various values such as setScrollBarModes(...) for example. An 2118 // setting various values such as setScrollBarModes(...) for example. An
2119 // ASSERT is triggered when a view is layout before being attached to a 2119 // ASSERT is triggered when a view is layout before being attached to a
2120 // frame(). 2120 // frame().
2121 if (!frame().view()) 2121 if (!frame().view())
2122 return; 2122 return;
2123 2123
2124 bool usesOverlayScrollbars = ScrollbarTheme::theme().usesOverlayScrollbars(); 2124 Element* customScrollbarElement = nullptr;
2125
2126 bool usesOverlayScrollbars =
2127 ScrollbarTheme::theme().usesOverlayScrollbars() &&
2128 !shouldUseCustomScrollbars(customScrollbarElement);
2125 2129
2126 // FIXME: this call to layout() could be called within FrameView::layout(), 2130 // FIXME: this call to layout() could be called within FrameView::layout(),
2127 // but before performLayout(), causing double-layout. See also 2131 // but before performLayout(), causing double-layout. See also
2128 // crbug.com/429242. 2132 // crbug.com/429242.
2129 if (!usesOverlayScrollbars && needsLayout()) 2133 if (!usesOverlayScrollbars && needsLayout())
2130 layout(); 2134 layout();
2131 2135
2132 if (!layoutViewItem().isNull() && layoutViewItem().usesCompositing()) { 2136 if (!layoutViewItem().isNull() && layoutViewItem().usesCompositing()) {
2133 layoutViewItem().compositor()->frameViewScrollbarsExistenceDidChange(); 2137 layoutViewItem().compositor()->frameViewScrollbarsExistenceDidChange();
2134 2138
(...skipping 3125 matching lines...) Expand 10 before | Expand all | Expand 10 after
5260 void FrameView::setAnimationHost( 5264 void FrameView::setAnimationHost(
5261 std::unique_ptr<CompositorAnimationHost> host) { 5265 std::unique_ptr<CompositorAnimationHost> host) {
5262 m_animationHost = std::move(host); 5266 m_animationHost = std::move(host);
5263 } 5267 }
5264 5268
5265 LayoutUnit FrameView::caretWidth() const { 5269 LayoutUnit FrameView::caretWidth() const {
5266 return LayoutUnit(getHostWindow()->windowToViewportScalar(1)); 5270 return LayoutUnit(getHostWindow()->windowToViewportScalar(1));
5267 } 5271 }
5268 5272
5269 } // namespace blink 5273 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/web/tests/ScrollbarsTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698