[webkit-dev] FontCache refactoring proposal

2008-12-11 Thread Julien Chaffraix
Hi everyone,

while working on memory leaks inside WebCore, the Pleyo team has found
that the FontCache was responsible for a few of them. In order to
solve those leaks and prevent future ones, we have done a refactoring
of the FontCache and its internal working (mainly making the
SimpleFontData Refcounted and change several sites inside WebCore to
hold RefPtr). The modification are done and they are too big for
integration right now so we would like to split them and contribute
them back to WebKit. You will find below the different parts that we
have worked on (this will follow more or less the order in which they
will be contributed back):

- initial clean-up
* share some methods that are the same in all implementations
* add a 'platform' suffix for those that should be implemented per platform
* avoid using FontPlatformData ouside the few font files inside platform
* make FontCache a singleton and remove all the current static methods

- Add leaks probe using RefCountedLeakCounter to track our progress as
well as see where the leaks occurs.

- Make the FontCache mechanism use smart pointers
* have SimpleFontData derive from RefCounted
* use internally RefPtr
* use RefPtr for external reference to SimpleFontData all over WebCore

- FontCache HashMap refactoring: currently some HashMaps return
FontPlatformData internally and there is a mapping between those and
SimpleFontData so it should be better to use the SimpleFontData
instead.

Those items are open to discussion and we will try to address the
comments before starting and as the work moves forward.

Best regards,
Julien
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev


[webkit-dev] JavaScriptCore: Accessing things created in C from script

2008-12-11 Thread Thomas Gutteridge
Hello

Can you help me? I'm using WebKit's JavaScriptCore from within an
application to allow some logic to be implemented in script and
therefore modified without recompilation. Although, I can create
JavaScript functions and objects using the C API, I can't see how to
give them names that can be used to reference them from script.

For example, I'm trying to use JSObjectMakeFunctionWithCallback to
create a JavaScript function with a native implementation. Crucially,
I'd like to then invoke this function from a script. However, the
name parameter is apparently only used when converting the function
to string. The name I give is undefined if I use it in a script.

Is what I'm trying to do possible?

Many thanks
Tom
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev


[webkit-dev] Porting WebKit

2008-12-11 Thread Gmail
Hi all

Has anyone ever ported WebKit to Windows Mobile?

I'm pretty new to the WebKit. Can someone share some experiences on porting
WebKit in general?

I'm wondering if WebKit has some collection of abstract classes or
interfaces that should be implemented on  a platform particularly while
porting?

What we're aiming at is that we want a clean layout, rendering engine from
WebKit and then we'll make our own UI on top of this engine. Ideally the
separation between the core and UI should be clean. In reality it might be
hard specially I have no idea on how WebKit code is orgnized.

It'll be very appreciated if I could get some inputs from you folk.

Thanks in advance!


Br,

Sam
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev


Re: [webkit-dev] JavaScriptCore: Accessing things created in C from script

2008-12-11 Thread Thomas Gutteridge
Great, it works like a dream!

Thank you Cameron, Oliver. I haven't a lot of experience with
JavaScript, otherwise that may have been more obvious :)


2008/12/11 Oliver Hunt [EMAIL PROTECTED]:
 On Dec 11, 2008, at 2:27 AM, Thomas Gutteridge wrote:

 Hello

 Can you help me? I'm using WebKit's JavaScriptCore from within an
 application to allow some logic to be implemented in script and
 therefore modified without recompilation. Although, I can create
 JavaScript functions and objects using the C API, I can't see how to
 give them names that can be used to reference them from script.

 For example, I'm trying to use JSObjectMakeFunctionWithCallback to
 create a JavaScript function with a native implementation. Crucially,
 I'd like to then invoke this function from a script. However, the
 name parameter is apparently only used when converting the function
 to string. The name I give is undefined if I use it in a script.

 Is what I'm trying to do possible?


 The name property that you're specifying is what will be used if you want
 to do myFunction.toString().  Accessing a function by name requires the
 function (or other object) being on an object in scope.

 The easiest way to achieve this is by putting it on the global object.  This
 will let you call it in the same way people use 'alert', 'document', etc on
 js in a web page.

 Something akin to the following should work (assuming jsFunction is your JSC
 function wrapper, and context is your JSC context):
 JSValueRef exception = 0;
 JSObjectRef global = JSContextGetGlobalObject(context);
 JSObjectSetProperty(context, global,
 JSStringCreateWithUTF8CString(myCFunction), jsFunction,
 kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly, exception);
 if (exception)
