Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Move some plugin-specific code from RenderWidget to RenderEmbeddedObj…
…ect.

<https://webkit.org/b/123845>

All RenderWidgets representing plugins will be RenderEmbeddedObjects.
Move some of the plugin-specific logic to RenderEmbeddedObject since it
doesn't make sense for all RenderWidgets (frames, embedded documents)
to care about this.

Reviewed by Anders Carlsson.


Canonical link: https://commits.webkit.org/142039@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@158712 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Andreas Kling committed Nov 6, 2013
1 parent f8e3849 commit 67ac57e
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 22 deletions.
12 changes: 12 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,15 @@
2013-11-05 Andreas Kling <akling@apple.com>

Move some plugin-specific code from RenderWidget to RenderEmbeddedObject.
<https://webkit.org/b/123845>

All RenderWidgets representing plugins will be RenderEmbeddedObjects.
Move some of the plugin-specific logic to RenderEmbeddedObject since it
doesn't make sense for all RenderWidgets (frames, embedded documents)
to care about this.

Reviewed by Anders Carlsson.

2013-11-05 Tim Horton <timothy_horton@apple.com>

Fix the 32-bit build.
Expand Down
4 changes: 4 additions & 0 deletions Source/WebCore/rendering/RenderEmbeddedObject.cpp
Expand Up @@ -630,6 +630,10 @@ CursorDirective RenderEmbeddedObject::getCursor(const LayoutPoint& point, Cursor
cursor = handCursor();
return SetCursor;
}
if (widget() && widget()->isPluginViewBase()) {
// A plug-in is responsible for setting the cursor when the pointer is over it.
return DoNotSetCursor;
}
return RenderWidget::getCursor(point, cursor);
}

Expand Down
22 changes: 1 addition & 21 deletions Source/WebCore/rendering/RenderWidget.cpp
Expand Up @@ -24,13 +24,9 @@
#include "RenderWidget.h"

#include "AXObjectCache.h"
#include "AnimationController.h"
#include "Frame.h"
#include "GraphicsContext.h"
#include "HTMLFrameOwnerElement.h"
#include "HitTestResult.h"
#include "PluginViewBase.h"
#include "RenderCounter.h"
#include "RenderLayer.h"
#include "RenderView.h"
#include <wtf/StackStats.h>
Expand Down Expand Up @@ -387,16 +383,6 @@ bool RenderWidget::nodeAtPoint(const HitTestRequest& request, HitTestResult& res
return inside;
}

CursorDirective RenderWidget::getCursor(const LayoutPoint& point, Cursor& cursor) const
{
if (widget() && widget()->isPluginViewBase()) {
// A plug-in is responsible for setting the cursor when the pointer is over it.
return DoNotSetCursor;
}
return RenderReplaced::getCursor(point, cursor);
}


#if USE(ACCELERATED_COMPOSITING)
bool RenderWidget::requiresLayer() const
{
Expand All @@ -405,13 +391,7 @@ bool RenderWidget::requiresLayer() const

bool RenderWidget::requiresAcceleratedCompositing() const
{
// There are two general cases in which we can return true. First, if this is a plugin
// 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() && toPluginViewBase(widget())->platformLayer())
return true;

// If this is a renderer with a contentDocument and that document needs a layer, then we need a layer.
if (Document* contentDocument = frameOwnerElement().contentDocument()) {
if (RenderView* view = contentDocument->renderView())
return view->usesCompositing();
Expand Down
1 change: 0 additions & 1 deletion Source/WebCore/rendering/RenderWidget.h
Expand Up @@ -82,7 +82,6 @@ class RenderWidget : public RenderReplaced, private OverlapTestRequestClient {
virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) OVERRIDE FINAL;
virtual void layout() OVERRIDE;
virtual void paint(PaintInfo&, const LayoutPoint&) OVERRIDE;
virtual CursorDirective getCursor(const LayoutPoint&, Cursor&) const OVERRIDE;
virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction) OVERRIDE;
virtual void paintContents(PaintInfo&, const LayoutPoint&);
#if USE(ACCELERATED_COMPOSITING)
Expand Down

0 comments on commit 67ac57e

Please sign in to comment.