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

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

Issue 774953003: CustomScrollbar Style not updated for IFrame. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 } 332 }
333 if (m_verticalScrollbar && m_verticalScrollbar->isCustomScrollbar()) { 333 if (m_verticalScrollbar && m_verticalScrollbar->isCustomScrollbar()) {
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 if (!m_parts.isEmpty())
343 recalculateWidgetCustomScrollbarStyle();
344 }
345
346 void FrameView::recalculateWidgetCustomScrollbarStyle()
MuVen 2014/12/04 15:47:10 with this changes any scrollbar pertaining to fram
347 {
348 WillBeHeapVector<RefPtrWillBeMember<RenderPart> > parts;
349 copyToVector(m_parts, parts);
350
351 for (size_t i = 0; i < parts.size() && renderView(); ++i) {
skobes 2014/12/04 17:18:38 This looks like it does the equivalent of FrameVie
MuVen 2014/12/04 17:50:28 True. Instead of writing one more api i have reuse
352 Widget* widget = parts[i]->widget();
353 if (widget && widget->isFrameView()) {
354 FrameView* frameView = toFrameView(widget);
355 bool didStyleChange = false;
356 if (frameView->horizontalScrollbar() && frameView->horizontalScrollb ar()->isCustomScrollbar()) {
357 frameView->horizontalScrollbar()->styleChanged();
358 didStyleChange = true;
359 }
360 if (frameView->verticalScrollbar() && frameView->verticalScrollbar() ->isCustomScrollbar()) {
361 frameView->verticalScrollbar()->styleChanged();
362 didStyleChange = true;
363 }
364 if (didStyleChange) {
365 frameView->updateScrollbarGeometry();
366 frameView->updateScrollCorner();
367 frameView->positionScrollbarLayers();
368 }
369 }
370 }
342 } 371 }
343 372
344 void FrameView::recalculateScrollbarOverlayStyle() 373 void FrameView::recalculateScrollbarOverlayStyle()
345 { 374 {
346 ScrollbarOverlayStyle oldOverlayStyle = scrollbarOverlayStyle(); 375 ScrollbarOverlayStyle oldOverlayStyle = scrollbarOverlayStyle();
347 ScrollbarOverlayStyle overlayStyle = ScrollbarOverlayStyleDefault; 376 ScrollbarOverlayStyle overlayStyle = ScrollbarOverlayStyleDefault;
348 377
349 Color backgroundColor = documentBackgroundColor(); 378 Color backgroundColor = documentBackgroundColor();
350 // Reduce the background color from RGB to a lightness value 379 // Reduce the background color from RGB to a lightness value
351 // and determine which scrollbar style to use based on a lightness 380 // and determine which scrollbar style to use based on a lightness
(...skipping 3610 matching lines...) Expand 10 before | Expand all | Expand 10 after
3962 return; 3991 return;
3963 3992
3964 ScrollableArea::setScrollOrigin(origin); 3993 ScrollableArea::setScrollOrigin(origin);
3965 3994
3966 // Update if the scroll origin changes, since our position will be different if the content size did not change. 3995 // Update if the scroll origin changes, since our position will be different if the content size did not change.
3967 if (updatePositionAtAll && updatePositionSynchronously) 3996 if (updatePositionAtAll && updatePositionSynchronously)
3968 updateScrollbars(scrollOffsetDouble()); 3997 updateScrollbars(scrollOffsetDouble());
3969 } 3998 }
3970 3999
3971 } // namespace blink 4000 } // 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