printf(Argh! an exception);

 Now your function will be available in JS as myCFunction on the global
 object.

 --Oliver



___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev


Re: [webkit-dev] winLauncher

2008-12-11 Thread Frank Zerangue

Brent,

This was in a earlier post --

WinLauncher.cpp, line 390: change initWithURL(.., .., 0) timeout from  
0 to something else like 30 or 60 seconds.


Frank

On Dec 10, 2008, at 11:08 PM, Brent Fulgham wrote:



On Dec 10, 2008, at 6:37 AM, Aman wrote:
I got WebKit to build properly on windows, and i got the  
winLauncher too.


But now the problem is : i type any URL and then enter key the  
winLauncher doesn't do anything.


anybody knows that situation??



I have been seeing this as well, but assumed I had broken something  
locally.


Using my Cairo/Curl version I get normal browsing support, so I'm  
guessing it has something to do with CFNetwork.


-Brent
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev


___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev


Re: [webkit-dev] winLauncher

2008-12-11 Thread Frank Zerangue

Brent --

What version of WebKit are you able to build the Cairo/Curl version?

Frank

On Dec 10, 2008, at 11:15 PM, Paul Pedriana wrote:

Ditto for me. I also have problems with crashes in CF, which cannot  
be debugged and so I can't diagnose them.





On Dec 10, 2008, at 6:37 AM, Aman wrote:
I got WebKit to build properly on windows, and i got the  
winLauncher too.


But now the problem is : i type any URL and then enter key the  
winLauncher doesn't do anything.


anybody knows that situation??



I have been seeing this as well, but assumed I had broken something  
locally.


Using my Cairo/Curl version I get normal browsing support, so I'm  
guessing it has something to do with CFNetwork.


-Brent

___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev



___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev


___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev


Re: [webkit-dev] winLauncher

2008-12-11 Thread Frank Zerangue

Paul,

I noticed that when I build WinLauncher within visual studio with  
configuration debug_internal, that I get the same crash. If

I change the configuration to debug it executes just fine.

Frank

On Dec 10, 2008, at 11:15 PM, Paul Pedriana wrote:

Ditto for me. I also have problems with crashes in CF, which cannot  
be debugged and so I can't diagnose them.





On Dec 10, 2008, at 6:37 AM, Aman wrote:
I got WebKit to build properly on windows, and i got the  
winLauncher too.


But now the problem is : i type any URL and then enter key the  
winLauncher doesn't do anything.


anybody knows that situation??



I have been seeing this as well, but assumed I had broken something  
locally.


Using my Cairo/Curl version I get normal browsing support, so I'm  
guessing it has something to do with CFNetwork.


-Brent

___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev



___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev


___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev


Re: [webkit-dev] winLauncher

2008-12-11 Thread Brent Fulgham
Hi Frank,

2008/12/11 Frank Zerangue [EMAIL PROTECTED]:
 This was in a earlier post --
 WinLauncher.cpp, line 390: change initWithURL(.., .., 0) timeout from 0 to
 something else like 30 or 60 seconds.

Thanks so much for that.  Is an existing bug filed to correct this?
If not, I'll get one of the guys to check that in.

-Brent
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev


Re: [webkit-dev] winLauncher

2008-12-11 Thread Brent Fulgham
Frank,

