Reduce the use of RenderLayer outside of the rendering code
authorjchaffraix@webkit.org <jchaffraix@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 12 Apr 2012 16:02:25 +0000 (16:02 +0000)
committerjchaffraix@webkit.org <jchaffraix@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 12 Apr 2012 16:02:25 +0000 (16:02 +0000)
https://bugs.webkit.org/show_bug.cgi?id=83728

Reviewed by Simon Fraser.

Source/WebCore:

Test: fast/layers/scrollByLines-overflow-no-layer.html

This is mostly a layering violation change. This changes reduces the number of
RenderLayer use outside rendering/ by a third but there are still numerous uses.

While auditing the different uses of RenderLayer, I found a potential crasher
and fixed it which is why we have a test case.

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::visiblePositionForPoint):
* dom/Document.cpp:
(WebCore::Document::nodesFromRect):
(WebCore::Document::handleZeroPadding):
(WebCore::nodeFromPoint):
(WebCore::Document::prepareMouseEvent):
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::contains):
* page/DragController.cpp:
(WebCore::elementUnderMouse):
* page/EventHandler.cpp:
(WebCore::EventHandler::handleMouseDraggedEvent):
(WebCore::EventHandler::eventMayStartDrag):
(WebCore::EventHandler::updateSelectionForMouseDrag):
(WebCore::EventHandler::hitTestResultAtPoint):
(WebCore::EventHandler::handleWheelEvent):
(WebCore::EventHandler::hoverTimerFired):
(WebCore::EventHandler::handleDrag):
Updated these call sites to use RenderView::hitTest.

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
* page/FrameView.cpp:
(WebCore::FrameView::contentsInCompositedLayer):
(WebCore::FrameView::scrollContentsFastPath):
Updated these call sites to use RenderObject::isComposited().

* dom/Element.cpp:
(WebCore::Element::scrollByUnits):
Call directly RenderBox::scroll instead of calling the layer.
This actually fixes a crasher that slipped through the cracks.

* editing/visible_units.cpp:
* html/shadow/TextControlInnerElements.cpp:
* page/ContextMenuController.cpp:
* page/FocusController.cpp:
* page/Frame.cpp:
* page/GestureTapHighlighter.cpp:
* page/PrintContext.cpp:
* plugins/mac/PluginViewMac.mm:
Removed unneeded #include.

* plugins/gtk/PluginViewGtk.cpp:
* plugins/qt/PluginViewQt.cpp:
Replaced RenderLayer.h #include with RenderObject.h as
we use RenderObject::absoluteToLocal.

* rendering/RenderObject.cpp:
(WebCore::RenderObject::isComposited):
* rendering/RenderObject.h:
* rendering/RenderView.cpp:
(WebCore::RenderView::hitTest):
* rendering/RenderView.h:
Added 2 new functions that pipe through the RenderLayer.

LayoutTests:

The test checks that calling scrollByUnit without a RenderLayer doesn't crash.

* fast/layers/scrollByLines-overflow-no-layer.html: Added.
* fast/layers/scrollByLines-overflow-no-layer-expected.txt: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113990 268f45cc-cd09-0410-ab3c-d52691b4dbfc

26 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/layers/scrollByLines-overflow-no-layer-expected.txt [new file with mode: 0644]
LayoutTests/fast/layers/scrollByLines-overflow-no-layer.html [new file with mode: 0755]
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AccessibilityRenderObject.cpp
Source/WebCore/css/CSSComputedStyleDeclaration.cpp
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/Element.cpp
Source/WebCore/editing/FrameSelection.cpp
Source/WebCore/editing/visible_units.cpp
Source/WebCore/html/shadow/TextControlInnerElements.cpp
Source/WebCore/page/ContextMenuController.cpp
Source/WebCore/page/DragController.cpp
Source/WebCore/page/EventHandler.cpp
Source/WebCore/page/FocusController.cpp
Source/WebCore/page/Frame.cpp
Source/WebCore/page/FrameView.cpp
Source/WebCore/page/GestureTapHighlighter.cpp
Source/WebCore/page/PrintContext.cpp
Source/WebCore/plugins/gtk/PluginViewGtk.cpp
Source/WebCore/plugins/mac/PluginViewMac.mm
Source/WebCore/plugins/qt/PluginViewQt.cpp
Source/WebCore/rendering/RenderObject.cpp
Source/WebCore/rendering/RenderObject.h
Source/WebCore/rendering/RenderView.cpp
Source/WebCore/rendering/RenderView.h

