| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights |
| 3 * reserved. | 3 * reserved. |
| 4 * | 4 * |
| 5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. | 5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. |
| 6 * | 6 * |
| 7 * Other contributors: | 7 * Other contributors: |
| 8 * Robert O'Callahan <roc+@cs.cmu.edu> | 8 * Robert O'Callahan <roc+@cs.cmu.edu> |
| 9 * David Baron <dbaron@fas.harvard.edu> | 9 * David Baron <dbaron@fas.harvard.edu> |
| 10 * Christian Biesinger <cbiesinger@gmail.com> | 10 * Christian Biesinger <cbiesinger@gmail.com> |
| (...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 bool has_horizontal_bar = HorizontalScrollbar(); | 308 bool has_horizontal_bar = HorizontalScrollbar(); |
| 309 bool has_vertical_bar = VerticalScrollbar(); | 309 bool has_vertical_bar = VerticalScrollbar(); |
| 310 bool has_resizer = Box().Style()->Resize() != RESIZE_NONE; | 310 bool has_resizer = Box().Style()->Resize() != RESIZE_NONE; |
| 311 if ((has_horizontal_bar && has_vertical_bar) || | 311 if ((has_horizontal_bar && has_vertical_bar) || |
| 312 (has_resizer && (has_horizontal_bar || has_vertical_bar))) | 312 (has_resizer && (has_horizontal_bar || has_vertical_bar))) |
| 313 return CornerRect(Box(), HorizontalScrollbar(), VerticalScrollbar(), | 313 return CornerRect(Box(), HorizontalScrollbar(), VerticalScrollbar(), |
| 314 Box().PixelSnappedBorderBoxRect()); | 314 Box().PixelSnappedBorderBoxRect()); |
| 315 return IntRect(); | 315 return IntRect(); |
| 316 } | 316 } |
| 317 | 317 |
| 318 IntRect PaintLayerScrollableArea::ConvertFromScrollbarToContainingFrameViewBase( | |
| 319 const Scrollbar& scrollbar, | |
| 320 const IntRect& scrollbar_rect) const { | |
| 321 LayoutView* view = Box().View(); | |
| 322 if (!view) | |
| 323 return scrollbar_rect; | |
| 324 | |
| 325 IntRect rect = scrollbar_rect; | |
| 326 rect.Move(ScrollbarOffset(scrollbar)); | |
| 327 | |
| 328 return view->GetFrameView()->ConvertFromLayoutItem(LayoutBoxItem(&Box()), | |
| 329 rect); | |
| 330 } | |
| 331 | |
| 332 IntRect PaintLayerScrollableArea::ConvertFromContainingFrameViewBaseToScrollbar( | |
| 333 const Scrollbar& scrollbar, | |
| 334 const IntRect& parent_rect) const { | |
| 335 LayoutView* view = Box().View(); | |
| 336 if (!view) | |
| 337 return parent_rect; | |
| 338 | |
| 339 IntRect rect = view->GetFrameView()->ConvertToLayoutItem( | |
| 340 LayoutBoxItem(&Box()), parent_rect); | |
| 341 rect.Move(-ScrollbarOffset(scrollbar)); | |
| 342 return rect; | |
| 343 } | |
| 344 | |
| 345 IntPoint | |
| 346 PaintLayerScrollableArea::ConvertFromScrollbarToContainingFrameViewBase( | |
| 347 const Scrollbar& scrollbar, | |
| 348 const IntPoint& scrollbar_point) const { | |
| 349 LayoutView* view = Box().View(); | |
| 350 if (!view) | |
| 351 return scrollbar_point; | |
| 352 | |
| 353 IntPoint point = scrollbar_point; | |
| 354 point.Move(ScrollbarOffset(scrollbar)); | |
| 355 return view->GetFrameView()->ConvertFromLayoutItem(LayoutBoxItem(&Box()), | |
| 356 point); | |
| 357 } | |
| 358 | |
| 359 IntPoint | 318 IntPoint |
| 360 PaintLayerScrollableArea::ConvertFromContainingFrameViewBaseToScrollbar( | 319 PaintLayerScrollableArea::ConvertFromContainingFrameViewBaseToScrollbar( |
| 361 const Scrollbar& scrollbar, | 320 const Scrollbar& scrollbar, |
| 362 const IntPoint& parent_point) const { | 321 const IntPoint& parent_point) const { |
| 363 LayoutView* view = Box().View(); | 322 LayoutView* view = Box().View(); |
| 364 if (!view) | 323 if (!view) |
| 365 return parent_point; | 324 return parent_point; |
| 366 | 325 |
| 367 IntPoint point = view->GetFrameView()->ConvertToLayoutItem( | 326 IntPoint point = view->GetFrameView()->ConvertToLayoutItem( |
| 368 LayoutBoxItem(&Box()), parent_point); | 327 LayoutBoxItem(&Box()), parent_point); |
| (...skipping 1768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2137 | 2096 |
| 2138 void PaintLayerScrollableArea::DelayScrollOffsetClampScope:: | 2097 void PaintLayerScrollableArea::DelayScrollOffsetClampScope:: |
| 2139 ClampScrollableAreas() { | 2098 ClampScrollableAreas() { |
| 2140 for (auto& scrollable_area : *needs_clamp_) | 2099 for (auto& scrollable_area : *needs_clamp_) |
| 2141 scrollable_area->ClampScrollOffsetAfterOverflowChange(); | 2100 scrollable_area->ClampScrollOffsetAfterOverflowChange(); |
| 2142 delete needs_clamp_; | 2101 delete needs_clamp_; |
| 2143 needs_clamp_ = nullptr; | 2102 needs_clamp_ = nullptr; |
| 2144 } | 2103 } |
| 2145 | 2104 |
| 2146 } // namespace blink | 2105 } // namespace blink |
| OLD | NEW |