| 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 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 if (Scrollbar* horizontalScrollbar = this->horizontalScrollbar()) | 275 if (Scrollbar* horizontalScrollbar = this->horizontalScrollbar()) |
| 276 horizontalScrollbar->offsetDidChange(); | 276 horizontalScrollbar->offsetDidChange(); |
| 277 if (Scrollbar* verticalScrollbar = this->verticalScrollbar()) | 277 if (Scrollbar* verticalScrollbar = this->verticalScrollbar()) |
| 278 verticalScrollbar->offsetDidChange(); | 278 verticalScrollbar->offsetDidChange(); |
| 279 | 279 |
| 280 if (scrollPositionDouble() != oldPosition) { | 280 if (scrollPositionDouble() != oldPosition) { |
| 281 // FIXME: Pass in DoubleSize. crbug.com/414283. | 281 // FIXME: Pass in DoubleSize. crbug.com/414283. |
| 282 scrollAnimator().notifyContentAreaScrolled(toFloatSize(scrollPositionDou
ble() - oldPosition)); | 282 scrollAnimator().notifyContentAreaScrolled(toFloatSize(scrollPositionDou
ble() - oldPosition)); |
| 283 } | 283 } |
| 284 | 284 |
| 285 scrollAnimator().setCurrentPosition(toFloatPoint(position)); | 285 scrollAnimator().setCurrentPosition(toFloatPoint(clampScrollPosition(positio
n))); |
| 286 } | 286 } |
| 287 | 287 |
| 288 bool ScrollableArea::scrollBehaviorFromString(const String& behaviorString, Scro
llBehavior& behavior) | 288 bool ScrollableArea::scrollBehaviorFromString(const String& behaviorString, Scro
llBehavior& behavior) |
| 289 { | 289 { |
| 290 if (behaviorString == "auto") | 290 if (behaviorString == "auto") |
| 291 behavior = ScrollBehaviorAuto; | 291 behavior = ScrollBehaviorAuto; |
| 292 else if (behaviorString == "instant") | 292 else if (behaviorString == "instant") |
| 293 behavior = ScrollBehaviorInstant; | 293 behavior = ScrollBehaviorInstant; |
| 294 else if (behaviorString == "smooth") | 294 else if (behaviorString == "smooth") |
| 295 behavior = ScrollBehaviorSmooth; | 295 behavior = ScrollBehaviorSmooth; |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 611 std::max(0, size.height() - horizontalScrollbarHeight())); | 611 std::max(0, size.height() - horizontalScrollbarHeight())); |
| 612 } | 612 } |
| 613 | 613 |
| 614 DEFINE_TRACE(ScrollableArea) | 614 DEFINE_TRACE(ScrollableArea) |
| 615 { | 615 { |
| 616 visitor->trace(m_scrollAnimator); | 616 visitor->trace(m_scrollAnimator); |
| 617 visitor->trace(m_programmaticScrollAnimator); | 617 visitor->trace(m_programmaticScrollAnimator); |
| 618 } | 618 } |
| 619 | 619 |
| 620 } // namespace blink | 620 } // namespace blink |
| OLD | NEW |