index 1232876..4d6fe27 100644 (file)
@@ -1,3 +1,15 @@
+2012-04-12  Julien Chaffraix  <jchaffraix@webkit.org>
+
+        Reduce the use of RenderLayer outside of the rendering code
+        https://bugs.webkit.org/show_bug.cgi?id=83728
+
+        Reviewed by Simon Fraser.
+
+        The test checks that calling scrollByUnit without a RenderLayer doesn't crash.
+
+        * fast/layers/scrollByLines-overflow-no-layer.html: Added.
+        * fast/layers/scrollByLines-overflow-no-layer-expected.txt: Added.
+
 2012-04-12  Alexei Filippov  <alexeif@chromium.org>
 
         Web Inspector: Move meta node out of nodes in snapshot serialization.
diff --git a/LayoutTests/fast/layers/scrollByLines-overflow-no-layer-expected.txt b/LayoutTests/fast/layers/scrollByLines-overflow-no-layer-expected.txt
new file mode 100644 (file)
index 0000000..969fee4
--- /dev/null
@@ -0,0 +1,3 @@
+bug 83728: Reduce the use of RenderLayer outside of the rendering code
+This test passes if you see PASSED below.
+PASSED: The test did not crash!
diff --git a/LayoutTests/fast/layers/scrollByLines-overflow-no-layer.html b/LayoutTests/fast/layers/scrollByLines-overflow-no-layer.html
new file mode 100755 (executable)
index 0000000..5fb4665
--- /dev/null
@@ -0,0 +1,30 @@
+<!DOCTYPE>
+<html>
+<head>
+<style>
+    #overflow {
+        height: 100px;
+        width: 100px;
+        overflow: hidden;
+    }
+</style>
+<script>
+    if (window.layoutTestController)
+        layoutTestController.dumpAsText();
+
+    function testScrollByLine()
+    {
+        var overflowDiv = document.getElementById("overflow");
+        overflowDiv.scrollByLines(10);
+        overflowDiv.scrollByPages(10);
+        overflowDiv.innerHTML = "PASSED: The test did not crash!";
+    }
+    window.addEventListener("load", testScrollByLine, false);
+</script>
+</head>
+<body>
+    <div><a href="https://bugs.webkit.org/show_bug.cgi?id=83728">bug 83728</a>: Reduce the use of RenderLayer outside of the rendering code</div>
+    <div>This test passes if you see PASSED below.</div>
+    <div id="overflow">FAILED</div>
+<body>
+</html>
index b3019a3..a6308c2 100644 (file)
@@ -1,3 +1,74 @@
+2012-04-12  Julien Chaffraix  <jchaffraix@webkit.org>
+
+        Reduce the use of RenderLayer outside of the rendering code
+        https://bugs.webkit.org/show_bug.cgi?id=83728
+
+        Reviewed by Simon Fraser.
+
+        Test: fast/layers/scrollByLines-overflow-no-layer.html
+
+        This is mostly a layering violation change. This changes reduces the number of
+        RenderLayer use outside rendering/ by a third but there are still numerous uses.
+
+        While auditing the different uses of RenderLayer, I found a potential crasher
+        and fixed it which is why we have a test case.
+
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::visiblePositionForPoint):
+        * dom/Document.cpp:
+        (WebCore::Document::nodesFromRect):
+        (WebCore::Document::handleZeroPadding):
+        (WebCore::nodeFromPoint):
+        (WebCore::Document::prepareMouseEvent):
+        * editing/FrameSelection.cpp:
+        (WebCore::FrameSelection::contains):
+        * page/DragController.cpp:
+        (WebCore::elementUnderMouse):
+        * page/EventHandler.cpp:
+        (WebCore::EventHandler::handleMouseDraggedEvent):
+        (WebCore::EventHandler::eventMayStartDrag):
+        (WebCore::EventHandler::updateSelectionForMouseDrag):
+        (WebCore::EventHandler::hitTestResultAtPoint):
+        (WebCore::EventHandler::handleWheelEvent):
+        (WebCore::EventHandler::hoverTimerFired):
+        (WebCore::EventHandler::handleDrag):
+        Updated these call sites to use RenderView::hitTest.
+
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
+        * page/FrameView.cpp:
+        (WebCore::FrameView::contentsInCompositedLayer):
+        (WebCore::FrameView::scrollContentsFastPath):
+        Updated these call sites to use RenderObject::isComposited().
+
+        * dom/Element.cpp:
+        (WebCore::Element::scrollByUnits):
+        Call directly RenderBox::scroll instead of calling the layer.
+        This actually fixes a crasher that slipped through the cracks.
+
+        * editing/visible_units.cpp:
+        * html/shadow/TextControlInnerElements.cpp:
+        * page/ContextMenuController.cpp:
+        * page/FocusController.cpp:
+        * page/Frame.cpp:
+        * page/GestureTapHighlighter.cpp:
+        * page/PrintContext.cpp:
+        * plugins/mac/PluginViewMac.mm:
+        Removed unneeded #include.
+
+        * plugins/gtk/PluginViewGtk.cpp:
+        * plugins/qt/PluginViewQt.cpp:
+        Replaced RenderLayer.h #include with RenderObject.h as
+        we use RenderObject::absoluteToLocal.
+
+        * rendering/RenderObject.cpp:
+        (WebCore::RenderObject::isComposited):
+        * rendering/RenderObject.h:
+        * rendering/RenderView.cpp:
+        (WebCore::RenderView::hitTest):
+        * rendering/RenderView.h:
+        Added 2 new functions that pipe through the RenderLayer.
+
 2012-04-12  Pravinin D  <pravind.2k4@gmail.com>
 
         font-size:0 text runs has non zero width in case of Windows Safari.
