diff options
Diffstat (limited to 'WebCore')
-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 |