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

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

Issue 748513006: Trigger style recalc when the window's active state change (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: added scrollbar adjust testcase and proper checks to call recursive apis Created 6 years 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') | 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 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 m_verticalScrollbar->styleChanged(); 334 m_verticalScrollbar->styleChanged();
335 didStyleChange = true; 335 didStyleChange = true;
336 } 336 }
337 if (didStyleChange) { 337 if (didStyleChange) {
338 updateScrollbarGeometry(); 338 updateScrollbarGeometry();
339 updateScrollCorner(); 339 updateScrollCorner();
340 positionScrollbarLayers(); 340 positionScrollbarLayers();
341 } 341 }
342 } 342 }
343 343
344 void FrameView::invalidateAllCustomScrollbarsOnActiveChanged()
345 {
346 const ChildrenWidgetSet* viewChildren = children();
347 bool didStyleChange = false;
348 for (const RefPtrWillBeMember<Widget>& child : *viewChildren) {
349 Widget* widget = child.get();
350 if (widget->isFrameView()) {
351 toFrameView(widget)->recalculateCustomScrollbarStyle();
352 if (toFrameView(widget)->hasCustomScrollbars())
rune 2014/12/10 08:29:32 hasCustomScrollbars() is traversing the whole widg
MuVen 2014/12/10 08:44:33 yes this is much simpler, I have verified all the
353 toFrameView(widget)->invalidateAllCustomScrollbarsOnActiveChange d();
354 } else if (widget->isScrollbar() && toScrollbar(widget)->isCustomScrollb ar()) {
355 toScrollbar(widget)->styleChanged();
356 didStyleChange = true;
357 }
358 }
359 if (didStyleChange) {
360 updateScrollbarGeometry();
361 updateScrollCorner();
362 positionScrollbarLayers();
363 }
364 }
365
344 void FrameView::recalculateScrollbarOverlayStyle() 366 void FrameView::recalculateScrollbarOverlayStyle()
345 { 367 {
346 ScrollbarOverlayStyle oldOverlayStyle = scrollbarOverlayStyle(); 368 ScrollbarOverlayStyle oldOverlayStyle = scrollbarOverlayStyle();
347 ScrollbarOverlayStyle overlayStyle = ScrollbarOverlayStyleDefault; 369 ScrollbarOverlayStyle overlayStyle = ScrollbarOverlayStyleDefault;
348 370
349 Color backgroundColor = documentBackgroundColor(); 371 Color backgroundColor = documentBackgroundColor();
350 // Reduce the background color from RGB to a lightness value 372 // Reduce the background color from RGB to a lightness value
351 // and determine which scrollbar style to use based on a lightness 373 // and determine which scrollbar style to use based on a lightness
352 // heuristic. 374 // heuristic.
353 double hue, saturation, lightness; 375 double hue, saturation, lightness;
(...skipping 3602 matching lines...) Expand 10 before | Expand all | Expand 10 after
3956 return; 3978 return;
3957 3979
3958 ScrollableArea::setScrollOrigin(origin); 3980 ScrollableArea::setScrollOrigin(origin);
3959 3981
3960 // Update if the scroll origin changes, since our position will be different if the content size did not change. 3982 // Update if the scroll origin changes, since our position will be different if the content size did not change.
3961 if (updatePositionAtAll && updatePositionSynchronously) 3983 if (updatePositionAtAll && updatePositionSynchronously)
3962 updateScrollbars(scrollOffsetDouble()); 3984 updateScrollbars(scrollOffsetDouble());
3963 } 3985 }
3964 3986
3965 } // namespace blink 3987 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/frame/FrameView.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698