diff options
author | Patrick Scott <phanna@android.com> | 2010-07-23 11:08:20 -0400 |
---|---|---|
committer | Patrick Scott <phanna@android.com> | 2010-07-23 11:32:25 -0400 |
commit | d0a75cfb0ee41e0d0e09d99f8c47dfe8bafe6873 (patch) | |
tree | 8eb8a402c3a9a3a66380f8833e1e61526ccb35aa /WebCore/rendering | |
parent | a06658390000824241bdbfe757e1781a90333a95 (diff) | |
download | external_webkit-d0a75cfb0ee41e0d0e09d99f8c47dfe8bafe6873.zip external_webkit-d0a75cfb0ee41e0d0e09d99f8c47dfe8bafe6873.tar.gz external_webkit-d0a75cfb0ee41e0d0e09d99f8c47dfe8bafe6873.tar.bz2 |
Fix page cycler crashes.
Bug: 2862822
Change-Id: I9de300517eaa2bd4027608d6bae093bf5a1072e0
Diffstat (limited to 'WebCore/rendering')
-rw-r--r-- | WebCore/rendering/RenderLayer.cpp | 9 | ||||
-rw-r--r-- | WebCore/rendering/RenderLayerCompositor.cpp | 9 |
2 files changed, 10 insertions, 8 deletions
diff --git a/WebCore/rendering/RenderLayer.cpp b/WebCore/rendering/RenderLayer.cpp index 75daa94..78fddfd 100644 --- a/WebCore/rendering/RenderLayer.cpp +++ b/WebCore/rendering/RenderLayer.cpp @@ -3758,15 +3758,16 @@ bool RenderLayer::shouldBeNormalFlowOnly() const } #if ENABLE(ANDROID_OVERFLOW_SCROLL) -static bool hasOverflowScroll(const RenderLayer* l) +static bool hasOverflowScroll(const RenderLayer* layer) { - RenderLayer* layer = const_cast<RenderLayer*>(l); RenderBox* box = layer->renderBox(); + if (!box || !box->node()->hasTagName(HTMLNames::divTag)) + return false; EOverflow x = box->style()->overflowX(); EOverflow y = box->style()->overflowY(); return (x == OAUTO || x == OSCROLL || y == OAUTO || y == OSCROLL) && - (layer->scrollWidth() > box->clientWidth() || - layer->scrollHeight() > box->clientHeight()); + (box->scrollWidth() > box->clientWidth() || + box->scrollHeight() > box->clientHeight()); } #endif diff --git a/WebCore/rendering/RenderLayerCompositor.cpp b/WebCore/rendering/RenderLayerCompositor.cpp index 1a28c37..fe0d4e8 100644 --- a/WebCore/rendering/RenderLayerCompositor.cpp +++ b/WebCore/rendering/RenderLayerCompositor.cpp @@ -1154,14 +1154,15 @@ bool RenderLayerCompositor::requiresCompositingForMobileSites(const RenderLayer* #endif #if ENABLE(ANDROID_OVERFLOW_SCROLL) -static bool requiresCompositingForOverflowScroll(const RenderLayer* l) { - RenderLayer* layer = const_cast<RenderLayer*>(l); +static bool requiresCompositingForOverflowScroll(const RenderLayer* layer) { RenderBox* box = layer->renderBox(); + if (!box || !box->node()->hasTagName(HTMLNames::divTag)) + return false; EOverflow x = box->style()->overflowX(); EOverflow y = box->style()->overflowY(); return (x == OAUTO || x == OSCROLL || y == OAUTO || y == OSCROLL) && - (layer->scrollWidth() > box->contentWidth() || - layer->scrollHeight() > box->contentHeight()); + (box->scrollWidth() > box->clientWidth() || + box->scrollHeight() > box->clientHeight()); } #endif |