[webkit-dev] about the class of "jscell" and "jsvalueptr"

2009-03-23 Thread 张正和
Hi all
Now I am learning at the JavaScriptCore, and I encounter some problems, Could 
you help me?
1. What data is stored in "JSCell", and how to print the data?
2.  , if there is a js 
function, as follow:
function test(){ alert(text1.value); }
Is the value stored in the "JSValuePtr"?
 
Could you introduce the "JSCell" and "JSValuePtr" for me?
thank you & best regards
zzh


  ___ 
  好玩贺卡等你发,邮箱贺卡全新上线! 
http://card.mail.cn.yahoo.com/___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev


Re: [webkit-dev] about the class of "jscell" and "jsvalueptr"

2009-03-23 Thread Zoltan Herczeg
Hi,

JSCell is a small memory block, which is maintaned by the garbage
collector. It is 32 byte on 32 bit machines and 64 byte in 64 bit machines
(see JavaScriptCore/runtime/collector.cpp).

JSValuePtr is the basic data type structure of JavaScript. It can be a
pointer to a JSCell or an immediate value (integer number, boolean, null,
undefined).

JSCell is an internal representation (may changed in the future), while
JSValuePtr is a high-level class with many helper/utility functions.

JSValuePtr has a toString method. It is a high level function, not
designed for debug purposes, but you can use it if the conversion does not
throw any exceptions.

Zoltan

> Hi all
> Now I am learning at the JavaScriptCore, and I encounter some problems,
> Could you help me?
> 1. What data is stored in "JSCell", and how to print the data?
> 2.  , if there is a js
> function, as follow:
> function test(){ alert(text1.value); }
> Is the value stored in the "JSValuePtr"?
>  
> Could you introduce the "JSCell" and "JSValuePtr" for me?
> thank you & best regards
> zzh


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


[webkit-dev] Is there any Windows-GDI-only port?

2009-03-23 Thread 김인기
Dear all.

 

I’m new comer to WebKit.

I want to port WebKit to Windows-Mobile device.

But, I could find only CoreGraphics-port and Cairo-port.

Is there no Windows-GDI-only port?

If it is not exist, there is any reason for it?

In my humble thought, 

porting WebKit directly on Windows GDI can show 

better performance than Cairo-port.

 

Thanks

 

Kim, In Gee.

 

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


[webkit-dev] about referencing objects between JavaScriptCore and WebCore

2009-03-23 Thread ZHOU Xiao-bo
dear all:

I have a question about the objects referencing between Javasciptcore
and WebCore:

JSNode uses m_impl to reference a Node in WebCore. And when
KJS::Collector::collect() is called the function mark() of each JSNode is
invoked to keep the corresponding Node in WebCore alive in memory.

The problem is: I want to seperate the memory managment of
each page. To do so, I allocate a large block of memory for eache page,
and delete it when loading the next page. ( I have commented out
'pagecache', 'backforwardlist' etc.)

But, when it jumps back to a page which has been visited before, and a
block of
javascipt codes is excuted, it crashes when JSNode use m_impl to reference
a Node in WebCore. The reason is m_impl is pointing an empty memory block.

   I used gdb to examine the value of m_impl, and I found that it likely
contained an
address  of a Node created when this page was loaded the first time.

   My question is: how do JavaSciptCore maintain the JSNode(s) to make them
reference
the old Nodes? And how can I force JSNode's m_impl reference the new Node?

   Do I make myself clear?
   Appreciate any clues!

thx!

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


Re: [webkit-dev] caching /memory leak... browsing images

2009-03-23 Thread Purushottam Sholapur
After debugging, I could find some memory leak/optimization that is
possible.

Files:
qt-embedded-linux-opensource-src-4.5.0/src/3rdparty/webkit/WebCore/platform/graphics/qt/ImageDecoderQt.cpp
and .h

In QImageDecodeQt, there is Qlist of ImageData (m_imageList), which is not
freed after its use.
Generally, with my understanding, every image is decoded and stored in this
list. Later it is converted to QPixmap. Which means there will be two copies
of decoded image, one in the list and other is Pixmap. This list image can
be freed after it is converted to Pixmap. This really saves a lot of
memory(decoded images are huge).

The only change I have made is cleaning this list. Can anybody verify this
and confirm.
Atleast, I did not see any new issue with this fix. I have verified with
valgrind on linux desktop, Now there is no memory leak for QImage.

Here is the patch.
--- ImageDecoderQt.cpp_ori  2009-03-19 13:46:04.0 +0530
+++ ImageDecoderQt.cpp  2009-03-23 18:54:13.0 +0530
@@ -303,7 +303,7 @@
 return 0;
 }

