OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2000 Dirk Mueller (mueller@kde.org) | 4 * (C) 2000 Dirk Mueller (mueller@kde.org) |
5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) | 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) |
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv
ed. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv
ed. |
7 * Copyright (C) 2009 Google Inc. All rights reserved. | 7 * Copyright (C) 2009 Google Inc. All rights reserved. |
8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
9 * | 9 * |
10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
(...skipping 2009 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2020 // Clearing these bits is required to avoid leaving stale renderers. | 2020 // Clearing these bits is required to avoid leaving stale renderers. |
2021 // FIXME: We shouldn't need that hack if our logic was totally correct. | 2021 // FIXME: We shouldn't need that hack if our logic was totally correct. |
2022 if (diff == StyleDifferenceLayout || diff == StyleDifferenceLayoutPositi
onedMovementOnly) { | 2022 if (diff == StyleDifferenceLayout || diff == StyleDifferenceLayoutPositi
onedMovementOnly) { |
2023 setFloating(false); | 2023 setFloating(false); |
2024 clearPositionedState(); | 2024 clearPositionedState(); |
2025 } | 2025 } |
2026 } else | 2026 } else |
2027 s_affectsParentBlock = false; | 2027 s_affectsParentBlock = false; |
2028 | 2028 |
2029 if (view()->frameView()) { | 2029 if (view()->frameView()) { |
2030 bool newStyleSlowScroll = newStyle && newStyle->hasFixedBackgroundImage(
); | 2030 bool shouldBlitOnFixedBackgroundImage = false; |
2031 bool oldStyleSlowScroll = m_style && m_style->hasFixedBackgroundImage(); | 2031 #if ENABLE(FAST_MOBILE_SCROLLING) |
| 2032 // On low-powered/mobile devices, preventing blitting on a scroll can ca
use noticeable delays |
| 2033 // when scrolling a page with a fixed background image. As an optimizati
on, assuming there are |
| 2034 // no fixed positoned elements on the page, we can acclerate scrolling (
via blitting) if we |
| 2035 // ignore the CSS property "background-attachment: fixed". |
| 2036 shouldBlitOnFixedBackgroundImage = true; |
| 2037 #endif |
| 2038 |
| 2039 bool newStyleSlowScroll = newStyle && !shouldBlitOnFixedBackgroundImage
&& newStyle->hasFixedBackgroundImage(); |
| 2040 bool oldStyleSlowScroll = m_style && !shouldBlitOnFixedBackgroundImage &
& m_style->hasFixedBackgroundImage(); |
2032 | 2041 |
2033 bool drawsRootBackground = isRoot() || (isBody() && !rendererHasBackgrou
nd(document().documentElement()->renderer())); | 2042 bool drawsRootBackground = isRoot() || (isBody() && !rendererHasBackgrou
nd(document().documentElement()->renderer())); |
2034 if (drawsRootBackground) { | 2043 if (drawsRootBackground && !shouldBlitOnFixedBackgroundImage) { |
2035 if (view()->compositor()->supportsFixedRootBackgroundCompositing())
{ | 2044 if (view()->compositor()->supportsFixedRootBackgroundCompositing())
{ |
2036 if (newStyleSlowScroll && newStyle->hasEntirelyFixedBackground()
) | 2045 if (newStyleSlowScroll && newStyle->hasEntirelyFixedBackground()
) |
2037 newStyleSlowScroll = false; | 2046 newStyleSlowScroll = false; |
2038 | 2047 |
2039 if (oldStyleSlowScroll && m_style->hasEntirelyFixedBackground()) | 2048 if (oldStyleSlowScroll && m_style->hasEntirelyFixedBackground()) |
2040 oldStyleSlowScroll = false; | 2049 oldStyleSlowScroll = false; |
2041 } | 2050 } |
2042 } | 2051 } |
2043 | 2052 |
2044 if (oldStyleSlowScroll != newStyleSlowScroll) { | 2053 if (oldStyleSlowScroll != newStyleSlowScroll) { |
(...skipping 1346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3391 { | 3400 { |
3392 if (object1) { | 3401 if (object1) { |
3393 const WebCore::RenderObject* root = object1; | 3402 const WebCore::RenderObject* root = object1; |
3394 while (root->parent()) | 3403 while (root->parent()) |
3395 root = root->parent(); | 3404 root = root->parent(); |
3396 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); | 3405 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); |
3397 } | 3406 } |
3398 } | 3407 } |
3399 | 3408 |
3400 #endif | 3409 #endif |
OLD | NEW |