| 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 3320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3331 | 3331 |
| 3332 void FrameView::addChild(Widget* child) | 3332 void FrameView::addChild(Widget* child) |
| 3333 { | 3333 { |
| 3334 ASSERT(child != this && !child->parent()); | 3334 ASSERT(child != this && !child->parent()); |
| 3335 child->setParent(this); | 3335 child->setParent(this); |
| 3336 m_children.add(child); | 3336 m_children.add(child); |
| 3337 } | 3337 } |
| 3338 | 3338 |
| 3339 void FrameView::setHasHorizontalScrollbar(bool hasBar) | 3339 void FrameView::setHasHorizontalScrollbar(bool hasBar) |
| 3340 { | 3340 { |
| 3341 DCHECK(m_frame->settings()); |
| 3342 if (m_frame->settings()->hideScrollbars()) |
| 3343 hasBar = false; |
| 3344 |
| 3341 if (hasBar == !!m_horizontalScrollbar) | 3345 if (hasBar == !!m_horizontalScrollbar) |
| 3342 return; | 3346 return; |
| 3343 | 3347 |
| 3344 if (hasBar) { | 3348 if (hasBar) { |
| 3345 m_horizontalScrollbar = createScrollbar(HorizontalScrollbar); | 3349 m_horizontalScrollbar = createScrollbar(HorizontalScrollbar); |
| 3346 addChild(m_horizontalScrollbar.get()); | 3350 addChild(m_horizontalScrollbar.get()); |
| 3347 didAddScrollbar(*m_horizontalScrollbar, HorizontalScrollbar); | 3351 didAddScrollbar(*m_horizontalScrollbar, HorizontalScrollbar); |
| 3348 m_horizontalScrollbar->styleChanged(); | 3352 m_horizontalScrollbar->styleChanged(); |
| 3349 } else { | 3353 } else { |
| 3350 willRemoveScrollbar(*m_horizontalScrollbar, HorizontalScrollbar); | 3354 willRemoveScrollbar(*m_horizontalScrollbar, HorizontalScrollbar); |
| 3351 // If the scrollbar has been marked as overlapping the window resizer, | 3355 // If the scrollbar has been marked as overlapping the window resizer, |
| 3352 // then its removal should reduce the count. | 3356 // then its removal should reduce the count. |
| 3353 if (m_horizontalScrollbar->overlapsResizer()) | 3357 if (m_horizontalScrollbar->overlapsResizer()) |
| 3354 adjustScrollbarsAvoidingResizerCount(-1); | 3358 adjustScrollbarsAvoidingResizerCount(-1); |
| 3355 removeChild(m_horizontalScrollbar.get()); | 3359 removeChild(m_horizontalScrollbar.get()); |
| 3356 m_horizontalScrollbar->disconnectFromScrollableArea(); | 3360 m_horizontalScrollbar->disconnectFromScrollableArea(); |
| 3357 m_horizontalScrollbar = nullptr; | 3361 m_horizontalScrollbar = nullptr; |
| 3358 } | 3362 } |
| 3359 | 3363 |
| 3360 setScrollCornerNeedsPaintInvalidation(); | 3364 setScrollCornerNeedsPaintInvalidation(); |
| 3361 } | 3365 } |
| 3362 | 3366 |
| 3363 void FrameView::setHasVerticalScrollbar(bool hasBar) | 3367 void FrameView::setHasVerticalScrollbar(bool hasBar) |
| 3364 { | 3368 { |
| 3369 DCHECK(m_frame->settings()); |
| 3370 if (m_frame->settings()->hideScrollbars()) |
| 3371 hasBar = false; |
| 3372 |
| 3365 if (hasBar == !!m_verticalScrollbar) | 3373 if (hasBar == !!m_verticalScrollbar) |
| 3366 return; | 3374 return; |
| 3367 | 3375 |
| 3368 if (hasBar) { | 3376 if (hasBar) { |
| 3369 m_verticalScrollbar = createScrollbar(VerticalScrollbar); | 3377 m_verticalScrollbar = createScrollbar(VerticalScrollbar); |
| 3370 addChild(m_verticalScrollbar.get()); | 3378 addChild(m_verticalScrollbar.get()); |
| 3371 didAddScrollbar(*m_verticalScrollbar, VerticalScrollbar); | 3379 didAddScrollbar(*m_verticalScrollbar, VerticalScrollbar); |
| 3372 m_verticalScrollbar->styleChanged(); | 3380 m_verticalScrollbar->styleChanged(); |
| 3373 } else { | 3381 } else { |
| 3374 willRemoveScrollbar(*m_verticalScrollbar, VerticalScrollbar); | 3382 willRemoveScrollbar(*m_verticalScrollbar, VerticalScrollbar); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 3392 // If the page's overflow setting has disabled scrolling, do not allow anyth
ing to override that setting. | 3400 // If the page's overflow setting has disabled scrolling, do not allow anyth
ing to override that setting. |
| 3393 // http://crbug.com/426447 | 3401 // http://crbug.com/426447 |
| 3394 LayoutObject* viewport = viewportLayoutObject(); | 3402 LayoutObject* viewport = viewportLayoutObject(); |
| 3395 if (viewport && !shouldIgnoreOverflowHidden()) { | 3403 if (viewport && !shouldIgnoreOverflowHidden()) { |
| 3396 if (viewport->style()->overflowX() == OverflowHidden) | 3404 if (viewport->style()->overflowX() == OverflowHidden) |
| 3397 horizontalMode = ScrollbarAlwaysOff; | 3405 horizontalMode = ScrollbarAlwaysOff; |
| 3398 if (viewport->style()->overflowY() == OverflowHidden) | 3406 if (viewport->style()->overflowY() == OverflowHidden) |
| 3399 verticalMode = ScrollbarAlwaysOff; | 3407 verticalMode = ScrollbarAlwaysOff; |
| 3400 } | 3408 } |
| 3401 | 3409 |
| 3402 DCHECK(m_frame->settings()); | |
| 3403 if (m_frame->settings()->hideScrollbars()) { | |
| 3404 horizontalMode = ScrollbarAlwaysOff; | |
| 3405 verticalMode = ScrollbarAlwaysOff; | |
| 3406 } | |
| 3407 | |
| 3408 if (horizontalMode != horizontalScrollbarMode() && !m_horizontalScrollbarLoc
k) { | 3410 if (horizontalMode != horizontalScrollbarMode() && !m_horizontalScrollbarLoc
k) { |
| 3409 m_horizontalScrollbarMode = horizontalMode; | 3411 m_horizontalScrollbarMode = horizontalMode; |
| 3410 needsUpdate = true; | 3412 needsUpdate = true; |
| 3411 } | 3413 } |
| 3412 | 3414 |
| 3413 if (verticalMode != verticalScrollbarMode() && !m_verticalScrollbarLock) { | 3415 if (verticalMode != verticalScrollbarMode() && !m_verticalScrollbarLock) { |
| 3414 m_verticalScrollbarMode = verticalMode; | 3416 m_verticalScrollbarMode = verticalMode; |
| 3415 needsUpdate = true; | 3417 needsUpdate = true; |
| 3416 } | 3418 } |
| 3417 | 3419 |
| (...skipping 1001 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4419 } | 4421 } |
| 4420 | 4422 |
| 4421 bool FrameView::canThrottleRendering() const | 4423 bool FrameView::canThrottleRendering() const |
| 4422 { | 4424 { |
| 4423 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled()) | 4425 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled()) |
| 4424 return false; | 4426 return false; |
| 4425 return m_subtreeThrottled || (m_hiddenForThrottling && m_crossOriginForThrot
tling); | 4427 return m_subtreeThrottled || (m_hiddenForThrottling && m_crossOriginForThrot
tling); |
| 4426 } | 4428 } |
| 4427 | 4429 |
| 4428 } // namespace blink | 4430 } // namespace blink |
| OLD | NEW |