-QPixmap* ImageDecoderQt::imageAtIndex(size_t index) const
+QPixmap* ImageDecoderQt::imageAtIndex(size_t index) //const
 {
 if (debugImageDecoderQt)
 qDebug() << "ImageDecoderQt::imageAtIndex(" << index << ')';
@@ -314,6 +314,7 @@
 if (!m_pixmapCache.contains(index)) {
 m_pixmapCache.insert(index,

QPixmap::fromImage(m_imageList[index].m_image));
+ m_imageList.clear();
 }
 return  &m_pixmapCache[index];
 }

--- ImageDecoderQt.h_ori2009-03-23 18:56:48.0 +0530
+++ ImageDecoderQt.h2009-03-23 18:57:15.0 +0530
@@ -50,7 +50,7 @@
 virtual int repetitionCount() const;
 virtual RGBA32Buffer* frameBufferAtIndex(size_t index);

-QPixmap* imageAtIndex(size_t index) const;
+QPixmap* imageAtIndex(size_t index) ;
 virtual bool supportsAlpha() const;
 int duration(size_t index) const;
 virtual String filenameExtension() const;

If you want more details about valgrind memory leak statistics or how to
test, etc I can send.

regards
Purush



On Mon, Mar 16, 2009 at 3:22 PM, zaheer ahmad  wrote:

> Webkit has a default cache of 8 Mb (WebCore/Loader/Cache.cpp) and your data
> suggests it is using with in that limit. And it is a fraction of 150Mb you
> have mentioned, please check where the other memory is going.
>
> thanks,
> Zaheer
> On Mon, Mar 16, 2009 at 11:49 AM, Purushottam Sholapur <
> purushottam.shola...@gmail.com> wrote:
>
>> Hi All,
>>
>> I am using webkit on davinci platform, with QT. We have 150MB of RAM,
>> If I use browser for 15-20 minutes. Entire memory is exhausted. There is
>> no other
>> application running. This is happening more with webpages having bigger
>> images. I am
>> browsing http://www.images.google.com
>>
>> I tried with QtLauncher and Qt demo/browser, behavior is same.
>> I tried with latest nightly webkit build also. (on 9th Mar '09), same
>> result.
>> Not sure where it is caching or leaking.
>>
>> Tried dumping Cache statistics periodically using.
>> Cache * cp = cache();
>> cp->dumpStats();
>>
>> It initially prints like this 
>> Count   SizeLiveSizeDecodedSize PurgeableSize
>> PurgedSize
>> --- --- --- --- --- ---
>> ---
>> Images3  210215  210215  186976
>> 0   0
>> CSS   0   0   0   0
>> 0   0
>> JavaScript122852285   0
>> 0   0
>> Fonts 0   0   0   0
>> 0   0
>> --- --- --- --- --- ---
>> ---
>> Later 
>> Count   SizeLiveSizeDecodedSize PurgeableSize
>> PurgedSize
>> --- --- --- --- --- ---
>> ---
>> Images   40 3968623 3891850 3729336
>> 0   0
>> CSS   2   17409   17409   0
>> 0   0
>> JavaScript4  651566  649281  432854
>> 0   0
>> Fonts 0   0   0   0
>> 0   0
>> --- --- --- --- --- ---
>> ---
>>
>> Images, CSS, JavaScript count never reduces. Are they cached..?
>>
>> Is it same as that of this ...
>> http://www.nabble.com/JavaScript-memory-management-question-to20842278.html#a20842278
>>
>>
>> Please suggest to solve this,
>>
>> regards
>> Purush
>>
>>
>>
>>
>> ___
>> 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] Is there any Windows-GDI-only port?

2009-03-23 Thread Adam Roben

On Mar 23, 2009, at 6:18 AM, 김인기 wrote:


I want to port WebKit to Windows-Mobile device.
But, I could find only CoreGraphics-port and Cairo-port.
Is there no Windows-GDI-only port?


That is correct, there is no Windows port that only uses bare GDI  
calls for drawing.



If it is not exist, there is any reason for it?


There are multiple reasons. One reason is that there have so far been  
no developers interested in this. Another is that GDI lacks some  
capabilities that WebKit requires.



In my humble thought,
porting WebKit directly on Windows GDI can show
better performance than Cairo-port.


Is this claim based on testing?

-Adam

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


Re: [webkit-dev] Is there any Windows-GDI-only port?

2009-03-23 Thread David Hyatt

On Mar 23, 2009, at 5:18 AM, 김인기 wrote:


