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

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

Issue 861553003: Invalidate CustomScrollbars on having window-inactive selector. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: addressed review comments Created 5 years, 11 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 | « Source/core/dom/StyleEngine.cpp ('k') | no next file » | 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 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 } 333 }
334 if (didStyleChange) { 334 if (didStyleChange) {
335 updateScrollbarGeometry(); 335 updateScrollbarGeometry();
336 updateScrollCorner(); 336 updateScrollCorner();
337 positionScrollbarLayers(); 337 positionScrollbarLayers();
338 } 338 }
339 } 339 }
340 340
341 void FrameView::invalidateAllCustomScrollbarsOnActiveChanged() 341 void FrameView::invalidateAllCustomScrollbarsOnActiveChanged()
342 { 342 {
343 bool usesWindowInactiveSelector = m_frame->document()->styleEngine()->usesWi ndowInactiveSelector();
344
343 const ChildrenWidgetSet* viewChildren = children(); 345 const ChildrenWidgetSet* viewChildren = children();
344 for (const RefPtrWillBeMember<Widget>& child : *viewChildren) { 346 for (const RefPtrWillBeMember<Widget>& child : *viewChildren) {
345 Widget* widget = child.get(); 347 Widget* widget = child.get();
346 if (widget->isFrameView()) 348 if (widget->isFrameView())
347 toFrameView(widget)->invalidateAllCustomScrollbarsOnActiveChanged(); 349 toFrameView(widget)->invalidateAllCustomScrollbarsOnActiveChanged();
348 else if (widget->isScrollbar() && toScrollbar(widget)->isCustomScrollbar ()) 350 else if (usesWindowInactiveSelector && widget->isScrollbar() && toScroll bar(widget)->isCustomScrollbar())
349 toScrollbar(widget)->styleChanged(); 351 toScrollbar(widget)->styleChanged();
350 } 352 }
351 recalculateCustomScrollbarStyle(); 353 if (usesWindowInactiveSelector)
354 recalculateCustomScrollbarStyle();
352 } 355 }
353 356
354 void FrameView::recalculateScrollbarOverlayStyle() 357 void FrameView::recalculateScrollbarOverlayStyle()
355 { 358 {
356 ScrollbarOverlayStyle oldOverlayStyle = scrollbarOverlayStyle(); 359 ScrollbarOverlayStyle oldOverlayStyle = scrollbarOverlayStyle();
357 ScrollbarOverlayStyle overlayStyle = ScrollbarOverlayStyleDefault; 360 ScrollbarOverlayStyle overlayStyle = ScrollbarOverlayStyleDefault;
358 361
359 Color backgroundColor = documentBackgroundColor(); 362 Color backgroundColor = documentBackgroundColor();
360 // Reduce the background color from RGB to a lightness value 363 // Reduce the background color from RGB to a lightness value
361 // and determine which scrollbar style to use based on a lightness 364 // and determine which scrollbar style to use based on a lightness
(...skipping 3643 matching lines...) Expand 10 before | Expand all | Expand 10 after
4005 return; 4008 return;
4006 4009
4007 ScrollableArea::setScrollOrigin(origin); 4010 ScrollableArea::setScrollOrigin(origin);
4008 4011
4009 // Update if the scroll origin changes, since our position will be different if the content size did not change. 4012 // Update if the scroll origin changes, since our position will be different if the content size did not change.
4010 if (updatePositionAtAll && updatePositionSynchronously) 4013 if (updatePositionAtAll && updatePositionSynchronously)
4011 updateScrollbars(scrollOffsetDouble()); 4014 updateScrollbars(scrollOffsetDouble());
4012 } 4015 }
4013 4016
4014 } // namespace blink 4017 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/dom/StyleEngine.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698