| 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 #include "platform/geometry/DoubleRect.h" | 89 #include "platform/geometry/DoubleRect.h" |
| 90 #include "platform/geometry/FloatRect.h" | 90 #include "platform/geometry/FloatRect.h" |
| 91 #include "platform/geometry/LayoutRect.h" | 91 #include "platform/geometry/LayoutRect.h" |
| 92 #include "platform/graphics/GraphicsContext.h" | 92 #include "platform/graphics/GraphicsContext.h" |
| 93 #include "platform/graphics/GraphicsLayer.h" | 93 #include "platform/graphics/GraphicsLayer.h" |
| 94 #include "platform/graphics/GraphicsLayerDebugInfo.h" | 94 #include "platform/graphics/GraphicsLayerDebugInfo.h" |
| 95 #include "platform/graphics/paint/CullRect.h" | 95 #include "platform/graphics/paint/CullRect.h" |
| 96 #include "platform/graphics/paint/PaintController.h" | 96 #include "platform/graphics/paint/PaintController.h" |
| 97 #include "platform/scheduler/CancellableTaskFactory.h" | 97 #include "platform/scheduler/CancellableTaskFactory.h" |
| 98 #include "platform/scroll/ScrollAnimatorBase.h" | 98 #include "platform/scroll/ScrollAnimatorBase.h" |
| 99 #include "platform/scroll/ScrollbarTheme.h" |
| 99 #include "platform/text/TextStream.h" | 100 #include "platform/text/TextStream.h" |
| 100 #include "public/platform/WebDisplayItemList.h" | 101 #include "public/platform/WebDisplayItemList.h" |
| 101 #include "public/platform/WebFrameScheduler.h" | 102 #include "public/platform/WebFrameScheduler.h" |
| 102 #include "wtf/CurrentTime.h" | 103 #include "wtf/CurrentTime.h" |
| 103 #include "wtf/StdLibExtras.h" | 104 #include "wtf/StdLibExtras.h" |
| 104 #include "wtf/TemporaryChange.h" | 105 #include "wtf/TemporaryChange.h" |
| 105 | 106 |
| 106 namespace blink { | 107 namespace blink { |
| 107 | 108 |
| 108 using namespace HTMLNames; | 109 using namespace HTMLNames; |
| (...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 502 } | 503 } |
| 503 | 504 |
| 504 PassRefPtrWillBeRawPtr<Scrollbar> FrameView::createScrollbar(ScrollbarOrientatio
n orientation) | 505 PassRefPtrWillBeRawPtr<Scrollbar> FrameView::createScrollbar(ScrollbarOrientatio
n orientation) |
| 505 { | 506 { |
| 506 Element* customScrollbarElement = nullptr; | 507 Element* customScrollbarElement = nullptr; |
| 507 LocalFrame* customScrollbarFrame = nullptr; | 508 LocalFrame* customScrollbarFrame = nullptr; |
| 508 if (shouldUseCustomScrollbars(customScrollbarElement, customScrollbarFrame)) | 509 if (shouldUseCustomScrollbars(customScrollbarElement, customScrollbarFrame)) |
| 509 return LayoutScrollbar::createCustomScrollbar(this, orientation, customS
crollbarElement, customScrollbarFrame); | 510 return LayoutScrollbar::createCustomScrollbar(this, orientation, customS
crollbarElement, customScrollbarFrame); |
| 510 | 511 |
| 511 // Nobody set a custom style, so we just use a native scrollbar. | 512 // Nobody set a custom style, so we just use a native scrollbar. |
| 512 return Scrollbar::create(this, orientation, RegularScrollbar); | 513 return Scrollbar::create(this, orientation, RegularScrollbar, &frame().page(
)->chromeClient()); |
| 513 } | 514 } |
| 514 | 515 |
| 515 void FrameView::setContentsSize(const IntSize& size) | 516 void FrameView::setContentsSize(const IntSize& size) |
| 516 { | 517 { |
| 517 if (size == contentsSize()) | 518 if (size == contentsSize()) |
| 518 return; | 519 return; |
| 519 | 520 |
| 520 m_contentsSize = size; | 521 m_contentsSize = size; |
| 521 updateScrollbars(scrollOffsetDouble()); | 522 updateScrollbars(scrollOffsetDouble()); |
| 522 ScrollableArea::contentsResized(); | 523 ScrollableArea::contentsResized(); |
| (...skipping 2703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3226 if (hScroll == ScrollbarAuto) | 3227 if (hScroll == ScrollbarAuto) |
| 3227 newHasHorizontalScrollbar = false; | 3228 newHasHorizontalScrollbar = false; |
| 3228 if (vScroll == ScrollbarAuto) | 3229 if (vScroll == ScrollbarAuto) |
| 3229 newHasVerticalScrollbar = false; | 3230 newHasVerticalScrollbar = false; |
| 3230 } | 3231 } |
| 3231 } | 3232 } |
| 3232 | 3233 |
| 3233 void FrameView::updateScrollbarGeometry() | 3234 void FrameView::updateScrollbarGeometry() |
| 3234 { | 3235 { |
| 3235 if (m_horizontalScrollbar) { | 3236 if (m_horizontalScrollbar) { |
| 3237 int thickness = m_horizontalScrollbar->scrollbarThickness(); |
| 3236 int clientWidth = visibleWidth(); | 3238 int clientWidth = visibleWidth(); |
| 3237 IntRect oldRect(m_horizontalScrollbar->frameRect()); | 3239 IntRect oldRect(m_horizontalScrollbar->frameRect()); |
| 3238 IntRect hBarRect((shouldPlaceVerticalScrollbarOnLeft() && m_verticalScro
llbar) ? m_verticalScrollbar->width() : 0, | 3240 IntRect hBarRect((shouldPlaceVerticalScrollbarOnLeft() && m_verticalScro
llbar) ? m_verticalScrollbar->width() : 0, |
| 3239 height() - m_horizontalScrollbar->height(), | 3241 height() - thickness, |
| 3240 width() - (m_verticalScrollbar ? m_verticalScrollbar->width() : 0), | 3242 width() - (m_verticalScrollbar ? m_verticalScrollbar->width() : 0), |
| 3241 m_horizontalScrollbar->height()); | 3243 thickness); |
| 3242 m_horizontalScrollbar->setFrameRect(adjustScrollbarRectForResizer(hBarRe
ct, *m_horizontalScrollbar)); | 3244 m_horizontalScrollbar->setFrameRect(adjustScrollbarRectForResizer(hBarRe
ct, *m_horizontalScrollbar)); |
| 3243 if (oldRect != m_horizontalScrollbar->frameRect()) | 3245 if (oldRect != m_horizontalScrollbar->frameRect()) |
| 3244 setScrollbarNeedsPaintInvalidation(HorizontalScrollbar); | 3246 setScrollbarNeedsPaintInvalidation(HorizontalScrollbar); |
| 3245 | 3247 |
| 3246 m_horizontalScrollbar->setEnabled(contentsWidth() > clientWidth); | 3248 m_horizontalScrollbar->setEnabled(contentsWidth() > clientWidth); |
| 3247 m_horizontalScrollbar->setProportion(clientWidth, contentsWidth()); | 3249 m_horizontalScrollbar->setProportion(clientWidth, contentsWidth()); |
| 3248 m_horizontalScrollbar->offsetDidChange(); | 3250 m_horizontalScrollbar->offsetDidChange(); |
| 3249 } | 3251 } |
| 3250 | 3252 |
| 3251 if (m_verticalScrollbar) { | 3253 if (m_verticalScrollbar) { |
| 3254 int thickness = m_verticalScrollbar->scrollbarThickness(); |
| 3252 int clientHeight = visibleHeight(); | 3255 int clientHeight = visibleHeight(); |
| 3253 IntRect oldRect(m_verticalScrollbar->frameRect()); | 3256 IntRect oldRect(m_verticalScrollbar->frameRect()); |
| 3254 IntRect vBarRect(shouldPlaceVerticalScrollbarOnLeft() ? 0 : (width() - m
_verticalScrollbar->width()), | 3257 IntRect vBarRect(shouldPlaceVerticalScrollbarOnLeft() ? 0 : (width() - t
hickness), |
| 3255 0, | 3258 0, |
| 3256 m_verticalScrollbar->width(), | 3259 thickness, |
| 3257 height() - (m_horizontalScrollbar ? m_horizontalScrollbar->height()
: 0)); | 3260 height() - (m_horizontalScrollbar ? m_horizontalScrollbar->height()
: 0)); |
| 3258 m_verticalScrollbar->setFrameRect(adjustScrollbarRectForResizer(vBarRect
, *m_verticalScrollbar)); | 3261 m_verticalScrollbar->setFrameRect(adjustScrollbarRectForResizer(vBarRect
, *m_verticalScrollbar)); |
| 3259 if (oldRect != m_verticalScrollbar->frameRect()) | 3262 if (oldRect != m_verticalScrollbar->frameRect()) |
| 3260 setScrollbarNeedsPaintInvalidation(VerticalScrollbar); | 3263 setScrollbarNeedsPaintInvalidation(VerticalScrollbar); |
| 3261 | 3264 |
| 3262 m_verticalScrollbar->setEnabled(contentsHeight() > clientHeight); | 3265 m_verticalScrollbar->setEnabled(contentsHeight() > clientHeight); |
| 3263 m_verticalScrollbar->setProportion(clientHeight, contentsHeight()); | 3266 m_verticalScrollbar->setProportion(clientHeight, contentsHeight()); |
| 3264 m_verticalScrollbar->offsetDidChange(); | 3267 m_verticalScrollbar->offsetDidChange(); |
| 3265 } | 3268 } |
| 3266 } | 3269 } |
| (...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4024 return m_hiddenForThrottling && m_crossOriginForThrottling; | 4027 return m_hiddenForThrottling && m_crossOriginForThrottling; |
| 4025 } | 4028 } |
| 4026 | 4029 |
| 4027 LayoutBox& FrameView::boxForScrollControlPaintInvalidation() const | 4030 LayoutBox& FrameView::boxForScrollControlPaintInvalidation() const |
| 4028 { | 4031 { |
| 4029 ASSERT(layoutView()); | 4032 ASSERT(layoutView()); |
| 4030 return *layoutView(); | 4033 return *layoutView(); |
| 4031 } | 4034 } |
| 4032 | 4035 |
| 4033 } // namespace blink | 4036 } // namespace blink |
| OLD | NEW |