summaryrefslogtreecommitdiffstats
path: root/WebCore/rendering
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/rendering')
-rw-r--r--WebCore/rendering/RenderLayer.cpp19
-rw-r--r--WebCore/rendering/RenderLayer.h16
-rw-r--r--WebCore/rendering/RenderLayerCompositor.cpp5
3 files changed, 34 insertions, 6 deletions
diff --git a/WebCore/rendering/RenderLayer.cpp b/WebCore/rendering/RenderLayer.cpp
index 4221816..9d894af 100644
--- a/WebCore/rendering/RenderLayer.cpp
+++ b/WebCore/rendering/RenderLayer.cpp
@@ -2945,6 +2945,14 @@ RenderLayer* RenderLayer::hitTestLayer(RenderLayer* rootLayer, RenderLayer* cont
candidateLayer = hitLayer;
}
+#if ENABLE(ANDROID_OVERFLOW_SCROLL)
+ if (hasOverflowParent()) {
+ ClipRects clipRects;
+ calculateClipRects(rootLayer, clipRects, useTemporaryClipRects);
+ fgRect.intersect(clipRects.hitTestClip());
+ bgRect.intersect(clipRects.hitTestClip());
+ }
+#endif
// Next we want to see if the mouse pos is inside the child RenderObjects of the layer.
if (fgRect.intersects(hitTestArea) && isSelfPaintingLayer()) {
// Hit test with a temporary HitTestResult, because we only want to commit to 'result' if we know we're frontmost.
@@ -3223,12 +3231,12 @@ void RenderLayer::calculateClipRects(const RenderLayer* rootLayer, ClipRects& cl
if (renderer()->hasOverflowClip()) {
IntRect newOverflowClip = toRenderBox(renderer())->overflowClipRect(x, y);
#if ENABLE(ANDROID_OVERFLOW_SCROLL)
+ clipRects.setHitTestClip(intersection(newOverflowClip, clipRects.hitTestClip()));
if (hasOverflowScroll()) {
RenderBox* box = toRenderBox(renderer());
newOverflowClip =
- IntRect(x, y,
- box->borderLeft() + box->borderRight() + m_scrollWidth,
- box->borderTop() + box->borderBottom() + m_scrollHeight);
+ IntRect(x + box->borderLeft(), y + box->borderTop(),
+ m_scrollWidth, m_scrollHeight);
}
#endif
clipRects.setOverflowClipRect(intersection(newOverflowClip, clipRects.overflowClipRect()));
@@ -3298,9 +3306,8 @@ void RenderLayer::calculateRects(const RenderLayer* rootLayer, const IntRect& pa
// Use the entire foreground rectangle to record the contents.
RenderBox* box = toRenderBox(renderer());
foregroundRect =
- IntRect(x, y,
- box->borderLeft() + box->borderRight() + m_scrollWidth,
- box->borderTop() + box->borderBottom() + m_scrollHeight);
+ IntRect(x + box->borderLeft(), y + box->borderTop(),
+ m_scrollWidth, m_scrollHeight);
} else
#endif
if (renderer()->hasOverflowClip())
diff --git a/WebCore/rendering/RenderLayer.h b/WebCore/rendering/RenderLayer.h
index 6b60fe1..be3ddc6 100644
--- a/WebCore/rendering/RenderLayer.h
+++ b/WebCore/rendering/RenderLayer.h
@@ -79,6 +79,9 @@ public:
: m_overflowClipRect(r)
, m_fixedClipRect(r)
, m_posClipRect(r)
+#if ENABLE(ANDROID_OVERFLOW_SCROLL)
+ , m_hitTestClip(r)
+#endif
, m_refCnt(0)
, m_fixed(false)
{
@@ -88,6 +91,9 @@ public:
: m_overflowClipRect(other.overflowClipRect())
, m_fixedClipRect(other.fixedClipRect())
, m_posClipRect(other.posClipRect())
+#if ENABLE(ANDROID_OVERFLOW_SCROLL)
+ , m_hitTestClip(other.hitTestClip())
+#endif
, m_refCnt(0)
, m_fixed(other.fixed())
{
@@ -98,6 +104,9 @@ public:
m_overflowClipRect = r;
m_fixedClipRect = r;
m_posClipRect = r;
+#if ENABLE(ANDROID_OVERFLOW_SCROLL)
+ m_hitTestClip = r;
+#endif
m_fixed = false;
}
@@ -109,6 +118,10 @@ public:
const IntRect& posClipRect() const { return m_posClipRect; }
void setPosClipRect(const IntRect& r) { m_posClipRect = r; }
+#if ENABLE(ANDROID_OVERFLOW_SCROLL)
+ const IntRect& hitTestClip() const { return m_hitTestClip; }
+ void setHitTestClip(const IntRect& r) { m_hitTestClip = r; }
+#endif
bool fixed() const { return m_fixed; }
void setFixed(bool fixed) { m_fixed = fixed; }
@@ -149,6 +162,9 @@ private:
IntRect m_overflowClipRect;
IntRect m_fixedClipRect;
IntRect m_posClipRect;
+#if ENABLE(ANDROID_OVERFLOW_SCROLL)
+ IntRect m_hitTestClip;
+#endif
unsigned m_refCnt : 31;
bool m_fixed : 1;
};
diff --git a/WebCore/rendering/RenderLayerCompositor.cpp b/WebCore/rendering/RenderLayerCompositor.cpp
index cf75a2a..ce80e5a 100644
--- a/WebCore/rendering/RenderLayerCompositor.cpp
+++ b/WebCore/rendering/RenderLayerCompositor.cpp
@@ -1176,6 +1176,11 @@ bool RenderLayerCompositor::requiresCompositingForMobileSites(const RenderLayer*
#if ENABLE(ANDROID_OVERFLOW_SCROLL)
if (layer->hasOverflowScroll())
return true;
+ HTMLFrameOwnerElement* ownerElement = enclosingIFrameElement();
+ RenderObject* renderer = ownerElement ? ownerElement->renderer() : 0;
+ // FIXME: Disabled for now until navigation is fixed.
+ if (false && layer->isRootLayer() && renderer && renderer->isRenderIFrame())
+ return true;
#endif
#if ENABLE(COMPOSITED_FIXED_ELEMENTS)
// First, check if we are in an iframe, and if so bail out