| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2010, Google Inc. All rights reserved. | 2 * Copyright (c) 2010, Google Inc. All rights reserved. |
| 3 * Copyright (C) 2008, 2011 Apple Inc. All Rights Reserved. | 3 * Copyright (C) 2008, 2011 Apple Inc. All Rights Reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 void ScrollableArea::scrollPositionChanged(const DoublePoint& position, ScrollTy
pe scrollType) | 237 void ScrollableArea::scrollPositionChanged(const DoublePoint& position, ScrollTy
pe scrollType) |
| 238 { | 238 { |
| 239 TRACE_EVENT0("blink", "ScrollableArea::scrollPositionChanged"); | 239 TRACE_EVENT0("blink", "ScrollableArea::scrollPositionChanged"); |
| 240 | 240 |
| 241 DoublePoint oldPosition = scrollPositionDouble(); | 241 DoublePoint oldPosition = scrollPositionDouble(); |
| 242 DoublePoint truncatedPosition = shouldUseIntegerScrollOffset() ? flooredIntP
oint(position) : position; | 242 DoublePoint truncatedPosition = shouldUseIntegerScrollOffset() ? flooredIntP
oint(position) : position; |
| 243 | 243 |
| 244 // Tell the derived class to scroll its contents. | 244 // Tell the derived class to scroll its contents. |
| 245 setScrollOffset(truncatedPosition, scrollType); | 245 setScrollOffset(truncatedPosition, scrollType); |
| 246 | 246 |
| 247 Scrollbar* verticalScrollbar = this->verticalScrollbar(); | |
| 248 | |
| 249 // Tell the scrollbars to update their thumb postions. | 247 // Tell the scrollbars to update their thumb postions. |
| 250 if (Scrollbar* horizontalScrollbar = this->horizontalScrollbar()) { | 248 // If the scrollbar does not have its own layer, it must always be |
| 249 // invalidated to reflect the new thumb position, even if the theme did not |
| 250 // invalidate any individual part. |
| 251 if (Scrollbar* horizontalScrollbar = this->horizontalScrollbar()) |
| 251 horizontalScrollbar->offsetDidChange(); | 252 horizontalScrollbar->offsetDidChange(); |
| 252 if (horizontalScrollbar->isOverlayScrollbar() && !hasLayerForHorizontalS
crollbar()) | 253 if (Scrollbar* verticalScrollbar = this->verticalScrollbar()) |
| 253 setScrollbarNeedsPaintInvalidation(HorizontalScrollbar); | |
| 254 } | |
| 255 if (verticalScrollbar) { | |
| 256 verticalScrollbar->offsetDidChange(); | 254 verticalScrollbar->offsetDidChange(); |
| 257 if (verticalScrollbar->isOverlayScrollbar() && !hasLayerForVerticalScrol
lbar()) | |
| 258 setScrollbarNeedsPaintInvalidation(VerticalScrollbar); | |
| 259 } | |
| 260 | 255 |
| 261 if (scrollPositionDouble() != oldPosition) { | 256 if (scrollPositionDouble() != oldPosition) { |
| 262 // FIXME: Pass in DoubleSize. crbug.com/414283. | 257 // FIXME: Pass in DoubleSize. crbug.com/414283. |
| 263 scrollAnimator().notifyContentAreaScrolled(toFloatSize(scrollPositionDou
ble() - oldPosition)); | 258 scrollAnimator().notifyContentAreaScrolled(toFloatSize(scrollPositionDou
ble() - oldPosition)); |
| 264 } | 259 } |
| 265 | 260 |
| 266 scrollAnimator().setCurrentPosition(toFloatPoint(position)); | 261 scrollAnimator().setCurrentPosition(toFloatPoint(position)); |
| 267 } | 262 } |
| 268 | 263 |
| 269 bool ScrollableArea::scrollBehaviorFromString(const String& behaviorString, Scro
llBehavior& behavior) | 264 bool ScrollableArea::scrollBehaviorFromString(const String& behaviorString, Scro
llBehavior& behavior) |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 594 std::max(0, size.height() - horizontalScrollbarHeight)); | 589 std::max(0, size.height() - horizontalScrollbarHeight)); |
| 595 } | 590 } |
| 596 | 591 |
| 597 DEFINE_TRACE(ScrollableArea) | 592 DEFINE_TRACE(ScrollableArea) |
| 598 { | 593 { |
| 599 visitor->trace(m_scrollAnimator); | 594 visitor->trace(m_scrollAnimator); |
| 600 visitor->trace(m_programmaticScrollAnimator); | 595 visitor->trace(m_programmaticScrollAnimator); |
| 601 } | 596 } |
| 602 | 597 |
| 603 } // namespace blink | 598 } // namespace blink |
| OLD | NEW |