index b9a5a5d..9bd478f 100644 (file)
@@ -2712,7 +2712,7 @@ VisiblePosition AccessibilityRenderObject::visiblePositionForPoint(const IntPoin
         HitTestRequest request(HitTestRequest::ReadOnly |
                                HitTestRequest::Active);
         HitTestResult result(ourpoint);
-        renderView->layer()->hitTest(request, result);
+        renderView->hitTest(request, result);
         innerNode = result.innerNode();
         if (!innerNode)
             return VisiblePosition();
index dde2ac7..70d3f9c 100644 (file)
@@ -54,7 +54,6 @@
 #include "Pair.h"
 #include "Rect.h"
 #include "RenderBox.h"
-#include "RenderLayer.h"
 #include "RenderStyle.h"
 #include "RenderView.h"
 #include "ShadowValue.h"
@@ -672,11 +671,6 @@ static LayoutRect sizingBox(RenderObject* renderer)
     return box->style()->boxSizing() == BORDER_BOX ? box->borderBoxRect() : box->computedCSSContentBoxRect();
 }
 
-static inline bool hasCompositedLayer(RenderObject* renderer)
-{
-    return renderer && renderer->hasLayer() && toRenderBoxModelObject(renderer)->layer()->isComposited();
-}
-
 static PassRefPtr<CSSValue> computedTransform(RenderObject* renderer, const RenderStyle* style)
 {
     if (!renderer || style->transform().operations().isEmpty())
@@ -1328,7 +1322,7 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(CSSPropert
     RenderObject* renderer = node->renderer();
 
     RefPtr<RenderStyle> style;
-    if (renderer && hasCompositedLayer(renderer) && AnimationController::supportsAcceleratedAnimationOfProperty(propertyID)) {
+    if (renderer && renderer->isComposited() && AnimationController::supportsAcceleratedAnimationOfProperty(propertyID)) {
         style = renderer->animation()->getAnimatedStyleForRenderer(renderer);
         if (m_pseudoElementSpecifier) {
             // FIXME: This cached pseudo style will only exist if the animation has been run at least once.
index aee04e0..d1d8252 100644 (file)
 #include "ProcessingInstruction.h"
 #include "RegisteredEventListener.h"
 #include "RenderArena.h"
-#include "RenderLayer.h"
-#include "RenderLayerBacking.h"
 #include "RenderNamedFlowThread.h"
 #include "RenderTextControl.h"
 #include "RenderView.h"
@@ -1274,14 +1272,14 @@ PassRefPtr<NodeList> Document::nodesFromRect(int centerX, int centerY, unsigned
 
     enum ShadowContentFilterPolicy shadowContentFilterPolicy = allowShadowContent ? AllowShadowContent : DoNotAllowShadowContent;
     HitTestResult result(point, topPadding, rightPadding, bottomPadding, leftPadding, shadowContentFilterPolicy);
-    renderView()->layer()->hitTest(request, result);
+    renderView()->hitTest(request, result);
 
     return StaticHashSetNodeList::adopt(result.rectBasedTestResult());
 }
 
 PassRefPtr<NodeList> Document::handleZeroPadding(const HitTestRequest& request, HitTestResult& result) const
 {
-    renderView()->layer()->hitTest(request, result);
+    renderView()->hitTest(request, result);
 
     Node* node = result.innerNode();
     if (!node)
@@ -1309,7 +1307,7 @@ static Node* nodeFromPoint(Frame* frame, RenderView* renderView, int x, int y, L
 
     HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::Active);
     HitTestResult result(point);
-    renderView->layer()->hitTest(request, result);
+    renderView->hitTest(request, result);
 
     if (localPoint)
         *localPoint = result.localPoint();
@@ -2957,7 +2955,7 @@ MouseEventWithHitTestResults Document::prepareMouseEvent(const HitTestRequest& r
         return MouseEventWithHitTestResults(event, HitTestResult(LayoutPoint()));
 
     HitTestResult result(documentPoint);
-    renderView()->layer()->hitTest(request, result);
+    renderView()->hitTest(request, result);
 
     if (!request.readOnly())
         updateStyleIfNeeded();
index 9d66c01..2d47f46 100644 (file)
@@ -282,7 +282,8 @@ void Element::scrollByUnits(int units, ScrollGranularity granularity)
         direction = ScrollUp;
         units = -units;
     }
-    toRenderBox(renderer())->layer()->scroll(direction, granularity, units);
+    Node* stopNode = this;
+    toRenderBox(renderer())->scroll(direction, granularity, units, &stopNode);
 }
 
 void Element::scrollByLines(int lines)
index a20aefc..96e8618 100644 (file)
@@ -1477,7 +1477,7 @@ bool FrameSelection::contains(const LayoutPoint& point)
     HitTestRequest request(HitTestRequest::ReadOnly |
                            HitTestRequest::Active);
     HitTestResult result(point);
-    document->renderView()->layer()->hitTest(request, result);
+    document->renderView()->hitTest(request, result);
     Node* innerNode = result.innerNode();
     if (!innerNode || !innerNode->renderer())
         return false;
index 5ecbee8..5eccb9b 100644 (file)
@@ -32,7 +32,6 @@
 #include "InlineTextBox.h"
 #include "Position.h"
 #include "RenderBlock.h"
-#include "RenderLayer.h"
 #include "RenderObject.h"
 #include "RenderedPosition.h"
 #include "Text.h"
index c9fb732..7bee1e6 100644 (file)
@@ -37,7 +37,6 @@
 #include "HTMLTextAreaElement.h"
 #include "MouseEvent.h"
 #include "Page.h"
-#include "RenderLayer.h"
 #include "RenderTextControlSingleLine.h"
 #include "RenderView.h"
 #include "ScriptController.h"
index 2627f6e..485b0a8 100644 (file)
@@ -59,7 +59,6 @@
 #include "Node.h"
 #include "Page.h"
 #include "PlatformEvent.h"
-#include "RenderLayer.h"
 #include "RenderObject.h"
 #include "ReplaceSelectionCommand.h"
 #include "ResourceRequest.h"
index 3d2e337..e58376e 100644 (file)
@@ -58,7 +58,6 @@
 #include "PlatformKeyboardEvent.h"
 #include "RenderFileUploadControl.h"
 #include "RenderImage.h"
-#include "RenderLayer.h"
 #include "RenderView.h"
 #include "ReplaceSelectionCommand.h"
 #include "ResourceRequest.h"
@@ -286,7 +285,7 @@ static Element* elementUnderMouse(Document* documentUnderMouse, const IntPoint&
 
     HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::Active);
     HitTestResult result(point);
-    documentUnderMouse->renderView()->layer()->hitTest(request, result);
+    documentUnderMouse->renderView()->hitTest(request, result);
 
     Node* n = result.innerNode();
     while (n && !n->isElementNode())
index 3ed5b03..4100412 100644 (file)
@@ -699,7 +699,7 @@ bool EventHandler::handleMouseDraggedEvent(const MouseEventWithHitTestResults& e
     if (m_selectionInitiationState != ExtendedSelection) {
         HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::Active);
         HitTestResult result(m_mouseDownPos);
-        m_frame->document()->renderView()->layer()->hitTest(request, result);
+        m_frame->document()->renderView()->hitTest(request, result);
 
         updateSelectionForMouseDrag(result);
     }
@@ -730,7 +730,7 @@ bool EventHandler::eventMayStartDrag(const PlatformMouseEvent& event) const
     updateDragSourceActionsAllowed();
     HitTestRequest request(HitTestRequest::ReadOnly);
     HitTestResult result(view->windowToContents(event.position()));
-    m_frame->contentRenderer()->layer()->hitTest(request, result);
+    m_frame->contentRenderer()->hitTest(request, result);
     DragState state;
     return result.innerNode() && page->dragController()->draggableNode(m_frame, result.innerNode(), roundedIntPoint(result.point()), state);
 }
@@ -743,15 +743,12 @@ void EventHandler::updateSelectionForMouseDrag()
     RenderView* renderer = m_frame->contentRenderer();
     if (!renderer)
         return;
-    RenderLayer* layer = renderer->layer();
-    if (!layer)
-        return;
 
     HitTestRequest request(HitTestRequest::ReadOnly |
                            HitTestRequest::Active |
                            HitTestRequest::Move);
     HitTestResult result(view->windowToContents(m_currentMousePosition));
-    layer->hitTest(request, result);
+    renderer->hitTest(request, result);
     updateSelectionForMouseDrag(result);
 }
 
@@ -1047,7 +1044,7 @@ HitTestResult EventHandler::hitTestResultAtPoint(const LayoutPoint& point, bool
         return result;
     if (ignoreClipping)
         hitType |= HitTestRequest::IgnoreClipping;
-    m_frame->contentRenderer()->layer()->hitTest(HitTestRequest(hitType), result);
+    m_frame->contentRenderer()->hitTest(HitTestRequest(hitType), result);
 
     while (true) {
         Node* n = result.innerNode();
@@ -1064,7 +1061,7 @@ HitTestResult EventHandler::hitTestResultAtPoint(const LayoutPoint& point, bool
         LayoutPoint widgetPoint(result.localPoint().x() + view->scrollX() - renderWidget->borderLeft() - renderWidget->paddingLeft(), 
             result.localPoint().y() + view->scrollY() - renderWidget->borderTop() - renderWidget->paddingTop());
         HitTestResult widgetHitTestResult(widgetPoint, padding.height(), padding.width(), padding.height(), padding.width(), shadowContentFilterPolicy);
-        frame->contentRenderer()->layer()->hitTest(HitTestRequest(hitType), widgetHitTestResult);
+        frame->contentRenderer()->hitTest(HitTestRequest(hitType), widgetHitTestResult);
         result = widgetHitTestResult;
 
         if (testScrollbars == ShouldHitTestScrollbars) {
@@ -2300,7 +2297,7 @@ bool EventHandler::handleWheelEvent(const PlatformWheelEvent& e)
 
     HitTestRequest request(HitTestRequest::ReadOnly);
     HitTestResult result(vPoint);
-    doc->renderView()->layer()->hitTest(request, result);
+    doc->renderView()->hitTest(request, result);
 
 #if PLATFORM(MAC)
     m_useLatchedWheelEventNode = e.momentumPhase() == PlatformWheelEventPhaseBegan || e.momentumPhase() == PlatformWheelEventPhaseChanged;
@@ -2675,7 +2672,7 @@ void EventHandler::hoverTimerFired(Timer<EventHandler>*)
         if (FrameView* view = m_frame->view()) {
             HitTestRequest request(HitTestRequest::Move);
             HitTestResult result(view->windowToContents(m_currentMousePosition));
-            renderer->layer()->hitTest(request, result);
+            renderer->hitTest(request, result);
             m_frame->document()->updateStyleIfNeeded();
         }
     }
@@ -3045,7 +3042,7 @@ bool EventHandler::handleDrag(const MouseEventWithHitTestResults& event)
         // try to find an element that wants to be dragged
         HitTestRequest request(HitTestRequest::ReadOnly);
         HitTestResult result(m_mouseDownPos);
-        m_frame->contentRenderer()->layer()->hitTest(request, result);
+        m_frame->contentRenderer()->hitTest(request, result);
         Node* node = result.innerNode();
         if (node && m_frame->page())
             dragState().m_dragSrc = m_frame->page()->dragController()->draggableNode(m_frame, node, m_mouseDownPos, dragState());
index 3fa14bc..511bc33 100644 (file)
@@ -49,7 +49,6 @@
 #include "KeyboardEvent.h"
 #include "Page.h"
 #include "Range.h"
-#include "RenderLayer.h"
 #include "RenderObject.h"
 #include "RenderWidget.h"
 #include "ScrollAnimator.h"
index 56cd972..5904c62 100644 (file)
@@ -68,7 +68,6 @@
 #include "Page.h"
 #include "PageGroup.h"
 #include "RegularExpression.h"
-#include "RenderLayer.h"
 #include "RenderPart.h"
 #include "RenderTableCell.h"
 #include "RenderTextControl.h"
index e1668a7..d8b4b4d 100644 (file)
@@ -1290,7 +1290,7 @@ bool FrameView::contentsInCompositedLayer() const
 {
 #if USE(ACCELERATED_COMPOSITING)
     RenderView* root = rootRenderer(this);
-    if (root && root->layer()->isComposited()) {
+    if (root && root->isComposited()) {
         GraphicsLayer* layer = root->layer()->backing()->graphicsLayer();
         if (layer && layer->drawsContent())
             return true;
@@ -1469,7 +1469,7 @@ bool FrameView::scrollContentsFastPath(const IntSize& scrollDelta, const IntRect
         if (renderBox->style()->position() != FixedPosition)
             continue;
 #if USE(ACCELERATED_COMPOSITING)
-        if (renderBox->layer()->isComposited())
+        if (renderBox->isComposited())
             continue;
 #endif
         IntRect updateRect = pixelSnappedIntRect(renderBox->layer()->repaintRectIncludingDescendants());
index 5734e8e..0cb694f 100644 (file)
@@ -39,7 +39,6 @@
 #include "Page.h"
 #include "RenderBoxModelObject.h"
 #include "RenderInline.h"
-#include "RenderLayer.h"
 #include "RenderObject.h"
 
 namespace WebCore {
index 0af0bb5..a2ea78c 100644 (file)
@@ -24,7 +24,6 @@
 #include "GraphicsContext.h"
 #include "Frame.h"
 #include "FrameView.h"
-#include "RenderLayer.h"
 #include "RenderView.h"
 #include <wtf/text/WTFString.h>
 
index c568a4b..d8c7429 100644 (file)
@@ -56,7 +56,7 @@
 #include "PluginDebug.h"
 #include "PluginMainThreadScheduler.h"
 #include "PluginPackage.h"
-#include "RenderLayer.h"
+#include "RenderObject.h"
 #include "Settings.h"
 #include "SpatialNavigation.h"
 #include "JSDOMBinding.h"
index 901a359..3abf62a 100644 (file)
@@ -55,7 +55,6 @@
 #include "PluginDebug.h"
 #include "PluginPackage.h"
 #include "PluginMainThreadScheduler.h"
-#include "RenderLayer.h"
 #include "ScriptController.h"
 #include "Settings.h"
 #include "npruntime_impl.h"
index ff912db..ac31cf0 100644 (file)
@@ -63,7 +63,7 @@
 #include "PluginPackage.h"
 #include "PluginMainThreadScheduler.h"
 #include "QWebPageClient.h"
-#include "RenderLayer.h"
+#include "RenderObject.h"
 #include "Settings.h"
 #include "npruntime_impl.h"
 #if USE(JSC)
index f1e00ba..3bea353 100755 (executable)
@@ -2398,6 +2398,11 @@ void RenderObject::updateDragState(bool dragOn)
         curr->updateDragState(dragOn);
 }
 
+bool RenderObject::isComposited() const
+{
+    return hasLayer() && toRenderBoxModelObject(this)->layer()->isComposited();
+}
+
 bool RenderObject::hitTest(const HitTestRequest& request, HitTestResult& result, const LayoutPoint& pointInContainer, const LayoutPoint& accumulatedOffset, HitTestFilter hitTestFilter)
 {
     bool inside = false;
index e731095..fb3dea9 100644 (file)
@@ -611,6 +611,8 @@ public:
     void collectDashboardRegions(Vector<DashboardRegionValue>&);
 #endif
 
+    bool isComposited() const;
+
     bool hitTest(const HitTestRequest&, HitTestResult&, const LayoutPoint& pointInContainer, const LayoutPoint& accumulatedOffset, HitTestFilter = HitTestAll);
     virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const LayoutPoint& pointInContainer, const LayoutPoint& accumulatedOffset, HitTestAction);
     virtual void updateHitTestResult(HitTestResult&, const LayoutPoint&);
index 4ba2afa..7cf2ead 100644 (file)
@@ -77,6 +77,11 @@ RenderView::~RenderView()
 {
 }
 
+bool RenderView::hitTest(const HitTestRequest& request, HitTestResult& result)
+{
+    return layer()->hitTest(request, result);
+}
+
 void RenderView::computeLogicalHeight()
 {
     if (!printing() && m_frameView)
index bb82c18..a0a3e55 100644 (file)
@@ -42,6 +42,8 @@ public:
     RenderView(Node*, FrameView*);
     virtual ~RenderView();
 
+    bool hitTest(const HitTestRequest&, HitTestResult&);
+
     virtual const char* renderName() const { return "RenderView"; }
 
     virtual bool isRenderView() const { return true; }