2008/12/11 Frank Zerangue [EMAIL PROTECTED]:
 Brent --
 What version of WebKit are you able to build the Cairo/Curl version?
 Frank

I am generally building against ToT; I just updated last night, but I
have not posted my revised patches in a few days.

I'll try to do so later on today.

Thanks,

-Brent
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev


Re: [webkit-dev] winLauncher

2008-12-11 Thread Frank Zerangue

Brent,

Not that I know of --

Frank

On Dec 11, 2008, at 11:08 AM, Brent Fulgham wrote:


Hi Frank,

2008/12/11 Frank Zerangue [EMAIL PROTECTED]:

This was in a earlier post --
WinLauncher.cpp, line 390: change initWithURL(.., .., 0) timeout  
from 0 to

something else like 30 or 60 seconds.


Thanks so much for that.  Is an existing bug filed to correct this?
If not, I'll get one of the guys to check that in.

-Brent


___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev


Re: [webkit-dev] winLauncher

2008-12-11 Thread Frank Zerangue

Brent,

I need to the build a windows cairo / curl version as well but have
been unsuccessful in doing so to this point. Any direction that you
could give me would be appreciated.

Frank

On Dec 11, 2008, at 11:09 AM, Brent Fulgham wrote:


Frank,

2008/12/11 Frank Zerangue [EMAIL PROTECTED]:

Brent --
What version of WebKit are you able to build the Cairo/Curl version?
Frank


I am generally building against ToT; I just updated last night, but I
have not posted my revised patches in a few days.

I'll try to do so later on today.

Thanks,

-Brent


___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev


Re: [webkit-dev] FontCache refactoring proposal

2008-12-11 Thread Dan Bernstein

Hi Julien,

On Dec 11, 2008, at 2:14 AM, Julien Chaffraix wrote:


Hi everyone,

while working on memory leaks inside WebCore, the Pleyo team has found
that the FontCache was responsible for a few of them.


It would be good to have a bug filed about each leak.


In order to
solve those leaks and prevent future ones, we have done a refactoring
of the FontCache and its internal working (mainly making the
SimpleFontData Refcounted and change several sites inside WebCore to
hold RefPtr). The modification are done and they are too big for
integration right now so we would like to split them and contribute
them back to WebKit. You will find below the different parts that we
have worked on (this will follow more or less the order in which they
will be contributed back):

- initial clean-up
   * share some methods that are the same in all implementations
   * add a 'platform' suffix for those that should be implemented  
per platform
   * avoid using FontPlatformData ouside the few font files inside  
platform
   * make FontCache a singleton and remove all the current static  
methods


- Add leaks probe using RefCountedLeakCounter to track our progress as
well as see where the leaks occurs.

- Make the FontCache mechanism use smart pointers
   * have SimpleFontData derive from RefCounted
   * use internally RefPtr
   * use RefPtr for external reference to SimpleFontData all over  
WebCore


- FontCache HashMap refactoring: currently some HashMaps return
FontPlatformData internally and there is a mapping between those and
SimpleFontData so it should be better to use the SimpleFontData
instead.


How do you plan to maintain the constructor
Font::Font(const FontPlatformData fontData, bool isPrinterFont)
without a mapping from FontPlatformData to FontData?

—Dan___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev


[webkit-dev] Proposal: Revise WebKit/win To use GraphicsContext rather than CG calls

2008-12-11 Thread Brent Fulgham
I have been keeping a set of patches attached to
https://bugs.webkit.org/show_bug.cgi?id=17484, which mainly #if/def
around various CG and CFNetwork calls.

Setting aside the issue of CFNetwork calls in WebKit/win, I wanted to
see if we could reach some agreement on revising the WebKit/win layer
so that rather than making direct calls to the CoreGraphics backend,
it would go through the GraphicsContext abstraction.  This would allow
the same code to run for both back-ends with minimal changes, and
would help avoid unintended breaks when new features were added to the
DLL.

