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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/frame/FrameView.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/frame/FrameView.cpp
diff --git a/Source/core/frame/FrameView.cpp b/Source/core/frame/FrameView.cpp
index fead2c37d5aef382869754e821fde1e16084b94b..3231af4128ba49c0bec7a0c9b2f4ea177455900f 100644
--- a/Source/core/frame/FrameView.cpp
+++ b/Source/core/frame/FrameView.cpp
@@ -341,6 +341,28 @@ void FrameView::recalculateCustomScrollbarStyle()
}
}
+void FrameView::invalidateAllCustomScrollbarsOnActiveChanged()
+{
+ const ChildrenWidgetSet* viewChildren = children();
+ bool didStyleChange = false;
+ for (const RefPtrWillBeMember<Widget>& child : *viewChildren) {
+ Widget* widget = child.get();
+ if (widget->isFrameView()) {
+ toFrameView(widget)->recalculateCustomScrollbarStyle();
+ 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
+ toFrameView(widget)->invalidateAllCustomScrollbarsOnActiveChanged();
+ } else if (widget->isScrollbar() && toScrollbar(widget)->isCustomScrollbar()) {
+ toScrollbar(widget)->styleChanged();
+ didStyleChange = true;
+ }
+ }
+ if (didStyleChange) {
+ updateScrollbarGeometry();
+ updateScrollCorner();
+ positionScrollbarLayers();
+ }
+}
+
void FrameView::recalculateScrollbarOverlayStyle()
{
ScrollbarOverlayStyle oldOverlayStyle = scrollbarOverlayStyle();
« 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