summaryrefslogtreecommitdiffstats
path: root/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm
diff options
context:
space:
mode:
Diffstat (limited to 'WebKit/mac/Plugins/WebBaseNetscapePluginView.mm')
-rw-r--r--WebKit/mac/Plugins/WebBaseNetscapePluginView.mm27
1 files changed, 23 insertions, 4 deletions
diff --git a/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm b/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm
index a2a8b50..26057fa 100644
--- a/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm
+++ b/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm
@@ -44,7 +44,9 @@
#import <WebCore/Element.h>
#import <WebCore/Frame.h>
#import <WebCore/FrameLoader.h>
+#import <WebCore/HTMLPlugInElement.h>
#import <WebCore/Page.h>
+#import <WebCore/RenderView.h>
#import <WebKit/DOMPrivate.h>
#import <runtime/InitializeThreading.h>
#import <wtf/Assertions.h>
@@ -73,14 +75,14 @@ using namespace WebCore;
attributeKeys:(NSArray *)keys
attributeValues:(NSArray *)values
loadManually:(BOOL)loadManually
- DOMElement:(DOMElement *)anElement
+ element:(PassRefPtr<WebCore::HTMLPlugInElement>)element
{
self = [super initWithFrame:frame];
if (!self)
return nil;
_pluginPackage = pluginPackage;
- _element = anElement;
+ _element = element;
_sourceURL.adoptNS([URL copy]);
_baseURL.adoptNS([baseURL copy]);
_MIMEType.adoptNS([MIME copy]);
@@ -237,11 +239,23 @@ using namespace WebCore;
[self startTimers];
}
+- (NSRect)_windowClipRect
+{
+ RenderObject* renderer = _element->renderer();
+
+ if (renderer && renderer->view()) {
+ if (FrameView* frameView = renderer->view()->frameView())
+ return frameView->windowClipRectForLayer(renderer->enclosingLayer(), true);
+ }
+
+ return NSZeroRect;
+}
+
- (NSRect)visibleRect
{
// WebCore may impose an additional clip (via CSS overflow or clip properties). Fetch
// that clip now.
- return NSIntersectionRect([self convertRect:[_element.get() _windowClipRect] fromView:nil], [super visibleRect]);
+ return NSIntersectionRect([self convertRect:[self _windowClipRect] fromView:nil], [super visibleRect]);
}
- (BOOL)acceptsFirstResponder
@@ -558,7 +572,7 @@ using namespace WebCore;
- (WebDataSource *)dataSource
{
- WebFrame *webFrame = kit(core(_element.get())->document()->frame());
+ WebFrame *webFrame = kit(_element->document()->frame());
return [webFrame _dataSource];
}
@@ -577,6 +591,11 @@ using namespace WebCore;
return [self window] ? [self window] : [[self webView] hostWindow];
}
+- (WebCore::HTMLPlugInElement*)element
+{
+ return _element.get();
+}
+
// We want to treat these as regular keyboard events.
- (void)cut:(id)sender