summaryrefslogtreecommitdiff
path: root/Source/WebCore/rendering/RenderPart.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@digia.com>2013-09-13 12:51:20 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-19 20:50:05 +0200
commitd441d6f39bb846989d95bcf5caf387b42414718d (patch)
treee367e64a75991c554930278175d403c072de6bb8 /Source/WebCore/rendering/RenderPart.cpp
parent0060b2994c07842f4c59de64b5e3e430525c4b90 (diff)
downloadqtwebkit-d441d6f39bb846989d95bcf5caf387b42414718d.tar.gz
Import Qt5x2 branch of QtWebkit for Qt 5.2
Importing a new snapshot of webkit. Change-Id: I2d01ad12cdc8af8cb015387641120a9d7ea5f10c Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Diffstat (limited to 'Source/WebCore/rendering/RenderPart.cpp')
-rw-r--r--Source/WebCore/rendering/RenderPart.cpp37
1 files changed, 34 insertions, 3 deletions
diff --git a/Source/WebCore/rendering/RenderPart.cpp b/Source/WebCore/rendering/RenderPart.cpp
index 92fcf5d85..6a269efb1 100644
--- a/Source/WebCore/rendering/RenderPart.cpp
+++ b/Source/WebCore/rendering/RenderPart.cpp
@@ -28,7 +28,9 @@
#include "Frame.h"
#include "FrameView.h"
#include "HTMLFrameElementBase.h"
+#include "HitTestResult.h"
#include "PluginViewBase.h"
+#include "RenderLayer.h"
#include "RenderSVGRoot.h"
#include "RenderView.h"
@@ -78,13 +80,13 @@ bool RenderPart::requiresAcceleratedCompositing() const
// renderer and the plugin has a layer, then we need a layer. Second, if this is
// a renderer with a contentDocument and that document needs a layer, then we need
// a layer.
- if (widget() && widget()->isPluginViewBase() && static_cast<PluginViewBase*>(widget())->platformLayer())
+ if (widget() && widget()->isPluginViewBase() && toPluginViewBase(widget())->platformLayer())
return true;
if (!node() || !node()->isFrameOwnerElement())
return false;
- HTMLFrameOwnerElement* element = static_cast<HTMLFrameOwnerElement*>(node());
+ HTMLFrameOwnerElement* element = toFrameOwnerElement(node());
if (Document* contentDocument = element->contentDocument()) {
if (RenderView* view = contentDocument->renderView())
return view->usesCompositing();
@@ -105,7 +107,36 @@ RenderBox* RenderPart::embeddedContentBox() const
{
if (!node() || !widget() || !widget()->isFrameView())
return 0;
- return static_cast<FrameView*>(widget())->embeddedContentBox();
+ return toFrameView(widget())->embeddedContentBox();
+}
+
+bool RenderPart::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction action)
+{
+ if (!widget() || !widget()->isFrameView() || !request.allowsChildFrameContent())
+ return RenderWidget::nodeAtPoint(request, result, locationInContainer, accumulatedOffset, action);
+
+ FrameView* childFrameView = toFrameView(widget());
+ RenderView* childRoot = childFrameView->renderView();
+
+ if (childRoot) {
+ LayoutPoint adjustedLocation = accumulatedOffset + location();
+ LayoutPoint contentOffset = LayoutPoint(borderLeft() + paddingLeft(), borderTop() + paddingTop()) - childFrameView->scrollOffset();
+ HitTestLocation newHitTestLocation(locationInContainer, -adjustedLocation - contentOffset);
+ HitTestRequest newHitTestRequest(request.type() | HitTestRequest::ChildFrameHitTest);
+ HitTestResult childFrameResult(newHitTestLocation);
+
+ bool isInsideChildFrame = childRoot->hitTest(newHitTestRequest, newHitTestLocation, childFrameResult);
+
+ if (newHitTestLocation.isRectBasedTest())
+ result.append(childFrameResult);
+ else if (isInsideChildFrame)
+ result = childFrameResult;
+
+ if (isInsideChildFrame)
+ return true;
+ }
+
+ return RenderWidget::nodeAtPoint(request, result, locationInContainer, accumulatedOffset, action);
}
}