Dear all.

I’m new comer to WebKit.
I want to port WebKit to Windows-Mobile device.
But, I could find only CoreGraphics-port and Cairo-port.
Is there no Windows-GDI-only port?
If it is not exist, there is any reason for it?
In my humble thought,
porting WebKit directly on Windows GDI can show
better performance than Cairo-port.



Cairo is actually built on top of GDI.  Where possible it just makes  
direct GDI calls.


dave
(hy...@apple.com)

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


Re: [webkit-dev] Is there any Windows-GDI-only port?

2009-03-23 Thread Adam Roben


On Mar 23, 2009, at 10:28 AM, Adam Roben wrote:


On Mar 23, 2009, at 6:18 AM, 김인기 wrote:


In my humble thought,
porting WebKit directly on Windows GDI can show
better performance than Cairo-port.


Is this claim based on testing?


Sorry, that came out harsher than I intended.

What I meant was: Have you seen benchmarks that indicate GDI is faster  
than Cairo? It would be interesting to know what those benchmarks  
tested. In my (very limited) experience with graphics benchmarks,  
relative performance of different graphics libraries can often be  
fairly benchmark-dependent.


In any case, the first step towards making WebKit use no other  
graphics library than GDI is to find one or more developers who want  
to work on it.


-Adam

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


Re: [webkit-dev] about referencing objects between JavaScriptCore and WebCore

2009-03-23 Thread Geoffrey Garen

Hi Zhou.

I have a question about the objects referencing between  
Javasciptcore

and WebCore:

JSNode uses m_impl to reference a Node in WebCore. And when
KJS::Collector::collect() is called the function mark() of each  
JSNode is

invoked to keep the corresponding Node in WebCore alive in memory.


That's not quite accurate.

m_impl is reference-counted -- nothing specific needs to happen during  
garbage collection in order to keep m_impl alive.


The purpose of marking JSNode objects is to keep alive the JavaScript  
wrapper around m_impl, to preserve custom properties set through the  
DOM API.


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


Re: [webkit-dev] Is there any Windows-GDI-only port?

2009-03-23 Thread Kevin Ollivier

Hi Adam,

On Mar 23, 2009, at 7:28 AM, Adam Roben wrote:


On Mar 23, 2009, at 6:18 AM, 김인기 wrote:


I want to port WebKit to Windows-Mobile device.
But, I could find only CoreGraphics-port and Cairo-port.
Is there no Windows-GDI-only port?


That is correct, there is no Windows port that only uses bare GDI  
calls for drawing.


Actually - the wx port does have a mode using GDI under the hood.  
Digsby currently uses it over the GDI+ mode for performance reasons,  
but they AFAICT don't need to worry about the missing features caused  
by using it.


Regards,

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


[webkit-dev] HAVE_LANGINFO_H and OS X

2009-03-23 Thread Kevin Ollivier

Hi all,

Gustavo Noronha recently wrote me and pointed out that he did some  
work on the GTK port to fix a JSCore test (http://trac.webkit.org/changeset/41909 
), and said he thought that the fix might also apply to the JSCore  
regression we see on the wx port. It does in fact fix the problem, but  
to get the fix I need to explicitly #define HAVE_LANGINFO_H 1 on Mac.  
I'm wondering if it's safe to define it to 1 for all ports building  
under Darwin, or if I should keep the fix isolated to the wx port?


Thanks,

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


Re: [webkit-dev] HAVE_LANGINFO_H and OS X

2009-03-23 Thread Darin Adler

On Mar 23, 2009, at 12:49 PM, Kevin Ollivier wrote:

It does in fact fix the problem, but to get the fix I need to  
explicitly #define HAVE_LANGINFO_H 1 on Mac. I'm wondering if it's  
safe to define it to 1 for all ports building under Darwin, or if I  
should keep the fix isolated to the wx port?


I think it’s safe to set that for all ports building under Darwin.

-- Darin

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


Re: [webkit-dev] HAVE_LANGINFO_H and OS X

2009-03-23 Thread Darin Adler
But I think that all DARWIN-targeted ports and indeed any port where  
PLATFORM(CF) is true, should use the superior version based on  
CFDateFormatter. That’s an even better fix for Mac OS X.


-- Darin

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


[webkit-dev] -webkit-transition-property receives unexpected values in Safari 3.1.2 (Windows)

2009-03-23 Thread Sergey V. Mikhanov
   Hi community,

I am developing an iPhone-optimized website and testing it on Safari 3.1.2
on Windows. For some elements in the website I am applying implicit
animation using -webkit-transition style.

