Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Suspected bug (was: Plugin's -webPlugInInitialize called when plugin moves on page)



Sorry for the slow reply --

I haven't heard of this behavior before, and I'm not sure what could be causing it. If you haven't done so already, please file a bug report on this at <http://bugreport.apple.com>. A binary of the plugin (or its source code) and a reproducible test case will help us find a fix for you much sooner.

Thanks,
-t

On Nov 25, 2005, at 3:20 AM, Ken Tabb wrote:

Hi folks,

Even stranger things spotted now. A WebView calls -initWithFrame on a plugin whenever:
[1] The webview becomes key (eg. tabbing from the URL field to the webview)
[2] The plugin moves about on the page (eg. on an editable page, as per e-mail below).


This isn't the correct behaviour surely: if a view (eg. plugin) is 'moved' within its superview, the superview should just call the plugin's -setFrame / -setFrameSize / -setFrameOrigin, yes?

Looking in ObjectAlloc at my (vanilla) WebView app, it generates a new plugin instance each time I tab back into the webview (from my URL field) or move HTML (and the plugin) about within the web page being edited. Granted it also releases the previous incarnation, but that means any computation my plugin has done (i.e. anything it needs to know that wasn't passed into it via the HTML EMBED parameters) is lost. Also surely this would be a performance knock, freeing / allocating RAM for a whole new view (plugin) vs. just moving the view (plugin) about?

Am I totally misunderstanding the way this should work?!

Any sanity checks gratefully received,
Ken

On 24 Nov 2005, at 5:27 pm, Ken Tabb wrote:

Hi folks,

I'm currently developing a WebKit plugin for an HTML-editing app, which allows data to be dragged in and dropped on it (from other apps, typically). Works like a charm, generally speaking, with a default "no data selected" / visual rendering of the data where appropriate.

As such, because the data isn't known about at the time of writing the HTML page, the markup to embed the plugin involves a 'dummy' filetype (eg. src="noSuchFile.noSuchType", which the plugin duly ignores during the -webPlugInInitialize method - it only exists to force the page to add an instance of the plugin, onto which data can then be dropped by the user.

However, I've noticed that if the plugin sits in an editable WebView then whenever my plugin gets moved (eg. selecting the words of text before & after the plugin, and dragging them elsewhere in the page to rearrange it all), my plugin's - webPlugInInitialize gets called again, effectively blanking any knowledge that something had been dragged and dropped onto it prior to the move (and drawing it with "no data selected").

Am I misunderstanding the API? Should it be zapping my plugin simply because it's moved on the page? Is there an obvious way around this? I'm guessing not, as the data is not yet known at the time of -webPlugInInitialize being called. Should I set the "no data set" flag in the plugin's -init / -initWithFrame method rather than the -webPlugInInitialize method? I'm guessing it doesn't call -initWithFrame each time the page is rearranged?

I'm using Xcode 2.2 / Mac OS X 10.4.3 if that makes any difference.

Thanks in advance for any light you can shed,
Ken

- - - - - - - - - -
Dr. Ken Tabb
Mac & UNIX Developer - Health & Human Sciences
Machine Vision & Neural Network researcher - School of Computer Science
University of Hertfordshire, UK
http://www.health.herts.ac.uk/ken/


Certified non-Microsoft Solution Provider

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webkitsdk-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webkitsdk-dev/email@hidden

This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Webkitsdk-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webkitsdk-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.