Would changing to GraphicsContext objects instead of bare CGContextRef
and friends be acceptable to the Apple/Safari team?  If so, I'd be
happy to put together a patch to make this happen.

Thanks,

-Brent
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev


Re: [webkit-dev] Proposal: Revise WebKit/win To use GraphicsContext rather than CG calls

2008-12-11 Thread Adam Roben

On Dec 11, 2008, at 10:35 AM, Brent Fulgham wrote:


Would changing to GraphicsContext objects instead of bare CGContextRef
and friends be acceptable to the Apple/Safari team?  If so, I'd be
happy to put together a patch to make this happen.


Sure, it's probably good to use GraphicsContext where possible. It  
might also make sense to move more of this code down into WebCore,  
though it's hard to know for sure without knowing the specific chunks  
of code you're talking about. Filing bugs for each area of the code  
you'd like to change might make sense.


-Adam

___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev


Re: [webkit-dev] Why the limited scope for preferredExtensionForImageSourceType?

2008-12-11 Thread Maciej Stachowiak


On Dec 11, 2008, at 11:38 AM, Brent Fulgham wrote:


A recent change added some tests in the dragging logic for valid file
extension.  The default Cairo implementation was set to return blank,
which causes these various assertions to fire, rendering these
operations unusable.

It seems that most of the information necessary to determine expected
file extension is present in the various decoders, but the mapping
from UTI's to extensions was implemented deep in the guts of
ImageSourceCGWin, rather than at some higher level.

Is the preferredExtensionForImageSourceType function really Windows
and CG-specific?  These types and UTI's seem like they should be
generally applicable.

I would like to move this to at least ImageSource.cpp, so that the
Cairo back-end could make use of the mapping.

Does anyone know why the scope of this function was limited so  
severely?


I think it is because we know exactly the types of images that CG can  
decode, but this is not necessarily the same set as exists for all  
other ports. In particular, the Mac port definitely supports a  
different set, and Cairo-based ports likely use the image decoder  
copies in the WebKit tree, which is yet another set. I think perhaps a  
good solution would be to make the mechanism general, but populate the  
mapping data separately for the different ports.


Regards,
Maciej

___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev


Re: [webkit-dev] JSON support

2008-12-11 Thread Darin Adler

On Dec 11, 2008, at 12:51 AM, Sriram Neelakandan wrote:


Is there any help that is required in getting this to trunk ?


I believe you started a discussion in the bug https://bugs.webkit.org/show_bug.cgi?id=20031 
 and got an answer there.


-- Darin

___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev


Re: [webkit-dev] FontCache refactoring proposal

2008-12-11 Thread Julien Chaffraix
Hi Dan,

On Thu, Dec 11, 2008 at 6:40 PM, Dan Bernstein m...@apple.com wrote:
 Hi Julien,
 On Dec 11, 2008, at 2:14 AM, Julien Chaffraix wrote:

 Hi everyone,

 while working on memory leaks inside WebCore, the Pleyo team has found
 that the FontCache was responsible for a few of them.

 It would be good to have a bug filed about each leak.


Sure. I was not the one to look for leaks but I will get the
information and file the bugs.

 In order to
 solve those leaks and prevent future ones, we have done a refactoring
 of the FontCache and its internal working (mainly making the
 SimpleFontData Refcounted and change several sites inside WebCore to
 hold RefPtr). The modification are done and they are too big for
 integration right now so we would like to split them and contribute
 them back to WebKit. You will find below the different parts that we
 have worked on (this will follow more or less the order in which they
 will be contributed back):

 - initial clean-up
* share some methods that are the same in all implementations
* add a 'platform' suffix for those that should be implemented per
 platform
* avoid using FontPlatformData ouside the few font files inside platform
* make FontCache a singleton and remove all the current static methods

 - Add leaks probe using RefCountedLeakCounter to track our progress as
 well as see where the leaks occurs.

 - Make the FontCache mechanism use smart pointers
