| OLD | NEW |
| 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 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 toFrameView(widget)->invalidateAllCustomScrollbarsOnActiveChanged(); | 354 toFrameView(widget)->invalidateAllCustomScrollbarsOnActiveChanged(); |
| 355 else if (usesWindowInactiveSelector && widget->isScrollbar() && toScroll
bar(widget)->isCustomScrollbar()) | 355 else if (usesWindowInactiveSelector && widget->isScrollbar() && toScroll
bar(widget)->isCustomScrollbar()) |
| 356 toScrollbar(widget)->styleChanged(); | 356 toScrollbar(widget)->styleChanged(); |
| 357 if (widget->isScrollbar()) | 357 if (widget->isScrollbar()) |
| 358 toScrollbar(widget)->windowActiveChangedForSnowLeopardOnly(); | 358 toScrollbar(widget)->windowActiveChangedForSnowLeopardOnly(); |
| 359 } | 359 } |
| 360 if (usesWindowInactiveSelector) | 360 if (usesWindowInactiveSelector) |
| 361 recalculateCustomScrollbarStyle(); | 361 recalculateCustomScrollbarStyle(); |
| 362 } | 362 } |
| 363 | 363 |
| 364 void FrameView::recalculateScrollbarOverlayStyle() | |
| 365 { | |
| 366 ScrollbarOverlayStyle oldOverlayStyle = scrollbarOverlayStyle(); | |
| 367 ScrollbarOverlayStyle overlayStyle = ScrollbarOverlayStyleDefault; | |
| 368 | |
| 369 Color backgroundColor = documentBackgroundColor(); | |
| 370 // Reduce the background color from RGB to a lightness value | |
| 371 // and determine which scrollbar style to use based on a lightness | |
| 372 // heuristic. | |
| 373 double hue, saturation, lightness; | |
| 374 backgroundColor.getHSL(hue, saturation, lightness); | |
| 375 if (lightness <= .5) | |
| 376 overlayStyle = ScrollbarOverlayStyleLight; | |
| 377 | |
| 378 if (oldOverlayStyle != overlayStyle) | |
| 379 setScrollbarOverlayStyle(overlayStyle); | |
| 380 } | |
| 381 | |
| 382 void FrameView::clear() | 364 void FrameView::clear() |
| 383 { | 365 { |
| 384 reset(); | 366 reset(); |
| 385 setScrollbarsSuppressed(true); | 367 setScrollbarsSuppressed(true); |
| 386 } | 368 } |
| 387 | 369 |
| 388 bool FrameView::didFirstLayout() const | 370 bool FrameView::didFirstLayout() const |
| 389 { | 371 { |
| 390 return !m_firstLayout; | 372 return !m_firstLayout; |
| 391 } | 373 } |
| (...skipping 1522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1914 void FrameView::setBaseBackgroundColor(const Color& backgroundColor) | 1896 void FrameView::setBaseBackgroundColor(const Color& backgroundColor) |
| 1915 { | 1897 { |
| 1916 m_baseBackgroundColor = backgroundColor; | 1898 m_baseBackgroundColor = backgroundColor; |
| 1917 | 1899 |
| 1918 if (layoutView() && layoutView()->layer()->hasCompositedLayerMapping()) { | 1900 if (layoutView() && layoutView()->layer()->hasCompositedLayerMapping()) { |
| 1919 CompositedLayerMapping* compositedLayerMapping = layoutView()->layer()->
compositedLayerMapping(); | 1901 CompositedLayerMapping* compositedLayerMapping = layoutView()->layer()->
compositedLayerMapping(); |
| 1920 compositedLayerMapping->updateContentsOpaque(); | 1902 compositedLayerMapping->updateContentsOpaque(); |
| 1921 if (compositedLayerMapping->mainGraphicsLayer()) | 1903 if (compositedLayerMapping->mainGraphicsLayer()) |
| 1922 compositedLayerMapping->mainGraphicsLayer()->setNeedsDisplay(); | 1904 compositedLayerMapping->mainGraphicsLayer()->setNeedsDisplay(); |
| 1923 } | 1905 } |
| 1924 recalculateScrollbarOverlayStyle(); | 1906 recalculateScrollbarOverlayStyle(documentBackgroundColor()); |
| 1925 } | 1907 } |
| 1926 | 1908 |
| 1927 void FrameView::updateBackgroundRecursively(const Color& backgroundColor, bool t
ransparent) | 1909 void FrameView::updateBackgroundRecursively(const Color& backgroundColor, bool t
ransparent) |
| 1928 { | 1910 { |
| 1929 forAllNonThrottledFrameViews([backgroundColor, transparent](FrameView& frame
View) { | 1911 forAllNonThrottledFrameViews([backgroundColor, transparent](FrameView& frame
View) { |
| 1930 frameView.setTransparent(transparent); | 1912 frameView.setTransparent(transparent); |
| 1931 frameView.setBaseBackgroundColor(backgroundColor); | 1913 frameView.setBaseBackgroundColor(backgroundColor); |
| 1932 }); | 1914 }); |
| 1933 } | 1915 } |
| 1934 | 1916 |
| (...skipping 2192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4127 return m_hiddenForThrottling && m_crossOriginForThrottling; | 4109 return m_hiddenForThrottling && m_crossOriginForThrottling; |
| 4128 } | 4110 } |
| 4129 | 4111 |
| 4130 LayoutBox& FrameView::boxForScrollControlPaintInvalidation() const | 4112 LayoutBox& FrameView::boxForScrollControlPaintInvalidation() const |
| 4131 { | 4113 { |
| 4132 ASSERT(layoutView()); | 4114 ASSERT(layoutView()); |
| 4133 return *layoutView(); | 4115 return *layoutView(); |
| 4134 } | 4116 } |
| 4135 | 4117 |
| 4136 } // namespace blink | 4118 } // namespace blink |
| OLD | NEW |