So basically, I have elements like this:

...

that sometimes are present in the document from the very beginning and
sometimes are loaded from another document and injected in DOM.

In the first case animation happens as expected, however when divs are
injected using JavaScript, -webkit-transition seems to be ignored (there's
no animation). Moreover, in the Safari's inspector I could see this:

-webkit-transition: condensed 2s linear;

What does this "condensed" mean and how could I force usage of the style
after injection?

Any clues would be appreciated.

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


Re: [webkit-dev] -webkit-transition-property receives unexpected values in Safari 3.1.2 (Windows)

2009-03-23 Thread Simon Fraser

On Mar 23, 2009, at 3:53 PM, Sergey V. Mikhanov wrote:


   Hi community,

I am developing an iPhone-optimized website and testing it on Safari  
3.1.2 on Windows. For some elements in the website I am applying  
implicit animation using -webkit-transition style.


So basically, I have elements like this:

...

that sometimes are present in the document from the very beginning  
and sometimes are loaded from another document and injected in DOM.


In the first case animation happens as expected, however when divs  
are injected using JavaScript, -webkit-transition seems to be  
ignored (there's no animation).


Transitions are not run when elements are first added to the DOM; they  
only run when style properties change from one value to another value.



Moreover, in the Safari's inspector I could see this:

-webkit-transition: condensed 2s linear;

What does this "condensed" mean and how could I force usage of the  
style after injection?


This is a bug, and I believe has been since fixed. I recommend you  
test with a nightly build, or at least the Safari 4 beta.


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


Re: [webkit-dev] -webkit-transition-property receives unexpected values in Safari 3.1.2 (Windows)

2009-03-23 Thread Sergey V. Mikhanov
>
> I am developing an iPhone-optimized website and testing it on Safari 3.1.2
>> on Windows. For some elements in the website I am applying implicit
>> animation using -webkit-transition style.
>>
>> So basically, I have elements like this:
>>
>> ...
>>
>> that sometimes are present in the document from the very beginning and
>> sometimes are loaded from another document and injected in DOM.
>>
>> In the first case animation happens as expected, however when divs are
>> injected using JavaScript, -webkit-transition seems to be ignored (there's
>> no animation).
>>
>
> Transitions are not run when elements are first added to the DOM; they only
> run when style properties change from one value to another value.
>

Yes, I forgot to mention that property is changed from JavaScript code
immediately after injection. I'm executing the code below immediately after
injecting element referred by toPage:

console.log('Before: ' + fromPage.id + ' -> ' + toPage.id + ' (' +
backwards + ')');
console.log('F.left: ' + fromPage.style.left);
console.log('T.left: ' + toPage.style.left);
console.log('F.transition: ' + fromPage.style.webkitTransition);
console.log('T.transition: ' + toPage.style.webkitTransition);

if (!fromPage.style.left) {
fromPage.style.webkitTransition = '';
fromPage.style.left = "0%";
fromPage.style.webkitTransition = 'left 2s linear';
}

if (!toPage.style.left) {
toPage.style.webkitTransition = '';
toPage.style.left = backwards ? "-100%" : "100%";
toPage.style.webkitTransition = 'left 2s linear';
}

toPage.setAttribute("selected", "true");
scrollTo(0, 1);
clearInterval(checkTimer);

fromPage.style.left = backwards ? "100%" : "-100%";
toPage.style.left = "0%";

console.log('After: ' + fromPage.id + ' -> ' + toPage.id + ' (' +
backwards + ')');
console.log('F.left: ' + fromPage.style.left);
console.log('T.left: ' + toPage.style.left);
console.log('F.transition: ' + fromPage.style.webkitTransition);
console.log('T.transition: ' + toPage.style.webkitTransition);

And this results in having this in the console:

Before: login -> home (undefined)
F.left:
T.left:
F.transition:
T.transition:
After: login -> home (undefined)
F.left: -100%
T.left: 0%
F.transition:
T.transition:

I.e. style.webkitTransition is never defined. Any clues why?


>  Moreover, in the Safari's inspector I could see this:
>>
>> -webkit-transition: condensed 2s linear;
>>
>> What does this "condensed" mean and how could I force usage of the style
>> after injection?
>>
>
> This is a bug, and I believe has been since fixed. I recommend you test
> with a nightly build, or at least the Safari 4 beta.


Thanks for the clue. The tricky thing is that this does not work on iPhone
either and updating Mobile Safari is not that easy.

I looked to the inspector for the case without injection being made, and it
turns out that it also has "condensed" there (and animation is performed
fine in this case).

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