* have SimpleFontData derive from RefCounted
* use internally RefPtr
* use RefPtr for external reference to SimpleFontData all over WebCore

 - FontCache HashMap refactoring: currently some HashMaps return
 FontPlatformData internally and there is a mapping between those and
 SimpleFontData so it should be better to use the SimpleFontData
 instead.

 How do you plan to maintain the constructor
 Font::Font(const FontPlatformData fontData, bool isPrinterFont)
 without a mapping from FontPlatformData to FontData?

I may have not explained well. A mapping between FontPlatformData and
FontData is required (as you were pointing out at least this
constructor requires this). However once you have made most of the
methods in FontCache return FontData, it seems relevant to also switch
to using FontData internally (and wrap the FontPlatformData in a
FontData if necessary). This switch is for FontPlatformDataCache which
currently maps a custom key to a FontPlatformData (but changing it
means to change all the methods that rely on the current mapping).

Best regards,
Julien
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev


[webkit-dev] Inspector under windows

2008-12-11 Thread webkit webkit
Hi, I have built webkit under windows, while when I start winlaucher then
right click it to choose Inspect Element, only get a window showing the
source code of html. I traced it to InspectorController.cpp, at
setWindowVisible():

if( !m_scriptContext || !m_scriptObject)
return;

The condition is always false, so I seek for help how to ture it true.

PS: The initial running winlaucher caused segfault in CF**.dll, so I did a
workaround to always use wintheme instead of safaritheme by hardcode :)
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev


Re: [webkit-dev] Inspector under windows

2008-12-11 Thread Brent Fulgham


On Dec 11, 2008, at 7:38 PM, webkit webkit wrote:

Hi, I have built webkit under windows, while when I start winlaucher  
then right click it to choose Inspect Element, only get a window  
showing the source code of html. I traced it to  
InspectorController.cpp, at setWindowVisible():


if( !m_scriptContext || !m_scriptObject)
return;

The condition is always false, so I seek for help how to ture it true.

PS: The initial running winlaucher caused segfault in CF**.dll, so I  
did a workaround to always use wintheme instead of safaritheme by  
hardcode :)


You probably did not copy the SafariTheme.resource folder to the  
location where the binary is running.


-Brent
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev


Re: [webkit-dev] Inspector under windows

2008-12-11 Thread Vincent Deng
I installed safari and copied necessary files to the running folder, and I
didn't not find SafariTheme.resource in Webkit.

On Fri, Dec 12, 2008 at 12:03 PM, Brent Fulgham bfulg...@gmail.com wrote:


 On Dec 11, 2008, at 7:38 PM, webkit webkit wrote:

  Hi, I have built webkit under windows, while when I start winlaucher then
 right click it to choose Inspect Element, only get a window showing the
 source code of html. I traced it to InspectorController.cpp, at
 setWindowVisible():

 if( !m_scriptContext || !m_scriptObject)
return;

 The condition is always false, so I seek for help how to ture it true.

 PS: The initial running winlaucher caused segfault in CF**.dll, so I did a
 workaround to always use wintheme instead of safaritheme by hardcode :)


 You probably did not copy the SafariTheme.resource folder to the location
 where the binary is running.

 -Brent

___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev


Re: [webkit-dev] Inspector under windows

2008-12-11 Thread Brent Fulgham


On Dec 11, 2008, at 10:48 PM, Vincent Deng wrote:

I installed safari and copied necessary files to the running folder,  
and I didn't not find SafariTheme.resource in Webkit.


On Fri, Dec 12, 2008 at 12:03 PM, Brent Fulgham bfulg...@gmail.com  
wrote:


You probably did not copy the SafariTheme.resource folder to the  
location where the binary is running.


-Brent



Vincent,

Please look for C:\Program Files\Safari\SafariTheme.resources.  This  
needs to be in the same directory with the SafariTheme.dll so that it  
can find what it needs.


-Brent___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev